Skip to content

Commit

Permalink
Merge pull request #958 from jtruesdal/scam_dev_exp
Browse files Browse the repository at this point in the history
cam6_4_023: SCAM-SE feature addition plus bugfixes and some refactoring.
This update includes some refactoring of SCAM, a few bugfixes, and adding the capability to use spectral elements dycore to do vertical transport in the column. The SE feature addition follows the E3SM implementation where a complete coarse resolution (ne3np4) of the SE dycore is initialized but only a single element is run through vertical transport with all element subcolumns being copies of the single column chosen by scmlat, scmlon.

Like the Eulerian version, SCAM-SE also has a bit for bit test to validate an exact run through the same physics as the full 3d model. Because SCAM updates the solution using a slightly different order of operations, the bfb capability is tested by making a special diagnostic run of CAM where the 3d model derives the phys/dyn tendency each time step and then recalculates the prognostic solution using the derived tendencies and SCAM's prognostic equation. This new solution (which is less precise (roundoff) due to the change in order of operations) is substituted for the full 3d solution at each time step of the model run. The substitution of the roundoff state in the 3d run allows SCAM to reproduce (BFB) each time step using the captured tendencies in the cam iop history file.

The SCAM-SE vertical advection skips the horizontal step and derives the floating level tendency based on the IOP prescribed vertical velocity. The floating levels are subsequently remapped at the end of the vertically Lagrangian dynamics step.

This PR also includes an update to .gitmodules for cice and CDEPS.
- update cice to fix scam regression failure
- update cdeps to fix CDEPS regression test build failures

Closes #957
Closes #853
Closes #742
  • Loading branch information
jtruesdal committed Aug 26, 2024
2 parents fc29092 + c50362c commit 6e32d03
Show file tree
Hide file tree
Showing 101 changed files with 4,070 additions and 2,766 deletions.
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ fxDONOTUSEurl = https://github.com/ESCOMP/CMEPS.git
[submodule "cdeps"]
path = components/cdeps
url = https://github.com/ESCOMP/CDEPS.git
fxtag = cdeps1.0.45
fxtag = cdeps1.0.48
fxrequired = ToplevelRequired
fxDONOTUSEurl = https://github.com/ESCOMP/CDEPS.git

Expand All @@ -172,7 +172,7 @@ fxDONOTUSEurl = https://github.com/NCAR/ParallelIO
[submodule "cice"]
path = components/cice
url = https://github.com/ESCOMP/CESM_CICE
fxtag = cesm_cice6_5_0_10
fxtag = cesm_cice6_5_0_12
fxrequired = ToplevelRequired
fxDONOTUSEurl = https://github.com/ESCOMP/CESM_CICE

Expand Down
27 changes: 26 additions & 1 deletion bld/build-namelist
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,7 @@ if ($adia_mode or $ideal_mode) { $simple_phys = 1; }

# Single column mode
my $scam = $cfg->get('scam');
my $scam_iop = $cfg->get('scam_iop');

# Coupling interval
# The default is for CAM to couple to the surface components every CAM timestep.
Expand Down Expand Up @@ -2516,7 +2517,7 @@ if (($chem =~ /_mam4/ or $chem =~ /_mam5/) and ($phys =~ /cam6/ or $phys =~ /cam
}

# MEGAN emissions
if (($chem eq 'trop_mam4' or $chem eq 'waccm_sc_mam4' or $chem eq 'ghg_mam4') and !$aqua_mode and !$scam){
if (($chem eq 'trop_mam4' or $chem eq 'waccm_sc_mam4' or $chem eq 'ghg_mam4') and !$aqua_mode){
my $val = "'SOAE = 0.5954*isoprene + 5.1004*(carene_3 + pinene_a + thujene_a + bornene +',"
. "' terpineol_4 + terpineol_a + terpinyl_ACT_a + myrtenal + sabinene + pinene_b + camphene +',"
. "' fenchene_a + limonene + phellandrene_a + terpinene_a + terpinene_g + terpinolene +',"
Expand Down Expand Up @@ -4089,6 +4090,30 @@ if ($dyn eq 'sld') {
# Single column model
if ($cfg->get('scam')) {
add_default($nl, 'iopfile');
add_default($nl, 'nhtfrq');
add_default($nl, 'mfilt');
add_default($nl, 'scm_use_obs_uv');
add_default($nl, 'scale_dry_air_mass');
add_default($nl, 'scm_relaxation');
add_default($nl, 'scm_relax_bot_p');
add_default($nl, 'scm_relax_top_p');
add_default($nl, 'scm_relax_linear');
add_default($nl, 'scm_relax_tau_bot_sec');
add_default($nl, 'scm_relax_tau_top_sec');
if ($chem =~ /_mam/) {
add_default($nl, 'scm_relax_fincl');
}
if ($scam_iop) {
add_default($nl, 'iopfile');
}
if ($scam_iop eq 'SAS') {
add_default($nl, 'use_gw_front');
add_default($nl, 'scm_backfill_iop_w_init');
}
if ($scam_iop eq 'twp06') {
add_default($nl, 'iradsw');
add_default($nl, 'iradlw');
}
}

# CAM generates IOP file for SCAM
Expand Down
10 changes: 7 additions & 3 deletions bld/config_files/definition.xml
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,16 @@ Turn on CO2 cycle in biogeochemistry model: 0 => no, 1 => yes.
Modifications that allow perturbation growth testing: 0=off, 1=on.
</entry>
<entry id="scam" valid_values="0,1" value="0">
Configure CAM for single column mode: 0=off, 1=on. This option only
supported for the Eulerian dycore.
Configure CAM for single column mode and specify an IOP: 0=no, 1=yes.
This option only supported for the Eulerian and SE dycores.
</entry>
<entry id="scam_iop" valid_values="arm95,arm97,atex,bomex,cgilss11,cgilss12,cgilss6,dycomsrf01,dycomsrf02,gateiii,mpace,rico,sas,sparticus,togaii,twp06,camfrc,none" value="none">
Single column IOP
Supported for Eulerian and SE dycores.
</entry>
<entry id="camiop" valid_values="0,1" value="0">
Configure CAM to generate an IOP file that can be used to drive SCAM: 0=no, 1=yes.
This option only supported for the Eulerian dycore.
Supported for Eulerian and SE dycores.
</entry>
<entry id="hgrid" value="">
Horizontal grid specifier. The recognized values depend on
Expand Down
29 changes: 21 additions & 8 deletions bld/configure
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,10 @@ OPTIONS
-camiop Configure CAM to generate an IOP file that can be used to drive SCAM.
This switch only works with the Eulerian dycore.
-scam Compiles model in single column mode. Only works with Eulerian dycore.
-scam <iopname> Compiles model in single column mode and configures for iop
[ arm95 | arm97 | atex | bomex | cgilsS11 | cgilsS12 | cgilsS6 | dycomsRF01 |
dycomsRF02 | gateIII | mpace | rico | sparticus | togaII | twp06 | SAS | camfrc ].
Default: arm97
CAM parallelization:
Expand Down Expand Up @@ -297,7 +300,7 @@ GetOptions(
"psubcols=s" => \$opts{'psubcols'},
"rad=s" => \$opts{'rad'},
"offline_drv=s" => \$opts{'offline_drv'},
"scam" => \$opts{'scam'},
"scam=s" => \$opts{'scam'},
"silhs" => \$opts{'silhs'},
"s|silent" => \$opts{'silent'},
"smp!" => \$opts{'smp'},
Expand Down Expand Up @@ -1207,15 +1210,25 @@ if ($print>=2) { print "Perturbation growth testing: $pergro$eol"; }

#-----------------------------------------------------------------------------------------------
# Single column mode

# Set default iop
my $scam_iop;

# Allow the user to override the default via the commandline.
if (defined $opts{'scam'}) {
$scam_iop = lc($opts{'scam'});
$cfg_ref->set('scam_iop', $scam_iop);
}

if (defined $opts{'scam'}) {
$cfg_ref->set('scam', 1);
}
my $scam = $cfg_ref->get('scam') ? "ON" : "OFF";

# The only dycore supported in SCAM mode is Eulerian
if ($scam eq 'ON' and $dyn_pkg ne 'eul') {
# The only dycores supported in SCAM mode are Eulerian and Spectral Elements
if ($scam eq 'ON' and !($dyn_pkg eq 'eul' or $dyn_pkg eq 'se')) {
die <<"EOF";
** ERROR: SCAM mode only works with Eulerian dycore.
** ERROR: SCAM mode only works with Eulerian or SE dycores.
** Requested dycore is: $dyn_pkg
EOF
}
Expand All @@ -1229,10 +1242,10 @@ if (defined $opts{'camiop'}) {
}
my $camiop = $cfg_ref->get('camiop') ? "ON" : "OFF";

# The only dycore supported in CAMIOP mode is Eulerian
if ($camiop eq 'ON' and $dyn_pkg ne 'eul') {
# The only dycores supported in SCAM mode are Eulerian and Spectral Elements
if ($camiop eq 'ON' and !($dyn_pkg eq 'eul' or $dyn_pkg eq 'se')) {
die <<"EOF";
** ERROR: CAMIOP mode only works with Eulerian dycore.
** ERROR: CAMIOP mode only works with the Eulerian or Spectral Element dycores.
** Requested dycore is: $dyn_pkg
EOF
}
Expand Down
Loading

0 comments on commit 6e32d03

Please sign in to comment.