Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removing legacy code and cleaning up logic for real processing of aer…
…osol for mp_physics=28 (#1567) TYPE: enhancement KEYWORDS: real, Thompson aerosol-aware, microphysics SOURCE: Timothy W. Juliano and Pedro A. Jimenez (NCAR/RAL) DESCRIPTION OF CHANGES: Problem: Several modifications have been made to the Thompson Aerosol-Aware scheme (mp_physics=28) in an effort to clean the logic in dyn_em/module_initialize_real and enable more flexibility when pre-processing first guess aerosol fields (e.g., GEOS-5). These modifications are made in preparation for upcoming enhancements to the Thompson AA scheme related to the addition of black carbon aerosol (anthropogenic and biomass burning) and organic carbon biomass burning aerosol, as well as time-varying surface emissions. Solution: 1. Processing of aerosol in real.exe contained legacy code. Specifically, the monthly qnwfa and qnifa variables (qn?fa_jan, qn?fa_feb, etc.) have been removed from Registry files and dyn_em/module_initialize_real. 2. Modifications have been made to the METGRID.TBL file to simplify the subsequent logic in the real program's dyn_em/module_initialize_real. Specifically, we: * replace FLAG_QNWFA and FLAG_QNIFA with FLAG_QNWFA_CL and FLAG_QNIFA_CL, respectively, in the W_WIF_DEC and I_WIF_DEC entries, where “CL” stands for climatology; * add FLAG_QNWFA and FLAG_QNIFA to the QNWFA and QNIFA entries, respectively, for the first guess aerosol arrays; * add entry P_WIF to give the user the option to interpolate the first guess aerosol using the native pressure levels of the host model; * use num_wif_levels for any z dimension associated with the aerosol field entries (climatology or first guess); * add surface aerosol emission arrays QNWFA2D and QNIFA2D to be processed. The modifications to METGRID.TBL are as follows: ``` ======================================== name=W_WIF_DEC z_dim_name=num_wif_levels interp_option=four_pt+average_4pt flag_in_output=FLAG_QNWFA_CL ======================================== name=I_WIF_DEC z_dim_name=num_wif_levels interp_option=four_pt+average_4pt flag_in_output=FLAG_QNIFA_CL ======================================== name=QNWFA z_dim_name=num_wif_levels interp_option=four_pt+average_4pt flag_in_output=FLAG_QNWFA ======================================== name=QNIFA z_dim_name=num_wif_levels interp_option=four_pt+average_4pt flag_in_output=FLAG_QNIFA ======================================== name=P_WIF z_dim_name=num_wif_levels interp_option=four_pt+average_4pt flag_in_output=FLAG_P_WIF ======================================== name=QNWFA2D interp_option=four_pt+average_4pt flag_in_output=FLAG_QNWFA2D ======================================== name=QNIFA2D interp_option=four_pt+average_4pt flag_in_output=FLAG_QNIFA2D ======================================== ``` 3. At present, if the user sets use_aero_icbc=.true. and does not set num_wif_levels to 30, then the code executes without error, even though the climatological aerosols will not be processed properly. Therefore, we have changed the default value of num_wif_levels from 27 to 30 to prevent unintended errors when the user forgets to set this value in the namelist. We note that with our code modifications, namelist variable num_wif_levels will be used to control both climatology and first guess aerosol processing in dyn_em/module_initialize_real. 4. We have added a new (surrogate) variable, aer_init_opt (integer, default=0), that facilitates much cleaner logic in dyn_em/module_initialize_real while “working in the background” and maintaining backward-compatibility such that namelist options use_aero_icbc and use_rap_aero_icbc may be used in the same manner as before. First, in share/module_check_a_mundo, we check if the user has selected Thompson AA and either use_aero_icbc (aer_init_opt=1) or use_rap_aero_icbc (aer_init_opt=2). Here, we also ensure that if aer_init_opt>0, then wif_input_opt=1. Now, in dyn_em/module_initialize_real, we are able to simplify the logic of processing aerosol fields by using select case on aer_init_opt for both the 3D and 2D (surface emissions) aerosol processing. 5. For the 3D aerosol processing, here is the new workflow. When the user selects use_aero_icbc=.true. (i.e., aer_init_opt=1) for climatology aerosol forcing, we interpolate the aerosol fields to the WRF grid pressure levels as before. No changes have been made to the interpolation routine for use_aero_icbc. However, when the user selects use_rap_aero_icbc=.true. (i.e., aer_init_opt=2) for first guess aerosol forcing, we allow for two possibilities: * the user has pre-processed the first guess aerosol such that they are located at the native pressure levels of the host model. In this case, the user will process pressure variable p_wif during metgrid, and flag_p_wif=1, as defined in the modified METGTRID.TBL file, will be written to the met_em files. In dyn_em/module_initialize_real, we check for flag_p_wif=1 and subsequently interpolate the aerosol fields to the WRF grid pressure levels. At this stage, we do not have a way to check to ensure that the user-defined num_wif_levels in the namelist is equal to num_wif_levels written to the met_em files. For now, the best we can do is write a comment to the rsl.out files. * the user has pre-processed the first guess aerosol such that they are interpolated to the ungrib pressure levels. In this case, the user will set num_wif_levels in the namelist equal to num_metgrid_levels; otherwise, a fatal error will occur. 6. For the 2D aerosol processing, here is the new workflow. When the user selects use_aero_icbc=.true. (i.e., aer_init_opt=1) for climatology aerosol forcing, the surface water-friendly and ice-friendly emissions are processed as before. No changes have been made to these routines. However, when the user selects use_rap_aero_icbc=.true. (i.e., aer_init_opt=2) for first guess aerosol forcing, we check for the surface emission flags for water- and ice-friendly and process if they are there; otherwise, the arrays are set to zero. LIST OF MODIFIED FILES: M Registry/Registry.EM M Registry/Registry.EM_CHEM M Registry/Registry.EM_COMMON M Registry/Registry.tladj M Registry/registry.new3d_wif M dyn_em/module_initialize_real.F M share/module_check_a_mundo.F M share/module_optional_input.F TESTS CONDUCTED: 1. We have tested the logic to ensure that it catches any issues related to namelist options and flags in met_em files. Also, we have tested to make sure that the 3D aerosol fields interpolated to the WRF grid are nearly identical when using either method for aerosol first guess (i.e., interpolating using the native pressure levels of the host model versus the pre-processed aerosol on metgrid levels). 2. Jenkins tests are all PASSING RELEASE NOTE: Code enhancements are introduced to the processing of aerosol information in real.exe for the Thompson Aerosol-Aware microphysics scheme; specifically, legacy code is removed and logic in the real program is improved.
- Loading branch information