Skip to content

Commit

Permalink
Merge tag 'ctsm1.0.dev015' into collapse2gencrop
Browse files Browse the repository at this point in the history
CMIP6 compset modifiers; usermods for output; other output enhancements

(1) Support %BGC-CROP-CMIP6DECK and %BGC-CROP-CMIP6WACCMDECK compset
    modifiers, so that we can turn on the necessary options
    (output-related and others) via new CMIP6-specific compsets.

(2) Turn on carbon isotopes in CMIP6 runs (from Erik Kluzek)

(3) Remove setting of CCSM_BGC=CO2A in the cmip6 usermods

(4) Add usermods directories for getting typical extra output that's
    wanted in many cases: output_crop, output_crop_highfreq, output_bgc,
    output_bgc_highfreq, output_sp, and output_sp_highfreq. These can be
    enabled by adding something like '--user-mods-dir output_crop' on
    the create_newcase line (that short-hand works for an I compset; for
    F or B compsets, you need to provide the full path to the usermod
    directory).

(4) Allow holes in the number of history tapes. Holes are cases where,
    for example, we have h0, h1 and h3 tapes, but no h2 tape (because
    there are no fields on the h2 tape). (This is needed for (3).)

(5) Fix reading and writing of 1-d logical global arrays. This fixes
    ESCOMP#24 for real (rather than just preventing an attempt to
    read/write 1-d logical arrays, as was done in the previous 'fix').

(6) Add C13_NBP and C14_NBP diagnostic fields (from Keith Oleson)

(7) Make a bunch of carbon isotope diagnostic fields inactive by default

(8) Don't allow interpolation (use_init_interp) from a case without
    carbon isotopes to a case with carbon isotopes: Due to
    ESCOMP#67, interpolation from a case
    without carbon isotopes to a case with carbon isotopes yields
    incorrect initialization values for the carbon isotopes. Now that
    we're turning carbon isotopes on via some semi-out-of-the-box
    usermods (for cmip6), it is becoming more important to check to make
    sure someone doesn't shoot themselves in the foot this way.

(9) Add tests of the new output usermods as well as of the CMIP6 compset
    modifiers

Conflicts:
	src/dyn_subgrid/dyncropFileMod.F90

slevis resolved conflicts (as far as I can tell) but cheyenne_intel suite
returns two new FAILs:
ERP_D_Ld5.f09_g17.I2000Clm50Vic.cheyenne_intel.clm-vrtlay RUN
ERS_D_Ld10.f10_f10_musgs.IHistClm50SpG.cheyenne_intel.clm-collapse_pfts_78_to_16_f10 RUN
I am committing the merge so as to then look at diffs that may be
leading to the FAILs.
  • Loading branch information
slevis-lmwg committed Oct 31, 2018
2 parents 9cff6b2 + f2839e2 commit 9f90b80
Show file tree
Hide file tree
Showing 84 changed files with 1,725 additions and 321 deletions.
25 changes: 22 additions & 3 deletions bld/CLMBuildNamelist.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1885,7 +1885,11 @@ sub setup_logic_irrigate {
if ( $physv->as_long() >= $physv->as_long("clm4_5") ) {
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'irrigate',
'use_crop'=>$nl_flags->{'use_crop'}, 'use_cndv'=>$nl_flags->{'use_cndv'} );
$nl_flags->{'irrigate'} = lc($nl->get_value('irrigate'));
if ( &value_is_true($nl->get_value('irrigate') ) ) {
$nl_flags->{'irrigate'} = ".true."
} else {
$nl_flags->{'irrigate'} = ".false."
}
}
}

Expand Down Expand Up @@ -2079,6 +2083,9 @@ sub setup_logic_create_crop_landunit {
if ( &value_is_true($nl_flags->{'use_fates'}) && &value_is_true($nl->get_value($var)) ) {
$log->fatal_error( "$var is true and yet use_fates is being set, which contradicts that (use_fates requires $var to be .false." );
}
if ( (! &value_is_true($nl_flags->{'use_fates'})) && (! &value_is_true($nl->get_value($var))) ) {
$log->fatal_error( "$var is false which is ONLY allowed when FATES is being used" );
}
}
}

Expand Down Expand Up @@ -2596,6 +2603,13 @@ sub setup_logic_do_transient_crops {
$log->fatal_error($cannot_be_true);
}

my $dopft = "do_transient_pfts";
# Make sure the value agrees with the do_transient_pft flag
if ( ( &value_is_true($nl->get_value($var))) && (! &value_is_true($nl->get_value($dopft))) ||
(! &value_is_true($nl->get_value($var))) && ( &value_is_true($nl->get_value($dopft))) ) {
$log->fatal_error("$var and $dopft do NOT agree and need to");
}

}
}

Expand Down Expand Up @@ -3063,9 +3077,12 @@ sub setup_logic_fertilizer {
my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_;

if ( $physv->as_long() >= $physv->as_long("clm4_5") ) {
$nl_flags->{'use_crop'} = $nl->get_value('use_crop');
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_fertilizer',
'use_crop'=>$nl_flags->{'use_crop'} );
my $use_fert = $nl->get_value('use_fertilizer');
if ( (! &value_is_true($nl_flags->{'use_crop'})) && &value_is_true($use_fert) ) {
$log->fatal_error("use_ferilizer can NOT be on without prognostic crop\n" );
}
}
}

Expand All @@ -3078,9 +3095,11 @@ sub setup_logic_grainproduct {
my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_;

if ( $physv->as_long() >= $physv->as_long("clm4_5") ) {
$nl_flags->{'use_crop'} = $nl->get_value('use_crop');
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_grainproduct',
'use_crop'=>$nl_flags->{'use_crop'}, 'phys'=>$physv->as_string() );
if ( (! &value_is_true($nl_flags->{'use_crop'})) && &value_is_true($nl->get_value('use_grainproduct') ) ) {
$log->fatal_error("use_grainproduct can NOT be on without prognostic crop\n" );
}
}
}

Expand Down
56 changes: 56 additions & 0 deletions bld/namelist_files/createMkSrfEntry.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#!/usr/bin/env python

import os, sys

class mksrfDataEntry_prog:

# Class data
year_start = 2016
year_end = 2100
ssp_rcp = "SSP5-8.5"
subdir = "pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005"
cdate = 171005
desc = "SSP5RCP85_clm5"

def parse_cmdline_args( self ):
"Parse the command line arguments for create data entry list"
from optparse import OptionParser, OptionGroup

parser = OptionParser( usage="%prog [options]" )
options = OptionGroup( parser, "Options" )
options.add_option( "-s", "--year_start", dest="year_start", default=self.year_start, \
help="Start year" )
options.add_option( "-f", "--year_end", dest="year_end", default=self.year_end, \
help="End year" )
options.add_option( "-d", "--subdir", dest="subdir", default=self.subdir, \
help="Subdirectory" )
options.add_option( "--cdate", dest="cdate", default=self.cdate, \
help="Creation date" )
options.add_option( "--desc", dest="desc", default=self.desc, \
help="Description string" )
parser.add_option_group(options)
(options, args) = parser.parse_args()
if len(args) != 0:
parser.error("incorrect number of arguments")

self.year_start = options.year_start
self.year_end = options.year_end
self.subdir = options.subdir
self.cdate = options.cdate
self.desc = options.desc

def printentry( self, year ):
"Print a single entry"
print '<mksrf_fvegtyp hgrid="0.25x0.25" ssp_rcp="%s" sim_year="%d" crop="on"' % (self.ssp_rcp, year)
print '>lnd/clm2/rawdata/%s/mksrf_landuse_%s_%s.c%s.nc' % (self.subdir, self.desc, year, self.cdate)
print '</mksrf_fvegtyp>\n'

entry = mksrfDataEntry_prog()
entry.parse_cmdline_args()

for year in range(entry.year_start, entry.year_end+1):
entry.printentry( year )




Loading

0 comments on commit 9f90b80

Please sign in to comment.