diff --git a/.README.txt.swp b/.README.txt.swp new file mode 100644 index 0000000000000000000000000000000000000000..d5666534131a220441d401770251c97d4211c743 Binary files /dev/null and b/.README.txt.swp differ diff --git a/README.txt b/README.txt index 19ba79d1262323479c003529c88d88ddd99c13f5..52e8259ba49d2f9462fa49d5ae00ea92fccb6cf4 100644 --- a/README.txt +++ b/README.txt @@ -5,36 +5,24 @@ The scripts are based on the wrf-CAMx interface: https://palm.muk.uni-hannover.de/trac/wiki/doc/app/iofiles/wrf_interface Usage: palm_dynamic -c [-w] +The optional parameter -w allows to skip horizontal and vertical +interpolation in case it is already done. +Example: python3 palm_dynamic.py -c augsburg_validation_summer_10 The script requires name of the case configuration on the command line. The corresponding configuration files are placed in subdirectory -"configuration" and they are named .conf. An example of -the config file is supplied with the scripts, all configuration -options with are in the file palm_dynamic_defaults.py as well as -at the end of this readme file. The values which agree with defaults -need not be present in the user config. The file palm_dynamic_init.py -contains setting and calculation of standard initialization values -for particular system and can be adjusted. The optional parameter -w -allows to skip horizontal and vertical interpolation in case it is -already done. - -The scripts were implemented with regards to good portability and they -only depend on standard and well-known Python libraries. -Needed modules are: +"configuration" and they are named .conf. The values which +agree with defaults need not be present in the user config. The file +palm_dynamic_init.py contains setting and calculation of standard +initialization values for particular system and can be adjusted. +Needed modules are: - numpy (https://pypi.org/project/numpy) - scipy (https://pypi.org/project/scipy) - pyproj (https://pypi.org/project/pyproj) - netCDF4 (https://pypi.org/project/netCDF4) - metpy (https://unidata.github.io/MetPy) -First four modules are included in all major linux distributions. In other cases, -they can be installed via pip (e.g. "pip3 install netCDF4"). - -The MetPy module is a well-known and widely used project for meteorological -calculations in Python maintained by Unidata. It can also be installed using -pip ("pip3 install MetPy"). - In the current version, the only supported projection in WRF-CHEM is Lambertiam conformal conic, which is WRF default and recommended projection for mid-latitudes. @@ -45,30 +33,20 @@ However, it is necessary to correctly configure this option via the setting "wrf_hybrid_levs = True/False". CONFIGURATION - -Configuration files have syntax: - = - = -... -Parameters can be string, integer, float, logical or list of these values. -The terms have Python syntax, the config file needs to contain only -parameters which differ from default. - Description of the particular configuration options are (defaults are in parenthesis): - # 1. Domain and case related config domain name of the simulation case ("") resolution name of the particular domain resolution scenario ("") scenario name of the individual scenario in the case ("") nested_domain False indicates parent and True nested domain. (False) -dynamic_driver_file file name of output dynamic driver (""). The default value - "" means the standard name assigned in the palm_dynamic_init. -grid_from_static value True - the grid parameters are imported from the static + +dynamic_driver_file file name of output dynamic driver (""). +grid_from_static True - the grid parameters are imported from the static driver, False - they are prescribed in the config (True) static_driver_file file name of the static driver in case of grid_from_static (""). - The default value "" means the standard name assigned in init. proj_palm reference coordinate system of PALM simulation ("EPSG:32633") proj_wgs84 reference coordinate system of lon-lat projection ("EPSG:4326") + dz height of the PALM vertical grid layer (0.0). The default value dz = 0.0 means dz is assigned from dx. nz number of vertical layers of PALM domain (200) @@ -76,20 +54,35 @@ dz_stretch_level height in meters from which stretching of vertical levels starts in PALM (5000.0) dz_stretch_factor coefficient of the stretching of the vertical layers in PALM (1.0) dz_max max height of the stretched vertical layers (100.0) + origin_time origin time of the PALM simulation in the format YYYY-MM-DD hh:mm:ss (""). The default value "" means that the value is read from the global attribute of the static driver. -simulation_hours extent of the simulation in hours (24) +simulation_hours extent of the simulation in hours # 2. WRF-CHEM related configurations +wrf_dir_name file path of the wrf-chem input files (""). +wrf_file_mask file mask of the wrf-chem input files ("wrfout_*.e000") wrf_hybrid_levs True means hybrid levels in WRF files, False means sigma levels (True). vinterp_terrain_smoothing - the standard deviation for Gaussian kernel of smoothing method - of the PALM terrain for WRF vertical interpolation to avoid sharp + the standard deviation for Gaussian kernel of smoothing method of + the PALM terrain for WRF vertical interpolation to avoid sharp horizontal gradients. Value None disables the smoothing. (None) -wrf_dir_name files path of the wrf and camx input files (""). The default value "" - means that the standard path will be calculated in the init. -wrf_file_mask file mask of the wrf input files ("wrfout_*.e000") +interp_dir_name file path to interpolated files + +wrfchem_spec wrf-chem chemical species to be included in dynamic driver, list + of species: no, no2, no3, pm10, PM2_5_DRY, o3, co, hno3, ho, h2o2, nh3 + ("no") + +aerosol_wrfchem True means aerosols are included, (False) +wrfchem_bin_limits wrf-chem aerosol siz bins ([3.9e-8, 1.56e-7, 6.25e-7, 2.5e-6, 1.0e-5]) +listspec PALM aerosol species, only aerosols, + options listspec = ['SO4', 'OC', 'BC', 'DU', 'SS', 'NH', 'NO'] ("SO4") +nbin SALSA parameter, # size bins in subrange ([1,7]) +reglim SALSA parameter, subrange limits ([3.9e-8, 5.0e-8, 2.5e-6]) +nf2a SALSA parameter, insoluble fraction, currently only soluble supported + in PALM (1.0) + radiation_from_wrf enable or disable processing of radiation from WRF files (True). wrf_rad_file_mask file mask of the wrf radiation input files ("auxhist6_*"). The default setting reads radiation from WRF auxiliary @@ -97,13 +90,6 @@ wrf_rad_file_mask file mask of the wrf radiation input files ("auxhist6_*"). radiation outputs than for other values. radiation_smoothing_distance smoothing distance for radiation values in m (10000.0). -species_names PALM names of the chemical species (['NO','NO2','O3','PM10','PM25']). - The default value can be used for phstatp and phstatp2 chemical - mechanisms in PALM. The mapping and recalculation from the WRF-CHEM - species to PALM species is defined in the variable camx_conversions - (see palm_dynamic_init.py).Additonal species can be included by making - suitable adjusts to the configuration file (.conf), palm_dynamic_init.py, - palm_dynamic_output.py, palm_dynamic.py and palm_wrf_utils.py # 3. Horizontal parameters of the PALM domain which have to be set in case # of grid_from_static = False @@ -113,12 +99,18 @@ origin_x, origin_y origin x and y of the domain origin_z origin of the domain in the vertical direction -# Changes from wrf + CAMx scripts made to wrf_chem_for_palm +# Major Changes from wrf + CAMx scripts made to wrf_chem_for_palm -Proj future warning resolved --Chemical species are read from wrf-chem files and interpolated at the same time as the dynamic variables +-Chemical species are read from wrf-chem files and interpolated at the same time as the + dynamic variables -Interpolated files are saved to a different directory than the wrf-chem data files +-A variety of chemical species can be inlcuded. +-Aerosols can be included and are weighted based on specified aerosol size bins # Latest update (Feb/March 2022) --Any chemical specie from wrf-chem can be selected in the configuration file and will be included in the dynamic driver. --Extensive changes were made to palm_dynamic_output and palm_dynamic_config to accomdate the changes above. +-Any chemical specie from wrf-chem can be selected in the configuration file and will be + included in the dynamic driver. +-Extensive changes were made to palm_dynamic_output and palm_dynamic_config to accomdate + the changes above. -Resolved issue: missing horizontal interpolation of chemical species has been resolved. +-README file updated and new defaults included. diff --git a/configurations/augsburg_validation_summer_10.conf b/configurations/augsburg_validation_summer_10.conf index 721faae30bb23e3b7b66153a21e6fc80d0bab6d4..3848780d77e262eb0dac7616501f7d346b9f15ab 100644 --- a/configurations/augsburg_validation_summer_10.conf +++ b/configurations/augsburg_validation_summer_10.conf @@ -38,16 +38,14 @@ interp_dir_name = '/cfs/home/d/u/dupreeda/MBEES/PALM/wrf_chem_data/interp' # WRF-chem species need for chemical reaction wrfchem_spec = ['no','no2','o3'] -# possible species: no, no2, no3, pm10,PM2_5_DRY, o3, co, hno3, ho, h2o2, nh3 # Aerosol profile - SALSA parameters aerosol_wrfchem = True wrfchem_bin_limits = [3.9e-8, 1.56e-7, 6.25e-7, 2.5e-6, 1.0e-5] listspec = ['SO4', 'NH', 'NO'] -# possibilities for listspec = ['SO4', 'OC', 'BC', 'DU', 'SS', 'NH', 'NO'] nbin = [1,7] reglim = [3.9e-8, 5.0e-8, 2.5e-6] -nf2a = 1.0 # insoluble not supported in PALM +nf2a = 1.0 # radiation radiation_from_wrf = False diff --git a/dynamic/palm_dynamic_defaults.py b/dynamic/palm_dynamic_defaults.py index 456f7c1417e0fa1c1ff9627c38c322320cf6c1f0..998f86ff922cf4d98ad0a4ed3081dc9f1441d2db 100644 --- a/dynamic/palm_dynamic_defaults.py +++ b/dynamic/palm_dynamic_defaults.py @@ -1,4 +1,3 @@ - # config template with config defaults # not a separate module, only sourced from palm_dynamic_config @@ -11,7 +10,6 @@ nested_domain = False # file name of output dynamic driver ("" means the standard name) dynamic_driver_file = "" - # import grid parameters for dynamic driver from static driver grid_from_static = True # file name of static driver ("" means the standard name) @@ -40,10 +38,21 @@ wrf_hybrid_levs = True # Smoothing of PALM terrain for WRF vertical interpolation to avoid sharp # horizontal gradients. None = off vinterp_terrain_smoothing = None +interp_dir_name = "" # wrf-chem input files path and default file mask wrf_dir_name = "" # "" means that standard path will be calculated in the init wrf_file_mask = "wrfout_d01_*" +wrfchem_spec = ["no"] + +# aerosols +aerosol_wrfchem = False +wrfchem_bin_limits = [3.9e-8, 1.56e-7, 6.25e-7, 2.5e-6, 1.0e-5] +listspec = ['SO4'] +nbin = [1,7] +reglim = [3.9e-8, 5.0e-8, 2.5e-6] +nf2a = 1.0 + # process radiation from wrf, true to include radiation_from_wrf = False wrf_rad_file_mask = "auxhist6_*"