Skip to content

Commit f5fefe9

Browse files
committed
EAMxx: Fixing run time error and adding a new test for aerosol interpolation.
1 parent 91c80f5 commit f5fefe9

File tree

5 files changed

+383
-2
lines changed

5 files changed

+383
-2
lines changed

components/eamxx/src/physics/mam/eamxx_mam_microphysics_process_interface.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -523,8 +523,8 @@ void MAMMicrophysics::initialize_impl(const RunType run_type) {
523523
add_postcondition_check<Interval>(get_field_out("cldfrac_liq"),m_grid,0.0,1.0,false);
524524
add_postcondition_check<LowerBound>(get_field_out("tke"),m_grid,0);
525525
*/
526-
#ifdef USE_OLD_LINOZ_FILE_READ
527526
{
527+
#ifdef USE_OLD_LINOZ_FILE_READ
528528
// climatology data for linear stratospheric chemistry
529529
auto linoz_o3_clim = buffer_.scratch[0]; // ozone (climatology) [vmr]
530530
auto linoz_o3col_clim =
@@ -542,6 +542,7 @@ void MAMMicrophysics::initialize_impl(const RunType run_type) {
542542
auto linoz_cariolle_pscs =
543543
buffer_.scratch[7]; // Cariolle parameter for PSC loss of ozone [1/s]
544544

545+
#endif
545546
auto ts = start_of_step_ts();
546547
std::string linoz_chlorine_file =
547548
m_params.get<std::string>("mam4_linoz_chlorine_file");
@@ -550,7 +551,6 @@ void MAMMicrophysics::initialize_impl(const RunType run_type) {
550551
linoz_chlorine_file, ts, chlorine_loading_ymd, chlorine_values_,
551552
chlorine_time_secs_);
552553
} // LINOZ
553-
#endif
554554
init_temporary_views();
555555
// FIXME : why are we only using nlev_ instead of ncol_xnlev?
556556
cmfdqr_ = view_1d("cmfdqr_", nlev_);
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
add_subdirectory(homme_shoc_cld_p3_mam_optics_rrtmgp)
22
add_subdirectory(homme_shoc_cld_mam_aci_p3_mam_optics_rrtmgp_mam_drydep)
33
add_subdirectory(homme_shoc_cld_spa_p3_rrtmgp_mam4_wetscav)
4+
add_subdirectory(homme_shoc_cld_p3_mam_optics_rrtmgp_microphysics)
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
include (ScreamUtils)
2+
3+
set (TEST_BASE_NAME homme_shoc_cld_p3_mam_optics_rrtmgp_microphysics)
4+
set (FIXTURES_BASE_NAME ${TEST_BASE_NAME}_generate_output_nc_files)
5+
6+
# Get or create the dynamics lib
7+
# HOMME_TARGET NP PLEV QSIZE_D
8+
CreateDynamicsLib("theta-l_kokkos" 4 72 41)
9+
10+
# Create the test
11+
CreateADUnitTest(${TEST_BASE_NAME}
12+
LIBS cld_fraction ${dynLibName} shoc p3 scream_rrtmgp mam
13+
LABELS dynamics shoc cld p3 rrtmgp physics mam4_optics
14+
MPI_RANKS ${TEST_RANK_START} ${TEST_RANK_END}
15+
FIXTURES_SETUP_INDIVIDUAL ${FIXTURES_BASE_NAME}
16+
)
17+
18+
# Set AD configurable options
19+
set (ATM_TIME_STEP 1800)
20+
SetVarDependingOnTestSize(NUM_STEPS 2 4 48) # 1h 2h 24h
21+
set (RUN_T0 2021-10-12-45000)
22+
23+
# Determine num subcycles needed to keep shoc dt<=300s
24+
set (SHOC_MAX_DT 300)
25+
math (EXPR MAC_MIC_SUBCYCLES "(${ATM_TIME_STEP} + ${SHOC_MAX_DT} - 1) / ${SHOC_MAX_DT}")
26+
27+
## Copy (and configure) yaml files needed by tests
28+
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/input.yaml
29+
${CMAKE_CURRENT_BINARY_DIR}/input.yaml)
30+
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/output.yaml
31+
${CMAKE_CURRENT_BINARY_DIR}/output.yaml)
32+
33+
# Set homme's test options, so that we can configure the namelist correctly
34+
# Discretization/algorithm settings
35+
set (HOMME_TEST_NE 2)
36+
set (HOMME_TEST_LIM 9)
37+
set (HOMME_TEST_REMAP_FACTOR 3)
38+
set (HOMME_TEST_TRACERS_FACTOR 1)
39+
set (HOMME_TEST_TIME_STEP 300)
40+
set (HOMME_THETA_FORM 1)
41+
set (HOMME_TTYPE 5)
42+
set (HOMME_SE_FTYPE 0)
43+
set (HOMME_TEST_TRANSPORT_ALG 0)
44+
set (HOMME_TEST_CUBED_SPHERE_MAP 0)
45+
46+
# Hyperviscosity settings
47+
set (HOMME_TEST_HVSCALING 0)
48+
set (HOMME_TEST_HVS 1)
49+
set (HOMME_TEST_HVS_TOM 0)
50+
set (HOMME_TEST_HVS_Q 1)
51+
52+
set (HOMME_TEST_NU 7e15)
53+
set (HOMME_TEST_NUDIV 1e15)
54+
set (HOMME_TEST_NUTOP 2.5e5)
55+
56+
# Testcase settings
57+
set (HOMME_TEST_MOISTURE notdry)
58+
set (HOMME_THETA_HY_MODE true)
59+
60+
# Vert coord settings
61+
set (HOMME_TEST_VCOORD_INT_FILE acme-72i.ascii)
62+
set (HOMME_TEST_VCOORD_MID_FILE acme-72m.ascii)
63+
64+
# Configure the namelist into the test directory
65+
configure_file(${SCREAM_SRC_DIR}/dynamics/homme/tests/theta.nl
66+
${CMAKE_CURRENT_BINARY_DIR}/namelist.nl)
67+
68+
# Ensure test input files are present in the data dir
69+
set (TEST_INPUT_FILES
70+
scream/mam4xx/physprops/mam4_mode1_rrtmg_aeronetdust_c20240206.nc
71+
scream/mam4xx/physprops/mam4_mode2_rrtmg_c20240206.nc
72+
scream/mam4xx/physprops/mam4_mode3_rrtmg_aeronetdust_c20240206.nc
73+
scream/mam4xx/physprops/mam4_mode4_rrtmg_c20240206.nc
74+
scream/mam4xx/physprops/water_refindex_rrtmg_c20240206.nc
75+
scream/mam4xx/physprops/ocphi_rrtmg_c20240206.nc
76+
scream/mam4xx/physprops/dust_aeronet_rrtmg_c20240206.nc
77+
scream/mam4xx/physprops/ssam_rrtmg_c20240206.nc
78+
scream/mam4xx/physprops/sulfate_rrtmg_c20240206.nc
79+
scream/mam4xx/physprops/ocpho_rrtmg_c20240206.nc
80+
scream/mam4xx/physprops/bcpho_rrtmg_c20240206.nc
81+
scream/mam4xx/physprops/poly_rrtmg_c20240206.nc
82+
)
83+
84+
foreach (file IN ITEMS ${TEST_INPUT_FILES})
85+
GetInputFile(${file})
86+
endforeach()
87+
88+
# Ensure test input files are present in the data dir
89+
GetInputFile(scream/init/${EAMxx_tests_IC_FILE_72lev})
90+
GetInputFile(scream/init/${EAMxx_tests_IC_FILE_MAM4xx_72lev})
91+
GetInputFile(cam/topo/${EAMxx_tests_TOPO_FILE})
92+
93+
# Compare output files produced by npX tests, to ensure they are bfb
94+
include (CompareNCFiles)
95+
96+
CompareNCFilesFamilyMpi (
97+
TEST_BASE_NAME ${TEST_BASE_NAME}
98+
FILE_META_NAME ${TEST_BASE_NAME}.INSTANT.nsteps_x${NUM_STEPS}.npMPIRANKS.${RUN_T0}.nc
99+
MPI_RANKS ${TEST_RANK_START} ${TEST_RANK_END}
100+
LABELS dynamics physics shoc cld p3 rrtmgp mam4_optics
101+
META_FIXTURES_REQUIRED ${FIXTURES_BASE_NAME}_npMPIRANKS_omp1
102+
)
103+
104+
if (SCREAM_ENABLE_BASELINE_TESTS)
105+
# Compare one of the output files with the baselines.
106+
# Note: one is enough, since we already check that np1 is BFB with npX
107+
set (OUT_FILE ${TEST_BASE_NAME}.INSTANT.nsteps_x${NUM_STEPS}.np${TEST_RANK_END}.${RUN_T0}.nc)
108+
CreateBaselineTest(${TEST_BASE_NAME} ${TEST_RANK_END} ${OUT_FILE} ${FIXTURES_BASE_NAME})
109+
endif()
Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
%YAML 1.1
2+
---
3+
driver_options:
4+
atmosphere_dag_verbosity_level: 5
5+
mass_column_conservation_error_tolerance: 1e-3
6+
energy_column_conservation_error_tolerance: 1e-4
7+
column_conservation_checks_fail_handling_type: warning
8+
property_check_data_fields: [phis]
9+
10+
time_stepping:
11+
time_step: ${ATM_TIME_STEP}
12+
run_t0: ${RUN_T0} # YYYY-MM-DD-XXXXX
13+
number_of_steps: ${NUM_STEPS}
14+
15+
initial_conditions:
16+
filename: ${SCREAM_DATA_DIR}/init/${EAMxx_tests_IC_FILE_MAM4xx_72lev}
17+
topography_filename: ${TOPO_DATA_DIR}/${EAMxx_tests_TOPO_FILE}
18+
surf_evap: 0.0
19+
surf_sens_flux: 0.0
20+
#precip_liq_surf_mass: 0.0
21+
#precip_ice_surf_mass: 0.0
22+
hetfrz_immersion_nucleation_tend: 0.1
23+
hetfrz_contact_nucleation_tend: 0.1
24+
hetfrz_deposition_nucleation_tend: 0.1
25+
phis : 1.0
26+
pbl_height: 1.0
27+
#These should come from the input file
28+
dgnum: [1.246662106183775E-007, 4.081134799487888E-008, 1.103139143795796E-006, 1.000000011686097E-007]
29+
dgnumwet: [2.367209731605067E-007, 6.780643470563889E-008, 3.028011448344027E-006, 1.000000096285154E-007]
30+
wetdens: [1038.67760516297, 1046.20002003441, 1031.74623165457, 1086.79731859184]
31+
nevapr: 0.0
32+
precip_total_tend: 0.0
33+
surf_radiative_T: 288.0
34+
ps: 105000.0
35+
horiz_winds: [-0.24988988196194634E+000, -0.23959782871450760E+000]
36+
precip_liq_surf_mass: 0.1
37+
precip_ice_surf_mass: 0.1
38+
snow_depth_land: 0.01
39+
fraction_landuse: 0.0
40+
SW_flux_dn: 500.0
41+
constituent_fluxes: 0.0
42+
43+
atmosphere_processes:
44+
atm_procs_list: [homme,physics]
45+
schedule_type: sequential
46+
homme:
47+
moisture: moist
48+
physics:
49+
atm_procs_list: [mac_mic,mam4_optics,rrtmgp, mam4_interpolation_aero_microphys, mam4_aero_microphys]
50+
schedule_type: sequential
51+
type: group
52+
mac_mic:
53+
atm_procs_list: [shoc,cld_fraction,p3]
54+
schedule_type: sequential
55+
type: group
56+
number_of_subcycles: ${MAC_MIC_SUBCYCLES}
57+
p3:
58+
do_prescribed_ccn: false
59+
enable_column_conservation_checks: true
60+
max_total_ni: 740.0e3
61+
shoc:
62+
enable_column_conservation_checks: true
63+
lambda_low: 0.001
64+
lambda_high: 0.08
65+
lambda_slope: 2.65
66+
lambda_thresh: 0.02
67+
thl2tune: 1.0
68+
qw2tune: 1.0
69+
qwthl2tune: 1.0
70+
w2tune: 1.0
71+
length_fac: 0.5
72+
c_diag_3rd_mom: 7.0
73+
coeff_kh: 0.1
74+
coeff_km: 0.1
75+
shoc_1p5tke: false
76+
77+
mam4_optics:
78+
mam4_mode1_physical_properties_file : ${SCREAM_DATA_DIR}/mam4xx/physprops/mam4_mode1_rrtmg_aeronetdust_c20240206.nc
79+
mam4_mode2_physical_properties_file : ${SCREAM_DATA_DIR}/mam4xx/physprops/mam4_mode2_rrtmg_c20240206.nc
80+
mam4_mode3_physical_properties_file : ${SCREAM_DATA_DIR}/mam4xx/physprops/mam4_mode3_rrtmg_aeronetdust_c20240206.nc
81+
mam4_mode4_physical_properties_file : ${SCREAM_DATA_DIR}/mam4xx/physprops/mam4_mode4_rrtmg_c20240206.nc
82+
mam4_water_refindex_file : ${SCREAM_DATA_DIR}/mam4xx/physprops/water_refindex_rrtmg_c20240206.nc
83+
mam4_soa_physical_properties_file : ${SCREAM_DATA_DIR}/mam4xx/physprops/ocphi_rrtmg_c20240206.nc
84+
mam4_dust_physical_properties_file : ${SCREAM_DATA_DIR}/mam4xx/physprops/dust_aeronet_rrtmg_c20240206.nc
85+
mam4_nacl_physical_properties_file : ${SCREAM_DATA_DIR}/mam4xx/physprops/ssam_rrtmg_c20240206.nc
86+
mam4_so4_physical_properties_file : ${SCREAM_DATA_DIR}/mam4xx/physprops/sulfate_rrtmg_c20240206.nc
87+
mam4_pom_physical_properties_file : ${SCREAM_DATA_DIR}/mam4xx/physprops/ocpho_rrtmg_c20240206.nc
88+
mam4_bc_physical_properties_file : ${SCREAM_DATA_DIR}/mam4xx/physprops/bcpho_rrtmg_c20240206.nc
89+
mam4_mom_physical_properties_file : ${SCREAM_DATA_DIR}/mam4xx/physprops/poly_rrtmg_c20240206.nc
90+
91+
rrtmgp:
92+
column_chunk_size: 123
93+
active_gases: ["h2o", "co2", "o3", "n2o", "co" , "ch4", "o2", "n2"]
94+
rrtmgp_coefficients_file_sw: ${SCREAM_DATA_DIR}/init/rrtmgp-data-sw-g112-210809.nc
95+
rrtmgp_coefficients_file_lw: ${SCREAM_DATA_DIR}/init/rrtmgp-data-lw-g128-210809.nc
96+
rrtmgp_cloud_optics_file_sw: ${SCREAM_DATA_DIR}/init/rrtmgp-cloud-optics-coeffs-sw.nc
97+
rrtmgp_cloud_optics_file_lw: ${SCREAM_DATA_DIR}/init/rrtmgp-cloud-optics-coeffs-lw.nc
98+
enable_column_conservation_checks: true
99+
100+
mam4_interpolation_aero_microphys:
101+
aero_microphys_remap_file: none
102+
create_fields_interval_checks: false
103+
enable_postcondition_checks: true
104+
enable_precondition_checks: true
105+
internal_diagnostics_level: 0
106+
mam4_linoz_file_name : ${SCREAM_DATA_DIR}/mam4xx/linoz/ne2np4/linoz1850-2015_2010JPL_CMIP6_10deg_58km_ne2np4_c20240724.nc
107+
mam4_oxid_file_name : ${SCREAM_DATA_DIR}/mam4xx/invariants/ne2np4/oxid_ne2np4_L26_1850-2015_c20240827.nc
108+
mam4_linoz_ymd: 20100101
109+
mam4_oxid_ymd: 20150101
110+
number_of_subcycles: 1
111+
repair_log_level: trace
112+
113+
mam4_aero_microphys:
114+
mam4_do_cond: true
115+
mam4_do_newnuc: true
116+
mam4_do_coag: true
117+
mam4_do_rename: true
118+
mam4_o3_tau: 172800.0
119+
mam4_o3_sfc: 3.0E-008
120+
mam4_o3_lbl: 4
121+
mam4_psc_T : 193.0
122+
mam4_linoz_ymd : 20100101
123+
mam4_linoz_file_name : ${SCREAM_DATA_DIR}/mam4xx/linoz/ne2np4/linoz1850-2015_2010JPL_CMIP6_10deg_58km_ne2np4_c20240724.nc
124+
mam4_oxid_file_name : ${SCREAM_DATA_DIR}/mam4xx/invariants/ne2np4/oxid_ne2np4_L26_1850-2015_c20240827.nc
125+
mam4_oxid_ymd : 20150101
126+
mam4_linoz_chlorine_file : ${SCREAM_DATA_DIR}/mam4xx/linoz/Linoz_Chlorine_Loading_CMIP6_0003-2017_c20171114.nc
127+
mam4_chlorine_loading_ymd : 20100101
128+
mam4_rsf_file : ${SCREAM_DATA_DIR}/mam4xx/photolysis/RSF_GT200nm_v3.0_c080811.nc
129+
mam4_xs_long_file : ${SCREAM_DATA_DIR}/mam4xx/photolysis/temp_prs_GT200nm_JPL10_c130206.nc
130+
elevated_emiss_ymd : 20100101
131+
mam4_so2_elevated_emiss_file_name : ${SCREAM_DATA_DIR}/mam4xx/emissions/ne2np4/elevated/cmip6_mam4_so2_elev_ne2np4_2010_clim_c20240726.nc
132+
mam4_so4_a1_elevated_emiss_file_name : ${SCREAM_DATA_DIR}/mam4xx/emissions/ne2np4/elevated/cmip6_mam4_so4_a1_elev_ne2np4_2010_clim_c20240823.nc
133+
mam4_so4_a2_elevated_emiss_file_name : ${SCREAM_DATA_DIR}/mam4xx/emissions/ne2np4/elevated/cmip6_mam4_so4_a2_elev_ne2np4_2010_clim_c20240823.nc
134+
mam4_pom_a4_elevated_emiss_file_name : ${SCREAM_DATA_DIR}/mam4xx/emissions/ne2np4/elevated/cmip6_mam4_pom_a4_elev_ne2np4_2010_clim_c20240823.nc
135+
mam4_bc_a4_elevated_emiss_file_name : ${SCREAM_DATA_DIR}/mam4xx/emissions/ne2np4/elevated/cmip6_mam4_bc_a4_elev_ne2np4_2010_clim_c20240823.nc
136+
mam4_num_a1_elevated_emiss_file_name : ${SCREAM_DATA_DIR}/mam4xx/emissions/ne2np4/elevated/cmip6_mam4_num_a1_elev_ne2np4_2010_clim_c20240823.nc
137+
mam4_num_a2_elevated_emiss_file_name : ${SCREAM_DATA_DIR}/mam4xx/emissions/ne2np4/elevated/cmip6_mam4_num_a2_elev_ne2np4_2010_clim_c20240823.nc
138+
mam4_num_a4_elevated_emiss_file_name : ${SCREAM_DATA_DIR}/mam4xx/emissions/ne2np4/elevated/cmip6_mam4_num_a4_elev_ne2np4_2010_clim_c20240823.nc
139+
mam4_soag_elevated_emiss_file_name : ${SCREAM_DATA_DIR}/mam4xx/emissions/ne2np4/elevated/cmip6_mam4_soag_elev_ne2np4_2010_clim_c20240823.nc
140+
mam4_season_wes_file : ${SCREAM_DATA_DIR}/mam4xx/drydep/season_wes.nc
141+
create_fields_interval_checks: true
142+
143+
grids_manager:
144+
type: homme
145+
physics_grid_type: gll
146+
dynamics_namelist_file_name: namelist.nl
147+
vertical_coordinate_filename: IC_FILE
148+
149+
# The parameters for I/O control
150+
scorpio:
151+
output_yaml_files: ["output.yaml"]
152+
...

0 commit comments

Comments
 (0)