-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds MAM4xx: Aerosol optics #2718
Adds MAM4xx: Aerosol optics #2718
Conversation
Status Flag 'Pull Request AutoTester' - User Requested Retest - Label AT: RETEST will be reset after testing. |
Status Flag 'Pull Request AutoTester' - Testing Jenkins Projects: Pull Request Auto Testing STARTING (click to expand)Build InformationTest Name: SCREAM_PullRequest_Autotester_Mappy
Jenkins Parameters
Build InformationTest Name: SCREAM_PullRequest_Autotester_Weaver
Jenkins Parameters
Using Repos:
Pull Request Author: odiazib |
@mahf708 and @brhillman , can you please confirm if you feel your comments have been adequately addressed? Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! Thanks!
Status Flag 'Pull Request AutoTester' - Jenkins Testing: 1 or more Jobs FAILED Note: Testing will normally be attempted again in approx. 2 Hrs. If a change to the PR source branch occurs, the testing will be attempted again on next available autotester run. Pull Request Auto Testing has FAILED (click to expand)Build InformationTest Name: SCREAM_PullRequest_Autotester_Mappy
Jenkins Parameters
Build InformationTest Name: SCREAM_PullRequest_Autotester_Weaver
Jenkins Parameters
SCREAM_PullRequest_Autotester_Mappy # 5166 FAILED (click to see last 100 lines of console output)
SCREAM_PullRequest_Autotester_Weaver # 5514 PASSED (click to see last 100 lines of console output)
|
DIFFs in the optics CIME case ( |
Kokkos::fence(); | ||
|
||
//tau_w_g : aerosol asymmetry parameter * tau * w | ||
const auto tau_g_sw = tau_g_sw_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be tau_ssa_g_sw
, not tau_g_sw
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the fortran code, the name of this variable is tau_w_g
; see here. I am okay changing this name from tau_g_sw
to tau_ssa_g_sw
or tau_g_sw
to tau_w_g
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment // tau_w_g : aerosol asymmetry parameter * tau * w
is from here. Is this comment correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don’t care so much about the _sw suffix, it’s the fact that the Fortran version has tau, w, and g to indicate that it’s a product of tau, w, and g, but the c++ version here only has tau and g in the name. So I read that and think this means it’s a product only of tau and g, which is not correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed the name of this variables, from tau_g_sw
to tau_ssa_g_sw
. Thanks for checking this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Thanks for clarifying this! It will make the next person who looks through this have an easier time understanding what is going on and what these fields represent!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks for addressing my comments!
We are adding an aerosol optics interface code to call
MAM4xx
aerosol optics code.To enable MAM4xx in EAMxx, we employ the cmake option
SCREAM_ENABLE_MAM
. From this PR, this option is set by default toON
. It will stayON
provided the impact on the build times is minimal. For global simulations, MAM4xx's aerosol optics calculations can be turned on by addingmam4_optics
label at runtime in the scream namelist file.The aerosol optics interface computes quantities the
rrtmgp
radiation model requires and also computes a diagnostic field aerosol optical depth (AOD).This interface invokes
mam4::aer_rad_props::aer_rad_props_sw
andmam4::aer_rad_props::aer_rad_props_lw
to compute the short and long-wave contributions of the aerosol optics. Therefore, the core computations of the aerosol optics interface are part of theMAM4xx
submodule. In particular,mam4::aer_rad_props::aer_rad_props_sw
computes the following fields:aero_g_sw
,aero_ssa_sw
,aero_tau_sw
,aero_tau_forward
, and the diagnosticaodvis
(aerosol optical depth). Furthermore,mam4::aer_rad_props::aer_rad_props_lw
computesaero_tau_lw
.First, this interface includes the necessary machinery to read NetCDF files for aerosol optics using the
scream::AtmosphereInput
interface. Therefore, we added additional tags in FieldTag for the new dimensions required by the aerosol optical NetCDF files. In particular:num_modes
: number of total modes.nrefindex_real
: number of real refractive index.nrefindex_im
: number of imaginary refractive index.ncoef_number
: number of coefficients.mode
: number of modes in NetCDF file.Note that the difference between
num_modes
andmode
is one corresponds to the total number of modes in MAM, i.e., 4, and the second one is the total number of modes in the NetCDF file, e.g., 1.In addition, in the original NetCDF files from E3SMv2, the dimension name of the total number of short waves was
swband
, and the total number of long waves waslwband
. Because EAMxx has already defined these dimensions but with a different name, we report this issue: FieldLayout with new FieldTag #2602. To overcome this issue, we rename these dimensions in the NetCDF files to match the ones in EAMxx.We reported an issue with scream::AtmosphereInput (AtmosphereInput and non-time dependent variables #2601) when non-time dependent variables of more than two dimensions are employed. As a temporary fix, we modified the aerosol optical NetCDF files by adding a time variable in all variables with more than one dimension.
Testing
We added three standalone tests and one CIME test in EAMxx.
scream/components/eamxx/tests/single-process/mam4_optics
: single-process test where onlymam4_optics
is executed.scream/components/eamxx/tests/multi-process/physics_only/mam_optics_rrtmgp
. A multi-process test where aerosol optics is executing withrrtmgp
.scream/components/eamxx/tests/multi-process/dynamics_physics/homme_shoc_mam_optics_cld_p3_rrtmgp
: A multi-process test where aerosol optics is executing withhomme
,dynamics
,shoc
,cld
,p3
, andrrtmgp
. We used the coupled testtests/coupled/homme_shoc_cld_spa_p3_rrtmgp
as the base and replaced spa with mam_optics.ne4pg2
global model test that uses EAMxx's test mods to invoke mam4xx's aerosol optics codes by modifying scream namelist (see Figure 1).Figure 1. Aerosol optical depth computed by
EMAxx
-MAM4xx
.Note that these tests check for the correct execution of optics code and nan. Thus, the output's test is not compared with reference values. However, validation tests for checking that C++ code produces equal values that the mam4 Fortran code is part of the mam4xx.
mam4_optics
is name of the atmosphere process for the aerosol optics in EMAxx. Thus, the input.yaml file of each test must contain the following information to enable this process:Testing in MAM4xx.
We have implemented a validation approach in mam4xx that relies on generated validation files in Skywalker format, allowing us to efficiently compare values generated by an E3SM case and the standalone test in mam4xx.
A set of validation files is produced for each Fortran subroutine, and the corresponding test is implemented in mam4xx.
For aerosol optics, we performed 12 tests.
binterp_ts_355
calc_diag_spec_ts_355
calc_refin_complex_ts_355_lw
calc_refin_complex_ts_355_sw
calc_volc_ext_ts_355
modal_size_parameters_ts_355_ismethod2_false
modal_size_parameters_ts_355_ismethod2_true
modal_aero_sw_ts_355
modal_aero_lw_ts_355
calc_parameterized_ts_355
update_aod_spec_ts_355
aer_rad_props_lw_ts_355
aer_rad_props_sw_ts_355
volcanic_cmip_sw_ts_355
In these tests
ts_355
corresponds to time step 355. Implementation of these tests is here.Compilation and run wall-times.
Enabling MAM4xx and excepting four EMAxx-MAM4xx tests increases ~ 8% (90 seconds) the compilation and run wall-times in weaver for EMAxx. Wall-time of
./scripts/test-all-scream -m weaver -c SCREAM_ENABLE_MAM=OFF -t dbg
is 1155 second, i.e., MAM4xx is not enabled. Wall-time of./scripts/test-all-scream -m weaver -c SCREAM_ENABLE_MAM=ON -t dbg
is 1245 seconds i.e., MAM4xx is enabled. In both cases, the compilation-run times are for a NVIDIA V100 (GPU).Label Time Summary when MAM4xx is enabled.
Label Time Summary when MAM4xx is not enabled.
Volcanic aerosols.
The following variables:
ssa_cmip6_sw
,af_cmip6_sw
,ext_cmip6_sw
,ext_cmip6_lw_
are obtained from netcdf files in mam4 (Fortran version). In mam4xx, we have set these variables to zero and will rely on eamxx to read/interpolate them; however, this work will be part of a future PR.New initial condition files with aerosols and gases
New initial condition (IC) files with aerosols and gas mass mixing ratios have been added. The files are added to the E3SM ANL data server so that it can downloaded to any machine where the tests are run.
The new IC file for the CIME simulations is:
inputdata/atm/scream/init/screami_mam4xx_ne4np4L72_c20240208.nc
The new IC for the unit tests is:
inputdata/atm/scream/init/scream_unit_tests_aerosol_optics_ne2np4L72_20220822.nc