Skip to content

Commit

Permalink
Merge branch 'jonbob/mpas/move-pio-control' (PR #1456)
Browse files Browse the repository at this point in the history
This PR moves control of PIO_TYPENAME to individual files by including settings
for "io_type" for each file in the mpas-o and mpas-seaice streams.  For high-res
grids, where some 3D fields require special handling, specific files are given
the following setting:
     io_type="pnetcdf,cdf5"
Otherwise, all streams are assigned the default PIO_TYPENAME for the machine
being run on.  The drivers are also modified to remove the setting of a default
io_type, which would overwrite the specific stream settings.

Tested for correct streams output via:
-compset GMPAS-IAF -mach edison -compiler intel -res T62_oEC60to30v3
-compset GMPAS-IAF -mach edison -compiler intel -res T62_oRRS18to6v3

[NML]
[BFB]
  • Loading branch information
jonbob committed May 16, 2017
2 parents b6241c8 + 51ea5bd commit b1c99ff
Show file tree
Hide file tree
Showing 4 changed files with 134 additions and 34 deletions.
79 changes: 60 additions & 19 deletions components/mpas-cice/cime_config/buildnml
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,24 @@ if ($#ARGV == -1) {
my ($CASEROOT) = @ARGV;
chdir "${CASEROOT}";

my $CIMEROOT = `./xmlquery CIMEROOT -value`;
my $CASEROOT = `./xmlquery CASEROOT -value`;
my $CASEBUILD = `./xmlquery CASEBUILD -value`;
my $COMPSET = `./xmlquery COMPSET -value`;
my $SRCROOT = `./xmlquery SRCROOT -value`;
my $OBJROOT = `./xmlquery OBJROOT -value`;
my $SCRIPTSROOT = `./xmlquery SCRIPTSROOT -value`;
my $COMP_INTERFACE = `./xmlquery COMP_INTERFACE -value`;
my $DIN_LOC_ROOT = `./xmlquery DIN_LOC_ROOT -value`;
my $ICE_GRID = `./xmlquery ICE_GRID -value`;
my $ICE_MASK = `./xmlquery MASK_GRID -value`;
my $IC_MODE = `./xmlquery MPASCICE_IC_MODE -value`;
my $NTASKS_ICE = `./xmlquery NTASKS_ICE -value`;
my $CIMEROOT = `./xmlquery CIMEROOT -value`;
my $CASEROOT = `./xmlquery CASEROOT -value`;
my $CASEBUILD = `./xmlquery CASEBUILD -value`;
my $COMPSET = `./xmlquery COMPSET -value`;
my $SRCROOT = `./xmlquery SRCROOT -value`;
my $OBJROOT = `./xmlquery OBJROOT -value`;
my $SCRIPTSROOT = `./xmlquery SCRIPTSROOT -value`;
my $COMP_INTERFACE = `./xmlquery COMP_INTERFACE -value`;
my $DIN_LOC_ROOT = `./xmlquery DIN_LOC_ROOT -value`;
my $ICE_GRID = `./xmlquery ICE_GRID -value`;
my $ICE_MASK = `./xmlquery MASK_GRID -value`;
my $IC_MODE = `./xmlquery MPASCICE_IC_MODE -value`;
my $NTASKS_ICE = `./xmlquery NTASKS_ICE -value`;
my $ICE_PIO_TYPENAME = `./xmlquery ICE_PIO_TYPENAME -value`;
#my $NINST_ICE = `./xmlquery NINST_ICE -value`;
my $NINST_ICE = 1; # Change if you want multiple instances... though this isn't coded yet.
my $RUNDIR = `./xmlquery RUNDIR -value`;
my $STREAM_NAME = 'streams.cice';
my $NINST_ICE = 1; # Change if you want multiple instances... though this isn't coded yet.
my $RUNDIR = `./xmlquery RUNDIR -value`;
my $STREAM_NAME = 'streams.cice';

my @dirs = ("$CIMEROOT/utils/perl5lib");
unshift @INC, @dirs;
Expand Down Expand Up @@ -236,10 +237,20 @@ if ( -e "$CASEROOT/SourceMods/src.mpascice/$STREAM_NAME" ) {
print $stream_file '<streams>' . "\n";
print $stream_file '<immutable_stream name="mesh"' . "\n";
print $stream_file ' type="none"' . "\n";
if ( $ICE_GRID =~ m/^oRRS1/ ) {
print $stream_file ' io_type="pnetcdf,cdf5"' . "\n";
} else {
print $stream_file ' io_type="' . "$ICE_PIO_TYPENAME" . '"' . "\n";
}
print $stream_file ' filename_template="mesh_variables.nc" />' . "\n";
print $stream_file '' . "\n";
print $stream_file '<immutable_stream name="input"' . "\n";
print $stream_file ' type="input"' . "\n";
if ( $ICE_GRID =~ m/^oRRS1/ ) {
print $stream_file ' io_type="pnetcdf,cdf5"' . "\n";
} else {
print $stream_file ' io_type="' . "$ICE_PIO_TYPENAME" . '"' . "\n";
}
print $stream_file ' filename_interval="none"' . "\n";
print $stream_file " filename_template=" . '"'
. "$DIN_LOC_ROOT/ice/mpas-cice/$ICE_MASK/$grid_prefix.$grid_date.nc"
Expand All @@ -259,6 +270,11 @@ if ( -e "$CASEROOT/SourceMods/src.mpascice/$STREAM_NAME" ) {
print $stream_file '' . "\n";
print $stream_file '<immutable_stream name="restart"' . "\n";
print $stream_file ' type="input;output"' . "\n";
if ( $ICE_GRID =~ m/^oRRS1/ ) {
print $stream_file ' io_type="pnetcdf,cdf5"' . "\n";
} else {
print $stream_file ' io_type="' . "$ICE_PIO_TYPENAME" . '"' . "\n";
}
print $stream_file ' filename_template="mpascice.rst.$Y-$M-$D_$S.nc"' . "\n";
print $stream_file ' filename_interval="output_interval"' . "\n";
print $stream_file ' input_interval="initial_only"' . "\n";
Expand All @@ -269,6 +285,11 @@ if ( -e "$CASEROOT/SourceMods/src.mpascice/$STREAM_NAME" ) {
if ( $IC_MODE eq 'spunup' ) {
print $stream_file '<immutable_stream name="restart_ic"' . "\n";
print $stream_file ' type="input"' . "\n";
if ( $ICE_GRID =~ m/^oRRS1/ ) {
print $stream_file ' io_type="pnetcdf,cdf5"' . "\n";
} else {
print $stream_file ' io_type="' . "$ICE_PIO_TYPENAME" . '"' . "\n";
}
print $stream_file " filename_template=" . '"'
. "$DIN_LOC_ROOT/ice/mpas-cice/$ICE_MASK/$grid_prefix.$grid_date.nc"
. '"' . "\n";
Expand All @@ -279,6 +300,7 @@ if ( -e "$CASEROOT/SourceMods/src.mpascice/$STREAM_NAME" ) {

print $stream_file '<stream name="output"' . "\n";
print $stream_file ' type="output"' . "\n";
print $stream_file ' io_type="' . "$ICE_PIO_TYPENAME" . '"' . "\n";
print $stream_file ' filename_template="mpascice.hist.$Y-$M-$D_$S.nc"' . "\n";
print $stream_file ' filename_interval="01-00-00_00:00:00"' . "\n";
print $stream_file ' clobber_mode="truncate"' . "\n";
Expand All @@ -297,44 +319,51 @@ if ( -e "$CASEROOT/SourceMods/src.mpascice/$STREAM_NAME" ) {
print $stream_file '' . "\n";
print $stream_file '<immutable_stream name="LYqSixHourlyForcing"' . "\n";
print $stream_file ' type="input"' . "\n";
print $stream_file ' io_type="' . "$ICE_PIO_TYPENAME" . '"' . "\n";
print $stream_file ' filename_template="forcing/atmosphere_forcing_six_hourly.$Y.nc"' . "\n";
print $stream_file ' filename_interval="0001-00-00_00:00:00"' . "\n";
print $stream_file ' reference_time="2000-01-01_03:00:00"' . "\n";
print $stream_file ' input_interval="none" />' . "\n";
print $stream_file '' . "\n";
print $stream_file '<immutable_stream name="LYqMonthlyForcing"' . "\n";
print $stream_file ' type="input"' . "\n";
print $stream_file ' io_type="' . "$ICE_PIO_TYPENAME" . '"' . "\n";
print $stream_file ' filename_template="forcing/atmosphere_forcing_monthly.nc"' . "\n";
print $stream_file ' filename_interval="none"' . "\n";
print $stream_file ' input_interval="none" />' . "\n";
print $stream_file '' . "\n";
print $stream_file '<immutable_stream name="NCARMonthlySSTForcing"' . "\n";
print $stream_file ' type="input"' . "\n";
print $stream_file ' io_type="' . "$ICE_PIO_TYPENAME" . '"' . "\n";
print $stream_file ' filename_template="forcing/ocean_forcing_monthly.nc"' . "\n";
print $stream_file ' filename_interval="none"' . "\n";
print $stream_file ' input_interval="none" />' . "\n";
print $stream_file '' . "\n";
print $stream_file '<immutable_stream name="NCARMonthlyForcing"' . "\n";
print $stream_file ' type="input"' . "\n";
print $stream_file ' io_type="' . "$ICE_PIO_TYPENAME" . '"' . "\n";
print $stream_file ' filename_template="forcing/ocean_forcing_monthly.nc"' . "\n";
print $stream_file ' filename_interval="none"' . "\n";
print $stream_file ' input_interval="none" />' . "\n";
print $stream_file '' . "\n";
print $stream_file '<immutable_stream name="StandardAerosolsInput"' . "\n";
print $stream_file ' type="input"' . "\n";
print $stream_file ' io_type="' . "$ICE_PIO_TYPENAME" . '"' . "\n";
print $stream_file ' filename_template="standard_optics_mpas_cice.nc"' . "\n";
print $stream_file ' filename_interval="none"' . "\n";
print $stream_file ' input_interval="none" />' . "\n";
print $stream_file '' . "\n";
print $stream_file '<immutable_stream name="ModalAerosolsInput"' . "\n";
print $stream_file ' type="input"' . "\n";
print $stream_file ' io_type="' . "$ICE_PIO_TYPENAME" . '"' . "\n";
print $stream_file ' filename_template="snicar_optics_5bnd_mam_c140303_mpas_cice.nc"' . "\n";
print $stream_file ' filename_interval="none"' . "\n";
print $stream_file ' input_interval="none" />' . "\n";
print $stream_file '' . "\n";
print $stream_file '' . "\n";
print $stream_file '<stream name="highFrequencyOutput"' . "\n";
print $stream_file ' type="output"' . "\n";
print $stream_file ' io_type="' . "$ICE_PIO_TYPENAME" . '"' . "\n";
print $stream_file ' filename_template="mpascice.hist.am.highFrequencyOutput.$Y-$M-$D.nc"' . "\n";
print $stream_file ' filename_interval="00-01-00_00:00:00"' . "\n";
print $stream_file ' output_interval="none"' . "\n";
Expand All @@ -348,6 +377,7 @@ if ( -e "$CASEROOT/SourceMods/src.mpascice/$STREAM_NAME" ) {
print $stream_file '' . "\n";
print $stream_file '<stream name="regionalStatisticsOutput"' . "\n";
print $stream_file ' type="output"' . "\n";
print $stream_file ' io_type="' . "$ICE_PIO_TYPENAME" . '"' . "\n";
print $stream_file ' filename_template="mpascice.hist.am.regionalStatistics.$Y.$M.nc"' . "\n";
print $stream_file ' filename_interval="00-01-00_00:00:00"' . "\n";
print $stream_file ' output_interval="00-00-01_00:00:00"' . "\n";
Expand All @@ -369,6 +399,7 @@ if ( -e "$CASEROOT/SourceMods/src.mpascice/$STREAM_NAME" ) {
print $stream_file '' . "\n";
print $stream_file '<stream name="conservationCheckOutput"' . "\n";
print $stream_file ' type="output"' . "\n";
print $stream_file ' io_type="' . "$ICE_PIO_TYPENAME" . '"' . "\n";
print $stream_file ' filename_template="mpascicehist.am.conservationCheck.$Y.nc"' . "\n";
print $stream_file ' filename_interval="01-00-00_00:00:00"' . "\n";
print $stream_file ' output_interval="00-01-00_00:00:00"' . "\n";
Expand Down Expand Up @@ -399,6 +430,7 @@ if ( -e "$CASEROOT/SourceMods/src.mpascice/$STREAM_NAME" ) {
print $stream_file '' . "\n";
print $stream_file '<stream name="conservationCheckRestart"' . "\n";
print $stream_file ' type="input;output"' . "\n";
print $stream_file ' io_type="' . "$ICE_PIO_TYPENAME" . '"' . "\n";
print $stream_file ' filename_template="mpascice.rst.am.conservationCheck.$Y-$M-$D_$S.nc"' . "\n";
print $stream_file ' filename_interval="output_interval"' . "\n";
print $stream_file ' clobber_mode="truncate"' . "\n";
Expand All @@ -409,6 +441,7 @@ if ( -e "$CASEROOT/SourceMods/src.mpascice/$STREAM_NAME" ) {
print $stream_file '' . "\n";
print $stream_file '<stream name="loadBalanceOutput"' . "\n";
print $stream_file ' type="output"' . "\n";
print $stream_file ' io_type="' . "$ICE_PIO_TYPENAME" . '"' . "\n";
print $stream_file ' filename_template="mpascice.hist.am.cice_loadBalance.$Y.nc"' . "\n";
print $stream_file ' filename_interval="01-00-00_00:00:00"' . "\n";
print $stream_file ' output_interval="00-00-00_01:00:00"' . "\n";
Expand All @@ -422,6 +455,7 @@ if ( -e "$CASEROOT/SourceMods/src.mpascice/$STREAM_NAME" ) {
print $stream_file '' . "\n";
print $stream_file '<stream name="maximumIcePresenceOutput"' . "\n";
print $stream_file ' type="output"' . "\n";
print $stream_file ' io_type="' . "$ICE_PIO_TYPENAME" . '"' . "\n";
print $stream_file ' filename_template="mpascice.hist.am.cice_maximumIcePresence.$Y.nc"' . "\n";
print $stream_file ' filename_interval="01-00-00_00:00:00"' . "\n";
print $stream_file ' output_interval="01-00-00_00:00:00"' . "\n";
Expand All @@ -435,6 +469,7 @@ if ( -e "$CASEROOT/SourceMods/src.mpascice/$STREAM_NAME" ) {
print $stream_file '' . "\n";
print $stream_file '<stream name="timeSeriesStatsDailyOutput"' . "\n";
print $stream_file ' type="output"' . "\n";
print $stream_file ' io_type="' . "$ICE_PIO_TYPENAME" . '"' . "\n";
print $stream_file ' filename_template="mpascice.hist.am.timeSeriesStatsDaily.$Y-$M-$D.nc"' . "\n";
print $stream_file ' filename_interval="00-01-00_00:00:00"' . "\n";
print $stream_file ' output_interval="00-00-01_00:00:00"' . "\n";
Expand All @@ -444,6 +479,7 @@ if ( -e "$CASEROOT/SourceMods/src.mpascice/$STREAM_NAME" ) {
print $stream_file '' . "\n";
print $stream_file '<stream name="timeSeriesStatsDailyRestart"' . "\n";
print $stream_file ' type="input;output"' . "\n";
print $stream_file ' io_type="' . "$ICE_PIO_TYPENAME" . '"' . "\n";
print $stream_file ' filename_template="mpascice.rst.am.timeSeriesStatsDaily.$Y-$M-$D_$S.nc"' . "\n";
print $stream_file ' filename_interval="output_interval"' . "\n";
print $stream_file ' clobber_mode="truncate"' . "\n";
Expand All @@ -454,6 +490,7 @@ if ( -e "$CASEROOT/SourceMods/src.mpascice/$STREAM_NAME" ) {
print $stream_file '' . "\n";
print $stream_file '<stream name="timeSeriesStatsMonthlyOutput"' . "\n";
print $stream_file ' type="output"' . "\n";
print $stream_file ' io_type="' . "$ICE_PIO_TYPENAME" . '"' . "\n";
print $stream_file ' filename_template="mpascice.hist.am.timeSeriesStatsMonthly.$Y-$M-$D.nc"' . "\n";
print $stream_file ' filename_interval="00-01-00_00:00:00"' . "\n";
print $stream_file ' output_interval="00-01-00_00:00:00"' . "\n";
Expand Down Expand Up @@ -517,6 +554,7 @@ if ( -e "$CASEROOT/SourceMods/src.mpascice/$STREAM_NAME" ) {
print $stream_file '' . "\n";
print $stream_file '<stream name="timeSeriesStatsMonthlyRestart"' . "\n";
print $stream_file ' type="input;output"' . "\n";
print $stream_file ' io_type="' . "$ICE_PIO_TYPENAME" . '"' . "\n";
print $stream_file ' filename_template="mpascice.rst.am.timeSeriesStatsMonthly.$Y-$M-$D_$S.nc"' . "\n";
print $stream_file ' filename_interval="output_interval"' . "\n";
print $stream_file ' clobber_mode="truncate"' . "\n";
Expand All @@ -527,6 +565,7 @@ if ( -e "$CASEROOT/SourceMods/src.mpascice/$STREAM_NAME" ) {
print $stream_file '' . "\n";
print $stream_file '<stream name="timeSeriesStatsClimatologyOutput"' . "\n";
print $stream_file ' type="output"' . "\n";
print $stream_file ' io_type="' . "$ICE_PIO_TYPENAME" . '"' . "\n";
print $stream_file ' filename_template="mpascice.hist.am.timeSeriesStatsClimatology.$Y.nc"' . "\n";
print $stream_file ' filename_interval="01-00-00_00:00:00"' . "\n";
print $stream_file ' clobber_mode="truncate"' . "\n";
Expand All @@ -541,6 +580,7 @@ if ( -e "$CASEROOT/SourceMods/src.mpascice/$STREAM_NAME" ) {
print $stream_file '' . "\n";
print $stream_file '<stream name="timeSeriesStatsClimatologyRestart"' . "\n";
print $stream_file ' type="input;output"' . "\n";
print $stream_file ' io_type="' . "$ICE_PIO_TYPENAME" . '"' . "\n";
print $stream_file ' filename_template="mpascice.rst.am.timeSeriesStatsClimatology.$Y-$M-$D_$S.nc"' . "\n";
print $stream_file ' filename_interval="output_interval"' . "\n";
print $stream_file ' clobber_mode="truncate"' . "\n";
Expand All @@ -550,9 +590,10 @@ if ( -e "$CASEROOT/SourceMods/src.mpascice/$STREAM_NAME" ) {
print $stream_file '</stream>' . "\n";
print $stream_file '' . "\n";
print $stream_file '<stream name="landIceMasks"' . "\n";
print $stream_file ' type="input"' . "\n";
print $stream_file ' input_interval="initial_only"' . "\n";
print $stream_file " filename_template=" . '"'
print $stream_file ' type="input"' . "\n";
print $stream_file ' io_type="' . "$ICE_PIO_TYPENAME" . '"' . "\n";
print $stream_file ' input_interval="initial_only"' . "\n";
print $stream_file " filename_template=" . '"'
. "$DIN_LOC_ROOT/ice/mpas-cice/$ICE_MASK/$grid_prefix.$grid_date.nc"
. '">' . "\n";
print $stream_file '' . "\n";
Expand Down
3 changes: 2 additions & 1 deletion components/mpas-cice/driver/ice_comp_mct.F
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,8 @@ end subroutine xml_stream_get_attributes
io_system => shr_pio_getiosys(iceid)

pio_iotype = shr_pio_getiotype(iceid)
call MPAS_io_set_iotype(domain % iocontext, pio_iotype)
! call MPAS_io_set_iotype(domain % iocontext, pio_iotype)
call MPAS_io_unset_iotype(domain % iocontext)

! ----------------
! Set up log file information
Expand Down
Loading

0 comments on commit b1c99ff

Please sign in to comment.