Skip to content
Snippets Groups Projects
Commit b62e022a authored by Christoph Knote's avatar Christoph Knote
Browse files

Add high res option

parent 6661b940
No related branches found
No related tags found
No related merge requests found
Showing
with 1245 additions and 0 deletions
22
\ No newline at end of file
blueprints/highres_chemistry/WRF_DOMAIN_PLOT_COAWST.png

80.7 KiB

#!/bin/bash
# ------------------------------------------------------------------------------
# WRFOTRON v 2.0b
# Christoph Knote (LMU Munich, Germany)
# 06/2016
# christoph.knote@lmu.de
# ------------------------------------------------------------------------------
# path to the WRFotron installation
chainDir=${HOME}/wrfotron
# --- Executable locations ---
# WPS installation directory
WPSDir=${WPS_SRC_PATH}
# WRF installation directory
WRFDir=${WRF_SRC_PATH}
# --- Input data settings ---
# path to geogrid input data
geogDir=/alcc/gpfs2/home/mbees/data/geog/
# meteo input
# Vtable for the chosen meteo input
metVtableFile=${WPS_SRC_PATH}/ungrib/Variable_Tables/Vtable.GFS
# time increment in hours
metInc=1
# full path to a met input file - you can use any "%<>" abbreviations known
# to the "date" command
metFilePattern="/alcc/gpfs2/home/mbees/data/meteo/GFS_OPR/GF%Y%m%d%H"
# example:
# "/glade/p/rda/data/ds083.2/grib2/%Y/%Y.%m/fnl_%Y%m%d_%H_00.grib2"
# --- Pre/Postprocessing settings ---
# prepararation script
preScriptPath=NONEXISTENT.bash
# postprocessing scripts (arbitrary)
postScriptPath=NONEXISTENT.bash
# postprocessing scripts (actions for each wrfout file)
postPerFileScriptPath=NONEXISTENT.bash
# --- Working directories ---
# where the WRF will be run (some fast, large disk like "scratch" or similar)
workDir=${SCRATCH}/WRF/work/
# where the unprocessed WRF output will be stored
stagingRootDir=${SCRATCH}/WRF/staging/
# where the WRF output will be stored
archiveRootDir=${SCRATCH}/archive/WRF/
# where the WRF restart files will be stored
restartRootDir=${SCRATCH}/WRF/restart/
# remove run directory after run is finished?
removeRunDir=false
# --- Chemistry ---
withChemistry=true
# WRF-Chem installation directory
WRFChemDir=${WRF_CHEM_SRC_PATH}
# path to utility executables
meganBioEmissBin=megan_bio_emiss
mozbcBin=mozbc
weselyBin=wesely
exo_coldensBin=exo_coldens
anthro_emisBin=anthro_emis
fire_emisBin=fire_emis
# path to Wesely and Exo_Coldens input data
wesColdensDataPath=${WESELY_EXO_COLDENS_DATA}
# path to MEGAN input data
MEGANdir=/alcc/gpfs2/home/mbees/data/emissions/biogenic/MEGAN
# use anthro_emiss or predefined files?
emissUseAnthroEmiss=false
# raw emission input - the files you read in with anthro_emiss
emissDir=/alcc/gpfs2/home/mbees/data/emissions/anthropogenic/EDGARv5/MOZART_MOSAIC
# emission conversion script for anthro_emis - must match emissions in emissDir
emissInpFile=emis_edgarv5_mozmos.inp
# year the emissions are valid for (for offset calculation)
emissYear=2015
# FINN fires
fireFilePattern="/alcc/gpfs2/home/mbees/data/emissions/fires/FINN/GLOB_MOZ4_%Y%j.txt"
fireInpFile=finn_fires.inp
# boundary condition input
chembcFilePattern="/alcc/gpfs2/home/mbees/data/chembc/WACCM/WACCM%Y%m%d"
chembcInpFile=waccm.inp
# TUV photolysis option 4 data file
TUVDataPath="/alcc/gpfs2/home/mbees/data/tuv/TUV.phot.bz2"
&CONTROL
domains = __domains__
anthro_dir = '__emissDir__'
src_file_prefix = 'edgar_v5_2015_'
src_file_suffix = '_0.1x0.1.nc'
src_names = 'CO(28)','NOx(30)','SO2(64)','NH3(17)','BC(12)','OC(12)','PM2.5(1)','PM10(1)','BENZENE(78)','BIGALK(72)','BIGENE(56)','C2H2(26)','C2H4(28)',
'C2H5OH(46)','C2H6(30)','C3H6(42)','C3H8(44)','CH2O(30)',
'CH3CHO(44)','CH3COCH3(58)','CH3OH(32)','CH3COOH(60)','HCOOH(46)',
'MEK(72)','TOLUENE(92)','XYLENES(106)'
sub_categories = 'TOTAL',
serial_output = .true.,
start_output_time = '__startDate__',
stop_output_time = '__startDate__',
output_interval = 3600,
data_yrs_offset = __emissYearOffset__,
emissions_zdim_stag = 1,
emis_map = 'CO->CO','NO->0.8*NOx','NO2->0.2*NOx','SO2->SO2','NH3->NH3','BIGALK->BIGALK','BIGENE->BIGENE',
'C2H4->C2H4','C2H5OH->C2H5OH','C2H6->C2H6','CH2O->CH2O','CH3CHO->CH3CHO',
'CH3COCH3->CH3COCH3','CH3OH->CH3OH','MEK->MEK','TOLUENE->TOLUENE',
'C3H6->C3H6','C3H8->C3H8','ISOP->0.0*CO','C10H16->0.0*CO',
'SULF->0.0*SO2','C2H2->0.00561790*CO','BENZENE->BENZENE','XYLENE->XYLENES',
'GLY->0.0*CO','MACR->0.0*CO','MGLY->0.0*CO','MVK->0.0*CO',
'HCOOH->0.0*CO','HONO->0.0*CO','VOCA->0.04*CO','VOCBB->0.0*CO',
'ECI(a)->0.1*BC','ECJ(a)->0.9*BC','ORGI(a)->0.1*OC','ORGJ(a)->0.9*OC','PM25I(a)->0.1*PM2.5',
'PM25J(a)->0.9*PM2.5','PM_10(a)->PM10 + -1.0*PM2.5','SO4I(a)->0.0*PM10','SO4J(a)->0.0*PM10','NO3I(a)->0.0*PM10',
'NO3J(a)->0.0*PM10','NH4I(a)->0.0*PM10','NH4J(a)->0.0*PM10','NAI(a)->0.0*PM10','NAJ(a)->0.0*PM10',
'CLI(a)->0.0*PM10','CLJ(a)->0.0*PM10','CO_A->CO','CO_BB->0.0*CO','ORGI_A(a)->0.0*PM10',
'ORGI_BB(a)->0.0*PM10','ORGJ_A(a)->0.0*PM10','ORGJ_BB(a)->0.0*PM10'
/
&control
wrf_dir = './'
domains = __domains__,
/
&control
fire_directory = './'
fire_filename(1) = 'FINN_FIRES.txt'
start_date = '__startYear__-__startMonth__-__startDay__',
end_date = '__endYear__-__endMonth__-__endDay__',
Model = 'WRF',
wrf_directory = './',
domains = __domain__,
defaultUnits = 'molecules/cm^2/s',
FinnVers = '1.5',
wrf2fire_map = 'co -> CO', 'no -> NO', 'no2 -> NO2', 'so2 -> SO2',
'nh3 -> NH3', 'open -> BIGALD', 'bigalk -> BIGALK',
'bigene -> BIGENE', 'apin -> C10H16', 'c2h4 -> C2H4',
'c2h5oh -> C2H5OH', 'c2h6 -> C2H6', 'c3h6 -> C3H6',
'c3h8 -> C3H8', 'ch2o -> CH2O', 'ald -> CH3CHO',
'ch3cn -> CH3CN', 'ACET -> CH3COCH3', 'mgly -> CH3COCHO',
'ch3cooh -> CH3COOH', 'ch3oh -> CH3OH', 'cres -> CRESOL',
'glyald -> GLYALD', 'hcn -> HCN', 'acetol -> HYAC',
'isop -> ISOP', 'macr -> MACR', 'mek -> MEK', 'mvk -> MVK',
'toluene -> TOLUENE', 'hcooh -> HCOOH', 'c2h2 -> C2H2',
'oc_a01 -> 0.01*OC;aerosol', 'oc_a02 -> 0.09*OC;aerosol',
'oc_a03 -> 0.70*OC;aerosol', 'oc_a04 -> 0.20*OC;aerosol',
'bc_a01 -> 0.01*BC;aerosol', 'bc_a02 -> 0.09*BC;aerosol',
'bc_a03 -> 0.70*BC;aerosol', 'bc_a04 -> 0.20*BC;aerosol',
'oin_a04 -> 1.00*PM10+-1.00*PM25+-0.20*OC+-0.20*BC;aerosol',
'oin_a01 -> 0.01*PM25+-0.01*OC+-0.01*BC;aerosol',
'oin_a02 -> 0.09*PM25+-0.09*OC+-0.09*BC;aerosol',
'oin_a03 -> 0.90*PM25+-0.90*OC+-0.90*BC;aerosol'
/
+:h:0:alt
+:h:0:gsw
+:h:0:extaer1
+:h:0:extaer2
+:h:0:extaer3
+:h:0:extaer4
+:h:0:tauaer1
+:h:0:tauaer2
+:h:0:tauaer3
+:h:0:tauaer4
+:h:0:gaer1
+:h:0:gaer2
+:h:0:gaer3
+:h:0:gaer4
+:h:0:waer1
+:h:0:waer2
+:h:0:waer3
+:h:0:waer4
+:h:0:brnch_rto
+:h:0:ccn1
+:h:0:alt
+:h:0:gsw
+:h:0:tke
+:h:0:SWDDIF
\ No newline at end of file
&control
domains = __domains__,
start_lai_mnth = 1,
end_lai_mnth = 12,
wrf_dir = '.',
megan_dir = '__MEGANdir__'
/
&control
do_ic = __do_ic__,
do_bc = __do_bc__,
domain = __domain__,
dir_wrf = './',
dir_moz = './',
fn_moz = 'moz0000.nc',
moz_var_suffix='',
spc_map =
'o3 -> O3',
'no -> NO',
'no2 -> NO2',
'hno3 -> HNO3',
'ho -> OH',
'ho2 -> HO2',
'h2o2 -> H2O2',
'so2 -> SO2',
'co -> CO',
'hcho -> CH2O',
'c2h4 -> C2H4',
'c2h6 -> C2H6',
'c3h6 -> C3H6',
'c3h8 -> C3H8',
'ald -> CH3CHO',
'acet -> CH3COCH3',
'ch3cooh -> CH3COOH',
'ch3oh -> CH3OH',
'ch3ooh -> CH3OOH',
'pan -> PAN',
'macr -> MACR',
'mvk -> MVK',
'c2h5oh -> C2H5OH',
!'etooh -> C2H5OOH',
'bigene -> BIGENE',
'bigalk -> BIGALK',
'tol -> TOLUENE',
'benzene -> BENZENE',
'xylenes -> XYLENES',
! http://www.atmos-chem-phys.net/12/7215/2012/acp-12-7215-2012.pdf Fig 6
'apin -> 0.75*MTERP',
'bpin -> 0.25*MTERP',
'isopr -> ISOP',
!
! aerosols
!
'oc_a01->0.1216*pom_a1+0.9886*soa1_a2+0.1216*soa1_a1+0.9886*soa2_a2+ 0.1216*soa2_a1+0.9886*soa3_a2+0.1216*soa3_a1+0.9886*soa4_a2+0.1216*soa4_a1+ 0.9886*soa5_a2+ 0.1216*soa5_a1;1.e9',
'oc_a02->0.7618*pom_a1+0.0114*soa1_a2+0.7618*soa1_a1+0.0114*soa2_a2+ 0.7618*soa2_a1+0.0114*soa3_a2+0.7618*soa3_a1+0.0114*soa4_a2+0.7618*soa4_a1+ 0.0114*soa5_a2+ 0.7618*soa5_a1;1.e9',
'oc_a03->0.1164*pom_a1+0.0000*soa1_a2+0.1164*soa1_a1+0.0000*soa2_a2+ 0.1164*soa2_a1+0.0000*soa3_a2+0.1164*soa3_a1+0.0000*soa4_a2+0.1164*soa4_a1+ 0.0000*soa5_a2+ 0.1164*soa5_a1;1.e9',
'oc_a04->0.0002*pom_a1+0.0000*soa1_a2+0.0002*soa1_a1+0.0000*soa2_a2+ 0.0002*soa2_a1+0.0000*soa3_a2+0.0002*soa3_a1+0.0000*soa4_a2+0.0002*soa4_a1+ 0.0000*soa5_a2+ 0.0002*soa5_a1;1.e9',
'bc_a01->0.1216*bc_a1+0.1216*bc_a4;1.e9',
'bc_a02->0.7618*bc_a1+0.7618*bc_a4;1.e9',
'bc_a03->0.1164*bc_a1+0.1164*bc_a4;1.e9',
'bc_a04->0.0002*bc_a1+0.0002*bc_a4;1.e9',
'so4_a01->0.9886*so4_a2+0.1216*so4_a1+0.0000*so4_a3;1.e9',
'so4_a02->0.0114*so4_a2+0.7618*so4_a1+0.0000*so4_a3;1.e9',
'so4_a03->0.0000*so4_a2+0.1164*so4_a1+0.0995*so4_a3;1.e9',
'so4_a04->0.0000*so4_a2+0.0002*so4_a1+0.9003*so4_a3;1.e9',
'nh4_a01->0.1856*so4_a2+0.0050*so4_a1+0.0000*so4_a3;1.e9',
'nh4_a02->0.0021*so4_a2+0.0930*so4_a1+0.0000*so4_a3;1.e9',
'nh4_a03->0.0000*so4_a2+0.0203*so4_a1+0.0186*so4_a3;1.e9',
'nh4_a04->0.0000*so4_a2+0.0000*so4_a1+0.1690*so4_a3;1.e9',
'no3_a01->0.0000*so4_a2+0.0000*so4_a1+0.0000*so4_a3;1.e9',
'no3_a02->0.0000*so4_a2+0.0000*so4_a1+0.0000*so4_a3;1.e9',
'no3_a03->0.0000*so4_a2+0.0000*so4_a1+0.0000*so4_a3;1.e9',
'no3_a04->0.0000*so4_a2+0.0000*so4_a1+0.0000*so4_a3;1.e9',
'na_a01->0.3889*ncl_a2+0.0479*ncl_a1+0.0000*ncl_a3;1.e9',
'na_a02->0.0045*ncl_a2+0.2997*ncl_a1+0.0000*ncl_a3;1.e9',
'na_a03->0.0000*ncl_a2+0.0458*ncl_a1+0.0391*ncl_a3;1.e9',
'na_a04->0.0000*ncl_a2+0.0000*ncl_a1+0.3542*ncl_a3;1.e9',
'cl_a01->0.5996*ncl_a2+0.0737*ncl_a1+0.0000*ncl_a3;1.e9',
'cl_a02->0.0068*ncl_a2+0.4621*ncl_a1+0.0000*ncl_a3;1.e9',
'cl_a03->0.0000*ncl_a2+0.0709*ncl_a1+0.0604*ncl_a3;1.e9',
'cl_a04->0.0000*ncl_a2+0.0001*ncl_a1+0.5462*ncl_a3;1.e9',
'oin_a01->0.9886*dst_a2+0.1216*dst_a1+0.0000*dst_a3;1.e9',
'oin_a02->0.0114*dst_a2+0.7618*dst_a1+0.0002*dst_a3;1.e9',
'oin_a03->0.0000*dst_a2+0.1164*dst_a1+0.0995*dst_a3;1.e9',
'oin_a04->0.0000*dst_a2+0.0002*dst_a1+0.9003*dst_a3;1.e9',
'num_a01->0.9996*num_a2+0.7135*num_a1+0.0000*num_a3;1.0',
'num_a02->0.0004*num_a2+0.2470*num_a1+0.2118*num_a3;1.0',
'num_a03->0.0000*num_a2+0.0016*num_a1+0.6258*num_a3;1.0',
'num_a04->0.0000*num_a2+0.0000*num_a1+0.3501*num_a3;1.0',
/
&control
do_ic = __do_ic__,
do_bc = __do_bc__,
domain = __domain__,
dir_wrf = './',
dir_moz = './',
fn_moz = 'moz0000.nc',
moz_var_suffix='',
def_missing_var = .true.
spc_map = 'o3 -> O3', 'n2o -> N2O', 'no -> NO',
'no2 -> NO2', 'nh3 -> NH3', 'hno3 -> HNO3', 'hno4 -> HO2NO2', 'n2o5 -> N2O5', 'h2o2 -> H2O2',
'ch4 -> CH4', 'co -> CO', 'ch3ooh -> CH3OOH',
'hcho -> CH2O', 'ch3oh -> CH3OH', 'c2h4 -> C2H4',
'ald -> CH3CHO', 'acet -> CH3COCH3', 'mgly -> CH3COCHO',
'pan -> PAN', 'mpan -> MPAN', 'macr -> MACR',
'mvk -> MVK', 'c2h6 -> C2H6', 'c3h6 -> C3H6', 'c3h8 -> C3H8', 'c2h5oh -> C2H5OH', 'c10h16 -> MTERP',
'isopr -> ISOP','acetol -> HYAC', 'mek -> MEK',
'bigene -> BIGENE', 'bigalk -> BIGALK',
'tol -> TOLUENE+BENZENE+XYLENES', 'cres -> CRESOL', 'dms -> DMS', 'so2 -> SO2',
'oc_a01->0.12*pom_a1+0.99*soa1_a2+0.12*soa1_a1+0.99*soa2_a2+0.12*soa2_a1+0.99*soa3_a2+0.12*soa3_a1+0.99*soa4_a2+0.12*soa4_a1+0.99*soa5_a2+0.12*soa5_a1;1.e9',
'oc_a02->0.76*pom_a1+0.01*soa1_a2+0.76*soa1_a1+0.01*soa2_a2+0.76*soa2_a1+0.01*soa3_a2+0.76*soa3_a1+0.01*soa4_a2+0.76*soa4_a1+0.01*soa5_a2+0.76*soa5_a1;1.e9',
'oc_a03->0.12*pom_a1+0.00*soa1_a2+0.12*soa1_a1+0.00*soa2_a2+0.12*soa2_a1+0.00*soa3_a2+0.12*soa3_a1+0.00*soa4_a2+0.12*soa4_a1+0.00*soa5_a2+0.12*soa5_a1;1.e9',
'oc_a04->0.00*pom_a1+0.00*soa1_a2+0.00*soa1_a1+0.00*soa2_a2+0.00*soa2_a1+0.00*soa3_a2+0.00*soa3_a1+0.00*soa4_a2+0.00*soa4_a1+0.00*soa5_a2+0.00*soa5_a1;1.e9',
'bc_a01->0.1216*bc_a1+0.1216*bc_a4;1.e9',
'bc_a02->0.7618*bc_a1+0.7618*bc_a4;1.e9',
'bc_a03->0.1164*bc_a1+0.1164*bc_a4;1.e9',
'bc_a04->0.0002*bc_a1+0.0002*bc_a4;1.e9',
'so4_a01->0.9886*so4_a2+0.1216*so4_a1+0.0000*so4_a3;1.e9',
'so4_a02->0.0114*so4_a2+0.7618*so4_a1+0.0002*so4_a3;1.e9',
'so4_a03->0.0000*so4_a2+0.1216*so4_a1+0.0995*so4_a3;1.e9',
'so4_a04->0.0000*so4_a2+0.0002*so4_a1+0.9003*so4_a3;1.e9',
'nh4_a01->0.1856*so4_a2+0.0050*so4_a1+0.0000*so4_a3;1.e9',
'nh4_a02->0.0021*so4_a2+0.0930*so4_a1+0.0000*so4_a3;1.e9',
'nh4_a03->0.0000*so4_a2+0.0203*so4_a1+0.0186*so4_a3;1.e9',
'nh4_a04->0.0000*so4_a2+0.0000*so4_a1+0.1690*so4_a3;1.e9',
'no3_a01->0.0000*so4_a2+0.0000*so4_a1+0.0000*so4_a3;1.e9',
'no3_a02->0.0000*so4_a2+0.0000*so4_a1+0.0000*so4_a3;1.e9',
'no3_a03->0.0000*so4_a2+0.0000*so4_a1+0.0000*so4_a3;1.e9',
'no3_a04->0.0000*so4_a2+0.0000*so4_a1+0.0000*so4_a3;1.e9',
'na_a01->0.3889*ncl_a2+0.0479*ncl_a1+0.0000*ncl_a3;1.e9',
'na_a02->0.0045*ncl_a2+0.2997*ncl_a1+0.0000*ncl_a3;1.e9',
'na_a03->0.0000*ncl_a2+0.0458*ncl_a1+0.0391*ncl_a3;1.e9',
'na_a04->0.0000*ncl_a2+0.0000*ncl_a1+0.3542*ncl_a3;1.e9',
'cl_a01->0.5995*ncl_a2+0.0737*ncl_a1+0.0000*ncl_a3;1.e9',
'cl_a02->0.0068*ncl_a2+0.4621*ncl_a1+0.0000*ncl_a3;1.e9',
'cl_a03->0.0000*ncl_a2+0.0709*ncl_a1+0.0604*ncl_a3;1.e9',
'cl_a04->0.0000*ncl_a2+0.0001*ncl_a1+0.5462*ncl_a3;1.e9',
'oin_a01->0.9886*dst_a2+0.1216*dst_a1+0.0000*dst_a3;1.e9',
'oin_a02->0.0114*dst_a2+0.7618*dst_a1+0.0002*dst_a3;1.e9',
'oin_a03->0.0000*dst_a2+0.1216*dst_a1+0.0995*dst_a3;1.e9',
'oin_a04->0.0000*dst_a2+0.0002*dst_a1+0.9003*dst_a3;1.e9',
'num_a01->0.9996*num_a2+0.7135*num_a1+0.0000*num_a3;1.0',
'num_a02->0.0004*num_a2+0.2847*num_a1+0.0239*num_a3;1.0',
'num_a03->0.0000*num_a2+0.0016*num_a1+0.6258*num_a3;1.0',
'num_a04->0.0000*num_a2+0.0000*num_a1+0.3501*num_a3;1.0',
/
&chem
kemit = 1,
chem_opt = 202, 202, 202,
bioemdt = 12., 4., 4.,
photdt = 12., 4., 4.,
chemdt = 12., 4., 4.,
io_style_emissions = 2,
emiss_inpt_opt = 102, 102, 102,
emiss_opt = 10, 10, 10,
chem_in_opt = 1, 2, 2,
phot_opt = 4, 4, 4,
gas_drydep_opt = 1, 1, 1,
aer_drydep_opt = 1, 1, 1,
bio_emiss_opt = 3, 3, 3,
gas_bc_opt = 1, 1, 1,
gas_ic_opt = 1, 1, 1,
aer_bc_opt = 1, 1, 1,
aer_ic_opt = 1, 1, 1,
gaschem_onoff = 1, 1, 1,
aerchem_onoff = 1, 1, 1,
wetscav_onoff = 1, 1, 1,
cldchem_onoff = 0, 0, 0,
vertmix_onoff = 1, 1, 1,
chem_conv_tr = 1, 1, 1,
conv_tr_wetscav = 1, 1, 1,
conv_tr_aqchem = 1, 1, 1,
seas_opt = 2,
dust_opt = 3,
dmsemis_opt = 1,
aer_ra_feedback = 1, 1, 1,
aer_op_opt = 1, 1, 1,
ne_area = 500,
opt_pars_out = 1,
have_bcs_chem = .true.,
have_bcs_upper = .false.,
biomass_burn_opt = 5, 5, 5,
plumerisefire_frq = 30, 30, 30,
scale_fire_emiss = .true., .true., .true.,
n2o5_hetchem = 1,
lnox_opt = 1, 1, 1,
diagnostic_chem = 0, 0, 0,
diagnostic_dep = 0, 0, 0,
/
&share
wrf_core = 'ARW',
max_dom = 3,
start_date = '__startDate__','__startDate__','__startDate__'
end_date = '__endDate__','__startDate__','__startDate__',
interval_seconds = __metIncSec__,
io_form_geogrid = 2,
/
&geogrid
parent_id = 1, 1, 2,
parent_grid_ratio = 1, 9, 5,
i_parent_start = 1, 96, 69,
j_parent_start = 1, 75, 74,
e_we = 185, 172, 151,
e_sn = 186, 163, 156,
! geog_data_res = 'modis_fpar+modis_lai+modis_lakes+modis_30s+modis_15s+30s', 'modis_fpar+modis_lai+modis_lakes+modis_30s+modis_15s+30s',
! 'modis_fpar+modis_lai+modis_lakes+modis_30s+modis_15s+30s',
dx = 20000,
dy = 20000,
map_proj = 'lambert',
ref_lat = 50.0,
ref_lon = 7.5,
truelat1 = 30.0,
truelat2 = 60.0,
stand_lon = 7.5,
geog_data_path = '__geogDir__'
/
&ungrib
out_format = 'WPS',
prefix = 'FILE',
/
&metgrid
fg_name = 'FILE',
constants_name = 'TAVGSFC',
io_form_metgrid = 2,
/
&time_control
start_year = __startYear__, __startYear__, __startYear__,
start_month = __startMonth__, __startMonth__, __startMonth__,
start_day = __startDay__, __startDay__, __startDay__,
start_hour = __startHour__, __startHour__, __startHour__,
start_minute = 00, 00, 00,
start_second = 00, 00, 00,
end_year = __endYear__, __endYear__, __endYear__,
end_month = __endMonth__, __endMonth__, __endMonth__,
end_day = __endDay__, __endDay__, __endDay__,
end_hour = __endHour__, __endHour__, __endHour__,
end_minute = 00, 00, 00,
end_second = 00, 00, 00,
interval_seconds = __metIncSec__,
input_from_file = .true., .true., .true.,
history_interval = 60, 60, 60,
frames_per_outfile = 1, 1, 1,
restart = __isRestart__,
restart_interval = __restartInterval__,
override_restart_timers = .true.,
io_form_history = 2
io_form_restart = 2
io_form_input = 2
io_form_boundary = 2
debug_level = 0
iofields_filename = "iofields" ,"iofields", "iofields",
force_use_old_data = .true.,
! CHEM
/
&domains
use_adaptive_time_step = .false.,
step_to_output_time = .true.,
target_cfl = 1.0, 1.0, 1.0,
max_step_increase_pct = 5, 51, 51,
starting_time_step = -1, -1, -1,
max_time_step = 200, 40, 3,
min_time_step = -1, -1, -1,
adaptation_domain = 3,
time_step = 120,
time_step_fract_num = 0,
time_step_fract_den = 1,
max_dom = 3,
e_we = 185, 172, 151,
e_sn = 186, 163, 156,
e_vert = 33, 33, 33,
num_metgrid_levels = 34,
num_metgrid_soil_levels = 4,
dx = 20000, 2222, 400,
dy = 20000, 2222, 400,
grid_id = 1, 2, 3,
parent_id = 0, 1, 2,
i_parent_start = 1, 96, 69,
j_parent_start = 1, 75, 74,
parent_grid_ratio = 1, 9, 5,
parent_time_step_ratio = 1, 9, 5,
feedback = 0,
/
&physics
mp_physics = 10, 10, 10,
progn = 1, 1, 1,
prec_acc_dt = 60., 60., 60.,
ra_lw_physics = 4, 4, 4,
ra_sw_physics = 4, 4, 4,
radt = 16, 4, 4,
aer_opt = 1,
sf_sfclay_physics = 5, 5, 5, ! Ravans suggestion
sf_surface_physics = 2, 2, 2, ! NOAH
sf_surface_mosaic = 0,
sf_lake_physics = 1, 1, 1,
sf_urban_physics = 1, 1, 1,
bl_pbl_physics = 5, 5, 5, ! MYNN 2.5
bl_mynn_cloudpdf = 1,
bl_mynn_cloudmix = 1,
scalar_pblmix = 1,
tracer_pblmix = 1,
! grav_settling = 0, 2, 2, ! settling of fog / cloud droplets
bldt = 0, 0, 0,
cu_physics = 5, 5, 0, ! Grell 3D
cudt = 1,
cugd_avedx = 1, ! set to 3 for 4km run, 1 for 36km
ishallow = 0,
iz0tlnd = 1, ! thermal roughness length over land determined by vegetation type
isfflx = 1,
ifsnow = 1,
icloud = 1,
icloud_bl = 1,
num_soil_layers = 4,
cu_rad_feedback = .true., .true.,.false.,
cu_diag = 1, 1, 0,
slope_rad = 0, 0, 1,
topo_shading = 0, 0, 0,
num_land_cat = 21,
/
&fdda
grid_fdda = 1, 0, 0,
gfdda_inname = "wrffdda_d<domain>",
gfdda_end_h = 312, 0, 0,
gfdda_interval_m = 60, 0, 0,
if_no_pbl_nudging_uv = 1, 1, 1,
if_no_pbl_nudging_t = 1, 1, 1,
if_no_pbl_nudging_q = 1, 1, 1,
if_zfac_uv = 0, 0, 0,
k_zfac_uv = 2,
if_zfac_t = 0, 0, 0,
k_zfac_t = 2,
if_zfac_q = 0, 0, 0,
k_zfac_q = 2,
guv = 0.0006, 0.0006, 0.0006,
gt = 0.0006, 0.0006, 0.0006,
gq = 0.0006, 0.0006, 0.0006,
if_ramping = 0,
dtramp_min = 360,
io_form_gfdda = 2,
/
&dynamics
rk_ord = 3,
time_step_sound = 4, 4, 4,
w_damping = 1,
diff_opt = 1, 1, 2,
km_opt = 4, 4, 4,
diff_6th_opt = 0, 0, 0,
diff_6th_factor = 0.12, 0.12, 0.75,
epssm = 0.1, 0.1, 0.5,
sfs_opt = 0, 0, 0,
base_temp = 290.
damp_opt = 3,
zdamp = 5000., 5000., 5000.,
dampcoef = 0.15, 0.15, 0.15,
khdif = 0, 0, 0,
kvdif = 0, 0, 0,
mix_isotropic = 0, 0, 1,
non_hydrostatic = .true.,
moist_adv_opt = 2, 2, 4,
scalar_adv_opt = 2, 2, 4,
tke_adv_opt = 2, 2, 4,
do_avgflx_em = 1, 1, 1,
hybrid_opt = 0,
use_theta_m = 1,
/
&bdy_control
spec_bdy_width = 5,
spec_zone = 1,
relax_zone = 4,
specified = .true., .false., .false.,
nested = .false., .true., .true.,
/
&grib2
/
&namelist_quilt
nio_tasks_per_group = 0,
nio_groups = 1
/
io_form_auxinput5 = 2,
auxinput5_inname = 'wrfchemi_d<domain>_<date>',
auxinput5_interval_h = 1, 1,
frames_per_auxinput5 = 1, 1,
io_form_auxinput6 = 2,
auxinput6_inname = 'wrfbiochemi_d<domain>'
auxinput6_interval_h = 2400, 2400,
io_form_auxinput7 = 2,
auxinput7_inname = 'wrffirechemi_d<domain>_<date>',
auxinput7_interval_m = 60, 60,
frames_per_auxinput7 = 1, 1,
\ No newline at end of file
# Edit this file to introduce tasks to be run by cron.
#
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
#
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use '*' in these fields (for 'any').#
# Notice that tasks will be started based on the cron's system
# daemon's notion of time and timezones.
#
# Output of the crontab jobs (including errors) is sent through
# email to the user the crontab file belongs to (unless redirected).
#
# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
#
# For more information see the manual pages of crontab(5) and cron(8)
#
# m h dom mon dow command
HOME=/home/m/met-wrf-chem
MAILTO=christoph.knote@physik.uni-muenchen.de
# wrf meteogram
52 * * * * /usr/bin/sbatch /alcc/gpfs2/home/u/knotechr/wrfotron/blueprints/operational_chemistry/pp/plotting/meteograms/run.sh
# wrf maps
00 07 * * * /usr/bin/sbatch /alcc/gpfs2/home/u/knotechr/wrfotron/blueprints/operational_chemistry/pp/plotting/maps/run.sh
# wrf geotiffs
17 6,12,18 * * * /usr/bin/sbatch /alcc/gpfs2/home/u/knotechr/wrfotron/blueprints/operational_chemistry/pp/plotting/geotiffs/run.sh
#!/bin/bash -l
#SBATCH --partition=alcc1
#SBATCH -o /alcc/gpfs2/scratch/mbees/knotechr/WRF/postprocessing/geotiffs.%j.%N.out
#SBATCH -J geotiffs
#SBATCH --ntasks=1
#SBATCH --mem=5G
#SBATCH --mail-type=FAIL
#SBATCH --mail-user=christoph.knote@med.uni-augsburg.de
#SBATCH --time=00:30:00
module load gnu gdal geos proj
scriptPath=/alcc/gpfs2/home/u/knotechr/wrfotron/tools/nc_2_geotiff.py
wrfDataPathPattern="/alcc/gpfs2/scratch/mbees/knotechr/archive/WRF/operational_chemistry/wrfout___domain___%Y-%m-%d_%H:%M:%S"
firstDateToProcess=`date --date="2 days ago" "+%Y-%m-%d"`
intervalHours=1
rangeHours=120
plotDirPattern="/alcc/gpfs2/scratch/mbees/knotechr/plots/WRF/operational_chemistry/__domain__/geotiffs/%Y/%m/%d"
for domain in d01 d02
do
plotPathPattern="${plotDirPattern/__domain__/${domain}}/{species:s}_%Y-%m-%d_%H-%M.tif"
for anHour in $(seq 0 ${intervalHours} ${rangeHours})
do
aWRFDataPath=$(date -u --date="${firstDateToProcess} 0 UTC +${anHour} hours" "+${wrfDataPathPattern/__domain__/${domain}}")
aPlotDir=$(date -u --date="${firstDateToProcess} 0 UTC +${anHour} hours" "+${plotDirPattern/__domain__/${domain}}")
aPlotPath=$(date -u --date="${firstDateToProcess} 0 UTC +${anHour} hours" "+${plotPathPattern}")
if [ -f ${aWRFDataPath} ]
then
mkdir -p $aPlotDir
python3 $scriptPath -s "o3,O3" -s "no2,NO2" -s "co,CO" -s "PM2_5_DRY,PM2.5" -s "PM10,PM10" "${aWRFDataPath}" "${aPlotPath}"
fi
done
done
from wrf import to_np, getvar, smooth2d, latlon_coords, interplevel, get_cartopy
import numpy as np
import matplotlib
from matplotlib import pyplot as plt
import cartopy.feature as cfeature
import cartopy.crs as ccrs
from matplotlib.colors import LinearSegmentedColormap, ListedColormap
from tools import total_prec, cartopy_lim_buffered, make_fig_and_ax, add_title_and_description
def slp_map(t, nc, prec_prev, output_path, plevels=np.arange(950, 1050, 5)):
#
slp = getvar(nc, "slp")
mid_clouds = getvar(nc, "mid_cloudfrac")
prec = total_prec(nc, prec_prev)
#
# Smooth the sea level pressure since it tends to be noisy near the
# mountains
smooth_slp = smooth2d(slp, 5, cenweight=4)
# Get the latitude and longitude points
lats, lons = latlon_coords(slp)
#
# Get the WRF projection (CRS) object
crs = get_cartopy(slp)
#
# Create a figure
fig, ax, ax_cbarv, ax_cbarh = make_fig_and_ax(plt, crs, add_horiz_cbar=True)
#
# Draw the contours and filled contours
cmap = LinearSegmentedColormap.from_list("", ["white", "silver"])
cmap2 = matplotlib.cm.viridis_r
#
con = ax.contourf(to_np(lons), to_np(lats), to_np(mid_clouds),
levels=[1/10, 1/4, 1/2, 3/4, 1], cmap=cmap, zorder=2,
transform=ccrs.PlateCarree())
con2 = ax.contourf(to_np(lons), to_np(lats), to_np(prec),
levels=[0.5, 1, 2, 5, 10, 25, 50], cmap=cmap2, zorder=2, extend='max',
transform=ccrs.PlateCarree())
#
linewidths = np.ones(plevels.shape)
linewidths[np.where(plevels == 1015)[0]] = 3
cs = ax.contour(to_np(lons), to_np(lats), to_np(smooth_slp), levels=plevels,
linewidths=linewidths, colors="black", zorder=4,
transform=ccrs.PlateCarree())
plt.clabel(cs, fmt='%1.0f', fontsize=8)
#
ax.coastlines(linewidth=0.3, zorder=2)
countries = cfeature.NaturalEarthFeature(category='cultural', name='admin_0_countries', scale='50m')
ax.add_feature(countries, facecolor='none', edgecolor='black', linewidth=0.3, zorder=3)
#
cbar = plt.colorbar(con, cax=ax_cbarv, ticks=[1/10, 1/4, 1/2, 3/4, 1])
cbar2 = plt.colorbar(con2, cax=ax_cbarh, orientation="horizontal")
#
try:
cbar.ax.set_yticklabels(["1/10", "1/4", "1/2", "3/4", "1"], fontsize=10)
except:
print("Plotting tick labels failed")
#
ax.set_xlim(cartopy_lim_buffered(slp, "x"))
ax.set_ylim(cartopy_lim_buffered(slp, "y"))
add_title_and_description(nc, "Sea Level Pressure [hPa], Mid-Level Cloud Cover, Total prec. in the last hour [mm] \n"
"WRF {init:s} +{fcsthour:d}", ax)
#
plt.savefig(output_path, bbox_inches='tight', pad_inches=0.1)
plt.close()
return prec
def plevel_map(t, nc, output_path, plevel, phi_contour_intervals=np.arange(400, 800, 8)):
#
def interp_var(nc, variablename, p, plevel):
var = getvar(nc, variablename)
return interplevel(var, p, plevel)
#
p = getvar(nc, "p", units='hPa')
#
geop = interp_var(nc, "geopt", p, plevel)
geop = smooth2d(geop, 5, cenweight=4)
#
temp = interp_var(nc, "tc", p, plevel)
#
u, v = interp_var(nc, "uvmet", p, plevel)
#
# Get the latitude and longitude points
lats, lons = latlon_coords(temp)
#
# Get the WRF projection (CRS) object
crs = get_cartopy(temp)
#
# Create a figure
fig, ax, ax_cbarv, ax_cbarh = make_fig_and_ax(plt, crs)
#
# Temperature
lab = np.array([-46, -41, -36, -31, -26, -21, -16, -11, -6, -1, 4])
con = ax.contourf(to_np(lons), to_np(lats), temp, levels=lab,
transform=ccrs.PlateCarree(),
cmap='viridis', zorder=0, extend='both')
#
# Geopotential height
linewidths = np.ones(phi_contour_intervals.shape)
linewidths[np.where(phi_contour_intervals == 552)[0]] = 3
cs = ax.contour(to_np(lons), to_np(lats), geop/98.0, levels=phi_contour_intervals,
linewidths=linewidths, colors="black",
zorder=1,
transform=ccrs.PlateCarree())
plt.clabel(cs, fmt='%1.0f', fontsize=10)
#
#
ax.coastlines(linewidth=0.3, zorder=2)
countries = cfeature.NaturalEarthFeature(category='cultural', name='admin_0_countries', scale='50m')
ax.add_feature(countries, facecolor='none', edgecolor='black', linewidth=0.3, zorder=3)
#
nb = 20
brsb = ax.barbs(to_np(lons[::nb,::nb]), to_np(lats[::nb,::nb]),
to_np(u[::nb,::nb]), to_np(v[::nb,::nb]),
transform=ccrs.PlateCarree(),
length=4.5, zorder=4, linewidth=0.3)
#
ax.set_xlim(cartopy_lim_buffered(temp, "x"))
ax.set_ylim(cartopy_lim_buffered(temp, "y"))
#
cbar = plt.colorbar(con, cax=ax_cbarv)
add_title_and_description(nc, "{:d}".format(plevel) + " hPa level Geopotential [gpdm], Temperature [°C] and Wind \n"
"WRF {init:s} +{fcsthour:d}", ax)
#
plt.savefig(output_path, bbox_inches='tight', pad_inches=0.1)
plt.close()
# https://stackoverflow.com/questions/37327308/add-alpha-to-an-existing-matplotlib-colormap
def alphafy_colormap(name, mina=0.0, maxa=0.8):
# Choose colormap
cmap = matplotlib.cm.get_cmap(name)
# Get the colormap colors
my_cmap = cmap(np.arange(cmap.N))
# Set alpha
my_cmap[:,-1] = np.linspace(mina, maxa, cmap.N)
# Create new colormap
return ListedColormap(my_cmap)
def sfc_map(t, nc, get_var_fun, levels, ticks, label, bg_function, output_path, cmap="YlOrRd", extend='both'):
#
var = get_var_fun(nc)
u, v = getvar(nc, 'uvmet10')
#
# Get the latitude and longitude points
lats, lons = latlon_coords(u)
#
# Get the WRF projection (CRS) object
crs = get_cartopy(u)
#
# Create a figure
fig, ax, ax_cbarv, ax_cbarh = make_fig_and_ax(plt, crs)
#
# Draw the contours and filled contours
lab = np.array(levels)
con = ax.contourf(to_np(lons), to_np(lats), var, levels=lab,
transform=ccrs.PlateCarree(),
cmap=alphafy_colormap(cmap), zorder=1, extend=extend)
#
linewidths = np.ones(lab.shape)/2
linewidths[np.where(lab == 0)[0]] = 1
cs = ax.contour(to_np(lons), to_np(lats), var, levels=lab[::2],
linewidths=linewidths, colors="black", alpha=0.5,
zorder=2,
transform=ccrs.PlateCarree())
plt.clabel(cs, fmt='%1.0f', fontsize=8)
#
# Add background (needs to happen after map is already created...)
bg_function(ax, crs)
#
nb = 10
brsb = ax.barbs(to_np(lons[::nb,::nb]), to_np(lats[::nb,::nb]),
to_np(u[::nb,::nb]), to_np(v[::nb,::nb]),
transform=ccrs.PlateCarree(),
length=4.5, zorder=4, linewidth=0.5)
xlim = cartopy_lim_buffered(u, "x")
ylim = cartopy_lim_buffered(u, "y")
#
ax.set_xlim(xlim)
ax.set_ylim(ylim)
#
cbar = plt.colorbar(con, cax=ax_cbarv)
cbar.set_ticks(ticks)
#
add_title_and_description(nc, label + " and Wind (10m) \n" + "WRF {init:s} +{fcsthour:d}", ax)
#
plt.savefig(output_path, bbox_inches='tight', pad_inches=0.1)
plt.close()
This diff is collapsed.
import datetime
from argparse import ArgumentParser, ArgumentTypeError
def valid_date(s):
try:
return datetime.datetime.strptime(s, "%Y-%m-%d")
except ValueError:
raise ArgumentTypeError("Not a valid date: '{0}'.".format(s))
parser = ArgumentParser()
parser.add_argument('wrf_data_fpath_pattern', type=str, help='WRF input data path pattern (including strptime pattern for date and {domain:02d} for domain (01, 02, ...))')
parser.add_argument('date', type=valid_date, help='Date to process (YYYY-mm-dd)')
parser.add_argument('interval_hours', type=int, help='Time interval in hours for plotting')
parser.add_argument('fcst_time_hours', type=int, help='Forecast time in hours')
parser.add_argument('plot_fpath_pattern', type=str, help='Plot output path pattern (including strptime pattern for date, {plot:s} for plot identifier (e.g., 500hPa...) and {domain:02d} for domain (01, 02)')
args = parser.parse_args()
from plots import plevel_map, sfc_map, slp_map
import pois
import netCDF4
from wrf import getvar
import numpy as np
import cartopy.feature as cfeature
import contextily
import rasterio
times = [ args.date + datetime.timedelta(hours=t) for t in range(0, args.fcst_time_hours, args.interval_hours) ]
# for calculating delta precip
prec_prev = None
def bg_function(ax, wrfcrs):
wrfcrs_proj4 = wrfcrs.proj4_init
wrfcrs_proj4 = wrfcrs_proj4.replace('+nadgrids=@null', '')
rasteriocrs = rasterio.crs.CRS.from_proj4(wrfcrs_proj4)
contextily.add_basemap(ax, source=contextily.providers.Stamen.TonerLite, crs=rasteriocrs, zorder=0)
for t in times:
input_path_d01 = t.strftime(args.wrf_data_fpath_pattern).format(domain=1)
input_path_d02 = t.strftime(args.wrf_data_fpath_pattern).format(domain=2)
try:
nc_d01 = netCDF4.Dataset(input_path_d01)
nc_d02 = netCDF4.Dataset(input_path_d02)
except Exception as e:
print("Not all data available for step {:s}: {:s}".format(t.strftime("%Y-%m-%d %H"), str(e)))
continue
print(t)
# 500 hPa Europe domain
# output_path = t.strftime(args.plot_fpath_pattern).format(plot='500hPa', domain=1)
# plevel_map(t, nc_d01, output_path, 500)
# Surface Europe domain
# temperature
# sfc_map(t, nc_d01, lambda nc: getvar(nc, 'T2') - 273.15,
# levels=[-25, -20, -15, -12.5, -10, -7.5, -5, -2.5, 0, 2.5, 5, 7.5, 10, 12.5, 15, 17.5, 20, 22.5, 25, 27.5, 30, 32.5, 35],
# ticks=[-25, -15, -10, -5, 0, 5, 10, 15, 20, 25, 30, 35],
# label="Temperature (2m) [°C]", pois=pois.capitals,
# output_path=t.strftime(args.plot_fpath_pattern).format(plot='T', domain=1))
# Ozone
for domain, nc_d, poilist in zip([1,2],[nc_d01, nc_d02], [pois.capitals, pois.southern_germany]):
sfc_map(t, nc_d, lambda nc: getvar(nc, 'o3')[0,:,:] * 1e3,
levels=range(0, 160, 10),
ticks=range(0, 150, 20),
label="Ozone (ground level) [ppbv]", bg_function=bg_function,
output_path=t.strftime(args.plot_fpath_pattern).format(plot='O3', domain=domain),
extend='max')
# NO2
sfc_map(t, nc_d, lambda nc: getvar(nc, 'no2')[0,:,:] * 1e3,
levels=range(0, 110, 10),
ticks=range(0, 110, 20),
label="NO$_2$ (ground level) [ppbv]", bg_function=bg_function,
output_path=t.strftime(args.plot_fpath_pattern).format(plot='NO2', domain=domain),
extend='max')
# PM
def get_pm(nc, bins=[ 1, 2, 3 ]) :
pmspecs = [ "so4", "no3", "smpa", "smpbb", "glysoa_sfc", "biog1_c", "biog1_o", "cl", "co3", "nh4", "na", "cl", "oin", "oc", "bc", "water" ] # ug kg-1
alt = getvar(nc, "ALT")[0,:,:] # inverse density m3 kg-1
all = [ getvar(nc, spec + "_a{:02d}".format(bin))[0,:,:] / alt for spec in pmspecs for bin in bins ]
return np.sum(all, axis=0)
# sfc_map(t, nc_d, lambda nc: get_pm(nc, bins=[1]),
# levels=range(0, 130, 10),
# ticks=range(0, 130, 20),
# label="UFP (ground level) [$\mu$g m$^{{-3}}$]", bg_function=bg_function,
# output_path=t.strftime(args.plot_fpath_pattern).format(plot='UFP', domain=domain),
# extend='max')
sfc_map(t, nc_d, lambda nc: get_pm(nc, bins=[1,2,3]),
levels=range(0, 130, 10),
ticks=range(0, 130, 20),
label="PM$_{{2.5}}$ (ground level) [$\mu$g m$^{{-3}}$]", bg_function=bg_function,
output_path=t.strftime(args.plot_fpath_pattern).format(plot='PM2_5', domain=domain),
extend='max')
sfc_map(t, nc_d, lambda nc: get_pm(nc, bins=[1,2,3,4]),
levels=range(0, 130, 10),
ticks=range(0, 130, 20),
label="PM$_{{10}}$ (ground level) [$\mu$g m$^{{-3}}$]", bg_function=bg_function,
output_path=t.strftime(args.plot_fpath_pattern).format(plot='PM10', domain=domain),
extend='max')
# SLP Europe
# output_path = t.strftime(args.plot_fpath_pattern).format(plot='SLP', domain=1)
# prec_prev = slp_map(t, nc_d01, prec_prev, output_path)
nc_d01.close()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment