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

Implement alternating control of Fortran P3 codes for eam and scream #5496

Merged
merged 3 commits into from
Mar 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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 @@ -210,6 +211,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",
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd like to see a DP test as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

DP test added to the developer test suite.

Copy link
Member

Choose a reason for hiding this comment

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

DP = "doubly-periodic" ? Hard to tell from the name that its that kind of domain.

)
},

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