Skip to content
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 wet scavenging interface #2848

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
636c765
wet_scav - get code from balwinder branch.
odiazib Mar 11, 2024
61fb835
wet_scav - update interface
odiazib Mar 11, 2024
912e0bc
wet_scav - using compute_calcsize_and_water_uptake_dr
odiazib Mar 11, 2024
68c9a9d
wet_scav - delete old code.
odiazib Mar 11, 2024
cc8ecaf
wet_scav - remove private member of parallel_for
odiazib Mar 11, 2024
9818035
wet_scav - add dig variables. Unit tests is working.
odiazib Mar 11, 2024
7d3cbff
wet_scav - update interface
odiazib Mar 22, 2024
8363b75
wet_scav - test is working in cpu/gpus.
odiazib Mar 26, 2024
604c2fa
wet_scav - adding single-process.
odiazib Mar 27, 2024
d0db05b
wet_dep - update to match mam4xx interface.
odiazib Apr 14, 2024
1ac385d
wet_dep - update mam4xx interface.
odiazib Apr 14, 2024
c5c0cfa
wet_dep - update name of tendencies.
odiazib Apr 14, 2024
593c8b1
wet_scav - rebase code
odiazib May 20, 2024
a76689c
wet_scav - adding missing input variable.
odiazib May 20, 2024
5cd64ae
wet_scav - removing old comments and variables that not needed.
odiazib May 21, 2024
711199b
wet_scav - updating code after rebase.
odiazib May 23, 2024
1b80528
wet_scav - Adding missing variables in input file.
odiazib May 23, 2024
8ec139c
wet_scav - Moving 'aerdepwetis' and 'aerdepwetcw' to the field manage…
odiazib May 27, 2024
7ced79a
wet_scav - Removing headers that are part of mam_coupling and unused …
odiazib May 27, 2024
6b6a79d
wet_scav - Adding output fields.
odiazib May 27, 2024
d39659a
wet_scav - Adding outputs and running test for 3 steps.
odiazib May 27, 2024
6e81baa
wet_sav- removin unused input.
odiazib May 27, 2024
5b0b243
wet_sav - Adding FIXME.
odiazib May 27, 2024
6e55317
wet_sav - Updating comments.
odiazib May 27, 2024
8cd04d2
wet_scav - Setting Frequency=2
odiazib May 27, 2024
e91b2e2
wet_scav - Adding multi-process test for mam4_wetsav.
odiazib May 27, 2024
2570f06
wet_sav - Adding wetscav to namelist.
odiazib May 27, 2024
7b1471d
wet_scav - Removing initial values of pbl_height and phis from nameli…
odiazib Jun 1, 2024
25d4a91
wet_scav - Adding line in CMakeLists.
odiazib Jun 1, 2024
3e6bf35
wet_scav - Update interstitial aerosol state.
odiazib Jun 2, 2024
a55b7a7
A working CIME case with wetscav in the process list at the right place
singhbalwinder Jun 4, 2024
7299556
Fixes single process test
singhbalwinder Jun 4, 2024
cf73f93
Fixes file for the mam4xx standalone tests
singhbalwinder Jun 5, 2024
f65792d
Removing uncoupled test files since they are renamed as single proces…
singhbalwinder Jun 10, 2024
0327c9e
Clang format and makes dp_frac and input, updates mam4xx submodule to…
singhbalwinder Jun 20, 2024
14efd0d
Makes cldt intent-in (include changes to the mam4xx submodule)
singhbalwinder Jun 21, 2024
6ada930
Makes some more convective fields intent-in (updates submodule mam4xx)
singhbalwinder Jun 21, 2024
04ae764
Fixes some more vars to be intent-in (mam4xx submodule updated)
singhbalwinder Jun 21, 2024
b4ffbe9
Moved around variables to match I/O-1
singhbalwinder Jul 2, 2024
abd75db
Removes ptend from output FM and some cleanup for I/O-2
singhbalwinder Jul 3, 2024
6c819c8
Done with the initialize_impl method cleanup
singhbalwinder Jul 3, 2024
3e73b8f
Rebased on current master
singhbalwinder Jul 3, 2024
f52f628
Completed a round of cleanup- variables rearranged to match i/o-3
singhbalwinder Jul 3, 2024
870e978
Adds a multi-process test: p3-wetscav
singhbalwinder Jul 3, 2024
8a81e1c
Adds missing files for the new multi-process test
singhbalwinder Jul 3, 2024
64fc5a3
Adds another multi-process test for wetscav
singhbalwinder Jul 3, 2024
0ec3227
updated submodule to a newer version
singhbalwinder Jul 5, 2024
d00cd50
Cleans wetscav hpp file and minor changes to the cpp file
singhbalwinder Jul 5, 2024
dd7e21b
Adds descriptive var names; removes conv vars from FM; fixes input an…
singhbalwinder Jul 5, 2024
e6610dd
Adds const for input vars, removes scorpio temp change
singhbalwinder Jul 5, 2024
8c7d2a7
Cleans up namelist xml file and removes double ICs
singhbalwinder Jul 5, 2024
83a85eb
Removes a left over comment
singhbalwinder Jul 5, 2024
140ee78
Minor change in comments
singhbalwinder Jul 5, 2024
aed9ffc
wet_scav - Removing Kokkos::resize.
odiazib Jul 5, 2024
019a54c
Fixes some test fails: remove old output varnames, fixed output nc fi…
singhbalwinder Jul 5, 2024
fe66519
Adds TODO to a comment as some editors can highlight these comments
singhbalwinder Jul 5, 2024
af58453
Fixes previous commit: Adds a TODO comment here
singhbalwinder Jul 5, 2024
4d3b7bc
Adds a new function to add additional tracers for MAM4xx
singhbalwinder Jul 6, 2024
6de6c33
Adds the new script for computing number of tracers
singhbalwinder Jul 6, 2024
54f7110
Fixes script to update tracer number in scream cmake options
singhbalwinder Jul 7, 2024
b00a709
Adds missing call to update the state (int and cldbrn aerosols)
singhbalwinder Jul 12, 2024
4734cac
Updates number mixing ratios for state
singhbalwinder Jul 12, 2024
1323ea6
Zero out tends before computing tends as they had junk values
singhbalwinder Jul 13, 2024
f8e206d
Ensure that Kokkos::deep_copy is called outside of parallel_for.
odiazib Jul 15, 2024
9cb990c
wet_scav - Fixing compilation errors.
odiazib Jul 15, 2024
047802b
Updates mam4xx submodule-pointed to main for wetscav qqcw update
singhbalwinder Jul 19, 2024
c75615f
Submodule update: declare local vrs for device code
singhbalwinder Jul 19, 2024
1f77bf0
Changes due to code review feedback.
overfelt Jul 29, 2024
2890ec1
Changes due to code review feedback.
overfelt Jul 29, 2024
8fd0eae
Changes due to code review feedback.
overfelt Jul 30, 2024
29d83eb
Revert "Changes due to code review feedback."
overfelt Jul 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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/")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't really need to sed the content SCREAM_CMAKE_OPTIONS. You can just do

./xmlchange --append SCREAM_CMAKE_OPTIONS="SCREAM_NUM_TRACERS $new_tracer_num"

In case of a repeated cmake option, the buildlib_cmake script in eamxx will honor the last one.


# 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