This is an old revision of the document!
Under the conventions of the BSC-AC Technical Memorandum 2016-002 this tools makes the reduced version of the CMAQ (CCTM) outputs.
This a tool developed specifically for the CMAQ outputs, it is developed in Python 2.7.x language and use many of the Python libraries to make it easy.
This tool is composed of 3 elements
cmaq_reduce.py is fully in Python 2.7.x language and uses some libraries:
All the functions of the script are documented following the conventions. Feel free to inspect them.
To run the script is needed two more files to specify What to do (Configuration file) and How to do it (Reduced specifications).
cmaq_reduce.conf is the configuration file needed to run the script. You must give the configuration file as an argument
./cmaq_reduced.py cmaq_reduced.conf
This configuration file is divided in 3 sections and all of the parameters are commented to clarify them.
All the sections will be explained later, but first you have to take in account that normally the paths where are stored the MCIP and CCTM outputs are not statics.
The way to do these dynamic paths is by sustitutions:
example:
start_date = 30/12/2016 domain = IP4 cmaq_out_dir = /gpfs/projects/bsc32/bsc32359/CMAQ-mat/FORECAST/AQ/F-<domain>/OUT mcip_folder = MCIP/OUTPUT_MCIP_<dateJ> cctm_folder = CCTM/<dateJ>
result:
mcip_directory -> /gpfs/projects/bsc32/bsc32359/CMAQ-mat/FORECAST/AQ/F-IP4/OUT/MCIP/OUTPUT_MCIP_2016366 cctm_directory -> /gpfs/projects/bsc32/bsc32359/CMAQ-mat/FORECAST/AQ/F-IP4/OUT/CCTM/2016366
The General section of the configuration file have the csv_path parameter that have to point to this file.
As you are supposing these specifications are under a CSV file like this:
var,var_cmaq,filename,factor,unit,timeint_stat sconco3,O3,CCTM_FORECAST_<domain>.ACONC.FORECAST_<domain>,1,ppm,1h 8h_max day_mean day_max sconcco,CO,CCTM_FORECAST_<domain>.ACONC.FORECAST_<domain>,1,ppm,1h 8h_max day_mean day_max sconcno2,NO2,CCTM_FORECAST_<domain>.ACONC.FORECAST_<domain>,1,ppm,1h 8h_max day_mean day_max sconcso2,SO2,CCTM_FORECAST_<domain>.ACONC.FORECAST_<domain>,1,ppm,1h 8h_max day_mean day_max sconcno,NO,CCTM_FORECAST_<domain>.ACONC.FORECAST_<domain>,1,ppm,1h sconchono,HONO,CCTM_FORECAST_<domain>.ACONC.FORECAST_<domain>,1,ppm,1h sconcnh3,NH3,CCTM_FORECAST_<domain>.ACONC.FORECAST_<domain>,1,ppm,1h sconchno3,HNO3,CCTM_FORECAST_<domain>.ACONC.FORECAST_<domain>,1,ppm,1h pm2p5,ASO4J ASO4I ANH4J ANH4I ANO3J ANO3I AORGPAJ AORGPAI AALKJ AXYL1J AXYL2J AXYL3J ATOL1J ATOL2J ATOL3J ABNZ1J ABNZ2J ABNZ3J AOLGAJ ATRP1J ATRP2J AISO1J AISO2J AISO3J ASQTJ AOLGBJ AORGCJ AECJ AECI A25J ANAJ ACLJ ACLI,CCTM_FORECAST_<domain>.ACONC.FORECAST_<domain>,0.00000001,kgm-3,1h day_mean day_max pm2p5so4,ASO4I ASO4J,CCTM_FORECAST_<domain>.ACONC.FORECAST_<domain>,0.00000001,kgm-3,1h pm2p5ppm,A25J AECJ AECI AORGPAJ AORGPAI AECI AECJ,CCTM_FORECAST_<domain>.ACONC.FORECAST_<domain>,0.00000001,kgm-3,1h pm2p5oc,AORGPAJ AORGPAI AALKJ AXYL1J AXYL2J AXYL3J ATOL1J ATOL2J ATOL3J ABNZ1J ABNZ2J ABNZ3J AOLGAJ ATRP1J ATRP2J AISO1J AISO2J AISO3J ASQTJ AOLGBJ AORGCJ,CCTM_FORECAST_<domain>.ACONC.FORECAST_<domain>,0.00000001,kgm-3,1h pm2p5no3,ANO3I ANO3J,CCTM_FORECAST_<domain>.ACONC.FORECAST_<domain>,0.00000001,kgm-3,1h pm2p5nh4,ANH4I ANH4J,CCTM_FORECAST_<domain>.ACONC.FORECAST_<domain>,0.00000001,kgm-3,1h pm2p5na,ANAJ,CCTM_FORECAST_<domain>.ACONC.FORECAST_<domain>,0.00000001,kgm-3,1h pm2p5cl,ACLJ ACLI,CCTM_FORECAST_<domain>.ACONC.FORECAST_<domain>,0.00000001,kgm-3,1h pm2p5bc,AECI AECJ,CCTM_FORECAST_<domain>.ACONC.FORECAST_<domain>,0.00000001,kgm-3,1h pm2p5du,,,,, pm2p5soa,AALKJ AXYL1J AXYL2J AXYL3J ATOL1J ATOL2J ATOL3J ABNZ1J ABNZ2J ABNZ3J AOLGAJ,CCTM_FORECAST_<domain>.ACONC.FORECAST_<domain>,0.00000001,kgm-3,1h pm10,ASO4J ASO4I ANH4J ANH4I ANO3J ANO3I AORGPAJ AORGPAI AALKJ AXYL1J AXYL2J AXYL3J ATOL1J ATOL2J ATOL3J ABNZ1J ABNZ2J ABNZ3J AOLGAJ ATRP1J ATRP2J AISO1J AISO2J AISO3J ASQTJ AOLGBJ AORGCJ AECJ AECI A25J ANAJ ACLJ ACLI ASO4K ANH4K ANO3K ANAK ACLK ACORS ASOIL,CCTM_FORECAST_<domain>.ACONC.FORECAST_<domain>,0.00000001,kgm-3,1h day_mean day_max pm10so4,ASO4I ASO4J,CCTM_FORECAST_<domain>.ACONC.FORECAST_<domain>,0.00000001,kgm-3,1h pm10ppm,A25J AECJ AECI AORGPAJ AORGPAI ACORS ASOIL AECI AECJ,CCTM_FORECAST_<domain>.ACONC.FORECAST_<domain>,0.00000001,kgm-3,1h pm10oc,AALKJ AXYL1J AXYL2J AXYL3J ATOL1J ATOL2J ATOL3J ABNZ1J ABNZ2J ABNZ3J AOLGAJ ATRP1J ATRP2J AISO1J AISO2J AISO3J ASQTJ AOLGBJ AORGCJ AORGPAJ AORGPAI,CCTM_FORECAST_<domain>.ACONC.FORECAST_<domain>,0.00000001,kgm-3,1h pm10no3,ANO3I ANO3J ANO3K,CCTM_FORECAST_<domain>.ACONC.FORECAST_<domain>,0.00000001,kgm-3,1h pm10nh4,ANH4I ANH4J ANH4K,CCTM_FORECAST_<domain>.ACONC.FORECAST_<domain>,0.00000001,kgm-3,1h pm10na,ANAJ ANAK,CCTM_FORECAST_<domain>.ACONC.FORECAST_<domain>,0.00000001,kgm-3,1h pm10cl,ACLJ ACLI ACLK,CCTM_FORECAST_<domain>.ACONC.FORECAST_<domain>,0.00000001,kgm-3,1h pm10bc,AECI AECJ,CCTM_FORECAST_<domain>.ACONC.FORECAST_<domain>,0.00000001,kgm-3,1h pm10du,,,,, pm10soa,AALKJ AXYL1J AXYL2J AXYL3J ATOL1J ATOL2J ATOL3J ABNZ1J ABNZ2J ABNZ3J AOLGAJ ATRP1J ATRP2J AISO1J AISO2J AISO3J ASQTJ AOLGBJ AORGCJ,CCTM_FORECAST_<domain>.ACONC.FORECAST_<domain>,0.00000001,kgm-3,1h vmro3,O3,CCTM_FORECAST_<domain>.CONC.FORECAST_<domain>,1,mol/mol,1h vmrno2,NO2,CCTM_FORECAST_<domain>.CONC.FORECAST_<domain>,1,mol/mol,1h vmrso2,SO2,CCTM_FORECAST_<domain>.CONC.FORECAST_<domain>,1,mol/mol,1h t2,TEMP2,METCRO2D_<domain>,1,K,1h pblh,PBL,METCRO2D_<domain>,1,m,1h wspd10,WSPD10,METCRO2D_<domain>,1,ms-1,1h sdir10,WDIR10,METCRO2D_<domain>,1,deg,1h psfc,PRSFC,METCRO2D_<domain>,1,Pa,1h ustar,USTAR,METCRO2D_<domain>,1,ms-1,1h t,TA,METCRO3D_<domain>,1,K,1h pint,PRES,METCRO3D_<domain>,1,Pa,1h z,ZH,METCRO3D_<domain>,1,m,1h zf,ZF,METCRO3D_<domain>,1,m,1h
In the first line it has the header that specifies the content of the following lines.
var,var_cmaq,filename,factor,unit,timeint_stat
All the output types are saved following the NetCDF conventions with the lat lon localization and the datetime.
This output type is directly the hourly values