1 | Scripts for processing of WRF and CAMx files to PALM dynamic driver. |
---|
2 | Version: v.3.1, 20201102 |
---|
3 | |
---|
4 | Usage: palm_dynamic -c <config_name> [-w] |
---|
5 | |
---|
6 | The script requires name of the case configuration on the command line. |
---|
7 | The corresponding configuration files are placed in subdirectory |
---|
8 | "configuration" and they are named <config_name>.conf. Examples of |
---|
9 | the config files are supplied with the scripts, all configuration |
---|
10 | options with are in the file palm_dynamic_defaults.py as well as |
---|
11 | at the end of this readme file. The values which agree with defaults |
---|
12 | need not be present in the user config. The file palm_dynamic_init.py |
---|
13 | contains setting and calculation of standard initialization values |
---|
14 | for particular system and can be adjusted. The optional parameter -w |
---|
15 | allows to skip horizontal and vertical interpolation in case it is |
---|
16 | already done. |
---|
17 | |
---|
18 | The scripts were implemented with regards to good portability and they |
---|
19 | only depend on standard and well-known Python libraries. |
---|
20 | Needed modules are: |
---|
21 | |
---|
22 | - numpy (https://pypi.org/project/numpy) |
---|
23 | - scipy (https://pypi.org/project/scipy) |
---|
24 | - pyproj (https://pypi.org/project/pyproj) |
---|
25 | - netCDF4 (https://pypi.org/project/netCDF4) |
---|
26 | - metpy (https://unidata.github.io/MetPy) |
---|
27 | |
---|
28 | First four modules are included in all major linux distributions. In other cases, |
---|
29 | they can be installed via pip (e.g. "pip3 install netCDF4"). |
---|
30 | |
---|
31 | The MetPy module is a well-known and widely used project for meteorological |
---|
32 | calculations in Python maintained by Unidata. It can also be installed using |
---|
33 | pip ("pip3 install MetPy"). |
---|
34 | |
---|
35 | In the current version, the only supported projection in WRF is Lambert |
---|
36 | conformal conic, which is WRF default and recommended projection for |
---|
37 | mid-latitudes. The CAMx output files, which are used optionally for the |
---|
38 | chemical initial and boundary conditions, are expected to be the result of |
---|
39 | a coupled CAMx simulation using the same horizontal grid as WRF, although this |
---|
40 | is not strictly required. |
---|
41 | |
---|
42 | The scripts support both variants of WRF vertical levels - the sigma levels |
---|
43 | (default until WRF version 3.*) and the hybrid levels (default since WRF 4.*). |
---|
44 | However, it is necessary to correctly configure this option via the setting |
---|
45 | "wrf_hybrid_levs = True/False". |
---|
46 | |
---|
47 | CONFIGURATION |
---|
48 | |
---|
49 | Configuration files have syntax: |
---|
50 | <parameter1> = <value1> |
---|
51 | <parameter2> = <value2> |
---|
52 | ... |
---|
53 | Parameters can be string, integer, float, logical or list of these values. |
---|
54 | The <value> terms have Python syntax, the config file needs to contain only |
---|
55 | parameters which differ from default. |
---|
56 | |
---|
57 | Description of the particular configuration options are (defaults are in parenthesis): |
---|
58 | |
---|
59 | # 1. Domain and case related config |
---|
60 | domain name of the simulation case ("") |
---|
61 | resolution name of the particular domain resolution scenario ("") |
---|
62 | scenario name of the individual scenario in the case ("") |
---|
63 | nested_domain False indicates parent and True nested domain. (False) |
---|
64 | dynamic_driver_file file name of output dynamic driver (""). The default value |
---|
65 | "" means the standard name assigned in the palm_dynamic_init. |
---|
66 | grid_from_static value True - the grid parameters are imported from the static |
---|
67 | driver, False - they are prescribed in the config (True) |
---|
68 | static_driver_file file name of the static driver in case of grid_from_static (""). |
---|
69 | The default value "" means the standard name assigned in init. |
---|
70 | proj_palm reference coordinate system of PALM simulation ("EPSG:32633") |
---|
71 | proj_wgs84 reference coordinate system of lon-lat projection ("EPSG:4326") |
---|
72 | dz height of the PALM vertical grid layer (0.0). The default |
---|
73 | value dz = 0.0 means dz is assigned from dx. |
---|
74 | nz number of vertical layers of PALM domain (200) |
---|
75 | dz_stretch_level height in meters from which stretching of vertical levels |
---|
76 | starts in PALM (5000.0) |
---|
77 | dz_stretch_factor coefficient of the stretching of the vertical layers in PALM (1.0) |
---|
78 | dz_max max height of the stretched vertical layers (100.0) |
---|
79 | origin_time origin time of the PALM simulation in the format |
---|
80 | YYYY-MM-DD hh:mm:ss (""). The default value "" means that |
---|
81 | the value is read from the global attribute of the static driver. |
---|
82 | simulation_hours extent of the simulation in hours (24) |
---|
83 | |
---|
84 | # 2. WRF and CAMx related configurations |
---|
85 | wrf_hybrid_levs True means hybrid levels in WRF files, False means sigma levels (True). |
---|
86 | vinterp_terrain_smoothing |
---|
87 | the standard deviation for Gaussian kernel of smoothing method |
---|
88 | of the PALM terrain for WRF vertical interpolation to avoid sharp |
---|
89 | horizontal gradients. Value None disables the smoothing. (None) |
---|
90 | wrf_dir_name files path of the wrf and camx input files (""). The default value "" |
---|
91 | means that the standard path will be calculated in the init. |
---|
92 | wrf_file_mask file mask of the wrf input files ("wrfout_*.e000") |
---|
93 | radiation_from_wrf enable or disable processing of radiation from WRF files (True). |
---|
94 | wrf_rad_file_mask file mask of the wrf radiation input files ("auxhist6_*"). |
---|
95 | The default setting reads radiation from WRF auxiliary |
---|
96 | history files. This setting allows to use finer time step for WRF |
---|
97 | radiation outputs than for other values. |
---|
98 | radiation_smoothing_distance |
---|
99 | smoothing distance for radiation values in m (10000.0). |
---|
100 | camx_file_mask file mask of the CAMx input files ("CAMx.*.nc"). |
---|
101 | species_names PALM names of the chemical species (['NO','NO2','O3','PM10','PM25']). |
---|
102 | The default value can be used for phstatp and phstatp2 chemical |
---|
103 | mechanisms in PALM. The mapping and recalculation from the CAMx |
---|
104 | species to PALM species is defined in the variable camx_conversions |
---|
105 | (see palm_dynamic_init.py). The current mapping is adjusted for |
---|
106 | CAMx v6.50 with CB05 + PM (CF,SOAP2.1,ISORROPIA) chemistry mechanisms. |
---|
107 | In the case other combinations, it may be necessary to adjust |
---|
108 | this mapping. |
---|
109 | |
---|
110 | # 3. horizontal parameters of the PALM domain which have to be set in case |
---|
111 | # of grid_from_static = False |
---|
112 | nx, ny number of horizontal grids of the domain in x and y directions |
---|
113 | dx, dy grid cell size of the domain in x and y directions |
---|
114 | origin_x, origin_y origin x and y of the domain |
---|
115 | origin_z origin of the domain in the vertical direction |
---|
116 | |
---|