Skip to content

Commit

Permalink
Merge branch 'jonbob/mpascice/dcompset' (PR #1815)
Browse files Browse the repository at this point in the history
This PR fixes D-compsets using the mpas-seaice component, which previously had
been broken. The slab ocean model used by the data-ocean model in all D-compsets
couples with a freezing melting potential, rather than direct frazil fluxes used
by the active ocean model. This PR introduces a new namelist variable
"config_ocean_surface_type" that the scripts set based on compset. This variable
is then used to set up the correct coupling mechanism in the driver and code. A
new version of mpas-seaice is also required. The scripts are also modified
slightly to change coupling intervals for D-compsets based on the underlying
seaice resolution.

This PR is BFB for all tested configurations, but will change answers for DTESTM
compsets.

Tested with:
* -compset DTEST -mach edison -res f45_g37_rx1
* -compset DTESTM -mach edison -res T62_oQU240

[NML]
[BFB]
  • Loading branch information
jonbob committed Oct 18, 2017
2 parents fd06a34 + 8775ee4 commit 658107a
Show file tree
Hide file tree
Showing 9 changed files with 120 additions and 75 deletions.
20 changes: 10 additions & 10 deletions cime/src/drivers/mct/cime_config/config_component_acme.xml
Original file line number Diff line number Diff line change
Expand Up @@ -255,16 +255,16 @@
<value compset="_DLND.*_MPASLI">1</value>
<value compset="_SLND.*SOCN.*_MPASLI">1</value>
<value compset="_DATM.*_SLND.*MPASO.*_MPASLI">24</value>
<value compset="_DATM.*_SLND.*MPASO" grid="oi%oQU240">12</value>
<value compset="_DATM.*_SLND.*MPASO" grid="oi%oQU240wLI">12</value>
<value compset="_DATM.*_SLND.*MPASO" grid="oi%oQU120">24</value>
<value compset="_DATM.*_SLND.*MPASO" grid="oi%oEC60to30">48</value>
<value compset="_DATM.*_SLND.*MPASO" grid="oi%oEC60to30v3">48</value>
<value compset="_DATM.*_SLND.*MPASO" grid="oi%oEC60to30wLI">48</value>
<value compset="_DATM.*_SLND.*MPASO" grid="oi%oRRS30to10v3">96</value>
<value compset="_DATM.*_SLND.*MPASO" grid="oi%oRRS30to10wLI">96</value>
<value compset="_DATM.*_SLND.*MPASO" grid="oi%oRRS18to6v3">96</value>
<value compset="_DATM.*_SLND.*MPASO" grid="oi%oRRS15to5">96</value>
<value compset="_DATM.*_SLND.*MPAS" grid="oi%oQU240">12</value>
<value compset="_DATM.*_SLND.*MPAS" grid="oi%oQU240wLI">12</value>
<value compset="_DATM.*_SLND.*MPAS" grid="oi%oQU120">24</value>
<value compset="_DATM.*_SLND.*MPAS" grid="oi%oEC60to30">48</value>
<value compset="_DATM.*_SLND.*MPAS" grid="oi%oEC60to30v3">48</value>
<value compset="_DATM.*_SLND.*MPAS" grid="oi%oEC60to30wLI">48</value>
<value compset="_DATM.*_SLND.*MPAS" grid="oi%oRRS30to10v3">96</value>
<value compset="_DATM.*_SLND.*MPAS" grid="oi%oRRS30to10wLI">96</value>
<value compset="_DATM.*_SLND.*MPAS" grid="oi%oRRS18to6v3">96</value>
<value compset="_DATM.*_SLND.*MPAS" grid="oi%oRRS15to5">96</value>
<value compset="_CAM.*_CLM.*MPASO">48</value>
<value compset="_CAM.*_CLM.*MPASO" grid="a%ne11np4">12</value>
<value compset="_CAM.*_CLM.*MPASO" grid="a%ne120np4">96</value>
Expand Down
85 changes: 46 additions & 39 deletions components/mpas-cice/bld/build-namelist
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ OPTIONS
-ic_mode variable for initial condition file mode
Options are: spunup, cold_start
-ice_bgc variable for enabling sea ice BGC
-surface_mode variable for surface mode
Options are: free, non-free
NOTE: The precedence for setting the values of namelist variables is (highest to lowest):
Expand Down Expand Up @@ -84,36 +86,38 @@ if ($ProgDir) {

# Process command-line options.

my %opts = ( help => 0,
test => 0,
verbose => 0,
preview => 0,
caseroot => undef,
casebuild => undef,
cimeroot => undef,
inst_string => undef,
ice_grid => undef,
date_stamp => undef,
ic_mode => undef,
ice_bgc => undef,
cfg_dir => $cfgdir,
my %opts = ( help => 0,
test => 0,
verbose => 0,
preview => 0,
caseroot => undef,
casebuild => undef,
cimeroot => undef,
inst_string => undef,
ice_grid => undef,
date_stamp => undef,
ic_mode => undef,
ice_bgc => undef,
surface_mode => undef,
cfg_dir => $cfgdir,
);

GetOptions(
"h|help" => \$opts{'help'},
"infile=s" => \$opts{'infile'},
"namelist=s" => \$opts{'namelist'},
"v|verbose" => \$opts{'verbose'},
"caseroot=s" => \$opts{'caseroot'},
"casebuild=s" => \$opts{'casebuild'},
"cimeroot=s" => \$opts{'cimeroot'},
"inst_string=s" => \$opts{'inst_string'},
"ice_grid=s" => \$opts{'ice_grid'},
"date_stamp=s" => \$opts{'date_stamp'},
"ic_mode=s" => \$opts{'ic_mode'},
"ice_bgc=s" => \$opts{'ice_bgc'},
"cfg_dir=s" => \$opts{'cfg_dir'},
"preview" => \$opts{'preview'},
"h|help" => \$opts{'help'},
"infile=s" => \$opts{'infile'},
"namelist=s" => \$opts{'namelist'},
"v|verbose" => \$opts{'verbose'},
"caseroot=s" => \$opts{'caseroot'},
"casebuild=s" => \$opts{'casebuild'},
"cimeroot=s" => \$opts{'cimeroot'},
"inst_string=s" => \$opts{'inst_string'},
"ice_grid=s" => \$opts{'ice_grid'},
"date_stamp=s" => \$opts{'date_stamp'},
"ic_mode=s" => \$opts{'ic_mode'},
"ice_bgc=s" => \$opts{'ice_bgc'},
"surface_mode=s" => \$opts{'surface_mode'},
"cfg_dir=s" => \$opts{'cfg_dir'},
"preview" => \$opts{'preview'},
) or usage();

# Give usage message.
Expand All @@ -137,15 +141,16 @@ my $eol = "\n";

if ($print>=2) { print "Setting MPAS-CICE configuration script directory to $cfgdir$eol"; }

my $CASEROOT = $opts{'caseroot'};
my $CASEBUILD = $opts{'casebuild'};
my $CIMEROOT = $opts{'cimeroot'};
my $inst_string = $opts{'inst_string'};
my $ICE_GRID = $opts{'ice_grid'};
my $date_stamp = $opts{'date_stamp'};
my $ic_mode = $opts{'ic_mode'};
my $ice_bgc = $opts{'ice_bgc'};
$cfgdir = $opts{'cfg_dir'};
my $CASEROOT = $opts{'caseroot'};
my $CASEBUILD = $opts{'casebuild'};
my $CIMEROOT = $opts{'cimeroot'};
my $inst_string = $opts{'inst_string'};
my $ICE_GRID = $opts{'ice_grid'};
my $date_stamp = $opts{'date_stamp'};
my $ic_mode = $opts{'ic_mode'};
my $ice_bgc = $opts{'ice_bgc'};
my $surface_mode = $opts{'surface_mode'};
$cfgdir = $opts{'cfg_dir'};

my $CIMEROOT;
if ( defined $opts{'cimeroot'} ) {
Expand Down Expand Up @@ -442,7 +447,6 @@ add_default($nl, 'config_pio_stride');
add_default($nl, 'config_write_output_on_startup');
add_default($nl, 'config_test_case_diag');
add_default($nl, 'config_test_case_diag_type');
add_default($nl, 'config_full_abort_write');

#################################
# Namelist group: decomposition #
Expand Down Expand Up @@ -531,7 +535,6 @@ add_default($nl, 'config_perform_unit_test');
add_default($nl, 'config_unit_test_type');
add_default($nl, 'config_unit_test_subtype');
add_default($nl, 'config_use_test_ice_shelf');
add_default($nl, 'config_testing_system_test');

###################################
# Namelist group: velocity_solver #
Expand Down Expand Up @@ -831,7 +834,11 @@ add_default($nl, 'config_use_ocean_mixed_layer');
add_default($nl, 'config_min_friction_velocity');
add_default($nl, 'config_ocean_heat_transfer_type');
add_default($nl, 'config_sea_freezing_temperature_type');
add_default($nl, 'config_ocean_surface_type');
if ($surface_mode eq 'non-free') {
add_default($nl, 'config_ocean_surface_type', 'val'=>"non-free");
} else {
add_default($nl, 'config_ocean_surface_type', 'val'=>"free");
}

###############################
# Namelist group: diagnostics #
Expand Down
1 change: 1 addition & 0 deletions components/mpas-cice/bld/build-namelist-section
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,7 @@ add_default($nl, 'config_boundary_layer_iteration_number');
add_default($nl, 'config_use_ocean_mixed_layer');
add_default($nl, 'config_min_friction_velocity');
add_default($nl, 'config_ocean_heat_transfer_type');
add_default($nl, 'config_ocean_surface_type');
add_default($nl, 'config_sea_freezing_temperature_type');
add_default($nl, 'config_ocean_surface_type');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@
<config_use_ocean_mixed_layer>false</config_use_ocean_mixed_layer>
<config_min_friction_velocity>0.0005</config_min_friction_velocity>
<config_ocean_heat_transfer_type>'constant'</config_ocean_heat_transfer_type>
<config_ocean_surface_type>'free'</config_ocean_surface_type>
<config_sea_freezing_temperature_type>'mushy'</config_sea_freezing_temperature_type>
<config_ocean_surface_type>'free'</config_ocean_surface_type>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2264,6 +2264,14 @@ Valid values: MISSING POSSIBLE VALUES
Default: Defined in namelist_defaults.xml
</entry>

<entry id="config_ocean_surface_type" type="char*1024"
category="ocean" group="ocean">
MISSING DESCRIPTION

Valid values: MISSING POSSIBLE VALUES
Default: Defined in namelist_defaults.xml
</entry>

<entry id="config_sea_freezing_temperature_type" type="char*1024"
category="ocean" group="ocean">
MISSING DESCRIPTION
Expand Down
36 changes: 19 additions & 17 deletions components/mpas-cice/cime_config/buildnml
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,25 @@ 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 $ICE_BGC = `./xmlquery MPASCICE_BGC -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 $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 $ICE_BGC = `./xmlquery MPASCICE_BGC -value`;
my $SURFACE_MODE = `./xmlquery MPASCICE_SURFACE_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 $RUNDIR = `./xmlquery RUNDIR -value`;
my $STREAM_NAME = 'streams.cice';

my @dirs = ("$CIMEROOT/utils/perl5lib");
Expand Down Expand Up @@ -208,6 +209,7 @@ while ($inst_counter <= $NINST_ICE) {
$sysmod .= " -ice_grid '$ICE_MASK'";
$sysmod .= " -ic_mode '$IC_MODE'";
$sysmod .= " -ice_bgc '$ICE_BGC'";
$sysmod .= " -surface_mode '$SURFACE_MODE'";

# pass in ICE_MASK for now as a short-cut for the grid
# at some point, we may want to pass both -- but for now this is simpler
Expand Down
15 changes: 14 additions & 1 deletion components/mpas-cice/cime_config/config_component.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,20 @@
</values>
<group>case_comp</group>
<file>env_case.xml</file>
<desc>Option to describe the MPASCICE initial condition model</desc>
<desc>Option to describe the MPASCICE initial condition mode</desc>
</entry>

<entry id="MPASCICE_SURFACE_MODE">
<type>char</type>
<valid_values>free,non-free</valid_values>
<default_value>free</default_value>
<values>
<value compset="_MPASO">free</value>
<value compset="_DOCN%SOM">non-free</value>
</values>
<group>case_comp</group>
<file>env_case.xml</file>
<desc>Option to describe the MPASCICE surface mode</desc>
</entry>

<entry id="MPASCICE_BGC">
Expand Down
27 changes: 19 additions & 8 deletions components/mpas-cice/driver/ice_comp_mct.F
Original file line number Diff line number Diff line change
Expand Up @@ -1380,8 +1380,9 @@ subroutine ice_import_mct(x2i_i, errorCode)!{{{
config_use_zaerosols, &
config_use_column_biogeochemistry
character(len=strKIND), pointer :: &
config_thermodynamics_type
character(len=strKIND), pointer :: &
config_thermodynamics_type, &
config_ocean_surface_type
type (field1DReal), pointer :: &
seaSurfaceTemperatureField, &
Expand Down Expand Up @@ -1488,6 +1489,7 @@ subroutine ice_import_mct(x2i_i, errorCode)!{{{
configs => block_ptr % configs
call mpas_pool_get_config(configs, "config_thermodynamics_type", config_thermodynamics_type)
call mpas_pool_get_config(configs, "config_ocean_surface_type", config_ocean_surface_type)
call mpas_pool_get_config(configs, "config_use_aerosols", config_use_aerosols)
call mpas_pool_get_config(configs, "config_use_modal_aerosols", config_use_modal_aerosols)
call mpas_pool_get_config(configs, "config_use_column_biogeochemistry", config_use_column_biogeochemistry)
Expand Down Expand Up @@ -1561,14 +1563,23 @@ subroutine ice_import_mct(x2i_i, errorCode)!{{{
vOceanVelocity(i) = x2i_i % rAttr(index_x2i_So_v, n)
seaSurfaceTiltU(i) = x2i_i % rAttr(index_x2i_So_dhdx, n)
seaSurfaceTiltV(i) = x2i_i % rAttr(index_x2i_So_dhdy, n)
meltingPotential = x2i_i % rAttr(index_x2i_Fioo_meltp, n)
! frazil calculation
frazilProduction = x2i_i % rAttr(index_x2i_Fioo_frazil, n)
call freezing_potential(freezingPotential, frazilProduction, seaSurfaceSalinity(i), &
config_thermodynamics_type)
freezingMeltingPotential(i) = freezingPotential + meltingPotential
if (trim(config_ocean_surface_type) == "free") then ! free surface (MPAS-O)
meltingPotential = x2i_i % rAttr(index_x2i_Fioo_meltp, n)
! frazil calculation
frazilProduction = x2i_i % rAttr(index_x2i_Fioo_frazil, n)
call freezing_potential(freezingPotential, frazilProduction, seaSurfaceSalinity(i), &
config_thermodynamics_type)
freezingMeltingPotential(i) = freezingPotential + meltingPotential
else ! non-free surface (SOM)
freezingMeltingPotential(i) = x2i_i % rAttr(index_x2i_Fioo_q, n)
endif
airLevelHeight(i) = x2i_i % rAttr(index_x2i_Sa_z, n)
airPotentialTemperature(i) = x2i_i % rAttr(index_x2i_Sa_ptem, n)
airTemperature(i) = x2i_i % rAttr(index_x2i_Sa_tbot, n)
Expand Down
2 changes: 2 additions & 0 deletions components/mpas-cice/driver/mpas_cice_cpl_indices.F
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ module mpas_cice_cpl_indices
integer :: index_x2i_Faxa_swnet ! sw: net
integer :: index_x2i_Fioo_meltp ! ocn melt heat
integer :: index_x2i_Fioo_frazil ! ocn frazil ice formation
integer :: index_x2i_Fioo_q ! ocn freezing melting potential
integer :: index_x2i_Faxa_bcphidry ! flux: Black Carbon hydrophilic dry deposition
integer :: index_x2i_Faxa_bcphodry ! flux: Black Carbon hydrophobic dry deposition
integer :: index_x2i_Faxa_bcphiwet ! flux: Black Carbon hydrophilic wet deposition
Expand Down Expand Up @@ -208,6 +209,7 @@ subroutine mpas_cice_cpl_indices_set( )
index_x2i_Faxa_swvdf = mct_avect_indexra(x2i,'Faxa_swvdf')
index_x2i_Fioo_meltp = mct_avect_indexra(x2i,'Fioo_meltp')
index_x2i_Fioo_frazil = mct_avect_indexra(x2i,'Fioo_frazil')
index_x2i_Fioo_q = mct_avect_indexra(x2i,'Fioo_q')
index_x2i_Faxa_bcphidry = mct_avect_indexra(x2i,'Faxa_bcphidry')
index_x2i_Faxa_bcphodry = mct_avect_indexra(x2i,'Faxa_bcphodry')
index_x2i_Faxa_bcphiwet = mct_avect_indexra(x2i,'Faxa_bcphiwet')
Expand Down

0 comments on commit 658107a

Please sign in to comment.