Skip to content

Commit

Permalink
Merge branch 'jonbob/mpas/fix-graphfile-spec' (PR $1921)
Browse files Browse the repository at this point in the history
Move graph file specifications from streams to build-namelists

This PR moves the MPAS graph file specification for all three E3SM
components from the scripts that build the associated streams files to
the build-namelist scripts. This allows users to point to different
graph file locations via the user_nl files to set
"config_block_decomp_file_prefix" -- and then use or test different
graph files without committing them to the inputdata repo.

Tested with:
* PET_Ln9.T62_oQU240.GMPAS-IAF.cori-knl_intel
* PET_Ln9.T62_oQU240.GMPAS-IAF.cori-knl_gnu
* ERS_Ld3.T62_oEC60to30v3.GMPAS-IAF.cori-knl_gnu
* SMS_Ln9.ne30_oECv3_ICG.A_WCYCL1850S.cori-knl_intel
* PET_Ln9.T62_oQU240.GMPAS-IAF.cori-haswell_intel
* PET_Ln9.T62_oQU240.GMPAS-IAF.cori-haswell_gnu
* PET_Ln9.T62_oQU240.GMPAS-IAF.theta_intel

Fixes #1276
Fixes #1651

[BFB]
  • Loading branch information
jonbob committed Dec 7, 2017
2 parents 82cf067 + a5865e8 commit d3aaa20
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 13 deletions.
17 changes: 16 additions & 1 deletion components/mpas-cice/bld/build-namelist
Original file line number Diff line number Diff line change
Expand Up @@ -1127,8 +1127,23 @@ my $outfile = "./mpas-cice_in";
$nl->write($outfile, 'groups'=>\@groups);
if ($print>=2) { print "Writing mpas-cice ice component namelist to $outfile $eol"; }

#--------------------------------------------------------------------
# Append namelist specified files to input data file
# currently just the graph file -- which is complicated because the prefix
# is set in the namelist and the suffix comes from the number of tasks
#--------------------------------------------------------------------

open(my $input_list, ">>", "$CASEBUILD/mpas-cice.input_data_list") or
die "** can't open filepath file: mpas-cice.input_data_list\n";
my $block_decomp_file_prefix = $nl->get_value( 'config_block_decomp_file_prefix' );
# remove quotes for concatenation
$block_decomp_file_prefix =~ s/['"]//g;
my $block_decomp_file = $block_decomp_file_prefix . $NTASKS_ICE;
print $input_list "graph$NTASKS_ICE = $block_decomp_file\n";
$input_list->close;

# Write input dataset list.
check_input_files($DIN_LOC_ROOT, "../mpas-cice.input_data_list");
check_input_files($DIN_LOC_ROOT, "$CASEBUILD/mpas-cice.input_data_list");

#-----------------------------------------------------------------------------------------------
# END OF MAIN SCRIPT
Expand Down
4 changes: 1 addition & 3 deletions components/mpas-cice/cime_config/buildnml
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,11 @@ if ( $ICE_GRID eq 'oEC60to30' ) {
chdir "$CASEBUILD/mpas-ciceconf";

#--------------------------------------------------------------------
# Generate input data file
# Generate input data file with stream-specified files
#--------------------------------------------------------------------

open(my $input_list, "+>", "$CASEBUILD/mpas-cice.input_data_list");
print $input_list "mesh = $DIN_LOC_ROOT/ice/mpas-cice/$ICE_MASK/$grid_prefix.$grid_date.nc\n";
#print $input_list "full_graph = $DIN_LOC_ROOT/ice/mpas-cice/$ICE_GRID/$decomp_prefix$grid_date\n";
print $input_list "graph$NTASKS_ICE = $DIN_LOC_ROOT/ice/mpas-cice/$ICE_MASK/$decomp_prefix$decomp_date.part.$NTASKS_ICE\n";
close($input_list);

#--------------------------------------------------------------------
Expand Down
19 changes: 17 additions & 2 deletions components/mpas-o/bld/build-namelist
Original file line number Diff line number Diff line change
Expand Up @@ -1493,13 +1493,28 @@ for my $var ($nl->get_variable_names('derived')) {
$nl->set_variable_value($broken[1], $broken[0], $val);
}

# Write out all groups to mpas-o_in
# Write out all groups to mpas-o_in
my $outfile = "./mpas-o_in";
$nl->write($outfile, 'groups'=>\@groups);
if ($print>=2) { print "Writing mpas-o ocean component namelist to $outfile $eol"; }

#--------------------------------------------------------------------
# Append namelist specified files to input data file
# currently just the graph file -- which is complicated because the prefix
# is set in the namelist and the suffix comes from the number of tasks
#--------------------------------------------------------------------

open(my $input_list, ">>", "$CASEBUILD/mpas-o.input_data_list") or
die "** can't open filepath file: mpas-o.input_data_list\n";
my $block_decomp_file_prefix = $nl->get_value( 'config_block_decomp_file_prefix' );
# remove quotes for concatenation
$block_decomp_file_prefix =~ s/['"]//g;
my $block_decomp_file = $block_decomp_file_prefix . $NTASKS_OCN;
print $input_list "graph$NTASKS_OCN = $block_decomp_file\n";
$input_list->close;

# Write input dataset list.
check_input_files($DIN_LOC_ROOT, "../mpas-o.input_data_list");
check_input_files($DIN_LOC_ROOT, "$CASEBUILD/mpas-o.input_data_list");

#-----------------------------------------------------------------------------------------------
# END OF MAIN SCRIPT
Expand Down
4 changes: 1 addition & 3 deletions components/mpas-o/cime_config/buildnml
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ if ($OCN_FORCING eq 'core_forced') {
}

#--------------------------------------------------------------------
# Generate input data file
# Generate input data file with stream-specified files
#--------------------------------------------------------------------

open(my $input_list, "+>", "$CASEBUILD/mpas-o.input_data_list");
Expand All @@ -171,8 +171,6 @@ if ($analysis_mask_file ne '') {
if ( $OCN_FORCING eq 'core_forced_restoring' ) {
print $input_list "sss = $DIN_LOC_ROOT/ocn/mpas-o/$OCN_MASK/$restoring_file\n";
}
#print $input_list "full_graph = $DIN_LOC_ROOT/ocn/mpas-o/$OCN_MASK/$decomp_prefix$decomp_date\n";
print $input_list "graph$NTASKS_OCN = $DIN_LOC_ROOT/ocn/mpas-o/$OCN_MASK/$decomp_prefix$decomp_date.part.$NTASKS_OCN\n";
close($input_list);

#--------------------------------------------------------------------
Expand Down
17 changes: 16 additions & 1 deletion components/mpasli/bld/build-namelist
Original file line number Diff line number Diff line change
Expand Up @@ -610,8 +610,23 @@ my $outfile = "./mpasli_in";
$nl->write($outfile, 'groups'=>\@groups);
if ($print>=2) { print "Writing mpasli glc component namelist to $outfile $eol"; }

#--------------------------------------------------------------------
# Append namelist specified files to input data file
# currently just the graph file -- which is complicated because the prefix
# is set in the namelist and the suffix comes from the number of tasks
#--------------------------------------------------------------------

open(my $input_list, ">>", "$CASEBUILD/mpasli.input_data_list") or
die "** can't open filepath file: mpasli.input_data_list\n";
my $block_decomp_file_prefix = $nl->get_value( 'config_block_decomp_file_prefix' );
# remove quotes for concatenation
$block_decomp_file_prefix =~ s/['"]//g;
my $block_decomp_file = $block_decomp_file_prefix . $NTASKS_GLC;
print $input_list "graph$NTASKS_GLC = $block_decomp_file\n";
$input_list->close;

# Write input dataset list.
check_input_files($DIN_LOC_ROOT, "../mpasli.input_data_list");
check_input_files($DIN_LOC_ROOT, "$CASEBUILD/mpasli.input_data_list");

#-----------------------------------------------------------------------------------------------
# END OF MAIN SCRIPT
Expand Down
4 changes: 1 addition & 3 deletions components/mpasli/cime_config/buildnml
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,11 @@ if ( $GLC_GRID eq 'mpas.gis20km' ) {
chdir "$CASEBUILD/mpasliconf";

#--------------------------------------------------------------------
# Generate input data file
# Generate input data file with stream-specified files
#--------------------------------------------------------------------

open(my $input_list, "+>", "$CASEBUILD/mpasli.input_data_list");
print $input_list "mesh = $DIN_LOC_ROOT/glc/mpasli/$GLC_GRID/$grid_prefix.$grid_date.nc\n";
#print $input_list "full_graph = $DIN_LOC_ROOT/glc/mpasli/$GLC_GRID/$decomp_prefix$grid_date\n";
print $input_list "graph$NTASKS_GLC = $DIN_LOC_ROOT/glc/mpasli/$GLC_GRID/$decomp_prefix$grid_date.part.$NTASKS_GLC\n";
close($input_list);

#--------------------------------------------------------------------
Expand Down

0 comments on commit d3aaa20

Please sign in to comment.