Skip to content

Commit

Permalink
Merge pull request #2848 from eagles-project/oscar/wet_scav_strt_balw…
Browse files Browse the repository at this point in the history
…inder

Adds MAM4xx: Aerosol wet scavenging interface
  • Loading branch information
bartgol authored Jul 30, 2024
2 parents 0da0f0c + 29d83eb commit 1d50836
Show file tree
Hide file tree
Showing 26 changed files with 1,721 additions and 11 deletions.
1 change: 1 addition & 0 deletions cime_config/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -724,6 +724,7 @@
"tests" : (
"SMS_D_Ln5.ne4pg2_oQU480.F2010-SCREAMv1-MPASSI.scream-mam4xx-optics",
"SMS_D_Ln5.ne4pg2_oQU480.F2010-SCREAMv1-MPASSI.scream-mam4xx-aci",
"SMS_D_Ln5.ne4pg2_oQU480.F2010-SCREAMv1-MPASSI.scream-mam4xx-wetscav",
)
},

Expand Down
15 changes: 14 additions & 1 deletion components/eamxx/cime_config/namelist_defaults_scream.xml
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,10 @@ be lost if SCREAM_HACK_XML is not enabled.
<mam4_mom_physical_properties_file type="file" doc="File containing optical properties for marine organic aerosol">${DIN_LOC_ROOT}/atm/scream/mam4xx/physprops/poly_rrtmg_c20240206.nc</mam4_mom_physical_properties_file>
</mam4_optics>

<!-- MAM4xx-Wetscav -->
<mam4_wetscav inherit="atm_proc_base">
</mam4_wetscav>

<!-- nudging -->
<nudging inherit="atm_proc_base">
<nudging_filenames_patterns type="array(string)"/>
Expand Down Expand Up @@ -490,7 +494,7 @@ be lost if SCREAM_HACK_XML is not enabled.
<surf_mom_flux type="array(real)">0.0,0.0</surf_mom_flux>
<!-- Note: MAM4xx-ACI needs dry aerosol diameter (dgnum), currently set to aitken model nominal diameter, remove it once all of MAM4xx is integrated -->
<dgnum type="real" doc="Dry aerosol particles diameter in meters">2.6e-08</dgnum>
<bc_c1 type="real">0.0</bc_c1>
<bc_c1 type="real">0.0</bc_c1>
<bc_c3 type="real">0.0</bc_c3>
<bc_c4 type="real">0.0</bc_c4>
<dst_c1 type="real">0.0</dst_c1>
Expand All @@ -515,6 +519,15 @@ be lost if SCREAM_HACK_XML is not enabled.
<num_c2 type="real">0.0</num_c2>
<num_c3 type="real">0.0</num_c3>
<num_c4 type="real">0.0</num_c4>
<!-- Surface fluxes for the land model from MAM4xx wet scavenging-->
<wetdep_hydrophilic_bc type="real">1e-5</wetdep_hydrophilic_bc>
<drydep_hydrophilic_bc type="real">1e-5</drydep_hydrophilic_bc>
<wetdep_hydrophilic_oc type="real">1e-5</wetdep_hydrophilic_oc>
<drydep_hydrophilic_oc type="real">1e-5</drydep_hydrophilic_oc>
<wetdep_dust_bin1 type="real">1e-5</wetdep_dust_bin1>
<wetdep_dust_bin2 type="real">1e-5</wetdep_dust_bin2>
<wetdep_dust_bin3 type="real">1e-5</wetdep_dust_bin3>
<wetdep_dust_bin4 type="real">1e-5</wetdep_dust_bin4>
<!-- default ne1024 initial condition files do not have these, so init to zero here -->
<!-- TODO: delete this once we can tell the AD that some fields can be inited by procs -->
<qc hgrid="ne256np4|ne1024np4">0.0</qc>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@

#Default scream has 10 tracers, MAM4xx adds another 31 making a total of 41 tracer
#Set total number of tracers to 41. We are using append here as last entry wins while parsing xml options
./xmlchange --append SCREAM_CMAKE_OPTIONS="SCREAM_NUM_TRACERS 41"
#------------------------------------------------------
# MAM4xx adds additionaltracers to the simulation
# Increase number of tracers for MAM4xx simulations
#------------------------------------------------------
$CIMEROOT/../components/eamxx/cime_config/testdefs/testmods_dirs/scream/mam4xx/update_eamxx_num_tracers.sh

#modify initial condition file to get aerosol species ICs
$CIMEROOT/../components/eamxx/scripts/atmchange initial_conditions::Filename='$DIN_LOC_ROOT/atm/scream/init/screami_mam4xx_ne4np4L72_c20240208.nc' -b
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@

#Default scream has 10 tracers, MAM4xx adds another 31 making a total of 41 tracer
#Set total number of tracers to 41. We are using append here as last entry wins while parsing xml options
./xmlchange --append SCREAM_CMAKE_OPTIONS="SCREAM_NUM_TRACERS 41"
#------------------------------------------------------
# MAM4xx adds additionaltracers to the simulation
# Increase number of tracers for MAM4xx simulations
#------------------------------------------------------
$CIMEROOT/../components/eamxx/cime_config/testdefs/testmods_dirs/scream/mam4xx/update_eamxx_num_tracers.sh

$CIMEROOT/../components/eamxx/scripts/atmchange initial_conditions::Filename='$DIN_LOC_ROOT/atm/scream/init/screami_mam4xx_ne4np4L72_c20240208.nc' -b
$CIMEROOT/../components/eamxx/scripts/atmchange physics::atm_procs_list="mac_aero_mic,mam4_optics,rrtmgp" -b
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/sh

#------------------------------------------------------
# MAM4xx adds additional tracers to the simulation
# Increase number of tracers for MAM4xx simulations
#------------------------------------------------------

# Additional MAM4xx tracers (MAM4xx adds 31 tracers)
ADDITIONAL_MAM4xx_TRACERS=31

# Original CMAKE options in env_build.xml
orig_cmake_opt=`./xmlquery --value SCREAM_CMAKE_OPTIONS`

# Extract the number of tracers
orig_tracer_num=$(echo $orig_cmake_opt | grep -oP 'SCREAM_NUM_TRACERS \K[0-9]+')

# Update number of tracers
new_tracer_num=$((orig_tracer_num + ADDITIONAL_MAM4xx_TRACERS))

# Form the new CMake options string by replacing the original number with the new number
new_cmake_opt=$(echo $orig_cmake_opt | sed "s/SCREAM_NUM_TRACERS $orig_tracer_num/SCREAM_NUM_TRACERS $new_tracer_num/")

# Update cmake options string
`./xmlchange SCREAM_CMAKE_OPTIONS="$new_cmake_opt"`
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh
#------------------------------------------------------
# MAM4xx adds additionaltracers to the simulation
# Increase number of tracers for MAM4xx simulations
#------------------------------------------------------

$CIMEROOT/../components/eamxx/cime_config/testdefs/testmods_dirs/scream/mam4xx/update_eamxx_num_tracers.sh -b

#------------------------------------------------------
#Update IC file and add wetscav process
#------------------------------------------------------
$CIMEROOT/../components/eamxx/scripts/atmchange initial_conditions::Filename='$DIN_LOC_ROOT/atm/scream/init/screami_mam4xx_ne4np4L72_c20240208.nc' -b
$CIMEROOT/../components/eamxx/scripts/atmchange physics::atm_procs_list="mac_aero_mic,mam4_wetscav,rrtmgp" -b
3 changes: 2 additions & 1 deletion components/eamxx/src/physics/mam/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ add_subdirectory(${EXTERNALS_SOURCE_DIR}/mam4xx ${CMAKE_BINARY_DIR}/externals/ma
add_library(mam
eamxx_mam_microphysics_process_interface.cpp
eamxx_mam_optics_process_interface.cpp
eamxx_mam_aci_process_interface.cpp)
eamxx_mam_aci_process_interface.cpp
eamxx_mam_wetscav_process_interface.cpp)
target_compile_definitions(mam PUBLIC EAMXX_HAS_MAM)
add_dependencies(mam mam4xx)
target_include_directories(mam PUBLIC
Expand Down
Loading

0 comments on commit 1d50836

Please sign in to comment.