Skip to content

Commit

Permalink
Merge branch 'wlin/atm/p3_alt_eam_scream' (#5496)
Browse files Browse the repository at this point in the history
The alternating switch, determined by the case configuration option (a scream case or else), serves to control which version of Fortran P3 codes being used to build the model. A test is needed to track scream configuration. The version for the EAM version is currently just a skelton, which will be replaced by the eventual P3 PR from v3atm

[BFB] Two new tests SMS_Ln9_P24x1.ne4_ne4.FDPSCREAM-ARM97
and SMS_Ld1.ne30pg2_ne30pg2.F2010-SCREAM-LR-DYAMOND2
  • Loading branch information
brhillman committed Mar 28, 2023
2 parents a33b6e5 + 9f2d8bb commit 4a313dd
Show file tree
Hide file tree
Showing 9 changed files with 879 additions and 4 deletions.
4 changes: 3 additions & 1 deletion cime_config/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@
"SMS_R_Ld5.ne4_ne4.FSCM-ARM97.eam-scm",
"SMS_D_Ln5.ne4_oQU240.F2010",
"SMS_Ln5.ne4pg2_oQU480.F2010",
"ERS_D.ne4_oQU240.F2010.eam-hommexx"
"ERS_D.ne4_oQU240.F2010.eam-hommexx",
"SMS_Ln9_P24x1.ne4_ne4.FDPSCREAM-ARM97",
)
},

Expand Down Expand Up @@ -228,6 +229,7 @@
"SMS_D_Ld1.T62_oEC60to30v3.DTESTM",
"SMS_D_Ld3.T62_oQU120.CMPASO-IAF",
"SMS_D_Ld1.ne30pg2_r05_EC30to60E2r2.WCYCL1850",
"SMS_Ln5.ne30pg2_ne30pg2.F2010-SCREAM-LR-DYAMOND2",
)
},

Expand Down
24 changes: 22 additions & 2 deletions components/eam/bld/configure
Original file line number Diff line number Diff line change
Expand Up @@ -1752,6 +1752,19 @@ if (defined $opts{'cppdefs'}) {
}
$cfg_ref->set('cppdefs', $usr_cppdefs);

# Define is_scream_config flag to select which P3 version codes to use
# If the config uses both p3 and shoc, it is recognized as a scream case.

my $is_scream_config = 0;
if ($microphys_pkg =~ /^p3/) {
if ($shoc_sgs) {
$is_scream_config = 1;
print "The case uses SCREAM config and SCREAM's version of P3 codes in Fortran 90.\n";
} else {
print "The case use EAM's version of P3 codes in Fortran 90.\n";
}
}

if ($usr_cppdefs and $print>=2) { print "Default and user CPP definitions: \'$usr_cppdefs\'$eol";}

# The following CPP macro definitions are used to implement the compile-time options. They are
Expand Down Expand Up @@ -2463,7 +2476,7 @@ my $fp_filename = 'Filepath'; # name of output filepath file
my $cpp_filename = 'CIME_cppdefs'; # name of output file for eam's cppdefs in cime

# Write the filepath file.
write_filepath("$cam_bld/$fp_filename", $cfg_ref);
write_filepath("$cam_bld/$fp_filename", $cfg_ref, $is_scream_config);
if ($print) { print "creating $cam_bld/$fp_filename\n"; }

if (($ccsm_seq)) {
Expand Down Expand Up @@ -2507,7 +2520,7 @@ exit;

sub write_filepath
{
my ($file, $cfg_ref) = @_;
my ($file, $cfg_ref, $is_scream_config) = @_;
my $fh = new IO::File;

$fh->open(">$file") or die "** can't open filepath file: $file\n";
Expand Down Expand Up @@ -2701,6 +2714,13 @@ sub write_filepath
print $fh "$camsrcdir/eam/src/physics/silhs\n";
}

# set Fortran P3 path, needed even if microphys is not P3
if ($is_scream_config eq '1') {
print $fh "$camsrcdir/eam/src/physics/p3/scream\n";
} else {
print $fh "$camsrcdir/eam/src/physics/p3/eam\n";
}

print $fh "$camsrcdir/eam/src/dynamics/$dyn\n";
if($dyn eq 'se') {
print $fh "$camsrcdir/homme/src/share\n";
Expand Down
280 changes: 280 additions & 0 deletions components/eam/src/physics/p3/eam/micro_p3.F90

Large diffs are not rendered by default.

Loading

0 comments on commit 4a313dd

Please sign in to comment.