ufs-community / ccpp-physics

UFS fork for CCPP
Other
4 stars 33 forks source link

Add new RRTMGP aerosol-optics #52

Open dustinswales opened 1 year ago

dustinswales commented 1 year ago

Opened on behalf of @yangfanglin and @Qingfu-Liu

RRTMGP now provides procedures to compute the aerosol optical properties. Currently RRTMGP uses the same external code as RRTMG. Everything done from the gas/cloud optics in GP needs to be done for the aerosols, using these files..

Some background and comments from offline discussions.

Both the longwave and shortwave have their own gas and cloud optics modules, each with their own derived-data type that contains BOTH the data needed for the optical calculations and the routines to compute them. rrtmgp_lw_gas_optics.F90 loads the lw_gas_props DDT rrtmgp_lw_cloud_optics.F90 loads the lw_cloud_props DDT rrtmgp_sw_gas_optics.F90 loads the sw_gas_props DDT rrtmgp_sw_cloud_optics.F90 loads the sw_cloud_props DDT

These modules all operate as follows. Read in file, load DDT. The "read" part needs to be MPI compliant, so there are additional commands/logic in the code for this. The input file (netcdf) is provided through the namelist, this file name is passed in as an interstitial variable. If you look at the contents of any of these input files and compare them to their respective routines you will see that they are doing something very simple, but it looks complicated. They are just reading in everything in the file and calling a rrtmgp routine to load the data into the DDT. You will need to create analogous routines starting with the aerosol data that is part of the rte-RRTMGP aerosol optics.

Later these DDTs are referenced by the main RRTMGP drivers, one for LW, one for SW. rrtmgp_lw_main.F90 rrtmgp_sw_main.F90 They are set up during the ccpp _init() phase, and referenced/used during the ccpp _run() phase. You will need to add calls to initialize the aerosol optics in the main drivers _init() phase, and add calls to the aerosol optics routines within the main radiation loop in the _run() phase.

Backing up to how this differs from RRTMG. In RRTMG, the data, constants, and code used by the gas optics calculation are in varying places. For example, in the longwave, the k-distribution data for the gas optics-is defined in radlw_datatb.f, the configuration information mixed in radlw_param.f, and all is referenced in radlw_main.F90 when calling taumol(). Whereas in GP, everything needed by the main longwave driver is contained within lw_gas_props (e.g lw_gas_props%get_nbands, lw_gas_props%gas_optics,...)

The aerosols in RRTMGP are isolated to a single module, rrtmgp_aerosol_optics.F90, where the LW/SW aerosol optical properties are computed using the routine setaer(), this is common to both RRTMG and RRTMGP. Then in the main GP driver, we add in the contributions from the aerosol optical properties by incrementing the gaseous-optics. This needs explaining... Within the RRTMGP DDTs mentioned above, there are native routines (type-bound procedures) to combine optical properties, called incrementing functions. These routines are "smart" in that they know how to combine to optical properties of varying spectral definitions, as long as they have the same underlying band structure (See https://github.com/earth-system-radiation/rte-rrtmgp/blob/main/rte/mo_optical_props.F90#L39 for more details). Unrelated, but there are other instances of incrementing in the cloud-mp coupling module, where optical properties of varying cloud types are incremented together before calling McICA. Sorry if I got off-track, but these increment calls aid the philosophy that GP can be configured to use an arbitrary number of radiative contributors.

yangfanglin commented 1 year ago

@dustinswales Thanks for submitting this Issue with a detailed description of the work to be done.

Per our discussion, we will check how the two new aerosol optics netcdf files differ from the ones used by RRTMG and current RRTMGp version. These files can be found under the "fix" directory ~/global-workflow/fix/lut in global-workflow

-rw-r--r-- 1 emc.global global 202000 Jun 24 2019 optics_BC.v1_3.dat -rw-r--r-- 1 emc.global global 461637 Jun 24 2019 optics_DU.v15_3.dat -rw-r--r-- 1 emc.global global 73711072 Jun 24 2019 optics_DU.v15_3.nc -rw-r--r-- 1 emc.global global 202000 Jun 24 2019 optics_OC.v1_3.dat -rw-r--r-- 1 emc.global global 502753 Jun 24 2019 optics_SS.v3_3.dat -rw-r--r-- 1 emc.global global 101749 Jun 24 2019 optics_SU.v1_3.dat

These files are provided by NASA.