From 89dd9db073178f2a7bb1bead291dafcc1ffdfc1a Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Mon, 1 Oct 2018 16:02:10 -0600 Subject: [PATCH 01/54] fix cime issue 2822 and pylint chk --- cime_config/buildlib | 2 +- cime_config/buildnml | 30 ++++++++++++++---------------- 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/cime_config/buildlib b/cime_config/buildlib index 6b86bb0b65..6c7914be86 100755 --- a/cime_config/buildlib +++ b/cime_config/buildlib @@ -3,7 +3,7 @@ """ build clm library """ -import sys, os, time, filecmp, shutil, imp +import sys, os, shutil, imp _CIMEROOT = os.environ.get("CIMEROOT") if _CIMEROOT is None: diff --git a/cime_config/buildnml b/cime_config/buildnml index 73855da4dd..3f5d9d3655 100755 --- a/cime_config/buildnml +++ b/cime_config/buildnml @@ -3,7 +3,7 @@ """ CLM namelist creator """ -import sys, os, time, shutil, re, imp, filecmp +import sys, os, shutil, imp, filecmp _CIMEROOT = os.environ.get("CIMEROOT") if _CIMEROOT is None: @@ -46,7 +46,6 @@ def buildnml(case, caseroot, compname): clm_force_coldstart = case.get_value("CLM_FORCE_COLDSTART") lnd_tuning_mode = case.get_value("LND_TUNING_MODE") clm_accelerated_spinup = case.get_value("CLM_ACCELERATED_SPINUP") - comp_glc = case.get_value("COMP_GLC") comp_atm = case.get_value("COMP_ATM") lnd_grid = case.get_value("LND_GRID") lnd_ncpl = case.get_value("LND_NCPL") @@ -62,14 +61,6 @@ def buildnml(case, caseroot, compname): glc_nec = case.get_value("GLC_NEC") mask = case.get_value("MASK_GRID") - # ----------------------------------------------------- - # Clear out old data - # ----------------------------------------------------- - - input_data_list = os.path.join(caseroot,"Buildconf","clm.input_data_list") - if os.path.exists(input_data_list): - os.remove(input_data_list) - # ----------------------------------------------------- # Set clmconf # ----------------------------------------------------- @@ -133,10 +124,10 @@ def buildnml(case, caseroot, compname): if run_type == "branch": startfile_type = "nrevsn" if clm_force_coldstart == "on": - clm_force_coldstart = "off" - logger.warning( "WARNING: You've turned on CLM_FORCE_COLDSTART for a branch run_type, which is a contradiction, the coldstart will be ignored\n" + - " turn off CLM_FORCE_COLDSTART, or set RUN_TYPE=hybrid to get rid of this warning" - ) + clm_force_coldstart = "off" + logger.warning( "WARNING: You've turned on CLM_FORCE_COLDSTART for a branch run_type, which is a contradiction, the coldstart will be ignored\n" + + " turn off CLM_FORCE_COLDSTART, or set RUN_TYPE=hybrid to get rid of this warning") + if (clm_force_coldstart == "on"): logger.warning( "WARNING: CLM is starting up from a cold state" ) @@ -168,9 +159,9 @@ def buildnml(case, caseroot, compname): usecase = "" if ( (mask != "null") and (mask != "UNSET") ): - gridmask = "-mask %s" %mask + gridmask = "-mask %s" %mask else: - gridmask = "" + gridmask = "" start_ymd = run_startdate.replace('-','') @@ -191,6 +182,13 @@ def buildnml(case, caseroot, compname): config_cache_file = os.path.join(caseroot,"Buildconf","clmconf","config_cache.xml") + # ----------------------------------------------------- + # Clear out old data + # ----------------------------------------------------- + + if os.path.exists(inputdata_file): + os.remove(inputdata_file) + # ----------------------------------------------------- # loop over instances # ----------------------------------------------------- From 8931885f05a7539ff5a4f32d905bd6d3f4f7e34d Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 18 Oct 2018 16:40:07 -0600 Subject: [PATCH 02/54] Temporary fix to allow transient %cft in transient pft runs Fix associated with issue #538. Minor code mods that allow %cft to advance beyond 1850 in transient pft simulations. --- src/dyn_subgrid/dynSubgridControlMod.F90 | 10 +++++----- src/dyn_subgrid/dyncropFileMod.F90 | 5 ++++- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/dyn_subgrid/dynSubgridControlMod.F90 b/src/dyn_subgrid/dynSubgridControlMod.F90 index 58e3a40359..665f98277c 100644 --- a/src/dyn_subgrid/dynSubgridControlMod.F90 +++ b/src/dyn_subgrid/dynSubgridControlMod.F90 @@ -165,7 +165,7 @@ subroutine read_namelist( NLFilename ) dyn_subgrid_control_inst = dyn_subgrid_control_type( & flanduse_timeseries = flanduse_timeseries, & do_transient_pfts = do_transient_pfts, & - do_transient_crops = do_transient_crops, & + do_transient_crops = do_transient_pfts, & do_harvest = do_harvest, & for_testing_allow_non_annual_changes = for_testing_allow_non_annual_changes, & for_testing_zero_dynbal_fluxes = for_testing_zero_dynbal_fluxes) @@ -225,10 +225,10 @@ subroutine check_namelist_consistency end if if (dyn_subgrid_control_inst%do_transient_crops) then - if (.not. use_crop) then - write(iulog,*) 'ERROR: do_transient_crops can only be true if use_crop is true' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if +! if (.not. use_crop) then +! write(iulog,*) 'ERROR: do_transient_crops can only be true if use_crop is true' +! call endrun(msg=errMsg(sourcefile, __LINE__)) +! end if if (use_fates) then ! NOTE(wjs, 2017-01-13) ED / FATES does not currently have a mechanism for ! changing its column areas, with the consequent changes in aboveground biomass diff --git a/src/dyn_subgrid/dyncropFileMod.F90 b/src/dyn_subgrid/dyncropFileMod.F90 index 9921ab5954..931839c295 100644 --- a/src/dyn_subgrid/dyncropFileMod.F90 +++ b/src/dyn_subgrid/dyncropFileMod.F90 @@ -125,6 +125,7 @@ subroutine dyncrop_interp(bounds,crop_inst) use CropType , only : crop_type use landunit_varcon , only : istcrop use clm_varpar , only : cft_lb, cft_ub + use clm_varctl , only : use_crop use surfrdUtilsMod , only : collapse_crop_types use subgridWeightsMod , only : set_landunit_weight ! @@ -164,7 +165,9 @@ subroutine dyncrop_interp(bounds,crop_inst) allocate(fertcft_cur(bounds%begg:bounds%endg, cft_lb:cft_ub)) call fertcft%get_current_data(fertcft_cur) - call collapse_crop_types(wtcft_cur, fertcft_cur, bounds%begg, bounds%endg, verbose = .false.) + if (use_crop) then + call collapse_crop_types(wtcft_cur, fertcft_cur, bounds%begg, bounds%endg, verbose = .false.) + end if allocate(col_set(bounds%begc:bounds%endc)) col_set(:) = .false. From 7c0560d09edff3d665b0b1ad54c860dd91a7d0ec Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 18 Oct 2018 22:20:44 -0600 Subject: [PATCH 03/54] One more change to get baseline working for all cases --- src/dyn_subgrid/dyncropFileMod.F90 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/dyn_subgrid/dyncropFileMod.F90 b/src/dyn_subgrid/dyncropFileMod.F90 index 931839c295..6c75bffe66 100644 --- a/src/dyn_subgrid/dyncropFileMod.F90 +++ b/src/dyn_subgrid/dyncropFileMod.F90 @@ -190,7 +190,9 @@ subroutine dyncrop_interp(bounds,crop_inst) end if col%wtlunit(c) = wtcft_cur(g,m) - crop_inst%fertnitro_patch(p) = fertcft_cur(g,m) + if (use_crop) then + crop_inst%fertnitro_patch(p) = fertcft_cur(g,m) + end if col_set(c) = .true. end if end do From 64cd188a95dcde9b093efff0a18d3e5f1788accc Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Sat, 20 Oct 2018 21:51:46 -0600 Subject: [PATCH 04/54] Changes to CLMBuildNamelist.pm for more robust fix Changing the default logic in CLMBuildNamelist.pm instead of hardwiring do_transient_crops to always equal do_transient_pfts in the code. This fix as is may be incomplete. It allows do_transient_crops = .true. when use_crop = .false. but it does not make sure do_transient_crops = do _transient_pfts. --- bld/CLMBuildNamelist.pm | 3 --- src/dyn_subgrid/dynSubgridControlMod.F90 | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index 71a2eb79f6..c1ce751c13 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -2571,9 +2571,6 @@ sub setup_logic_do_transient_crops { if (string_is_undef_or_empty($nl->get_value('flanduse_timeseries'))) { $cannot_be_true = "$var can only be set to true when running a transient case (flanduse_timeseries non-blank)"; } - elsif (!&value_is_true($nl->get_value('use_crop'))) { - $cannot_be_true = "$var can only be set to true when running with use_crop = true"; - } elsif (&value_is_true($nl->get_value('use_fates'))) { # In principle, use_fates should be compatible with # do_transient_crops. However, this hasn't been tested, so to be safe, diff --git a/src/dyn_subgrid/dynSubgridControlMod.F90 b/src/dyn_subgrid/dynSubgridControlMod.F90 index 665f98277c..9c9fabdac8 100644 --- a/src/dyn_subgrid/dynSubgridControlMod.F90 +++ b/src/dyn_subgrid/dynSubgridControlMod.F90 @@ -165,7 +165,7 @@ subroutine read_namelist( NLFilename ) dyn_subgrid_control_inst = dyn_subgrid_control_type( & flanduse_timeseries = flanduse_timeseries, & do_transient_pfts = do_transient_pfts, & - do_transient_crops = do_transient_pfts, & + do_transient_crops = do_transient_crops, & do_harvest = do_harvest, & for_testing_allow_non_annual_changes = for_testing_allow_non_annual_changes, & for_testing_zero_dynbal_fluxes = for_testing_zero_dynbal_fluxes) From 9adcdd79aff1bcb6ac968e7d3b0231b51a17df8b Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 24 Oct 2018 13:38:15 -0600 Subject: [PATCH 05/54] Add more checking to build-namelist and tester for it, fertilizer, do_transient consistency, grainproduct, and create_crop_landunit --- bld/CLMBuildNamelist.pm | 25 +++++++++++++-- .../namelist_definition_clm4_5.xml | 1 - bld/unit_testers/build-namelist_test.pl | 31 ++++++++++++++++--- 3 files changed, 48 insertions(+), 9 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index c1ce751c13..4d33fe14e1 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -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." + } } } @@ -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" ); + } } } @@ -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"); + } + } } @@ -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" ); + } } } @@ -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" ); + } } } diff --git a/bld/namelist_files/namelist_definition_clm4_5.xml b/bld/namelist_files/namelist_definition_clm4_5.xml index 88e5b6ab01..ff6850c928 100644 --- a/bld/namelist_files/namelist_definition_clm4_5.xml +++ b/bld/namelist_files/namelist_definition_clm4_5.xml @@ -2225,7 +2225,6 @@ If TRUE, apply transient natural PFTs from flanduse_timeseries file. group="dynamic_subgrid" valid_values="" > If TRUE, apply transient crops from flanduse_timeseries file. (Only valid for transient runs, where there is a flanduse_timeseries file.) -(Also, only valid for use_crop = true.) "FALSE", conopts=>"-phys clm4_5", }, - "baset_map without crop" =>{ options=>"-bgc bgc -envxml_dir .", + "baset_map without crop" =>{ options=>"-bgc bgc -envxml_dir . -no-crop", namelst=>"baset_mapping='constant'", GLC_TWO_WAY_COUPLING=>"FALSE", conopts=>"-phys clm5_0", }, - "mapvary var w/o varymap" =>{ options=>"-crop -bgc bgc -envxml_dir .", + "mapvary var w/o varymap" =>{ options=>"-crop -bgc bgc -envxml_dir . -crop", namelst=>"baset_mapping='constant', baset_latvary_slope=1.0, baset_latvary_intercept=10.0", GLC_TWO_WAY_COUPLING=>"FALSE", conopts=>"-phys clm5_0", @@ -442,8 +442,14 @@ sub make_env_run { GLC_TWO_WAY_COUPLING=>"FALSE", conopts=>"-phys clm4_0 -bgc cn -crop on", }, - "-irrigate=T without -crop" =>{ options=>"-bgc cn -irrig .true. -envxml_dir .", - namelst=>"irrigate=.true.", + # This one should fail now, because we don't have non irrigated non-crop datasets + "-irrigate=F without -crop" =>{ options=>"-bgc cn -no-crop -envxml_dir .", + namelst=>"irrigate=.false.", + GLC_TWO_WAY_COUPLING=>"FALSE", + conopts=>"-phys clm4_5", + }, + "grainproductWOcrop" =>{ options=>"-bgc cn -no-crop -envxml_dir .", + namelst=>"use_grainproduct=.true.", GLC_TWO_WAY_COUPLING=>"FALSE", conopts=>"-phys clm4_5", }, @@ -777,6 +783,11 @@ sub make_env_run { GLC_TWO_WAY_COUPLING=>"FALSE", conopts=>"-phys clm5_0", }, + "createcropFalse" =>{ options=>"-bgc bgc -envxml_dir . -no-megan", + namelst=>"create_crop_landunit=.false.", + GLC_TWO_WAY_COUPLING=>"FALSE", + conopts=>"-phys clm5_0", + }, "useFATESWTransient" =>{ options=>"-bgc fates -use_case 20thC_transient -envxml_dir . -no-megan -res 10x15", namelst=>"", GLC_TWO_WAY_COUPLING=>"FALSE", @@ -837,6 +848,16 @@ sub make_env_run { GLC_TWO_WAY_COUPLING=>"FALSE", conopts=>"-phys clm5_0", }, + "spdotransconflict" =>{ options=>"-envxml_dir . -bgc sp -use_case 20thC_transient", + namelst=>"do_transient_pfts=T,do_transient_crops=.false.", + GLC_TWO_WAY_COUPLING=>"FALSE", + conopts=>"-phys clm5_0", + }, + "nocropwfert" =>{ options=>"-envxml_dir . -bgc sp -no-crop", + namelst=>"use_fertilizer=T", + GLC_TWO_WAY_COUPLING=>"FALSE", + conopts=>"-phys clm5_0", + }, "lmr1WOcn" =>{ options=>"-envxml_dir . -bgc sp", namelst=>"leafresp_method=1", GLC_TWO_WAY_COUPLING=>"FALSE", From c065cc2fa3a5212d5aa2d68c1c969f63f9b019d0 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 24 Oct 2018 13:53:19 -0600 Subject: [PATCH 06/54] Properly remove commented out code, and replace a tab character --- src/dyn_subgrid/dynSubgridControlMod.F90 | 4 ---- src/dyn_subgrid/dyncropFileMod.F90 | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/dyn_subgrid/dynSubgridControlMod.F90 b/src/dyn_subgrid/dynSubgridControlMod.F90 index 9c9fabdac8..9d07a55212 100644 --- a/src/dyn_subgrid/dynSubgridControlMod.F90 +++ b/src/dyn_subgrid/dynSubgridControlMod.F90 @@ -225,10 +225,6 @@ subroutine check_namelist_consistency end if if (dyn_subgrid_control_inst%do_transient_crops) then -! if (.not. use_crop) then -! write(iulog,*) 'ERROR: do_transient_crops can only be true if use_crop is true' -! call endrun(msg=errMsg(sourcefile, __LINE__)) -! end if if (use_fates) then ! NOTE(wjs, 2017-01-13) ED / FATES does not currently have a mechanism for ! changing its column areas, with the consequent changes in aboveground biomass diff --git a/src/dyn_subgrid/dyncropFileMod.F90 b/src/dyn_subgrid/dyncropFileMod.F90 index 6c75bffe66..a465a26fe7 100644 --- a/src/dyn_subgrid/dyncropFileMod.F90 +++ b/src/dyn_subgrid/dyncropFileMod.F90 @@ -191,7 +191,7 @@ subroutine dyncrop_interp(bounds,crop_inst) col%wtlunit(c) = wtcft_cur(g,m) if (use_crop) then - crop_inst%fertnitro_patch(p) = fertcft_cur(g,m) + crop_inst%fertnitro_patch(p) = fertcft_cur(g,m) end if col_set(c) = .true. end if From cdf9770c19cfbd4295446d6902a5e229e40d6c1a Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 25 Oct 2018 01:13:09 -0600 Subject: [PATCH 07/54] Start adding ssp-rcp option --- bld/namelist_files/createMkSrfEntry.py | 55 +++++++++++++++++++ .../namelist_definition_clm4_5.xml | 8 +++ tools/mksurfdata_map/mksurfdata.pl | 53 +++++++++--------- 3 files changed, 88 insertions(+), 28 deletions(-) create mode 100755 bld/namelist_files/createMkSrfEntry.py diff --git a/bld/namelist_files/createMkSrfEntry.py b/bld/namelist_files/createMkSrfEntry.py new file mode 100755 index 0000000000..b2e77f12ae --- /dev/null +++ b/bld/namelist_files/createMkSrfEntry.py @@ -0,0 +1,55 @@ +#!/usr/bin/env python + +import os, sys + +class mksrfDataEntry_prog: + + # Class data + year_start = 2016 + year_end = 2100 + 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 'lnd/clm2/rawdata/%s/mksrf_landuse_%s_%s.c%s.nc' % (self.subdir, self.desc, year, self.cdate) + print '\n' + +entry = mksrfDataEntry_prog() +entry.parse_cmdline_args() + +for year in range(entry.year_start, entry.year_end+1): + entry.printentry( year ) + + + + diff --git a/bld/namelist_files/namelist_definition_clm4_5.xml b/bld/namelist_files/namelist_definition_clm4_5.xml index 88e5b6ab01..12a45d3600 100644 --- a/bld/namelist_files/namelist_definition_clm4_5.xml +++ b/bld/namelist_files/namelist_definition_clm4_5.xml @@ -1771,6 +1771,14 @@ Representative concentration pathway for future scenarios [radiative forcing at -999.9 means do NOT use a future scenario, just use historical data. + +Shared Socioeconomic Pathway and Representative Concentration Pathway combination for future scenarios +The form is SSPn-m.m Where n is the SSP number and m.m is RCP radiative forcing at peak or 2100 in W/m^2 +hist means do NOT use a future scenario, just use historical data. + + diff --git a/tools/mksurfdata_map/mksurfdata.pl b/tools/mksurfdata_map/mksurfdata.pl index 7a2955421f..1f0c005860 100755 --- a/tools/mksurfdata_map/mksurfdata.pl +++ b/tools/mksurfdata_map/mksurfdata.pl @@ -51,7 +51,7 @@ my %opts = ( hgrid=>"all", - rcp=>"-999.9", + ssp_rcp=>"hist", debug=>0, exedir=>undef, allownofile=>undef, @@ -91,7 +91,7 @@ sub usage { For supported resolutions: $ProgName -res [OPTIONS] - -res [or -r] is the supported resolution(s) to use for files (by default $opts{'hgrid'} ). + -res [or -r] "resolution" is the supported resolution(s) to use for files (by default $opts{'hgrid'} ). For unsupported, user-specified resolutions: @@ -131,16 +131,20 @@ sub usage { -no-crop Create datasets without the extensive list of prognostic crop types -no_surfdata Do not output a surface dataset This is useful if you only want a landuse_timeseries file - -years [or -y] Simulation year(s) to run over (by default $opts{'years'}) + -years [or -y] "years" Simulation year(s) to run over (by default $opts{'years'}) (can also be a simulation year range: i.e. 1850-2000) -help [or -h] Display this help. -rundir "directory" Directory to run in (by default current directory $opts{'rundir'}) + + -ssp-rcp "scenario-name" Shared Socioeconomic Pathway and Representative Concentration Pathway Scenario name(s). + "hist" for historical, otherwise in form of SSPn-m.m where n is the SSP number + and m.m is the radiative forcing in W/m^2 at the peak or 2100. -usrname "clm_usrdat_name" CLM user data name to find grid file with. - NOTE: years, res, and rcp can be comma delimited lists. + NOTE: years, res, and ssp_rcp can be comma delimited lists. OPTIONS to override the mapping of the input gridded data with hardcoded input @@ -251,7 +255,7 @@ ($) } sub write_transient_timeseries_file { - my ($transient, $desc, $sim_yr0, $sim_yrn, $queryfilopts, $resol, $resolhrv, $rcp, $mkcrop, $sim_yr_surfdat) = @_; + my ($transient, $desc, $sim_yr0, $sim_yrn, $queryfilopts, $resol, $resolhrv, $ssp_rcp, $mkcrop, $sim_yr_surfdat) = @_; my $strlen = 195; my $dynpft_format = "%-${strlen}.${strlen}s %4.4d\n"; @@ -263,10 +267,10 @@ sub write_transient_timeseries_file { $fh_landuse_timeseries->open( ">$landuse_timeseries_text_file" ) or die "** can't open file: $landuse_timeseries_text_file\n"; print "Writing out landuse_timeseries text file: $landuse_timeseries_text_file\n"; for( my $yr = $sim_yr0; $yr <= $sim_yrn; $yr++ ) { - my $vegtypyr = `$scrdir/../../bld/queryDefaultNamelist.pl $queryfilopts $resol -options sim_year=$yr,rcp=${rcp}${mkcrop} -var mksrf_fvegtyp -namelist clmexp`; + my $vegtypyr = `$scrdir/../../bld/queryDefaultNamelist.pl $queryfilopts $resol -options sim_year=$yr,ssp-rcp=${ssp_rcp}${mkcrop} -var mksrf_fvegtyp -namelist clmexp`; chomp( $vegtypyr ); printf $fh_landuse_timeseries $dynpft_format, $vegtypyr, $yr; - my $hrvtypyr = `$scrdir/../../bld/queryDefaultNamelist.pl $queryfilopts $resolhrv -options sim_year=$yr,rcp=${rcp}${mkcrop} -var mksrf_fvegtyp -namelist clmexp`; + my $hrvtypyr = `$scrdir/../../bld/queryDefaultNamelist.pl $queryfilopts $resolhrv -options sim_year=$yr,ssp-rcp=${ssp_rcp}${mkcrop} -var mksrf_fvegtyp -namelist clmexp`; chomp( $hrvtypyr ); printf $fh_landuse_timeseries $dynpft_format, $hrvtypyr, $yr; if ( $yr % 100 == 0 ) { @@ -521,17 +525,15 @@ sub write_namelist_file { } } # - # Set rcp to use + # Set ssp-rcp to use # - my @rcpaths = split( ",", $opts{'rcp'} ); - # Check that rcp is valid - foreach my $rcp ( @rcpaths ) { - if ( ! $definition->is_valid_value( "rcp", $rcp ) ) { - if ( ! $definition->is_valid_value( "rcp", "$rcp" ) ) { - print "** Invalid rcp: $rcp\n"; - usage(); - } - } + my @rcpaths = split( ",", $opts{'ssp_rcp'} ); + # Check that ssp-rcp is valid + foreach my $ssp_rcp ( @rcpaths ) { + if ( ! $definition->is_valid_value( "ssp-rcp", $ssp_rcp ) ) { + print "** Invalid ssp_rcp: $ssp_rcp\n"; + usage(); + } } # CMIP series input data is corresponding to @@ -686,7 +688,7 @@ sub write_namelist_file { # # Loop over each sim_year # - RCP: foreach my $rcp ( @rcpaths ) { + RCP: foreach my $ssp_rcp ( @rcpaths ) { # # Loop over each sim_year # @@ -740,13 +742,8 @@ sub write_namelist_file { if ( $mkcrop ne "" ) { $options = "-options $mkcrop"; } - if ( $rcp != -999.9 ) { - $desc = sprintf( "%s%2.1f_%s_%ssimyr%4.4d-%4.4d", "rcp", $rcp, $crpdes, $cmip_series, $sim_yr0, $sim_yrn ); - $desc_surfdat = sprintf( "%s%2.1f_%s_%ssimyr%4.4d", "rcp", $rcp, $crpdes, $cmip_series, $sim_yr_surfdat ); - } else { - $desc = sprintf( "hist_%s_%s_simyr%4.4d-%4.4d", $crpdes, $cmip_series, $sim_yr0, $sim_yrn ); - $desc_surfdat = sprintf( "%s_%s_simyr%4.4d", $crpdes, $cmip_series, $sim_yr_surfdat ); - } + $desc = sprintf( "%s_%s_%ssimyr%4.4d-%4.4d", $ssp_rcp, $crpdes, $cmip_series, $sim_yr0, $sim_yrn ); + $desc_surfdat = sprintf( "%s_%s_%ssimyr%4.4d", $ssp_rcp, $crpdes, $cmip_series, $sim_yr_surfdat ); my $fsurdat_fname_base = ""; my $fsurdat_fname = ""; @@ -779,11 +776,11 @@ sub write_namelist_file { my ($landuse_timeseries_text_file) = write_transient_timeseries_file( $transient, $desc, $sim_yr0, $sim_yrn, - $queryfilopts, $resol, $resolhrv, $rcp, $mkcrop, + $queryfilopts, $resol, $resolhrv, $ssp_rcp, $mkcrop, $sim_yr_surfdat); print "CSMDATA is $CSMDATA \n"; - print "resolution: $res rcp=$rcp sim_year = $sim_year\n"; + print "resolution: $res ssp-rcp=$ssp_rcp sim_year = $sim_year\n"; print "namelist: $namelist_fname\n"; write_namelist_file( @@ -827,7 +824,7 @@ sub write_namelist_file { } } # End of sim_year loop - } # End of rcp loop + } # End of ssp_rcp loop } close( $cfh ); print "Successfully created fsurdat files\n"; From 9ccbde734879a4d9e564b9067b69766b91be87bb Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 25 Oct 2018 01:40:12 -0600 Subject: [PATCH 08/54] Add in ssp_rcp and SSP5-8.5 filenames, and get mksurfdata.pl to work with it --- bld/namelist_files/createMkSrfEntry.py | 3 +- .../namelist_defaults_clm4_5_tools.xml | 341 ++++++++++++++++++ tools/mksurfdata_map/mksurfdata.pl | 3 +- 3 files changed, 345 insertions(+), 2 deletions(-) diff --git a/bld/namelist_files/createMkSrfEntry.py b/bld/namelist_files/createMkSrfEntry.py index b2e77f12ae..ee1175c9b1 100755 --- a/bld/namelist_files/createMkSrfEntry.py +++ b/bld/namelist_files/createMkSrfEntry.py @@ -7,6 +7,7 @@ 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" @@ -40,7 +41,7 @@ def parse_cmdline_args( self ): def printentry( self, year ): "Print a single entry" - print 'lnd/clm2/rawdata/%s/mksrf_landuse_%s_%s.c%s.nc' % (self.subdir, self.desc, year, self.cdate) print '\n' diff --git a/bld/namelist_files/namelist_defaults_clm4_5_tools.xml b/bld/namelist_files/namelist_defaults_clm4_5_tools.xml index 579a83f3c0..0683f52b88 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5_tools.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5_tools.xml @@ -623,6 +623,347 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_2015.c170629.nc +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2016.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2017.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2018.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2019.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2020.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2021.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2022.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2023.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2024.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2025.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2026.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2027.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2028.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2029.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2030.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2031.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2032.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2033.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2034.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2035.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2036.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2037.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2038.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2039.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2040.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2041.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2042.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2043.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2044.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2045.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2046.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2047.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2048.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2049.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2050.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2051.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2052.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2053.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2054.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2055.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2056.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2057.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2058.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2059.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2060.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2061.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2062.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2063.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2064.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2065.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2066.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2067.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2068.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2069.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2070.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2071.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2072.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2073.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2074.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2075.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2076.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2077.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2078.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2079.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2080.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2081.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2082.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2083.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2084.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2085.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2086.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2087.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2088.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2089.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2090.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2091.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2092.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2093.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2094.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2095.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2096.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2097.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2098.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2099.c171005.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2100.c171005.nc + + + atm/waccm/lb/LBC_17500116-20150116_CMIP6_0p5degLat_c180905.nc /gpfs/fs1/p/acom/acom-climate/cesm2/inputdata/atm/waccm/lb/LBC_1750-2015_CMIP6_GlobAnnAvg_c180905.nc diff --git a/tools/mksurfdata_map/mksurfdata.pl b/tools/mksurfdata_map/mksurfdata.pl index 1f0c005860..586b9a3dae 100755 --- a/tools/mksurfdata_map/mksurfdata.pl +++ b/tools/mksurfdata_map/mksurfdata.pl @@ -138,7 +138,7 @@ sub usage { -rundir "directory" Directory to run in (by default current directory $opts{'rundir'}) - -ssp-rcp "scenario-name" Shared Socioeconomic Pathway and Representative Concentration Pathway Scenario name(s). + -ssp_rcp "scenario-name" Shared Socioeconomic Pathway and Representative Concentration Pathway Scenario name(s). "hist" for historical, otherwise in form of SSPn-m.m where n is the SSP number and m.m is the radiative forcing in W/m^2 at the peak or 2100. @@ -449,6 +449,7 @@ sub write_namelist_file { "no_surfdata" => \$opts{'no_surfdata'}, "pft_frc=s" => \$opts{'pft_frc'}, "pft_idx=s" => \$opts{'pft_idx'}, + "ssp_rcp=s" => \$opts{'ssp_rcp'}, "rundir=s" => \$opts{'rundir'}, "soil_col=i" => \$opts{'soil_col'}, "soil_fmx=f" => \$opts{'soil_fmx'}, From 49b07b33a88701b516cc04e463a4470555c69358 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 25 Oct 2018 14:53:00 -0600 Subject: [PATCH 09/54] Add an underscore to make the name clearer --- tools/mksurfdata_map/mksurfdata.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/mksurfdata_map/mksurfdata.pl b/tools/mksurfdata_map/mksurfdata.pl index 586b9a3dae..f0589d8437 100755 --- a/tools/mksurfdata_map/mksurfdata.pl +++ b/tools/mksurfdata_map/mksurfdata.pl @@ -743,8 +743,8 @@ sub write_namelist_file { if ( $mkcrop ne "" ) { $options = "-options $mkcrop"; } - $desc = sprintf( "%s_%s_%ssimyr%4.4d-%4.4d", $ssp_rcp, $crpdes, $cmip_series, $sim_yr0, $sim_yrn ); - $desc_surfdat = sprintf( "%s_%s_%ssimyr%4.4d", $ssp_rcp, $crpdes, $cmip_series, $sim_yr_surfdat ); + $desc = sprintf( "%s_%s_%s_simyr%4.4d-%4.4d", $ssp_rcp, $crpdes, $cmip_series, $sim_yr0, $sim_yrn ); + $desc_surfdat = sprintf( "%s_%s_%s_simyr%4.4d", $ssp_rcp, $crpdes, $cmip_series, $sim_yr_surfdat ); my $fsurdat_fname_base = ""; my $fsurdat_fname = ""; From 46194ffc6550d4f402225fe99ebbd472170419c3 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 25 Oct 2018 15:23:49 -0600 Subject: [PATCH 10/54] Add a new tool test for mksurfdata.pl at SSP5-8.5 --- test/tools/README.testnames | 10 ++++++++-- test/tools/input_tests_master | 2 ++ .../nl_files/mksrfdt_1x1_numaIA_crp_SSP5-8.5_1850-2100 | 1 + test/tools/tests_posttag_nompi_regression | 1 + test/tools/tests_pretag_cheyenne_nompi | 1 + 5 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 test/tools/nl_files/mksrfdt_1x1_numaIA_crp_SSP5-8.5_1850-2100 diff --git a/test/tools/README.testnames b/test/tools/README.testnames index b6c18d406b..5cb5de027a 100644 --- a/test/tools/README.testnames +++ b/test/tools/README.testnames @@ -42,14 +42,20 @@ m is the resolution c -- US-UMB with cycling on forcing and transient use-case g -- US-UMB with global forcing and grid PFT and soil y -- 1.9x2.5 with transient 1850-2100 for rcp=2.6 and glacier-MEC on +T -- 1x1_numaIA Z -- 10x15 with crop on @ -- ne120np4 # -- ne30np4 i is the specific test (usually this implies...) +1 -- Serial script +2 -- Serial 3 -- OpenMP only -4 -- serial -7 -- OpenMP only second test (without DEBUG compiler mode on) +4 -- serial, DEBUG +7 -- OpenMP only second test, DEBUG +8 -- OpenMP only third test, DEBUG +9 -- Serial Script +0 -- Serial Script diff --git a/test/tools/input_tests_master b/test/tools/input_tests_master index 84b98883eb..90b8aa293a 100644 --- a/test/tools/input_tests_master +++ b/test/tools/input_tests_master @@ -29,6 +29,8 @@ smi78 TSMscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_brazil_1850^to bli78 TBLscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_brazil_1850^tools__ds smiT4 TSMscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_numaIA_mp24_2000^tools__ds bliT4 TBLscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_numaIA_mp24_2000^tools__ds +smiT2 TSMscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_numaIA_crp_SSP5-8.5_1850-2100^tools__s +bliT2 TBLscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_numaIA_crp_SSP5-8.5_1850-2100^tools__s smi#2 TSMscript_tools.sh mkmapdata mkmapdata.sh mkmapdata_ne30np4 bli#2 TBLscript_tools.sh mkmapdata mkmapdata.sh mkmapdata_ne30np4 diff --git a/test/tools/nl_files/mksrfdt_1x1_numaIA_crp_SSP5-8.5_1850-2100 b/test/tools/nl_files/mksrfdt_1x1_numaIA_crp_SSP5-8.5_1850-2100 new file mode 100644 index 0000000000..ed83434075 --- /dev/null +++ b/test/tools/nl_files/mksrfdt_1x1_numaIA_crp_SSP5-8.5_1850-2100 @@ -0,0 +1 @@ +-l CSMDATA -r 1x1_numaIA -y 1850-2100 -ssp_rcp SSP5-8.5 -exedir EXEDIR diff --git a/test/tools/tests_posttag_nompi_regression b/test/tools/tests_posttag_nompi_regression index f1ebea192d..8b4f9889c4 100644 --- a/test/tools/tests_posttag_nompi_regression +++ b/test/tools/tests_posttag_nompi_regression @@ -10,6 +10,7 @@ smi58 bli58 smi74 bli74 smi78 bli78 smiT4 bliT4 +smiT2 bliT2 smf84 blf84 smfc4 blfc4 smfg4 blfg4 diff --git a/test/tools/tests_pretag_cheyenne_nompi b/test/tools/tests_pretag_cheyenne_nompi index 1795119813..c3a2325cea 100644 --- a/test/tools/tests_pretag_cheyenne_nompi +++ b/test/tools/tests_pretag_cheyenne_nompi @@ -10,6 +10,7 @@ smi58 bli58 smiS4 bliS4 smi74 bli74 smiT4 bliT4 +smiT2 bliT2 smf84 blf84 smfc4 blfc4 smfg4 blfg4 From b5d0521adc95fa2d23be097254725e1638b33253 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 25 Oct 2018 16:25:48 -0600 Subject: [PATCH 11/54] Update changelog for new tag --- doc/ChangeLog | 121 ++++++++++++++++++++++++++++++++++++++++++++++++++ doc/ChangeSum | 1 + 2 files changed, 122 insertions(+) diff --git a/doc/ChangeLog b/doc/ChangeLog index e13372d045..f0bb69bd60 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,4 +1,125 @@ =============================================================== +Tag name: ctsm1.0.dev013 +Originator(s): erik (Erik Kluzek)/slevisconsulting +Date: Thu Oct 25 16:25:26 MDT 2018 +One-line Summary: Fix the fact that transient Bgc and SP cases had constant crop area in time + +Purpose of changes +------------------ + +Fix transient non-crop cases that had constant crop area so that crop area will change in time +(and hence natural veg area will also change corresponding to it). + +Also bring in changes to update mksurfdata_map to handle SSP-RCP future scenarios. Right now +it can handle SSP5-8.5 out of the box. Also add a new test for that. + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): #538 + #538 -- In transient pft simulations with use_crop=.false., %crop does not advance from 1850 values + +Known bugs found since the previous tag (include github issue ID): #545 + #545 -- Antarctica ice shelves are being treated as wetlands rather than glaciers + + +Significant changes to scientifically-supported configurations +-------------------------------------------------------------- + +Does this tag change answers significantly for any of the following physics configurations? +(Details of any changes will be given in the "Answer changes" section below.) + + [Put an [X] in the box for any configuration with significant answer changes.] + +[X] clm5_0 + +[X] clm4_5 + +[ ] clm4_0 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): A few more namelist checks + Added a check to make sure do_transient_pfts was the same as do_transient_crops + Don't allow use_fertilizer for non-crop case + namelist checks that create_crop_landunit=T except for FATES + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): + New -ssp_rcp option to mksurfdata.pl + +Changes made to namelist defaults (e.g., changed parameter values): None + +Changes to the datasets (e.g., parameter, surface or initial files): New mksrfpft datasets in XML for SSP5-8.5 + +Substantial timing or memory changes: None + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in ../CTSMMasterChecklist as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): + Now, do_transient_pfts and do_transient_crops only work in unison, and hence + should be simplified to one logical called do_transient_veg + +Changes to tests or testing: Add new SSP5-8.5 mksurf test + +Code reviewed by: self, slevisconsulting, billsacks + +CTSM testing: regular, tools + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - PASS (18 of the transient test namelists are different to baseline as expected) + + unit-tests (components/clm/src): + + cheyenne - PASS + + tools-tests (components/clm/test/tools): + + cheyenne - OK (PTCLM tests fail) + + regular tests (aux_clm): + + cheyenne_intel ---- OK + cheyenne_gnu ------ OK + hobart_nag -------- OK + hobart_pgi -------- OK + hobart_intel ------ OK + +CTSM tag used for the baseline comparisons: ctsm1.0.dev012 + + +Answer changes +-------------- + +Changes answers relative to baseline: Yes! + + Summarize any changes to answers, i.e., + - what code configurations: clm4_5/clm5_0 transient simulations without Crop (either Bgc or SP) + - what platforms/compilers: All + - nature of change: crop areas increase in time and impact simulations + + If this tag changes climate describe the run(s) done to evaluate the new + climate (put details of the simulations in the experiment database) + - casename: dll/clm50_r267_1deg_GSWP3V1_iso_hist_nocrop_transientfix + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): None + +Pull Requests that document the changes (include PR ids): #546, #540 +(https://github.com/ESCOMP/ctsm/pull) + + #546 -- Add in ability for mksurfdata_map to handle ssp_rcp scenarios and specifically SSP5-8.5 + $540 -- Transient PFT issue + +=============================================================== +=============================================================== Tag name: ctsm1.0.dev012 Originator(s): erik (Erik Kluzek) Date: Sat Sep 29 11:49:35 MDT 2018 diff --git a/doc/ChangeSum b/doc/ChangeSum index f7b633dafa..3b42263972 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,6 @@ Tag Who Date Summary ============================================================================================================================ + ctsm1.0.dev013 erik 10/25/2018 Fix the fact that transient Bgc and SP cases had constant crop area in time ctsm1.0.dev012 erik 09/29/2018 Add snow-free fields for snowmip, fix several issues ctsm1.0.dev011 sacks 09/12/2018 Add water tracer consistency checks, and other water tracer work ctsm1.0.dev010 sacks 08/30/2018 Update cime to cime5.7.3 From 0f432bc4cbcf1ef106e6fe311a079150537d2afc Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 25 Oct 2018 18:10:17 -0600 Subject: [PATCH 12/54] Update changelog time --- doc/ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index f0bb69bd60..6fb59c73b2 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,7 +1,7 @@ =============================================================== Tag name: ctsm1.0.dev013 Originator(s): erik (Erik Kluzek)/slevisconsulting -Date: Thu Oct 25 16:25:26 MDT 2018 +Date: Thu Oct 25 18:09:47 MDT 2018 One-line Summary: Fix the fact that transient Bgc and SP cases had constant crop area in time Purpose of changes From a2f1df5bf3d46ce2813c2d689fcc67f780e54bb6 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Thu, 25 Oct 2018 19:55:49 -0600 Subject: [PATCH 13/54] Change uppercase DEBUG variables to lowercase debug This is needed to avoid conflicting with the DEBUG CPP token. I also changed one instance of debug to a 'parameter'. I left others as is because I didn't do the analysis needed to confirm that they're never set from elsewhere (because they are public to their modules). Fixes ESCOMP/ctsm#534 --- src/biogeophys/SurfaceRadiationMod.F90 | 4 ++-- src/utils/clmfates_interfaceMod.F90 | 8 ++++---- src/utils/clmfates_paraminterfaceMod.F90 | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/biogeophys/SurfaceRadiationMod.F90 b/src/biogeophys/SurfaceRadiationMod.F90 index 4589a47a21..4b85747d5e 100644 --- a/src/biogeophys/SurfaceRadiationMod.F90 +++ b/src/biogeophys/SurfaceRadiationMod.F90 @@ -25,7 +25,7 @@ module SurfaceRadiationMod implicit none private - logical :: DEBUG = .false. ! for debugging this module + logical, parameter :: debug = .false. ! for debugging this module ! ! !PUBLIC MEMBER FUNCTIONS: @@ -977,7 +977,7 @@ subroutine SurfaceRadiation(bounds, num_nourbanp, filter_nourbanp, & g = patch%gridcell(p) if(elai(p)==0.0_r8.and.fabd(p,1)>0._r8)then - if ( DEBUG ) write(iulog,*) 'absorption without LAI',elai(p),tlai(p),fabd(p,1),p + if ( debug ) write(iulog,*) 'absorption without LAI',elai(p),tlai(p),fabd(p,1),p endif ! Solar incident diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index a92a153331..d5436afb97 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -198,7 +198,7 @@ module CLMFatesInterfaceMod ! developer will at least question its usage (RGK) private :: hlm_bounds_to_fates_bounds - logical :: DEBUG = .false. + logical :: debug = .false. character(len=*), parameter, private :: sourcefile = & __FILE__ @@ -367,7 +367,7 @@ subroutine init(this, bounds_proc ) ! Check through FATES parameters to see if all have been set call set_fates_ctrlparms('check_allset') - if(DEBUG)then + if(debug)then write(iulog,*) 'clm_fates%init(): allocating for ',nclumps,' threads' end if @@ -402,7 +402,7 @@ subroutine init(this, bounds_proc ) s = s + 1 collist(s) = c this%f2hmap(nc)%hsites(c) = s - if(DEBUG)then + if(debug)then write(iulog,*) 'clm_fates%init(): thread',nc,': found column',c,'with lu',l write(iulog,*) 'LU type:', lun%itype(l) end if @@ -410,7 +410,7 @@ subroutine init(this, bounds_proc ) enddo - if(DEBUG)then + if(debug)then write(iulog,*) 'clm_fates%init(): thread',nc,': allocated ',s,' sites' end if diff --git a/src/utils/clmfates_paraminterfaceMod.F90 b/src/utils/clmfates_paraminterfaceMod.F90 index 4fc12fdc31..9a3ce58ff7 100644 --- a/src/utils/clmfates_paraminterfaceMod.F90 +++ b/src/utils/clmfates_paraminterfaceMod.F90 @@ -15,7 +15,7 @@ module CLMFatesParamInterfaceMod private :: SetParameterDimensions private :: GetUsedDimensionSizes - logical :: DEBUG = .false. + logical :: debug = .false. character(len=*), parameter, private :: sourcefile = & __FILE__ From 6ec12316d6d7e1c7f9e1cd186076dab5994b6861 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Thu, 25 Oct 2018 20:02:15 -0600 Subject: [PATCH 14/54] Remove unnecessary line of code This initial setting of Nstore was problematic because it referenced the uninitialized PNstoreold variable. From some analysis, it looks like Nstore is always overwritten before it's referenced, so it's safe to just remove this line, along with the now-unnecessary PNstoreold subroutine argument. Fixes ESCOMP/ctsm#322 --- src/biogeophys/LunaMod.F90 | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/biogeophys/LunaMod.F90 b/src/biogeophys/LunaMod.F90 index ff07b2987b..b5beb755a4 100644 --- a/src/biogeophys/LunaMod.F90 +++ b/src/biogeophys/LunaMod.F90 @@ -36,10 +36,10 @@ module LunaMod ! PRIVATE MEMBER FUNCTIONS: public :: LunaReadNML !subroutine to read in the Luna namelist public :: Update_Photosynthesis_Capacity !subroutine to update the canopy nitrogen profile - public :: NitrogenAllocation !subroutine to update the Vcmax25 and Jmax25 at the leaf level public :: Acc24_Climate_LUNA !subroutine to accumulate 24 hr climates public :: Acc240_Climate_LUNA !subroutine to accumulate 10 day climates public :: Clear24_Climate_LUNA !subroutine to clear 24 hr climates + private :: NitrogenAllocation !subroutine to update the Vcmax25 and Jmax25 at the leaf level private :: NUEref !Calculate the Nitrogen use effieciency based on reference CO2 and leaf temperature private :: NUE !Calculate the Nitrogen use effieciency based on current CO2 and leaf temperature private :: JmxTLeuning !Calculate the temperature response for Jmax, based on Leunning 2002 Plant, Cell & Environment @@ -367,7 +367,7 @@ subroutine Update_Photosynthesis_Capacity(bounds, fn, filterp, & PNcbold = 0.0_r8 call NitrogenAllocation(FNCa,forc_pbot10(p), relh10, CO2a10, O2a10, PARi10, PARimx10, rb10v, hourpd, & tair10, tleafd10, tleafn10, & - Jmaxb0, Jmaxb1, Wc2Wjb0, relhExp, PNstoreold, PNlcold, PNetold, PNrespold, & + Jmaxb0, Jmaxb1, Wc2Wjb0, relhExp, PNlcold, PNetold, PNrespold, & PNcbold, PNstoreopt, PNlcopt, PNetopt, PNrespopt, PNcbopt) vcmx25_opt= PNcbopt * FNCa * Fc25 jmx25_opt= PNetopt * FNCa * Fj25 @@ -756,7 +756,7 @@ end subroutine Clear24_Climate_LUNA !Use the LUNA model to calculate the Nitrogen partioning subroutine NitrogenAllocation(FNCa,forc_pbot10, relh10, CO2a10,O2a10, PARi10,PARimx10,rb10, hourpd, tair10, tleafd10, tleafn10, & Jmaxb0, Jmaxb1, Wc2Wjb0, relhExp,& - PNstoreold, PNlcold, PNetold, PNrespold, PNcbold, & + PNlcold, PNetold, PNrespold, PNcbold, & PNstoreopt, PNlcopt, PNetopt, PNrespopt, PNcbopt) implicit none real(r8), intent (in) :: FNCa !Area based functional nitrogen content (g N/m2 leaf) @@ -775,7 +775,6 @@ subroutine NitrogenAllocation(FNCa,forc_pbot10, relh10, CO2a10,O2a10, PARi10,PAR real(r8), intent (in) :: Jmaxb1 !coefficient determining the response of electron transport rate to light availability (unitless) real(r8), intent (in) :: Wc2Wjb0 !the baseline ratio of rubisco-limited rate vs light-limited photosynthetic rate (Wc:Wj) real(r8), intent (in) :: relhExp !specifies the impact of relative humidity on electron transport rate (unitless) - real(r8), intent (in) :: PNstoreold !old value of the proportion of nitrogen allocated to storage (unitless) real(r8), intent (in) :: PNlcold !old value of the proportion of nitrogen allocated to light capture (unitless) real(r8), intent (in) :: PNetold !old value of the proportion of nitrogen allocated to electron transport (unitless) real(r8), intent (in) :: PNrespold !old value of the proportion of nitrogen allocated to respiration (unitless) @@ -848,7 +847,6 @@ subroutine NitrogenAllocation(FNCa,forc_pbot10, relh10, CO2a10,O2a10, PARi10,PAR call NUEref(NUEjref, NUEcref, Kj2Kcref) theta_cj = 0.95_r8 - Nstore = PNstoreold * FNCa !proportion of storage nitrogen in functional nitrogen Nlc = PNlcold * FNCa !proportion of light capturing nitrogen in functional nitrogen Net = PNetold * FNCa !proportion of light harvesting (electron transport) nitrogen in functional nitrogen Nresp = PNrespold * FNCa !proportion of respirational nitrogen in functional nitrogen From 531994d1205af7d4f2b515144b8d7a4dc13cd4df Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Thu, 4 Oct 2018 11:00:38 -0400 Subject: [PATCH 15/54] fix build issue with xlf compiler --- src/biogeochem/CropType.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/biogeochem/CropType.F90 b/src/biogeochem/CropType.F90 index eaed486bc5..0b2c0fc1db 100644 --- a/src/biogeochem/CropType.F90 +++ b/src/biogeochem/CropType.F90 @@ -574,7 +574,7 @@ subroutine CropUpdateAccVars(this, bounds, t_ref2m_patch, t_soisno_col) call extract_accum_field ('GDDPLANT', rbufslp, nstep) do p = begp,endp - rbufslp(p) = max(0.,this%gddplant_patch(p)-rbufslp(p)) + rbufslp(p) = max(0.0_r8,this%gddplant_patch(p)-rbufslp(p)) end do call update_accum_field ('GDDPLANT', rbufslp, nstep) do p = begp,endp From d21e274d2e34f1dd2a3c0ba5325278e10936d3d9 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Fri, 26 Oct 2018 06:20:42 -0600 Subject: [PATCH 16/54] Update changelog --- doc/ChangeLog | 140 ++++++++++++++++++++++++++++++++++++++++++++++++++ doc/ChangeSum | 1 + 2 files changed, 141 insertions(+) diff --git a/doc/ChangeLog b/doc/ChangeLog index 6fb59c73b2..fb8ba6e937 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,4 +1,144 @@ =============================================================== +Tag name: ctsm1.0.dev014 +Originator(s): sacks (Bill Sacks) +Date: Fri Oct 26 06:20:34 MDT 2018 +One-line Summary: Miscellaneous minor, bit-for-bit bug fixes + +Purpose of changes +------------------ + +Four miscellaneous minor, bit-for-bit bug fixes: + +(1) Py3 pylint check and address cime issue ESMCI/cime#2822 (from Jim + Edwards: ESCOMP/ctsm#526) + +(2) Change uppercase DEBUG variables to lowercase debug (requested by + Jim Edwards to avoid conflicting with the DEBUG CPP token) + (Fixes ESCOMP/ctsm#534) + +(3) Remove unnecessary line of code in LunaMod.F90 that was causing + problems with some compilers due to an uninitialized variable + (Fixes ESCOMP/ctsm#322) + +(4) Add r8 to 0 constant to fix build issue with XLF compiler (from Jim + Edwards: ESCOMP/ctsm#531) + + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +- Fixes ESCOMP/ctsm#322 (ERS_D_Ld5.f19_g16.I2000Clm50BgcCruGs run FAIL (intel)) +- Fixes ESCOMP/ctsm#534 (Rename DEBUG to debug in a few places) + + +Significant changes to scientifically-supported configurations +-------------------------------------------------------------- + +Does this tag change answers significantly for any of the following physics configurations? +(Details of any changes will be given in the "Answer changes" section below.) + + [Put an [X] in the box for any configuration with significant answer changes.] + +[ ] clm5_0 + +[ ] clm4_5 + +[ ] clm4_0 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: none + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in ../CTSMMasterChecklist as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): + +Changes to tests or testing: none + +Code reviewed by: different pieces reviewed by different people + + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + unit-tests (components/clm/src): + + cheyenne - pass + + tools-tests (components/clm/test/tools): + + cheyenne - not run + + PTCLM testing (components/clm/tools/shared/PTCLM/test): + + cheyenne - not run + + regular tests (aux_clm): + + cheyenne_intel ---- ok + cheyenne_gnu ------ ok + hobart_nag -------- ok + hobart_pgi -------- ok + hobart_intel ------ ok + + ok means tests and baseline comparisons pass. There were unexpected + NLCOMP diffs. From spot-checking a few tests, I see the following: + + + (1) On both cheyenne and hobart: Diffs in logfile. This looks like a + problem in cime: it says: + + BASE: logfile = 'rof.log.136342.hobart.cgd.ucar.edu + COMP: logfile = 'rof.log + + (2) On hobart: Diffs in pio_typename: netcdf vs. pnetcdf (says that + new uses pnetcdf): but when I compare files by hand, they look + the same in this respect (both baseline and new use netcdf), so + maybe this is due to a problem in the timing of when nlcomp is + run? + + Since these both look like problems in the comparison script rather + than in the tag, I'm letting these go, but will open a cime issue if + we see this again. + + +CTSM tag used for the baseline comparisons: ctsm1.0.dev013 + + +Answer changes +-------------- + +Changes answers relative to baseline: NO + + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): +- https://github.com/ESCOMP/ctsm/pull/531 (fix build issue with xlf compiler) +- https://github.com/ESCOMP/ctsm/pull/526 (fix cime issue 2822 and pylint chk) + +=============================================================== +=============================================================== Tag name: ctsm1.0.dev013 Originator(s): erik (Erik Kluzek)/slevisconsulting Date: Thu Oct 25 18:09:47 MDT 2018 diff --git a/doc/ChangeSum b/doc/ChangeSum index 3b42263972..035cdbbbfd 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,6 @@ Tag Who Date Summary ============================================================================================================================ + ctsm1.0.dev014 sacks 10/26/2018 Miscellaneous minor, bit-for-bit bug fixes ctsm1.0.dev013 erik 10/25/2018 Fix the fact that transient Bgc and SP cases had constant crop area in time ctsm1.0.dev012 erik 09/29/2018 Add snow-free fields for snowmip, fix several issues ctsm1.0.dev011 sacks 09/12/2018 Add water tracer consistency checks, and other water tracer work From cb187edbc2c50c9bdff9c4c3d428d7aa90408600 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Fri, 19 Oct 2018 06:57:47 -0600 Subject: [PATCH 17/54] Support a %CMIP6DECK compset modifier This was suggested by @rljacob and supported by @mvertens @jedwards4b and @bertinia as a mechanism to provide CMIP6-specific compsets. I have tentatively chosen the modifier %CMIP6DECK rather than just %CMIP6, mainly because I imagine we might want some other %CMIP6XXX modifiers later, and if we had a simple %CMIP6 modifier, it would be harder to write a correct regular expression that matches %CMIP6XXX without accidentally matching %CMIP6. For CTSM, my impression is that we want the same mods for all DECK runs. Other components might want something different, and they don't necessarily have to use %CMIP6DECK: they can come up with their own set of modifiers. Finally, a specific note about the regex match: Elsewhere we use regular expressions like "_CLM50%[^_]*BGC", but here I have put the "%" immediately before the modifier, like "_CLM50[^_]*%CMIP6DECK": this seems slightly more robust. --- cime_config/config_component.xml | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml index bd95959f94..98c2e20ae2 100644 --- a/cime_config/config_component.xml +++ b/cime_config/config_component.xml @@ -13,10 +13,10 @@ --> - + clm4.0: - clm4.5: - clm5.0: + clm4.5: + clm5.0: Satellite phenology: CN: Carbon Nitrogen model CNDV: CN with Dynamic Vegetation @@ -29,6 +29,7 @@ FATES (Functionally Assembled Terrestrial Ecosystem Simulator) Ecosystem Demography model: (experimental) BGC (vert. resol. CN and methane) with dynamic vegetation: BGC (vert. resol. CN and methane) with dynamic vegetation and prognostic crop: + With modifications appropriate for CMIP6 DECK experiments: @@ -224,6 +225,22 @@ precedence over any settings for finidat in the $CASEROOT/user_clm_clm file. + + char + + + + + $SRCROOT/components/clm/cime_config/usermods_dirs/cmip6 + $SRCROOT/components/clm/cime_config/usermods_dirs/cmip6 + + run_component_clm + env_case.xml + User mods to apply to specific compset matches. + + ========================================= CLM naming conventions From c9fdb21e650073e75df33e7a931620e4c123c991 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Sat, 20 Oct 2018 07:26:04 -0600 Subject: [PATCH 18/54] Only allow CMIP6DECK modifier with CLM50%BGC-CROP Per suggestion of @ekluzek, we now use CLM50%BGC-CROP-CMIP6DECK rather than CLM50%BGC-CROP%CMIP6DECK. One main purpose of this is so that we can keep modifier_mode="1" (since changing it to "+" would allow many things that are non-sensical). Also, as Erik pointed out, CMIP6DECK can only be used with BGC-CROP; the previous implementation allowed it with other options as well. This new version also only allows CMIP6DECK with CLM50 - not with CLM45. A few notes about the implementation: - I didn't need to add anything in CLM_BLDNML_OPTS, because %BGC-CROP-CMIP6DECK still matches the existing "BGC-CROP" regular expression. - The match for CLM_USER_MODS is something fairly general ("_CLM50%[^_]*CMIP6DECK"). This seemed more future-proof than explicitly listing "BGC-CROP-CMIP6DECK". The description section will currently prevent CMIP6DECK from being specified anywhere other than with BGC-CROP, so for the CLM_USER_MODS I figured I might as well match CMIP6DECK occurring anywhere within a CLM50 modifier. --- cime_config/config_component.xml | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml index 98c2e20ae2..10f3d6bb59 100644 --- a/cime_config/config_component.xml +++ b/cime_config/config_component.xml @@ -13,10 +13,10 @@ --> - + clm4.0: - clm4.5: - clm5.0: + clm4.5: + clm5.0: Satellite phenology: CN: Carbon Nitrogen model CNDV: CN with Dynamic Vegetation @@ -29,7 +29,7 @@ FATES (Functionally Assembled Terrestrial Ecosystem Simulator) Ecosystem Demography model: (experimental) BGC (vert. resol. CN and methane) with dynamic vegetation: BGC (vert. resol. CN and methane) with dynamic vegetation and prognostic crop: - With modifications appropriate for CMIP6 DECK experiments: + BGC (vert. resol. CN and methane) with prognostic crop, with modifications appropriate for CMIP6 DECK experiments: @@ -230,11 +230,7 @@ - - $SRCROOT/components/clm/cime_config/usermods_dirs/cmip6 - $SRCROOT/components/clm/cime_config/usermods_dirs/cmip6 + $SRCROOT/components/clm/cime_config/usermods_dirs/cmip6 run_component_clm env_case.xml From 209c2d1300570c5ece15a580ed597b11d5a860b8 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Mon, 22 Oct 2018 14:14:13 -0600 Subject: [PATCH 19/54] Make match of CMIP6DECK more robust This way, the CMIP6DECK match won't accidentally match something like CMIP6DECKFOO --- cime_config/config_component.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml index 10f3d6bb59..73050aafb1 100644 --- a/cime_config/config_component.xml +++ b/cime_config/config_component.xml @@ -230,7 +230,7 @@ - $SRCROOT/components/clm/cime_config/usermods_dirs/cmip6 + $SRCROOT/components/clm/cime_config/usermods_dirs/cmip6 run_component_clm env_case.xml From 46298b11925dffa30d8f59b393a85b26bd00f523 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 2 Oct 2018 09:30:02 -0600 Subject: [PATCH 20/54] Add carbon_isotope user-mod directory to turn on c13 and c14 and add it to the cmip6 user-mod directory --- cime_config/usermods_dirs/carbon_isotopes/user_nl_clm | 4 ++++ cime_config/usermods_dirs/cmip6/include_user_mods | 1 + 2 files changed, 5 insertions(+) create mode 100644 cime_config/usermods_dirs/carbon_isotopes/user_nl_clm diff --git a/cime_config/usermods_dirs/carbon_isotopes/user_nl_clm b/cime_config/usermods_dirs/carbon_isotopes/user_nl_clm new file mode 100644 index 0000000000..2fa530330a --- /dev/null +++ b/cime_config/usermods_dirs/carbon_isotopes/user_nl_clm @@ -0,0 +1,4 @@ +use_c13 = .true. +use_c14 = .true. +use_c13_timeseries = .true. +use_c14_bombspike = .true. diff --git a/cime_config/usermods_dirs/cmip6/include_user_mods b/cime_config/usermods_dirs/cmip6/include_user_mods index 012ab60771..88609339ba 100644 --- a/cime_config/usermods_dirs/cmip6/include_user_mods +++ b/cime_config/usermods_dirs/cmip6/include_user_mods @@ -1,2 +1,3 @@ ../cmip6_glaciers ../cmip6_output +../carbon_isotopes From 5252e2299a734103503d18993beae24fdd770c50 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Tue, 9 Oct 2018 14:53:49 -0600 Subject: [PATCH 21/54] 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). The key part of this implementation is cycling some loops if a given history tape is not in use. There are a few other loops for which it probably would have been fine to do this cycling, but it wasn't necessary - e.g., doing initialization of some per-tape variables. In most of those cases, I didn't bother doing this cycling because it seemed like it could keep the code more robust to still initialize these per-tape variables for the not-in-use tapes. Note that I removed this error check: ! Check that the number of history files declared does not exceed ! the maximum allowed. if (ntapes > max_tapes) then write(iulog,*) trim(subname),' ERROR: Too many history files declared, max_tapes=',max_tapes call endrun(msg=errMsg(sourcefile, __LINE__)) end if because, with the way ntapes is determined, it's impossible for ntapes to exceed max_tapes - i.e., this error check wasn't actually doing anything. Also note that I put in some error-checking code to ensure that, in a restart run, if a history file is in use in the current run, then it was in use on the restart file, and vice versa. --- src/main/histFileMod.F90 | 148 ++++++++++++++++++++++++++++++--------- 1 file changed, 114 insertions(+), 34 deletions(-) diff --git a/src/main/histFileMod.F90 b/src/main/histFileMod.F90 index 8899917c5f..d09bc523b2 100644 --- a/src/main/histFileMod.F90 +++ b/src/main/histFileMod.F90 @@ -55,7 +55,11 @@ module histFileMod ! ! Counters ! - integer , public :: ntapes = 0 ! index of max history file requested + ! ntapes gives the index of the max history file requested. There can be "holes" in the + ! numbering - e.g., we can have h0, h1 and h3 tapes, but no h2 tape (because there are + ! no fields on the h2 tape). In this case, ntapes will be 4 (for h0, h1, h2 and h3, + ! since h3 is the last requested file), not 3 (the number of files actually produced). + integer , private :: ntapes = 0 ! index of max history file requested ! ! Namelist ! @@ -239,6 +243,11 @@ module histFileMod ! type (master_entry) :: masterlist(max_flds) ! master field list ! + ! Whether each history tape is in use in this run. If history_tape_in_use(i) is false, + ! then data in tape(i) is undefined and should not be referenced. + ! + logical :: history_tape_in_use(max_tapes) ! whether each history tape is in use in this run + ! ! History tape: an array of history_tape entities (only active fields) ! type (history_tape) :: tape(max_tapes) ! array history tapes @@ -698,6 +707,7 @@ subroutine htapes_fieldlist() end do end do + history_tape_in_use(:) = .false. tape(:)%nflds = 0 do t = 1,max_tapes @@ -774,7 +784,7 @@ subroutine htapes_fieldlist() end if end do - ! Determine total number of active history tapes + ! Determine index of max active history tape, and whether each tape is in use ntapes = 0 do t = max_tapes,1,-1 @@ -784,24 +794,12 @@ subroutine htapes_fieldlist() end if end do - ! Ensure there are no "holes" in tape specification, i.e. empty tapes. - ! Enabling holes should not be difficult if necessary. - - do t = 1,ntapes - if (tape(t)%nflds == 0) then - write(iulog,*) trim(subname),' ERROR: Tape ',t,' is empty' - call endrun(msg=errMsg(sourcefile, __LINE__)) + do t = 1, ntapes + if (tape(t)%nflds > 0) then + history_tape_in_use(t) = .true. end if end do - ! Check that the number of history files declared does not exceed - ! the maximum allowed. - - if (ntapes > max_tapes) then - write(iulog,*) trim(subname),' ERROR: Too many history files declared, max_tapes=',max_tapes - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - ! Change 1d output per tape output flag if requested - only for history ! tapes where 2d xy averaging is not enabled @@ -834,6 +832,10 @@ subroutine htapes_fieldlist() end if write(iulog,*)'Number of time samples on history tape ',t,' is ',hist_mfilt(t) write(iulog,*)'Output precision on history tape ',t,'=',hist_ndens(t) + if (.not. history_tape_in_use(t)) then + write(iulog,*) 'History tape ',t,' does not have any fields,' + write(iulog,*) 'so it will not be written!' + end if write(iulog,*) end do call shr_sys_flush(iulog) @@ -3381,9 +3383,15 @@ subroutine hist_htapes_wrapup( rstwr, nlend, bounds, & ! and write data to history files if end of history interval. do t = 1, ntapes + if (.not. history_tape_in_use(t)) then + cycle + end if + ! Skip nstep=0 if monthly average - if (nstep==0 .and. tape(t)%nhtfrq==0) cycle + if (nstep==0 .and. tape(t)%nhtfrq==0) then + cycle + end if ! Determine if end of history interval tape(t)%is_endhist = .false. @@ -3486,6 +3494,10 @@ subroutine hist_htapes_wrapup( rstwr, nlend, bounds, & ! must reopen the files do t = 1, ntapes + if (.not. history_tape_in_use(t)) then + cycle + end if + if (if_disphist(t)) then if (tape(t)%ntimes /= 0) then if (masterproc) then @@ -3511,6 +3523,10 @@ subroutine hist_htapes_wrapup( rstwr, nlend, bounds, & ! Reset number of time samples to zero if file is full do t = 1, ntapes + if (.not. history_tape_in_use(t)) then + cycle + end if + if (if_disphist(t) .and. tape(t)%ntimes==tape(t)%mfilt) then tape(t)%ntimes = 0 end if @@ -3559,7 +3575,9 @@ subroutine hist_restart_ncd (bounds, ncid, flag, rdate) character(len=max_chars) :: units ! units of variable character(len=max_chars) :: units_acc ! accumulator units character(len=max_chars) :: fname ! full name of history file - character(len=max_chars) :: locrest(max_tapes) ! local history restart file names + character(len=max_chars) :: locrest(max_tapes) ! local history restart file names + character(len=max_length_filename) :: my_locfnh ! temporary version of locfnh + character(len=max_length_filename) :: my_locfnhr ! temporary version of locfnhr character(len=max_namlen),allocatable :: tname(:) character(len=max_chars), allocatable :: tunits(:),tlongname(:) @@ -3590,7 +3608,9 @@ subroutine hist_restart_ncd (bounds, ncid, flag, rdate) integer :: dimid ! dimension ID integer :: k ! 1d index integer :: ntapes_onfile ! number of history tapes on the restart file + logical :: history_tape_in_use_onfile ! whether a given history tape is in use, according to the restart file integer :: nflds_onfile ! number of history fields on the restart file + logical :: readvar ! whether a variable was read successfully integer :: t ! tape index integer :: f ! field index integer :: varid ! variable id @@ -3642,6 +3662,12 @@ subroutine hist_restart_ncd (bounds, ncid, flag, rdate) call ncd_defdim( ncid, 'ntapes' , ntapes , dimid) call ncd_defdim( ncid, 'max_chars' , max_chars , dimid) + call ncd_defvar(ncid=ncid, varname='history_tape_in_use', xtype=ncd_log, & + long_name="Whether this history tape is in use", & + dim1name="ntapes") + ier = PIO_inq_varid(ncid, 'history_tape_in_use', vardesc) + ier = PIO_put_att(ncid, vardesc%varid, 'interpinic_flag', iflag_skip) + call ncd_defvar(ncid=ncid, varname='locfnh', xtype=ncd_char, & long_name="History filename", & comment="This variable NOT needed for startup or branch simulations", & @@ -3665,6 +3691,9 @@ subroutine hist_restart_ncd (bounds, ncid, flag, rdate) ! only read/write accumulators and counters if needed do t = 1,ntapes + if (.not. history_tape_in_use(t)) then + cycle + end if ! Create the restart history filename and open it write(hnum,'(i1.1)') t-1 @@ -3839,8 +3868,16 @@ subroutine hist_restart_ncd (bounds, ncid, flag, rdate) ! Add history filenames to master restart file do t = 1,ntapes - call ncd_io('locfnh', locfnh(t), 'write', ncid, nt=t) - call ncd_io('locfnhr', locfnhr(t), 'write', ncid, nt=t) + call ncd_io('history_tape_in_use', history_tape_in_use(t), 'write', ncid, nt=t) + if (history_tape_in_use(t)) then + my_locfnh = locfnh(t) + my_locfnhr = locfnhr(t) + else + my_locfnh = 'non_existent_file' + my_locfnhr = 'non_existent_file' + end if + call ncd_io('locfnh', my_locfnh, 'write', ncid, nt=t) + call ncd_io('locfnhr', my_locfnhr, 'write', ncid, nt=t) end do fincl(:,1) = hist_fincl1(:) @@ -3876,6 +3913,10 @@ subroutine hist_restart_ncd (bounds, ncid, flag, rdate) allocate(itemp(max_nflds)) do t = 1,ntapes + if (.not. history_tape_in_use(t)) then + cycle + end if + call ncd_io(varname='fincl', data=fincl(:,t), ncid=ncid_hist(t), flag='write') call ncd_io(varname='fexcl', data=fexcl(:,t), ncid=ncid_hist(t), flag='write') @@ -3941,19 +3982,48 @@ subroutine hist_restart_ncd (bounds, ncid, flag, rdate) !================================================ call ncd_inqdlen(ncid,dimid,ntapes_onfile, name='ntapes') - if ( is_restart() .and. ntapes_onfile /= ntapes )then - write(iulog,*) 'ntapes = ', ntapes, ' ntapes_onfile = ', ntapes_onfile - call endrun(msg=' ERROR: number of ntapes different than on restart file!,'// & - ' you can NOT change history options on restart!' //& - errMsg(sourcefile, __LINE__)) - end if - if ( is_restart() .and. ntapes > 0 )then - call ncd_io('locfnh', locfnh(1:ntapes), 'read', ncid ) - call ncd_io('locfnhr', locrest(1:ntapes), 'read', ncid ) - do t = 1,ntapes - call strip_null(locrest(t)) - call strip_null(locfnh(t)) + if (is_restart()) then + if (ntapes_onfile /= ntapes) then + write(iulog,*) 'ntapes = ', ntapes, ' ntapes_onfile = ', ntapes_onfile + call endrun(msg=' ERROR: number of ntapes differs from restart file. '// & + 'You can NOT change history options on restart.', & + additional_msg=errMsg(sourcefile, __LINE__)) + end if + + do t = 1, ntapes + ! NOTE(wjs, 2018-10-06) Ideally, we'd read all values of history_tape_in_use + ! at once. However, we currently don't have a 1-d logical ncd_io routine, so + ! we have to read values one at a time. + call ncd_io('history_tape_in_use', history_tape_in_use_onfile, 'read', ncid, & + readvar=readvar, nt=t) + if (.not. readvar) then + ! BACKWARDS_COMPATIBILITY(wjs, 2018-10-06) Old restart files do not have + ! 'history_tape_in_use'. However, before now, this has implicitly been + ! true for all tapes <= ntapes. + history_tape_in_use_onfile = .true. + end if + if (history_tape_in_use_onfile .neqv. history_tape_in_use(t)) then + write(iulog,*) subname//' ERROR: history_tape_in_use on restart file' + write(iulog,*) 'disagrees with current run: For tape ', t + write(iulog,*) 'On restart file: ', history_tape_in_use_onfile + write(iulog,*) 'In current run : ', history_tape_in_use(t) + write(iulog,*) 'This suggests that this tape was empty in one case,' + write(iulog,*) 'but non-empty in the other. (history_tape_in_use .false.' + write(iulog,*) 'means that history tape is empty.)' + call endrun(msg=' ERROR: history_tape_in_use differs from restart file. '// & + 'You can NOT change history options on restart.', & + additional_msg=errMsg(sourcefile, __LINE__)) + end if end do + + if (ntapes > 0 )then + call ncd_io('locfnh', locfnh(1:ntapes), 'read', ncid ) + call ncd_io('locfnhr', locrest(1:ntapes), 'read', ncid ) + do t = 1,ntapes + call strip_null(locrest(t)) + call strip_null(locfnh(t)) + end do + end if end if ! Determine necessary indices - the following is needed if model decomposition is different on restart @@ -3962,6 +4032,9 @@ subroutine hist_restart_ncd (bounds, ncid, flag, rdate) if ( is_restart() )then do t = 1,ntapes + if (.not. history_tape_in_use(t)) then + cycle + end if call getfil( locrest(t), locfnhr(t), 0 ) call ncd_pio_openfile (ncid_hist(t), trim(locfnhr(t)), ncd_nowrite) @@ -4167,6 +4240,10 @@ subroutine hist_restart_ncd (bounds, ncid, flag, rdate) if (flag == 'write') then do t = 1,ntapes + if (.not. history_tape_in_use(t)) then + cycle + end if + if (.not. tape(t)%is_endhist) then do f = 1,tape(t)%nflds @@ -4218,6 +4295,9 @@ subroutine hist_restart_ncd (bounds, ncid, flag, rdate) ! Read history restart information if history files are not full do t = 1,ntapes + if (.not. history_tape_in_use(t)) then + cycle + end if if (.not. tape(t)%is_endhist) then @@ -5106,7 +5186,7 @@ end subroutine strip_null subroutine hist_do_disp (ntapes, hist_ntimes, hist_mfilt, if_stop, if_disphist, rstwr, nlend) ! ! !DESCRIPTION: - ! Determine logic for closeing and/or disposing history file + ! Determine logic for closing and/or disposing history file ! Sets values for if_disphist, if_stop (arguments) ! Remove history files unless this is end of run or ! history file is not full. From e001cdcd4f9a5cce81dc810281cb9f692f223031 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Wed, 10 Oct 2018 07:07:08 -0600 Subject: [PATCH 22/54] Revert "Remove broken ncd_io_1d_log_glob" This reverts commit 0a36ae0d8058c887f40c358a70bcb26d66db4515. I'm going to try to fix ncd_io_1d_log_glob --- src/main/ncdio_pio.F90.in | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/src/main/ncdio_pio.F90.in b/src/main/ncdio_pio.F90.in index 6de8acb363..58f26636bf 100644 --- a/src/main/ncdio_pio.F90.in +++ b/src/main/ncdio_pio.F90.in @@ -104,7 +104,7 @@ module ncdio_pio interface ncd_io module procedure ncd_io_char_var0_start_glob - !DIMS 0 + !DIMS 0,1 module procedure ncd_io_{DIMS}d_log_glob !DIMS 0,1,2,3 @@ -1192,11 +1192,11 @@ contains end subroutine ncd_io_char_var0_start_glob !------------------------------------------------------------------------ - !DIMS 0 + !DIMS 0,1 subroutine ncd_io_{DIMS}d_log_glob(varname, data, flag, ncid, readvar, nt, posNOTonfile) ! ! !DESCRIPTION: - ! netcdf I/O of global logical variable + ! netcdf I/O of global integer variable ! ! !ARGUMENTS: class(file_desc_t) , intent(inout) :: ncid ! netcdf file id @@ -1242,7 +1242,12 @@ contains call shr_sys_abort(' ERROR: bad integer value for logical data'//errMsg(sourcefile, __LINE__)) end if #else - call shr_sys_abort('ncd_io_*_log_glob not implemented for DIMS > 0') + allocate(idata1d(size(data))) + data = (idata1d == 1) + if ( any(idata1d /= 0 .and. idata1d /= 1) )then + call shr_sys_abort(' ERROR: read in bad integer value(s) for logical data'//errMsg(sourcefile, __LINE__)) + end if + deallocate(idata1d) #endif endif if (present(readvar)) readvar = varpresent @@ -1262,7 +1267,18 @@ contains status = pio_put_var(ncid, varid, start, count, idata1d) deallocate(idata1d) #else - call shr_sys_abort('ncd_io_*_log_glob not implemented for DIMS > 0') + start(1) = 1 ; count(1) = size(data) + start(2) = 1 ; count(2) = 1 + if (present(nt)) start(2) = nt + allocate(idata1d(size(data))) + where( data ) + idata1d = 1 + elsewhere + idata1d = 0 + end where + call ncd_inqvid (ncid, varname, varid, vardesc) + status = pio_put_var(ncid, varid, start, count, idata1d) + deallocate( idata1d ) #endif endif ! flag From 9d8d8e8915b95e133639ff39136e2206ce88ecee Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Fri, 12 Oct 2018 06:50:27 -0600 Subject: [PATCH 23/54] Fix reading and writing of 1-d logical global arrays I copied the implementation of ncd_io_{DIMS}d_{TYPE}_glob to ncd_io_{DIMS}d_log_glob (with appropriate adjustments for the fact that we're working with logical data). By looking at diffs between those routines, I have confirmed that the two are now essentially identical in their implementation. I also made some very minor tweaks to ncd_io_{DIMS}d_{TYPE}_glob in order to reconcile the diffs between these two routines. This fixes #24 for real. --- src/main/ncdio_pio.F90.in | 57 ++++++++++++++++++++++++++++----------- 1 file changed, 41 insertions(+), 16 deletions(-) diff --git a/src/main/ncdio_pio.F90.in b/src/main/ncdio_pio.F90.in index 58f26636bf..970505918b 100644 --- a/src/main/ncdio_pio.F90.in +++ b/src/main/ncdio_pio.F90.in @@ -1196,7 +1196,7 @@ contains subroutine ncd_io_{DIMS}d_log_glob(varname, data, flag, ncid, readvar, nt, posNOTonfile) ! ! !DESCRIPTION: - ! netcdf I/O of global integer variable + ! netcdf I/O of global logical variable ! ! !ARGUMENTS: class(file_desc_t) , intent(inout) :: ncid ! netcdf file id @@ -1212,10 +1212,12 @@ contains integer :: start(2), count(2) ! output bounds integer :: status ! error code logical :: varpresent ! if true, variable is on tape + logical :: found ! if true, found lat/lon dims on file integer :: idata integer, pointer :: idata1d(:) ! Temporary integer data to send to file character(len=32) :: vname ! variable error checking type(var_desc_t) :: vardesc ! local vardesc pointer + integer :: ndims character(len=*),parameter :: subname='ncd_io_{DIMS}d_log_glob' !----------------------------------------------------------------------- @@ -1225,15 +1227,21 @@ contains if (flag == 'read') then call ncd_inqvid(ncid, varname, varid, vardesc, readvar=varpresent) + + call pio_seterrorhandling(ncid, PIO_BCAST_ERROR) +#if ({DIMS}==0) if (varpresent) then + status = pio_get_var(ncid, vardesc, idata) if (single_column .and. present(posNOTonfile) ) then if ( .not. posNOTonfile )then call shr_sys_abort(' ERROR: scalar var is NOT compatable with posNOTonfile = .false.'//& errMsg(sourcefile, __LINE__)) end if endif -#if ({DIMS}==0) - status = pio_get_var(ncid, varid, idata) + if ( status /= PIO_NOERR )then + call shr_sys_abort(' ERROR: reading variable: '//trim(varname)//' ' & + // errMsg(sourcefile, __LINE__)) + end if if ( idata == 0 )then data = .false. else if ( idata == 1 )then @@ -1241,32 +1249,51 @@ contains else call shr_sys_abort(' ERROR: bad integer value for logical data'//errMsg(sourcefile, __LINE__)) end if + end if #else + if (varpresent) then allocate(idata1d(size(data))) - data = (idata1d == 1) + if (single_column) then + call scam_field_offsets(ncid,'undefined', vardesc,& + start, count, found=found, posNOTonfile=posNOTonfile) + if ( found )then + status = pio_get_var(ncid, varid, start, count, idata1d) + else + status = pio_get_var(ncid, varid, idata1d) + end if + else + status = pio_get_var(ncid, varid, idata1d) + endif + if ( status /= PIO_NOERR )then + call shr_sys_abort(' ERROR: reading variable: '//trim(varname)//' ' & + // errMsg(sourcefile, __LINE__)) + end if if ( any(idata1d /= 0 .and. idata1d /= 1) )then call shr_sys_abort(' ERROR: read in bad integer value(s) for logical data'//errMsg(sourcefile, __LINE__)) end if + data = (idata1d == 1) deallocate(idata1d) -#endif endif +#endif + call pio_seterrorhandling(ncid, PIO_INTERNAL_ERROR) if (present(readvar)) readvar = varpresent elseif (flag == 'write') then - + ndims = {DIMS} + if(present(nt)) ndims=ndims+1 + call ncd_inqvid (ncid, varname, varid, vardesc) #if ({DIMS}==0) start(1) = 1 ; count(1) = 1 if (present(nt)) start(1) = nt - call ncd_inqvid (ncid, varname, varid, vardesc) allocate(idata1d(1)) if ( data )then idata1d(1) = 1 else idata1d(1) = 0 end if - status = pio_put_var(ncid, varid, start, count, idata1d) + status = pio_put_var(ncid, varid, start(1:1), count(1:1), idata1d) deallocate(idata1d) -#else +#elif ({DIMS}==1) start(1) = 1 ; count(1) = size(data) start(2) = 1 ; count(2) = 1 if (present(nt)) start(2) = nt @@ -1276,8 +1303,7 @@ contains elsewhere idata1d = 0 end where - call ncd_inqvid (ncid, varname, varid, vardesc) - status = pio_put_var(ncid, varid, start, count, idata1d) + status = pio_put_var(ncid, varid, start(1:ndims), count(1:ndims), idata1d) deallocate( idata1d ) #endif @@ -1303,7 +1329,6 @@ contains logical , optional, intent(in) :: posNOTonfile ! position is NOT on this file ! ! !LOCAL VARIABLES: - integer :: m integer :: varid ! netCDF variable id integer :: start({DIMS}+1), count({DIMS}+1) ! output bounds integer :: status ! error code @@ -1311,9 +1336,9 @@ contains logical :: found ! if true, found lat/lon dims on file character(len=32) :: vname ! variable error checking type(var_desc_t) :: vardesc ! local vardesc pointer - {VTYPE} :: temp(1) + integer :: ndims + {VTYPE} :: temp(1) character(len=*),parameter :: subname='ncd_io_{DIMS}d_{TYPE}_glob' - integer :: ndims !----------------------------------------------------------------------- start(:) = 0 @@ -1366,7 +1391,7 @@ contains call ncd_inqvid (ncid, varname, varid, vardesc) #if ({DIMS}==0) start(1) = 1 ; count(1) = 1 - if (present(nt)) start(1) = nt ; count(1) = 1 + if (present(nt)) start(1) = nt temp(1) = data status = pio_put_var(ncid, varid, start(1:1), count(1:1), temp) #elif ({DIMS}==1) @@ -1392,7 +1417,7 @@ contains end if #endif - endif + endif ! flag end subroutine ncd_io_{DIMS}d_{TYPE}_glob From 7e5d52d9324c0a5fba2a66e852fb6aa9da7b120f Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Fri, 12 Oct 2018 06:59:59 -0600 Subject: [PATCH 24/54] Read whole history_tape_in_use array at once It wasn't working to read this array one element at a time: the ncd_io routine seems not to support this use. Now that I have fixed this routine to allow reading / writing of 1-d data, I'm leveraging this functionality. --- src/main/histFileMod.F90 | 40 +++++++++++++++++++--------------------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/src/main/histFileMod.F90 b/src/main/histFileMod.F90 index d09bc523b2..a4eb5331ed 100644 --- a/src/main/histFileMod.F90 +++ b/src/main/histFileMod.F90 @@ -3608,7 +3608,7 @@ subroutine hist_restart_ncd (bounds, ncid, flag, rdate) integer :: dimid ! dimension ID integer :: k ! 1d index integer :: ntapes_onfile ! number of history tapes on the restart file - logical :: history_tape_in_use_onfile ! whether a given history tape is in use, according to the restart file + logical, allocatable :: history_tape_in_use_onfile(:) ! whether a given history tape is in use, according to the restart file integer :: nflds_onfile ! number of history fields on the restart file logical :: readvar ! whether a variable was read successfully integer :: t ! tape index @@ -3990,33 +3990,31 @@ subroutine hist_restart_ncd (bounds, ncid, flag, rdate) additional_msg=errMsg(sourcefile, __LINE__)) end if - do t = 1, ntapes - ! NOTE(wjs, 2018-10-06) Ideally, we'd read all values of history_tape_in_use - ! at once. However, we currently don't have a 1-d logical ncd_io routine, so - ! we have to read values one at a time. + if (ntapes > 0) then + allocate(history_tape_in_use_onfile(ntapes)) call ncd_io('history_tape_in_use', history_tape_in_use_onfile, 'read', ncid, & - readvar=readvar, nt=t) + readvar=readvar) if (.not. readvar) then ! BACKWARDS_COMPATIBILITY(wjs, 2018-10-06) Old restart files do not have ! 'history_tape_in_use'. However, before now, this has implicitly been ! true for all tapes <= ntapes. - history_tape_in_use_onfile = .true. + history_tape_in_use_onfile(:) = .true. end if - if (history_tape_in_use_onfile .neqv. history_tape_in_use(t)) then - write(iulog,*) subname//' ERROR: history_tape_in_use on restart file' - write(iulog,*) 'disagrees with current run: For tape ', t - write(iulog,*) 'On restart file: ', history_tape_in_use_onfile - write(iulog,*) 'In current run : ', history_tape_in_use(t) - write(iulog,*) 'This suggests that this tape was empty in one case,' - write(iulog,*) 'but non-empty in the other. (history_tape_in_use .false.' - write(iulog,*) 'means that history tape is empty.)' - call endrun(msg=' ERROR: history_tape_in_use differs from restart file. '// & - 'You can NOT change history options on restart.', & - additional_msg=errMsg(sourcefile, __LINE__)) - end if - end do + do t = 1, ntapes + if (history_tape_in_use_onfile(t) .neqv. history_tape_in_use(t)) then + write(iulog,*) subname//' ERROR: history_tape_in_use on restart file' + write(iulog,*) 'disagrees with current run: For tape ', t + write(iulog,*) 'On restart file: ', history_tape_in_use_onfile(t) + write(iulog,*) 'In current run : ', history_tape_in_use(t) + write(iulog,*) 'This suggests that this tape was empty in one case,' + write(iulog,*) 'but non-empty in the other. (history_tape_in_use .false.' + write(iulog,*) 'means that history tape is empty.)' + call endrun(msg=' ERROR: history_tape_in_use differs from restart file. '// & + 'You can NOT change history options on restart.', & + additional_msg=errMsg(sourcefile, __LINE__)) + end if + end do - if (ntapes > 0 )then call ncd_io('locfnh', locfnh(1:ntapes), 'read', ncid ) call ncd_io('locfnhr', locrest(1:ntapes), 'read', ncid ) do t = 1,ntapes From d7efaa97242cb5cc57af9cf10c4208a09d641728 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Mon, 15 Oct 2018 10:16:00 -0600 Subject: [PATCH 25/54] Change = to += in hist_fexcl and hist_fincl lists This will be more robust as we leverage inheritance more heavily in these usermods. --- .../usermods_dirs/cmip6_output/user_nl_clm | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/cime_config/usermods_dirs/cmip6_output/user_nl_clm b/cime_config/usermods_dirs/cmip6_output/user_nl_clm index 5c9890a64f..1ac4015e5e 100644 --- a/cime_config/usermods_dirs/cmip6_output/user_nl_clm +++ b/cime_config/usermods_dirs/cmip6_output/user_nl_clm @@ -20,13 +20,13 @@ ! h0 stream (monthly average, gridcell-level) ! Emon, Lmon, LIMon -hist_fexcl1 = 'PCT_CFT', 'PCT_GLC_MEC', 'SOIL1C_vr', 'SOIL1N_vr', 'SOIL2C_vr', 'SOIL2N_vr', 'SOIL3C_vr', 'SOIL3N_vr', 'CWDC_vr', +hist_fexcl1 += 'PCT_CFT', 'PCT_GLC_MEC', 'SOIL1C_vr', 'SOIL1N_vr', 'SOIL2C_vr', 'SOIL2N_vr', 'SOIL3C_vr', 'SOIL3N_vr', 'CWDC_vr', 'LITR1C_vr', 'LITR2C_vr', 'LITR3C_vr', 'LITR1N_vr', 'LITR2N_vr', 'LITR3N_vr','CWDN_vr', 'PCT_NAT_PFT','SMIN_NO3_vr','CONC_O2_UNSAT', 'CONC_O2_SAT','SMIN_NH4_vr','SMINN_vr' ! h0 stream ICE variables and other variables inactive by default (monthly average, gridcell-level) ! Emon, Lmon, LIMon -hist_fincl1 = 'EFLX_LH_TOT_ICE', 'FIRE_ICE', 'FLDS_ICE', 'FSH_ICE', 'FSNO_ICE', 'FSR_ICE', +hist_fincl1 += 'EFLX_LH_TOT_ICE', 'FIRE_ICE', 'FLDS_ICE', 'FSH_ICE', 'FSNO_ICE', 'FSR_ICE', 'QFLX_SUB_SNOW_ICE', 'QRUNOFF_ICE', 'QSNOFRZ_ICE', 'QSNOMELT_ICE', 'RAIN_ICE', 'SNOW_ICE', 'SNOWICE_ICE', 'SNOWLIQ_ICE', 'SNOTXMASS_ICE', 'TG_ICE', 'TOPO_COL_ICE', 'TSA_ICE', 'TSOI_ICE', 'LEAFC_TO_LITTER', 'FROOTC_TO_LITTER','LITR1C_TO_SOIL1C','LITR1N_TO_SOIL1N','LITR2C_TO_SOIL1C', @@ -34,42 +34,42 @@ hist_fincl1 = 'EFLX_LH_TOT_ICE', 'FIRE_ICE', 'FLDS_ICE', 'FSH_ICE', 'FSNO_ICE', ! h1 stream (monthly average, finest sub-grid) ! Emon, Lmon -hist_fincl2 = 'GPP', 'NPP', 'AGNPP', 'TLAI', 'TOTVEGC', 'TSA','TREFMNAV','TREFMXAV', 'BTRANMN', 'NPP_NUPTAKE', 'GRAINC_TO_FOOD', +hist_fincl2 += 'GPP', 'NPP', 'AGNPP', 'TLAI', 'TOTVEGC', 'TSA','TREFMNAV','TREFMXAV', 'BTRANMN', 'NPP_NUPTAKE', 'GRAINC_TO_FOOD', 'Vcmx25Z', 'FSH', 'NFERTILIZATION', 'AR', 'VEGWP', 'FCTR', 'FCEV', 'FGEV', 'FIRE', 'FSR', 'HTOP', 'FIRA', 'FSA', 'HR', 'GSSUNLN', 'GSSHALN', 'TSKIN' ! h2 stream (monthly average, landunit-level) ! Emon ! TOT_WOODPRODC:I, CROPPROD1C:I, and NEE are not available at the landunit level -hist_fincl3 = 'FSR', 'H2OSNO', 'Q2M', 'SNOWDP', 'TSA', 'TREFMNAV', 'TREFMXAV', 'TG', 'QRUNOFF', 'FSH', 'FIRE', 'FIRA', 'FGR', +hist_fincl3 += 'FSR', 'H2OSNO', 'Q2M', 'SNOWDP', 'TSA', 'TREFMNAV', 'TREFMXAV', 'TG', 'QRUNOFF', 'FSH', 'FIRE', 'FIRA', 'FGR', 'EFLX_LH_TOT', 'RH2M', 'TLAI', 'GPP', 'NPP', 'SOILWATER_10CM', 'TOTSOILLIQ', 'TOTSOILICE', 'AR', 'HR', 'DWT_CONV_CFLUX_PATCH', 'WOOD_HARVESTC', 'U10', 'DWT_WOOD_PRODUCTC_GAIN_PATCH', 'GRAINC_TO_FOOD', 'SLASH_HARVESTC', 'TSOI_10CM', 'COL_FIRE_CLOSS', 'DWT_SLASH_CFLUX', 'QIRRIG', 'URBAN_HEAT', 'WASTEHEAT', 'HTOP', 'TSKIN', 'FROOTC:I' ! h3 stream (yearly average, gridcell-level) ! Eyr -hist_fincl4 = 'PCT_CFT', 'PCT_GLC_MEC', 'SOIL1C_vr', 'SOIL1N_vr', 'SOIL2C_vr', 'SOIL2N_vr', 'SOIL3C_vr', 'SOIL3N_vr', 'CWDC_vr', +hist_fincl4 += 'PCT_CFT', 'PCT_GLC_MEC', 'SOIL1C_vr', 'SOIL1N_vr', 'SOIL2C_vr', 'SOIL2N_vr', 'SOIL3C_vr', 'SOIL3N_vr', 'CWDC_vr', 'LITR1C_vr', 'LITR2C_vr', 'LITR3C_vr', 'LITR1N_vr', 'LITR2N_vr', 'LITR3N_vr','CWDN_vr', 'QICE_FORC', 'TSRF_FORC', 'TOPO_FORC' 'PCT_NAT_PFT','PCT_LANDUNIT','TOTLITC:I','TOT_WOODPRODC:I','CROPPROD1C:I','TOTSOMC:I','TOTVEGC:I','FSNO_ICE' ! h4 stream (yearly average, landunit-level) ! Eyr landuse tiles -hist_fincl5 = 'TOTSOMC:I', 'TOTSOMC_1m:I', 'TOTECOSYSC:I', 'TOTVEGC:I', 'WOODC:I', 'TOTLITC:I', 'LIVECROOTC:I', 'DEADCROOTC:I', 'FROOTC:I' +hist_fincl5 += 'TOTSOMC:I', 'TOTSOMC_1m:I', 'TOTECOSYSC:I', 'TOTVEGC:I', 'WOODC:I', 'TOTLITC:I', 'LIVECROOTC:I', 'DEADCROOTC:I', 'FROOTC:I' ! h5 stream (daily average, gridcell-level) ! day, Eday -hist_fincl6 = 'SOILWATER_10CM', 'TOTSOILLIQ', 'TOTSOILICE', 'GPP', 'NPP', 'AR', 'HR', 'EFLX_LH_TOT', 'FSH', 'FGR12', 'FSM', 'QSNOEVAP', 'TLAI', 'QDRAI', 'QDRAI_PERCH', 'QOVER', 'QFLX_SUB_SNOW', 'FSA', 'FIRA', 'H2OSNO', 'SNOCAN', 'QSNOFRZ', 'QFLX_SNOW_DRAIN', 'SNOWDP', 'H2OSFC', 'TV', 'TG', 'TAUX', 'TAUY', 'QVEGT', 'TWS', 'H2OCAN', 'ALT', 'QVEGE', 'QSOIL', 'TSKIN', 'FSDS','FSNO','SNOFSRVD','SNOFSRVI','SNOFSRND','SNOFSRNI','FSDSVD','FSDSVI','FSDSND','FSDSNI','SNOWLIQ','SOILICE','SOILLIQ','QINTR','SNOBCMSL','TSOI','SNOTXMASS','SNOWICE','SNOWLIQ','QRUNOFF','RAIN','SNOW' +hist_fincl6 += 'SOILWATER_10CM', 'TOTSOILLIQ', 'TOTSOILICE', 'GPP', 'NPP', 'AR', 'HR', 'EFLX_LH_TOT', 'FSH', 'FGR12', 'FSM', 'QSNOEVAP', 'TLAI', 'QDRAI', 'QDRAI_PERCH', 'QOVER', 'QFLX_SUB_SNOW', 'FSA', 'FIRA', 'H2OSNO', 'SNOCAN', 'QSNOFRZ', 'QFLX_SNOW_DRAIN', 'SNOWDP', 'H2OSFC', 'TV', 'TG', 'TAUX', 'TAUY', 'QVEGT', 'TWS', 'H2OCAN', 'ALT', 'QVEGE', 'QSOIL', 'TSKIN', 'FSDS','FSNO','SNOFSRVD','SNOFSRVI','SNOFSRND','SNOFSRNI','FSDSVD','FSDSVI','FSDSND','FSDSNI','SNOWLIQ','SOILICE','SOILLIQ','QINTR','SNOBCMSL','TSOI','SNOTXMASS','SNOWICE','SNOWLIQ','QRUNOFF','RAIN','SNOW' ! h6 stream (daily average, landunit-level) ! Eday -hist_fincl7 = 'TREFMXAV','TREFMNAV' +hist_fincl7 += 'TREFMXAV','TREFMNAV' ! h7 stream (3-hourly average, gridcell-level) ! 3hr, E3hr, CF3hr ! 3hr requires QRUNOFF for time mean, and SOILWATER_10CM, TSKIN for time point (I) ! E3hr requires GPP, AR, HR for time mean ! CF3hr requires QFLX_SUB_SNOW for time point (I) -hist_fincl8 = 'GPP','AR','HR','TSA','RH2M','SOILWATER_10CM:I','FSH','EFLX_LH_TOT','FSDS','QRUNOFF','QFLX_SUB_SNOW:I','TSKIN:I' +hist_fincl8 += 'GPP','AR','HR','TSA','RH2M','SOILWATER_10CM:I','FSH','EFLX_LH_TOT','FSDS','QRUNOFF','QFLX_SUB_SNOW:I','TSKIN:I' hist_mfilt = 1,1,1,1,1,365,365,2920 hist_dov2xy = .true.,.false.,.false.,.true.,.false.,.true.,.false.,.true. From 1f9a3d57eb8e1d4c393bda79c49945edb65fe66f Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Mon, 15 Oct 2018 10:18:10 -0600 Subject: [PATCH 26/54] Move the setting of histaux_l2x1yrg into cmip6_glaciers This setting is generally wanted when the other cmip6_glaciers settings are wanted. This move will allow us to use cmip6_output for more general purposes. --- .../usermods_dirs/{cmip6_output => cmip6_glaciers}/user_nl_cpl | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename cime_config/usermods_dirs/{cmip6_output => cmip6_glaciers}/user_nl_cpl (100%) diff --git a/cime_config/usermods_dirs/cmip6_output/user_nl_cpl b/cime_config/usermods_dirs/cmip6_glaciers/user_nl_cpl similarity index 100% rename from cime_config/usermods_dirs/cmip6_output/user_nl_cpl rename to cime_config/usermods_dirs/cmip6_glaciers/user_nl_cpl From 632bd5fa6cc0a71262a02e5b8a8bfcb2a5c52f89 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Mon, 22 Oct 2018 06:50:46 -0600 Subject: [PATCH 27/54] Start adding usermods directories for extra output This begins to add hierarchical usermods directories for getting extra output. output_base and output_base_highfreq will serve as the starting point for specific configurations (for SP, BGC and BGC-CROP). This also adds directories for SP (output_sp and output_sp_highfreq). BGC and BGC-CROP versions are still needed. Note that hist_nhtfrq and related options are listed individually, like: hist_nhtfrq(1) = 0 hist_nhtfrq(2) = 0 ... rather than as a list: hist_nhtfrq = 0,0,... My rationale for this is two-fold: (1) It more clearly shows the association between fields and characteristics of the tape (2) It makes things work right if a given usermods directory ends up including both output_base and output_base_highfreq directly or indirectly (which is easy to have happen). --- cime_config/usermods_dirs/output_base/README | 6 ++ .../usermods_dirs/output_base/user_nl_clm | 66 +++++++++++++++++++ .../usermods_dirs/output_base_highfreq/README | 7 ++ .../output_base_highfreq/include_user_mods | 1 + .../output_base_highfreq/user_nl_clm | 31 +++++++++ .../usermods_dirs/output_sp/include_user_mods | 1 + .../usermods_dirs/output_sp/user_nl_clm | 10 +++ .../output_sp_highfreq/include_user_mods | 2 + .../output_sp_highfreq/user_nl_clm | 10 +++ 9 files changed, 134 insertions(+) create mode 100644 cime_config/usermods_dirs/output_base/README create mode 100644 cime_config/usermods_dirs/output_base/user_nl_clm create mode 100644 cime_config/usermods_dirs/output_base_highfreq/README create mode 100644 cime_config/usermods_dirs/output_base_highfreq/include_user_mods create mode 100644 cime_config/usermods_dirs/output_base_highfreq/user_nl_clm create mode 100644 cime_config/usermods_dirs/output_sp/include_user_mods create mode 100644 cime_config/usermods_dirs/output_sp/user_nl_clm create mode 100644 cime_config/usermods_dirs/output_sp_highfreq/include_user_mods create mode 100644 cime_config/usermods_dirs/output_sp_highfreq/user_nl_clm diff --git a/cime_config/usermods_dirs/output_base/README b/cime_config/usermods_dirs/output_base/README new file mode 100644 index 0000000000..12022992fb --- /dev/null +++ b/cime_config/usermods_dirs/output_base/README @@ -0,0 +1,6 @@ +This usermods directory provides a common base on which other usermods +can build for changing the out-of-the-box output to something more +generally useful. + +This should not be used directly. Instead, use one of the other usermods +directories that builds on this. diff --git a/cime_config/usermods_dirs/output_base/user_nl_clm b/cime_config/usermods_dirs/output_base/user_nl_clm new file mode 100644 index 0000000000..6f85d5a516 --- /dev/null +++ b/cime_config/usermods_dirs/output_base/user_nl_clm @@ -0,0 +1,66 @@ +!---------------------------------------------------------------------------------- +! Users should add all user specific namelist changes below in the form of +! namelist_var = new_namelist_value +! +! EXCEPTIONS: +! Set use_cndv by the compset you use and the CLM_BLDNML_OPTS -dynamic_vegetation setting +! Set use_vichydro by the compset you use and the CLM_BLDNML_OPTS -vichydro setting +! Set use_cn by the compset you use and CLM_BLDNML_OPTS -bgc setting +! Set use_crop by the compset you use and CLM_BLDNML_OPTS -crop setting +! Set spinup_state by the CLM_BLDNML_OPTS -bgc_spinup setting +! Set irrigate by the CLM_BLDNML_OPTS -irrig setting +! Set co2_ppmv with CCSM_CO2_PPMV option +! Set dtime with L_NCPL option +! Set fatmlndfrc with LND_DOMAIN_PATH/LND_DOMAIN_FILE options +! Set finidat with RUN_REFCASE/RUN_REFDATE/RUN_REFTOD options for hybrid or branch cases +! (includes $inst_string for multi-ensemble cases) +! Set maxpatch_glcmec with GLC_NEC option +! Set glc_do_dynglacier with GLC_TWO_WAY_COUPLING env variable +!---------------------------------------------------------------------------------- + +!---------------------------------------------------------------------------------- +! Settings from output_base +!---------------------------------------------------------------------------------- + +! h0 stream (monthly average, gridcell-level) +! h0 stream ICE variables and other variables inactive by default (monthly average, gridcell-level) +! Emon, Lmon, LIMon +hist_mfilt(1) = 1 +hist_dov2xy(1) = .true. +hist_nhtfrq(1) = 0 +hist_type1d_pertape(1) = ' ' +hist_fexcl1 += 'PCT_GLC_MEC','PCT_NAT_PFT' +hist_fincl1 += 'EFLX_LH_TOT_ICE', 'FIRE_ICE', 'FLDS_ICE', 'FSH_ICE', 'FSNO_ICE', 'FSR_ICE', 'QFLX_SUB_SNOW_ICE', 'QRUNOFF_ICE', 'QSNOFRZ_ICE', 'QSNOMELT_ICE', 'RAIN_ICE', 'SNOW_ICE', 'SNOWICE_ICE', 'SNOWLIQ_ICE', 'SNOTXMASS_ICE', 'TG_ICE', 'TOPO_COL_ICE', 'TSA_ICE', 'TSOI_ICE' + +! h1 stream (monthly average, finest sub-grid) +! Emon, Lmon +hist_mfilt(2) = 1 +hist_dov2xy(2) = .false. +hist_nhtfrq(2) = 0 +hist_type1d_pertape(2) = ' ' +hist_fincl2 += 'TLAI', 'TSA','TREFMNAV','TREFMXAV', 'BTRANMN', 'Vcmx25Z', 'FSH', 'VEGWP', 'FCTR', 'FCEV', 'FGEV', 'FIRE', 'FSR', 'HTOP', 'FIRA', 'FSA', 'HR', 'GSSUNLN', 'GSSHALN', 'TSKIN' + +! h2 stream (monthly average, landunit-level) +! Emon +hist_mfilt(3) = 1 +hist_dov2xy(3) = .false. +hist_nhtfrq(3) = 0 +hist_type1d_pertape(3) = 'LAND' +hist_fincl3 += 'FSR', 'H2OSNO', 'Q2M', 'SNOWDP', 'TSA', 'TREFMNAV', 'TREFMXAV', 'TG', 'QRUNOFF', 'FSH', 'FIRE', 'FIRA', 'FGR', 'EFLX_LH_TOT', 'RH2M', 'TLAI', 'SOILWATER_10CM', 'TOTSOILLIQ', 'TOTSOILICE', 'U10', 'TSOI_10CM', 'QIRRIG', 'URBAN_HEAT', 'WASTEHEAT', 'TSKIN' + +! h3 stream (yearly average, gridcell-level) +! Eyr +hist_mfilt(4) = 1 +hist_dov2xy(4) = .true. +hist_nhtfrq(4) = -8760 +hist_type1d_pertape(4) = ' ' +hist_fincl4 += 'PCT_GLC_MEC', 'QICE_FORC', 'TSRF_FORC', 'TOPO_FORC', 'PCT_NAT_PFT','PCT_LANDUNIT','FSNO_ICE' + +! h4 stream (yearly average, landunit-level) +! Eyr landuse tiles +! (No fields in base, but other usermods add to this stream) +hist_mfilt(5) = 1 +hist_dov2xy(5) = .false. +hist_nhtfrq(5) = -8760 +hist_type1d_pertape(5) = 'LAND' + diff --git a/cime_config/usermods_dirs/output_base_highfreq/README b/cime_config/usermods_dirs/output_base_highfreq/README new file mode 100644 index 0000000000..fe6c7e0999 --- /dev/null +++ b/cime_config/usermods_dirs/output_base_highfreq/README @@ -0,0 +1,7 @@ +This usermods directory provides a common base on which other usermods +can build for changing the out-of-the-box output to something useful +when you want to include high-frequency output (daily and more +frequent). + +This should not be used directly. Instead, use one of the other usermods +directories that builds on this. diff --git a/cime_config/usermods_dirs/output_base_highfreq/include_user_mods b/cime_config/usermods_dirs/output_base_highfreq/include_user_mods new file mode 100644 index 0000000000..bee18982f6 --- /dev/null +++ b/cime_config/usermods_dirs/output_base_highfreq/include_user_mods @@ -0,0 +1 @@ +../output_base diff --git a/cime_config/usermods_dirs/output_base_highfreq/user_nl_clm b/cime_config/usermods_dirs/output_base_highfreq/user_nl_clm new file mode 100644 index 0000000000..969f9ab7fd --- /dev/null +++ b/cime_config/usermods_dirs/output_base_highfreq/user_nl_clm @@ -0,0 +1,31 @@ +!---------------------------------------------------------------------------------- +! Settings from output_base_highfreq +!---------------------------------------------------------------------------------- + +! h5 stream (daily average, gridcell-level) +! day, Eday +hist_mfilt(6) = 365 +hist_dov2xy(6) = .true. +hist_nhtfrq(6) = -24 +hist_type1d_pertape(6) = ' ' +hist_fincl6 += 'SOILWATER_10CM', 'TOTSOILLIQ', 'TOTSOILICE', 'EFLX_LH_TOT', 'FSH', 'FGR12', 'FSM', 'QSNOEVAP', 'TLAI', 'QDRAI', 'QDRAI_PERCH', 'QOVER', 'QFLX_SUB_SNOW', 'FSA', 'FIRA', 'H2OSNO', 'SNOCAN', 'QSNOFRZ', 'QFLX_SNOW_DRAIN', 'SNOWDP', 'H2OSFC', 'TV', 'TG', 'TAUX', 'TAUY', 'QVEGT', 'TWS', 'H2OCAN', 'QVEGE', 'QSOIL', 'TSKIN', 'FSDS','FSNO','SNOFSRVD','SNOFSRVI','SNOFSRND','SNOFSRNI','FSDSVD','FSDSVI','FSDSND','FSDSNI','SNOWLIQ','SOILICE','SOILLIQ','QINTR','SNOBCMSL','TSOI','SNOTXMASS','SNOWICE','SNOWLIQ','QRUNOFF','RAIN','SNOW' + +! h6 stream (daily average, landunit-level) +! Eday +hist_mfilt(7) = 365 +hist_dov2xy(7) = .false. +hist_nhtfrq(7) = -24 +hist_type1d_pertape(7) = 'LAND' +hist_fincl7 += 'TREFMXAV','TREFMNAV' + +! h7 stream (3-hourly average, gridcell-level) +! 3hr, E3hr, CF3hr +! 3hr requires QRUNOFF for time mean, and SOILWATER_10CM, TSKIN for time point (I) +! E3hr requires GPP, AR, HR for time mean +! CF3hr requires QFLX_SUB_SNOW for time point (I) +hist_mfilt(8) = 2920 +hist_dov2xy(8) = .true. +hist_nhtfrq(8) = -3 +hist_type1d_pertape(8) = ' ' +hist_fincl8 += 'TSA','RH2M','SOILWATER_10CM:I','FSH','EFLX_LH_TOT','FSDS','QRUNOFF','QFLX_SUB_SNOW:I','TSKIN:I' + diff --git a/cime_config/usermods_dirs/output_sp/include_user_mods b/cime_config/usermods_dirs/output_sp/include_user_mods new file mode 100644 index 0000000000..bee18982f6 --- /dev/null +++ b/cime_config/usermods_dirs/output_sp/include_user_mods @@ -0,0 +1 @@ +../output_base diff --git a/cime_config/usermods_dirs/output_sp/user_nl_clm b/cime_config/usermods_dirs/output_sp/user_nl_clm new file mode 100644 index 0000000000..1dfb4970b5 --- /dev/null +++ b/cime_config/usermods_dirs/output_sp/user_nl_clm @@ -0,0 +1,10 @@ +!---------------------------------------------------------------------------------- +! Settings from output_sp +!---------------------------------------------------------------------------------- + +! h1 stream (monthly average, finest sub-grid) +hist_fincl2 += 'FPSN' + +! h2 stream (monthly average, landunit-level) +hist_fincl3 += 'FPSN' + diff --git a/cime_config/usermods_dirs/output_sp_highfreq/include_user_mods b/cime_config/usermods_dirs/output_sp_highfreq/include_user_mods new file mode 100644 index 0000000000..4a3a211b15 --- /dev/null +++ b/cime_config/usermods_dirs/output_sp_highfreq/include_user_mods @@ -0,0 +1,2 @@ +../output_sp +../output_base_highfreq diff --git a/cime_config/usermods_dirs/output_sp_highfreq/user_nl_clm b/cime_config/usermods_dirs/output_sp_highfreq/user_nl_clm new file mode 100644 index 0000000000..a8f6e30965 --- /dev/null +++ b/cime_config/usermods_dirs/output_sp_highfreq/user_nl_clm @@ -0,0 +1,10 @@ +!---------------------------------------------------------------------------------- +! Settings from output_sp_highfreq +!---------------------------------------------------------------------------------- + +! h5 stream (daily average, gridcell-level) +hist_fincl6 += 'FPSN' + +! h7 stream (3-hourly average, gridcell-level) +hist_fincl8 += 'FPSN' + From 9bdaac434a30cc8654f429b18d57a8cb801046fd Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Mon, 22 Oct 2018 15:55:00 -0600 Subject: [PATCH 28/54] Add output_bgc and output_bgc_highfreq usermods --- .../output_bgc/include_user_mods | 1 + .../usermods_dirs/output_bgc/user_nl_clm | 21 +++++++++++++++++++ .../output_bgc_highfreq/include_user_mods | 2 ++ .../output_bgc_highfreq/user_nl_clm | 11 ++++++++++ 4 files changed, 35 insertions(+) create mode 100644 cime_config/usermods_dirs/output_bgc/include_user_mods create mode 100644 cime_config/usermods_dirs/output_bgc/user_nl_clm create mode 100644 cime_config/usermods_dirs/output_bgc_highfreq/include_user_mods create mode 100644 cime_config/usermods_dirs/output_bgc_highfreq/user_nl_clm diff --git a/cime_config/usermods_dirs/output_bgc/include_user_mods b/cime_config/usermods_dirs/output_bgc/include_user_mods new file mode 100644 index 0000000000..bee18982f6 --- /dev/null +++ b/cime_config/usermods_dirs/output_bgc/include_user_mods @@ -0,0 +1 @@ +../output_base diff --git a/cime_config/usermods_dirs/output_bgc/user_nl_clm b/cime_config/usermods_dirs/output_bgc/user_nl_clm new file mode 100644 index 0000000000..be63446b98 --- /dev/null +++ b/cime_config/usermods_dirs/output_bgc/user_nl_clm @@ -0,0 +1,21 @@ +!---------------------------------------------------------------------------------- +! Settings from output_bgc +!---------------------------------------------------------------------------------- + +! h0 stream (monthly average, gridcell-level) +hist_fexcl1 += 'SOIL1C_vr', 'SOIL1N_vr', 'SOIL2C_vr', 'SOIL2N_vr', 'SOIL3C_vr', 'SOIL3N_vr', 'CWDC_vr', 'LITR1C_vr', 'LITR2C_vr', 'LITR3C_vr', 'LITR1N_vr', 'LITR2N_vr', 'LITR3N_vr', 'CWDN_vr', 'SMIN_NO3_vr', 'CONC_O2_UNSAT', 'CONC_O2_SAT','SMIN_NH4_vr','SMINN_vr' +hist_fincl1 += 'LEAFC_TO_LITTER', 'FROOTC_TO_LITTER','LITR1C_TO_SOIL1C','LITR1N_TO_SOIL1N','LITR2C_TO_SOIL1C', 'LITR2N_TO_SOIL1N','LITR3C_TO_SOIL2C','LITR3N_TO_SOIL2N','DWT_WOOD_PRODUCTC_GAIN_PATCH' + +! h1 stream (monthly average, finest sub-grid) +hist_fincl2 += 'GPP', 'NPP', 'AGNPP', 'TOTVEGC', 'NPP_NUPTAKE', 'Vcmx25Z', 'AR' + +! h2 stream (monthly average, landunit-level) +! TOT_WOODPRODC:I, CROPPROD1C:I, and NEE are not available at the landunit level +hist_fincl3 += 'GPP', 'NPP', 'AR', 'HR', 'DWT_CONV_CFLUX_PATCH', 'WOOD_HARVESTC', 'DWT_WOOD_PRODUCTC_GAIN_PATCH', 'SLASH_HARVESTC', 'COL_FIRE_CLOSS', 'DWT_SLASH_CFLUX', 'FROOTC:I', 'HTOP' + +! h3 stream (yearly average, gridcell-level) +hist_fincl4 += 'SOIL1C_vr', 'SOIL1N_vr', 'SOIL2C_vr', 'SOIL2N_vr', 'SOIL3C_vr', 'SOIL3N_vr', 'CWDC_vr', 'LITR1C_vr', 'LITR2C_vr', 'LITR3C_vr', 'LITR1N_vr', 'LITR2N_vr', 'LITR3N_vr','CWDN_vr', 'TOTLITC:I', 'TOT_WOODPRODC:I', 'TOTSOMC:I','TOTVEGC:I' + +! h4 stream (yearly average, landunit-level) +hist_fincl5 += 'TOTSOMC:I', 'TOTSOMC_1m:I', 'TOTECOSYSC:I', 'TOTVEGC:I', 'WOODC:I', 'TOTLITC:I', 'LIVECROOTC:I', 'DEADCROOTC:I', 'FROOTC:I' + diff --git a/cime_config/usermods_dirs/output_bgc_highfreq/include_user_mods b/cime_config/usermods_dirs/output_bgc_highfreq/include_user_mods new file mode 100644 index 0000000000..3d7b23c7ad --- /dev/null +++ b/cime_config/usermods_dirs/output_bgc_highfreq/include_user_mods @@ -0,0 +1,2 @@ +../output_bgc +../output_base_highfreq diff --git a/cime_config/usermods_dirs/output_bgc_highfreq/user_nl_clm b/cime_config/usermods_dirs/output_bgc_highfreq/user_nl_clm new file mode 100644 index 0000000000..b6fc0b1133 --- /dev/null +++ b/cime_config/usermods_dirs/output_bgc_highfreq/user_nl_clm @@ -0,0 +1,11 @@ +!---------------------------------------------------------------------------------- +! Settings from output_bgc_highfreq +!---------------------------------------------------------------------------------- + +! h5 stream (daily average, gridcell-level) +hist_fincl6 += 'GPP', 'NPP', 'AR', 'HR', 'ALT' + +! h7 stream (3-hourly average, gridcell-level) +! E3hr requires GPP, AR, HR for time mean +hist_fincl8 += 'GPP','AR','HR' + From d0da10b05e11a9a5cb7f75161d7858f64cb651a1 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Mon, 22 Oct 2018 16:00:15 -0600 Subject: [PATCH 29/54] Move HTOP and HR to BGC-specific usermods These fields aren't available in SP cases --- cime_config/usermods_dirs/output_base/user_nl_clm | 2 +- cime_config/usermods_dirs/output_base_highfreq/user_nl_clm | 1 - cime_config/usermods_dirs/output_bgc/user_nl_clm | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/cime_config/usermods_dirs/output_base/user_nl_clm b/cime_config/usermods_dirs/output_base/user_nl_clm index 6f85d5a516..8ed36a1fa3 100644 --- a/cime_config/usermods_dirs/output_base/user_nl_clm +++ b/cime_config/usermods_dirs/output_base/user_nl_clm @@ -38,7 +38,7 @@ hist_mfilt(2) = 1 hist_dov2xy(2) = .false. hist_nhtfrq(2) = 0 hist_type1d_pertape(2) = ' ' -hist_fincl2 += 'TLAI', 'TSA','TREFMNAV','TREFMXAV', 'BTRANMN', 'Vcmx25Z', 'FSH', 'VEGWP', 'FCTR', 'FCEV', 'FGEV', 'FIRE', 'FSR', 'HTOP', 'FIRA', 'FSA', 'HR', 'GSSUNLN', 'GSSHALN', 'TSKIN' +hist_fincl2 += 'TLAI', 'TSA','TREFMNAV','TREFMXAV', 'BTRANMN', 'Vcmx25Z', 'FSH', 'VEGWP', 'FCTR', 'FCEV', 'FGEV', 'FIRE', 'FSR', 'FIRA', 'FSA', 'GSSUNLN', 'GSSHALN', 'TSKIN' ! h2 stream (monthly average, landunit-level) ! Emon diff --git a/cime_config/usermods_dirs/output_base_highfreq/user_nl_clm b/cime_config/usermods_dirs/output_base_highfreq/user_nl_clm index 969f9ab7fd..0972d19bb5 100644 --- a/cime_config/usermods_dirs/output_base_highfreq/user_nl_clm +++ b/cime_config/usermods_dirs/output_base_highfreq/user_nl_clm @@ -21,7 +21,6 @@ hist_fincl7 += 'TREFMXAV','TREFMNAV' ! h7 stream (3-hourly average, gridcell-level) ! 3hr, E3hr, CF3hr ! 3hr requires QRUNOFF for time mean, and SOILWATER_10CM, TSKIN for time point (I) -! E3hr requires GPP, AR, HR for time mean ! CF3hr requires QFLX_SUB_SNOW for time point (I) hist_mfilt(8) = 2920 hist_dov2xy(8) = .true. diff --git a/cime_config/usermods_dirs/output_bgc/user_nl_clm b/cime_config/usermods_dirs/output_bgc/user_nl_clm index be63446b98..0a2ad86eba 100644 --- a/cime_config/usermods_dirs/output_bgc/user_nl_clm +++ b/cime_config/usermods_dirs/output_bgc/user_nl_clm @@ -7,7 +7,7 @@ hist_fexcl1 += 'SOIL1C_vr', 'SOIL1N_vr', 'SOIL2C_vr', 'SOIL2N_vr', 'SOIL3C_vr', hist_fincl1 += 'LEAFC_TO_LITTER', 'FROOTC_TO_LITTER','LITR1C_TO_SOIL1C','LITR1N_TO_SOIL1N','LITR2C_TO_SOIL1C', 'LITR2N_TO_SOIL1N','LITR3C_TO_SOIL2C','LITR3N_TO_SOIL2N','DWT_WOOD_PRODUCTC_GAIN_PATCH' ! h1 stream (monthly average, finest sub-grid) -hist_fincl2 += 'GPP', 'NPP', 'AGNPP', 'TOTVEGC', 'NPP_NUPTAKE', 'Vcmx25Z', 'AR' +hist_fincl2 += 'GPP', 'NPP', 'AGNPP', 'TOTVEGC', 'NPP_NUPTAKE', 'Vcmx25Z', 'AR', 'HR', 'HTOP' ! h2 stream (monthly average, landunit-level) ! TOT_WOODPRODC:I, CROPPROD1C:I, and NEE are not available at the landunit level From 9b1c1fd5988d7883edcc9fa5f9429cc70d7a7e05 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Mon, 22 Oct 2018 16:21:05 -0600 Subject: [PATCH 30/54] Add output_crop and output_crop_highfreq usermods --- .../usermods_dirs/output_crop/include_user_mods | 1 + cime_config/usermods_dirs/output_crop/user_nl_clm | 15 +++++++++++++++ .../output_crop_highfreq/include_user_mods | 2 ++ 3 files changed, 18 insertions(+) create mode 100644 cime_config/usermods_dirs/output_crop/include_user_mods create mode 100644 cime_config/usermods_dirs/output_crop/user_nl_clm create mode 100644 cime_config/usermods_dirs/output_crop_highfreq/include_user_mods diff --git a/cime_config/usermods_dirs/output_crop/include_user_mods b/cime_config/usermods_dirs/output_crop/include_user_mods new file mode 100644 index 0000000000..3f5a274997 --- /dev/null +++ b/cime_config/usermods_dirs/output_crop/include_user_mods @@ -0,0 +1 @@ +../output_bgc diff --git a/cime_config/usermods_dirs/output_crop/user_nl_clm b/cime_config/usermods_dirs/output_crop/user_nl_clm new file mode 100644 index 0000000000..26cf990d5f --- /dev/null +++ b/cime_config/usermods_dirs/output_crop/user_nl_clm @@ -0,0 +1,15 @@ +!---------------------------------------------------------------------------------- +! Settings from output_crop +!---------------------------------------------------------------------------------- + +! h0 stream (monthly average, gridcell-level) +hist_fexcl1 += 'PCT_CFT' + +! h1 stream (monthly average, finest sub-grid) +hist_fincl2 += 'GRAINC_TO_FOOD','NFERTILIZATION' + +! h2 stream (monthly average, landunit-level) +hist_fincl3 += 'GRAINC_TO_FOOD' + +! h3 stream (yearly average, gridcell-level) +hist_fincl4 += 'PCT_CFT','CROPPROD1C:I' diff --git a/cime_config/usermods_dirs/output_crop_highfreq/include_user_mods b/cime_config/usermods_dirs/output_crop_highfreq/include_user_mods new file mode 100644 index 0000000000..62e8c58697 --- /dev/null +++ b/cime_config/usermods_dirs/output_crop_highfreq/include_user_mods @@ -0,0 +1,2 @@ +../output_crop +../output_bgc_highfreq From 25c55ecd8aae482459b3959e38fd9f455f82af6a Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Tue, 23 Oct 2018 13:07:38 -0600 Subject: [PATCH 31/54] Rework cmip6 usermods and testmods to leverage the new output usermods Note that the cmip6 testmods now uses cmip6_deck_highfreq rather than cmip6_evolving_glaciers (partly because cmip6_evolving_glaciers doesn't include high-frequency output, and partly because I think it's more important to have a test of that more standard configuration). This means that we don't have any tests of cmip6_evolving_glaciers. I think that's okay, since the diffs relative to cmip6_deck are minimal. --- cime_config/testdefs/testlist_clm.xml | 4 +- .../testdefs/testmods_dirs/clm/cmip6/README | 6 -- .../testmods_dirs/clm/cmip6/include_user_mods | 1 - .../testmods_dirs/clm/cmip6/shell_commands | 4 - .../clm/cmip6_deck_highfreq/include_user_mods | 1 + .../clm/cmip6_deck_highfreq/shell_commands | 6 ++ .../{cmip6 => cmip6_deck}/include_user_mods | 2 +- .../cmip6_deck_highfreq/include_user_mods | 2 + .../cmip6_evolving_icesheet/include_user_mods | 2 +- .../cmip6_evolving_icesheet/user_nl_clm | 6 ++ .../usermods_dirs/cmip6_glaciers/user_nl_clm | 4 + cime_config/usermods_dirs/cmip6_output/README | 5 -- .../usermods_dirs/cmip6_output/shell_commands | 4 - .../usermods_dirs/cmip6_output/user_nl_clm | 77 ------------------- 14 files changed, 23 insertions(+), 101 deletions(-) delete mode 100644 cime_config/testdefs/testmods_dirs/clm/cmip6/README delete mode 100644 cime_config/testdefs/testmods_dirs/clm/cmip6/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/cmip6/shell_commands create mode 100644 cime_config/testdefs/testmods_dirs/clm/cmip6_deck_highfreq/include_user_mods create mode 100644 cime_config/testdefs/testmods_dirs/clm/cmip6_deck_highfreq/shell_commands rename cime_config/usermods_dirs/{cmip6 => cmip6_deck}/include_user_mods (52%) create mode 100644 cime_config/usermods_dirs/cmip6_deck_highfreq/include_user_mods delete mode 100644 cime_config/usermods_dirs/cmip6_output/README delete mode 100644 cime_config/usermods_dirs/cmip6_output/shell_commands delete mode 100644 cime_config/usermods_dirs/cmip6_output/user_nl_clm diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 061615a5dc..1a3e7a90e1 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -980,7 +980,7 @@ - + @@ -1486,7 +1486,7 @@ - + diff --git a/cime_config/testdefs/testmods_dirs/clm/cmip6/README b/cime_config/testdefs/testmods_dirs/clm/cmip6/README deleted file mode 100644 index 40b90f9ce0..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/cmip6/README +++ /dev/null @@ -1,6 +0,0 @@ -Note that this testmod directory includes cmip6_evolving_icesheet rather -than simply cmip6: cmip6_evolving_icesheet includes cmip6 and adds to -it. So, rather than having tests of the cmip6 usermods and separate -tests of cmip6_evolving_icesheet, it's more efficient to just have tests -of the cmip6_evolving_icesheet usermods directory, which then also cover -the cmip6 usermods directory. diff --git a/cime_config/testdefs/testmods_dirs/clm/cmip6/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/cmip6/include_user_mods deleted file mode 100644 index 7e8fa5ec83..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/cmip6/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../../../../usermods_dirs/cmip6_evolving_icesheet diff --git a/cime_config/testdefs/testmods_dirs/clm/cmip6/shell_commands b/cime_config/testdefs/testmods_dirs/clm/cmip6/shell_commands deleted file mode 100644 index 33792ffaee..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/cmip6/shell_commands +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -./xmlchange BFBFLAG="TRUE" - diff --git a/cime_config/testdefs/testmods_dirs/clm/cmip6_deck_highfreq/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/cmip6_deck_highfreq/include_user_mods new file mode 100644 index 0000000000..136c5c1df1 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/cmip6_deck_highfreq/include_user_mods @@ -0,0 +1 @@ +../../../../usermods_dirs/cmip6_deck_highfreq diff --git a/cime_config/testdefs/testmods_dirs/clm/cmip6_deck_highfreq/shell_commands b/cime_config/testdefs/testmods_dirs/clm/cmip6_deck_highfreq/shell_commands new file mode 100644 index 0000000000..1d678a9c7d --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/cmip6_deck_highfreq/shell_commands @@ -0,0 +1,6 @@ +#!/bin/bash + +./xmlchange BFBFLAG="TRUE" + +# FIXME(wjs, 2018-10-23) This is temporary to match what was being run before; it should be removed +./xmlchange CCSM_BGC=CO2A diff --git a/cime_config/usermods_dirs/cmip6/include_user_mods b/cime_config/usermods_dirs/cmip6_deck/include_user_mods similarity index 52% rename from cime_config/usermods_dirs/cmip6/include_user_mods rename to cime_config/usermods_dirs/cmip6_deck/include_user_mods index 012ab60771..6d1c3aaf05 100644 --- a/cime_config/usermods_dirs/cmip6/include_user_mods +++ b/cime_config/usermods_dirs/cmip6_deck/include_user_mods @@ -1,2 +1,2 @@ ../cmip6_glaciers -../cmip6_output +../output_crop diff --git a/cime_config/usermods_dirs/cmip6_deck_highfreq/include_user_mods b/cime_config/usermods_dirs/cmip6_deck_highfreq/include_user_mods new file mode 100644 index 0000000000..95a25001e0 --- /dev/null +++ b/cime_config/usermods_dirs/cmip6_deck_highfreq/include_user_mods @@ -0,0 +1,2 @@ +../cmip6_glaciers +../output_crop_highfreq diff --git a/cime_config/usermods_dirs/cmip6_evolving_icesheet/include_user_mods b/cime_config/usermods_dirs/cmip6_evolving_icesheet/include_user_mods index d8d7dacfae..58e17babd3 100644 --- a/cime_config/usermods_dirs/cmip6_evolving_icesheet/include_user_mods +++ b/cime_config/usermods_dirs/cmip6_evolving_icesheet/include_user_mods @@ -1 +1 @@ -../cmip6 +../cmip6_deck diff --git a/cime_config/usermods_dirs/cmip6_evolving_icesheet/user_nl_clm b/cime_config/usermods_dirs/cmip6_evolving_icesheet/user_nl_clm index 193f0624e7..70ca6a3946 100644 --- a/cime_config/usermods_dirs/cmip6_evolving_icesheet/user_nl_clm +++ b/cime_config/usermods_dirs/cmip6_evolving_icesheet/user_nl_clm @@ -1 +1,7 @@ +!---------------------------------------------------------------------------------- +! Settings from cmip6_evolving_icesheet +!---------------------------------------------------------------------------------- + +! h3 stream (yearly average, gridcell-level) hist_fincl4 += 'ICE_MODEL_FRACTION' + diff --git a/cime_config/usermods_dirs/cmip6_glaciers/user_nl_clm b/cime_config/usermods_dirs/cmip6_glaciers/user_nl_clm index 4963c4945a..fdc1cdb732 100644 --- a/cime_config/usermods_dirs/cmip6_glaciers/user_nl_clm +++ b/cime_config/usermods_dirs/cmip6_glaciers/user_nl_clm @@ -1,5 +1,9 @@ +!---------------------------------------------------------------------------------- +! Settings from cmip6_glaciers +!---------------------------------------------------------------------------------- ! This differs from the default in that it turns on virtual columns over Antarctica ! This is desired so that we have the output needed to drive a later offline CISM Antarctica simulation ! However, this increases the cost of CLM by about 10% glacier_region_behavior = 'single_at_atm_topo', 'virtual', 'virtual', 'virtual' + diff --git a/cime_config/usermods_dirs/cmip6_output/README b/cime_config/usermods_dirs/cmip6_output/README deleted file mode 100644 index f073548a51..0000000000 --- a/cime_config/usermods_dirs/cmip6_output/README +++ /dev/null @@ -1,5 +0,0 @@ -This directory turns on a variety of extra output fields that are desired for -cmip6 runs. - -To use these mods, you must be using a configuration with CLM50%BGC-CROP using -glc_mec (which is the standard cmip6 configuration). diff --git a/cime_config/usermods_dirs/cmip6_output/shell_commands b/cime_config/usermods_dirs/cmip6_output/shell_commands deleted file mode 100644 index d742a80f83..0000000000 --- a/cime_config/usermods_dirs/cmip6_output/shell_commands +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -./xmlchange CCSM_BGC=CO2A - diff --git a/cime_config/usermods_dirs/cmip6_output/user_nl_clm b/cime_config/usermods_dirs/cmip6_output/user_nl_clm deleted file mode 100644 index 1ac4015e5e..0000000000 --- a/cime_config/usermods_dirs/cmip6_output/user_nl_clm +++ /dev/null @@ -1,77 +0,0 @@ -!---------------------------------------------------------------------------------- -! Users should add all user specific namelist changes below in the form of -! namelist_var = new_namelist_value -! -! EXCEPTIONS: -! Set use_cndv by the compset you use and the CLM_BLDNML_OPTS -dynamic_vegetation setting -! Set use_vichydro by the compset you use and the CLM_BLDNML_OPTS -vichydro setting -! Set use_cn by the compset you use and CLM_BLDNML_OPTS -bgc setting -! Set use_crop by the compset you use and CLM_BLDNML_OPTS -crop setting -! Set spinup_state by the CLM_BLDNML_OPTS -bgc_spinup setting -! Set irrigate by the CLM_BLDNML_OPTS -irrig setting -! Set co2_ppmv with CCSM_CO2_PPMV option -! Set dtime with L_NCPL option -! Set fatmlndfrc with LND_DOMAIN_PATH/LND_DOMAIN_FILE options -! Set finidat with RUN_REFCASE/RUN_REFDATE/RUN_REFTOD options for hybrid or branch cases -! (includes $inst_string for multi-ensemble cases) -! Set maxpatch_glcmec with GLC_NEC option -! Set glc_do_dynglacier with GLC_TWO_WAY_COUPLING env variable -!---------------------------------------------------------------------------------- - -! h0 stream (monthly average, gridcell-level) -! Emon, Lmon, LIMon -hist_fexcl1 += 'PCT_CFT', 'PCT_GLC_MEC', 'SOIL1C_vr', 'SOIL1N_vr', 'SOIL2C_vr', 'SOIL2N_vr', 'SOIL3C_vr', 'SOIL3N_vr', 'CWDC_vr', -'LITR1C_vr', 'LITR2C_vr', 'LITR3C_vr', 'LITR1N_vr', 'LITR2N_vr', 'LITR3N_vr','CWDN_vr', -'PCT_NAT_PFT','SMIN_NO3_vr','CONC_O2_UNSAT', 'CONC_O2_SAT','SMIN_NH4_vr','SMINN_vr' - -! h0 stream ICE variables and other variables inactive by default (monthly average, gridcell-level) -! Emon, Lmon, LIMon -hist_fincl1 += 'EFLX_LH_TOT_ICE', 'FIRE_ICE', 'FLDS_ICE', 'FSH_ICE', 'FSNO_ICE', 'FSR_ICE', -'QFLX_SUB_SNOW_ICE', 'QRUNOFF_ICE', 'QSNOFRZ_ICE', 'QSNOMELT_ICE', 'RAIN_ICE', 'SNOW_ICE', -'SNOWICE_ICE', 'SNOWLIQ_ICE', 'SNOTXMASS_ICE', 'TG_ICE', 'TOPO_COL_ICE', 'TSA_ICE', 'TSOI_ICE', -'LEAFC_TO_LITTER', 'FROOTC_TO_LITTER','LITR1C_TO_SOIL1C','LITR1N_TO_SOIL1N','LITR2C_TO_SOIL1C', -'LITR2N_TO_SOIL1N','LITR3C_TO_SOIL2C','LITR3N_TO_SOIL2N','DWT_WOOD_PRODUCTC_GAIN_PATCH' - -! h1 stream (monthly average, finest sub-grid) -! Emon, Lmon -hist_fincl2 += 'GPP', 'NPP', 'AGNPP', 'TLAI', 'TOTVEGC', 'TSA','TREFMNAV','TREFMXAV', 'BTRANMN', 'NPP_NUPTAKE', 'GRAINC_TO_FOOD', -'Vcmx25Z', 'FSH', 'NFERTILIZATION', 'AR', 'VEGWP', 'FCTR', 'FCEV', 'FGEV', 'FIRE', 'FSR', 'HTOP', -'FIRA', 'FSA', 'HR', 'GSSUNLN', 'GSSHALN', 'TSKIN' - -! h2 stream (monthly average, landunit-level) -! Emon -! TOT_WOODPRODC:I, CROPPROD1C:I, and NEE are not available at the landunit level -hist_fincl3 += 'FSR', 'H2OSNO', 'Q2M', 'SNOWDP', 'TSA', 'TREFMNAV', 'TREFMXAV', 'TG', 'QRUNOFF', 'FSH', 'FIRE', 'FIRA', 'FGR', -'EFLX_LH_TOT', 'RH2M', 'TLAI', 'GPP', 'NPP', 'SOILWATER_10CM', 'TOTSOILLIQ', 'TOTSOILICE', 'AR', 'HR', 'DWT_CONV_CFLUX_PATCH', -'WOOD_HARVESTC', 'U10', 'DWT_WOOD_PRODUCTC_GAIN_PATCH', 'GRAINC_TO_FOOD', 'SLASH_HARVESTC', 'TSOI_10CM', 'COL_FIRE_CLOSS', -'DWT_SLASH_CFLUX', 'QIRRIG', 'URBAN_HEAT', 'WASTEHEAT', 'HTOP', 'TSKIN', 'FROOTC:I' - -! h3 stream (yearly average, gridcell-level) -! Eyr -hist_fincl4 += 'PCT_CFT', 'PCT_GLC_MEC', 'SOIL1C_vr', 'SOIL1N_vr', 'SOIL2C_vr', 'SOIL2N_vr', 'SOIL3C_vr', 'SOIL3N_vr', 'CWDC_vr', -'LITR1C_vr', 'LITR2C_vr', 'LITR3C_vr', 'LITR1N_vr', 'LITR2N_vr', 'LITR3N_vr','CWDN_vr', 'QICE_FORC', 'TSRF_FORC', 'TOPO_FORC' -'PCT_NAT_PFT','PCT_LANDUNIT','TOTLITC:I','TOT_WOODPRODC:I','CROPPROD1C:I','TOTSOMC:I','TOTVEGC:I','FSNO_ICE' - -! h4 stream (yearly average, landunit-level) -! Eyr landuse tiles -hist_fincl5 += 'TOTSOMC:I', 'TOTSOMC_1m:I', 'TOTECOSYSC:I', 'TOTVEGC:I', 'WOODC:I', 'TOTLITC:I', 'LIVECROOTC:I', 'DEADCROOTC:I', 'FROOTC:I' - -! h5 stream (daily average, gridcell-level) -! day, Eday -hist_fincl6 += 'SOILWATER_10CM', 'TOTSOILLIQ', 'TOTSOILICE', 'GPP', 'NPP', 'AR', 'HR', 'EFLX_LH_TOT', 'FSH', 'FGR12', 'FSM', 'QSNOEVAP', 'TLAI', 'QDRAI', 'QDRAI_PERCH', 'QOVER', 'QFLX_SUB_SNOW', 'FSA', 'FIRA', 'H2OSNO', 'SNOCAN', 'QSNOFRZ', 'QFLX_SNOW_DRAIN', 'SNOWDP', 'H2OSFC', 'TV', 'TG', 'TAUX', 'TAUY', 'QVEGT', 'TWS', 'H2OCAN', 'ALT', 'QVEGE', 'QSOIL', 'TSKIN', 'FSDS','FSNO','SNOFSRVD','SNOFSRVI','SNOFSRND','SNOFSRNI','FSDSVD','FSDSVI','FSDSND','FSDSNI','SNOWLIQ','SOILICE','SOILLIQ','QINTR','SNOBCMSL','TSOI','SNOTXMASS','SNOWICE','SNOWLIQ','QRUNOFF','RAIN','SNOW' - -! h6 stream (daily average, landunit-level) -! Eday -hist_fincl7 += 'TREFMXAV','TREFMNAV' - -! h7 stream (3-hourly average, gridcell-level) -! 3hr, E3hr, CF3hr -! 3hr requires QRUNOFF for time mean, and SOILWATER_10CM, TSKIN for time point (I) -! E3hr requires GPP, AR, HR for time mean -! CF3hr requires QFLX_SUB_SNOW for time point (I) -hist_fincl8 += 'GPP','AR','HR','TSA','RH2M','SOILWATER_10CM:I','FSH','EFLX_LH_TOT','FSDS','QRUNOFF','QFLX_SUB_SNOW:I','TSKIN:I' - -hist_mfilt = 1,1,1,1,1,365,365,2920 -hist_dov2xy = .true.,.false.,.false.,.true.,.false.,.true.,.false.,.true. -hist_nhtfrq = 0,0,0,-8760,-8760,-24,-24,-3 -hist_type1d_pertape = ' ',' ','LAND',' ','LAND',' ','LAND',' ' From 7ed039b0a74ced12130cac63d42c325d4938bf4e Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Tue, 23 Oct 2018 15:10:15 -0600 Subject: [PATCH 32/54] Fix double inclusion of Vcmx25Z history field This was included via both the base and bgc mods --- cime_config/usermods_dirs/output_bgc/user_nl_clm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/usermods_dirs/output_bgc/user_nl_clm b/cime_config/usermods_dirs/output_bgc/user_nl_clm index 0a2ad86eba..c97c282ff6 100644 --- a/cime_config/usermods_dirs/output_bgc/user_nl_clm +++ b/cime_config/usermods_dirs/output_bgc/user_nl_clm @@ -7,7 +7,7 @@ hist_fexcl1 += 'SOIL1C_vr', 'SOIL1N_vr', 'SOIL2C_vr', 'SOIL2N_vr', 'SOIL3C_vr', hist_fincl1 += 'LEAFC_TO_LITTER', 'FROOTC_TO_LITTER','LITR1C_TO_SOIL1C','LITR1N_TO_SOIL1N','LITR2C_TO_SOIL1C', 'LITR2N_TO_SOIL1N','LITR3C_TO_SOIL2C','LITR3N_TO_SOIL2N','DWT_WOOD_PRODUCTC_GAIN_PATCH' ! h1 stream (monthly average, finest sub-grid) -hist_fincl2 += 'GPP', 'NPP', 'AGNPP', 'TOTVEGC', 'NPP_NUPTAKE', 'Vcmx25Z', 'AR', 'HR', 'HTOP' +hist_fincl2 += 'GPP', 'NPP', 'AGNPP', 'TOTVEGC', 'NPP_NUPTAKE', 'AR', 'HR', 'HTOP' ! h2 stream (monthly average, landunit-level) ! TOT_WOODPRODC:I, CROPPROD1C:I, and NEE are not available at the landunit level From 012b517865c3d529a7620bd1b20d3a3217ba1732 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Tue, 23 Oct 2018 15:12:08 -0600 Subject: [PATCH 33/54] Remove setting of CCSM_BGC=CO2A in the cmip6 testmods This was in place in order to match what was being done before, but Erik, Keith and I can't see why this is set in the cmip6 mods. --- .../testmods_dirs/clm/cmip6_deck_highfreq/shell_commands | 3 --- 1 file changed, 3 deletions(-) diff --git a/cime_config/testdefs/testmods_dirs/clm/cmip6_deck_highfreq/shell_commands b/cime_config/testdefs/testmods_dirs/clm/cmip6_deck_highfreq/shell_commands index 1d678a9c7d..070b7ba1a8 100644 --- a/cime_config/testdefs/testmods_dirs/clm/cmip6_deck_highfreq/shell_commands +++ b/cime_config/testdefs/testmods_dirs/clm/cmip6_deck_highfreq/shell_commands @@ -1,6 +1,3 @@ #!/bin/bash ./xmlchange BFBFLAG="TRUE" - -# FIXME(wjs, 2018-10-23) This is temporary to match what was being run before; it should be removed -./xmlchange CCSM_BGC=CO2A From 1993cc945f39d83c44c63db077d0f308d17a053c Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Tue, 23 Oct 2018 17:03:36 -0600 Subject: [PATCH 34/54] Reorganize usermods directories (1) Move usermods to an _includes subdirectory if they are not meant to be used directly (2) Split cmip6_glaciers into two pieces, since cmip6_waccm_deck (not yet created) will only use cmip6_glaciers_cplhist (3) Remove cmip6_deck_highfreq: I couldn't see how this would actually be used in practice, so I don't think it's worth maintaining this. Along with this removal, I have changed the cmip6 testmod to use cmip6_deck rather than cmip6_deck_highfreq. --- cime_config/testdefs/testlist_clm.xml | 4 ++-- .../testdefs/testmods_dirs/clm/cmip6_deck/include_user_mods | 1 + .../clm/{cmip6_deck_highfreq => cmip6_deck}/shell_commands | 0 .../testmods_dirs/clm/cmip6_deck_highfreq/include_user_mods | 1 - cime_config/usermods_dirs/_includes/README | 2 ++ .../cmip6_glaciers_cplhist}/user_nl_cpl | 0 .../cmip6_glaciers_virtual_antarctica}/user_nl_clm | 2 +- cime_config/usermods_dirs/{ => _includes}/output_base/README | 0 .../usermods_dirs/{ => _includes}/output_base/user_nl_clm | 0 .../usermods_dirs/{ => _includes}/output_base_highfreq/README | 0 .../{ => _includes}/output_base_highfreq/include_user_mods | 0 .../{ => _includes}/output_base_highfreq/user_nl_clm | 0 cime_config/usermods_dirs/cmip6_deck/include_user_mods | 3 ++- .../usermods_dirs/cmip6_deck_highfreq/include_user_mods | 2 -- cime_config/usermods_dirs/output_bgc/include_user_mods | 2 +- .../usermods_dirs/output_bgc_highfreq/include_user_mods | 2 +- cime_config/usermods_dirs/output_crop/user_nl_clm | 1 + cime_config/usermods_dirs/output_sp/include_user_mods | 2 +- .../usermods_dirs/output_sp_highfreq/include_user_mods | 2 +- 19 files changed, 13 insertions(+), 11 deletions(-) create mode 100644 cime_config/testdefs/testmods_dirs/clm/cmip6_deck/include_user_mods rename cime_config/testdefs/testmods_dirs/clm/{cmip6_deck_highfreq => cmip6_deck}/shell_commands (100%) delete mode 100644 cime_config/testdefs/testmods_dirs/clm/cmip6_deck_highfreq/include_user_mods create mode 100644 cime_config/usermods_dirs/_includes/README rename cime_config/usermods_dirs/{cmip6_glaciers => _includes/cmip6_glaciers_cplhist}/user_nl_cpl (100%) rename cime_config/usermods_dirs/{cmip6_glaciers => _includes/cmip6_glaciers_virtual_antarctica}/user_nl_clm (90%) rename cime_config/usermods_dirs/{ => _includes}/output_base/README (100%) rename cime_config/usermods_dirs/{ => _includes}/output_base/user_nl_clm (100%) rename cime_config/usermods_dirs/{ => _includes}/output_base_highfreq/README (100%) rename cime_config/usermods_dirs/{ => _includes}/output_base_highfreq/include_user_mods (100%) rename cime_config/usermods_dirs/{ => _includes}/output_base_highfreq/user_nl_clm (100%) delete mode 100644 cime_config/usermods_dirs/cmip6_deck_highfreq/include_user_mods diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 1a3e7a90e1..7fef3f4d41 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -980,7 +980,7 @@ - + @@ -1486,7 +1486,7 @@ - + diff --git a/cime_config/testdefs/testmods_dirs/clm/cmip6_deck/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/cmip6_deck/include_user_mods new file mode 100644 index 0000000000..45859d47f6 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/cmip6_deck/include_user_mods @@ -0,0 +1 @@ +../../../../usermods_dirs/cmip6_deck diff --git a/cime_config/testdefs/testmods_dirs/clm/cmip6_deck_highfreq/shell_commands b/cime_config/testdefs/testmods_dirs/clm/cmip6_deck/shell_commands similarity index 100% rename from cime_config/testdefs/testmods_dirs/clm/cmip6_deck_highfreq/shell_commands rename to cime_config/testdefs/testmods_dirs/clm/cmip6_deck/shell_commands diff --git a/cime_config/testdefs/testmods_dirs/clm/cmip6_deck_highfreq/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/cmip6_deck_highfreq/include_user_mods deleted file mode 100644 index 136c5c1df1..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/cmip6_deck_highfreq/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../../../../usermods_dirs/cmip6_deck_highfreq diff --git a/cime_config/usermods_dirs/_includes/README b/cime_config/usermods_dirs/_includes/README new file mode 100644 index 0000000000..44484d36bc --- /dev/null +++ b/cime_config/usermods_dirs/_includes/README @@ -0,0 +1,2 @@ +This directory contains usermods directories that are meant to be +included in other usermods directories, not used directly diff --git a/cime_config/usermods_dirs/cmip6_glaciers/user_nl_cpl b/cime_config/usermods_dirs/_includes/cmip6_glaciers_cplhist/user_nl_cpl similarity index 100% rename from cime_config/usermods_dirs/cmip6_glaciers/user_nl_cpl rename to cime_config/usermods_dirs/_includes/cmip6_glaciers_cplhist/user_nl_cpl diff --git a/cime_config/usermods_dirs/cmip6_glaciers/user_nl_clm b/cime_config/usermods_dirs/_includes/cmip6_glaciers_virtual_antarctica/user_nl_clm similarity index 90% rename from cime_config/usermods_dirs/cmip6_glaciers/user_nl_clm rename to cime_config/usermods_dirs/_includes/cmip6_glaciers_virtual_antarctica/user_nl_clm index fdc1cdb732..3486d7abfb 100644 --- a/cime_config/usermods_dirs/cmip6_glaciers/user_nl_clm +++ b/cime_config/usermods_dirs/_includes/cmip6_glaciers_virtual_antarctica/user_nl_clm @@ -1,5 +1,5 @@ !---------------------------------------------------------------------------------- -! Settings from cmip6_glaciers +! Settings from cmip6_glaciers_virtual_antarctica !---------------------------------------------------------------------------------- ! This differs from the default in that it turns on virtual columns over Antarctica diff --git a/cime_config/usermods_dirs/output_base/README b/cime_config/usermods_dirs/_includes/output_base/README similarity index 100% rename from cime_config/usermods_dirs/output_base/README rename to cime_config/usermods_dirs/_includes/output_base/README diff --git a/cime_config/usermods_dirs/output_base/user_nl_clm b/cime_config/usermods_dirs/_includes/output_base/user_nl_clm similarity index 100% rename from cime_config/usermods_dirs/output_base/user_nl_clm rename to cime_config/usermods_dirs/_includes/output_base/user_nl_clm diff --git a/cime_config/usermods_dirs/output_base_highfreq/README b/cime_config/usermods_dirs/_includes/output_base_highfreq/README similarity index 100% rename from cime_config/usermods_dirs/output_base_highfreq/README rename to cime_config/usermods_dirs/_includes/output_base_highfreq/README diff --git a/cime_config/usermods_dirs/output_base_highfreq/include_user_mods b/cime_config/usermods_dirs/_includes/output_base_highfreq/include_user_mods similarity index 100% rename from cime_config/usermods_dirs/output_base_highfreq/include_user_mods rename to cime_config/usermods_dirs/_includes/output_base_highfreq/include_user_mods diff --git a/cime_config/usermods_dirs/output_base_highfreq/user_nl_clm b/cime_config/usermods_dirs/_includes/output_base_highfreq/user_nl_clm similarity index 100% rename from cime_config/usermods_dirs/output_base_highfreq/user_nl_clm rename to cime_config/usermods_dirs/_includes/output_base_highfreq/user_nl_clm diff --git a/cime_config/usermods_dirs/cmip6_deck/include_user_mods b/cime_config/usermods_dirs/cmip6_deck/include_user_mods index 6d1c3aaf05..1e912156d6 100644 --- a/cime_config/usermods_dirs/cmip6_deck/include_user_mods +++ b/cime_config/usermods_dirs/cmip6_deck/include_user_mods @@ -1,2 +1,3 @@ -../cmip6_glaciers +../_includes/cmip6_glaciers_cplhist +../_includes/cmip6_glaciers_virtual_antarctica ../output_crop diff --git a/cime_config/usermods_dirs/cmip6_deck_highfreq/include_user_mods b/cime_config/usermods_dirs/cmip6_deck_highfreq/include_user_mods deleted file mode 100644 index 95a25001e0..0000000000 --- a/cime_config/usermods_dirs/cmip6_deck_highfreq/include_user_mods +++ /dev/null @@ -1,2 +0,0 @@ -../cmip6_glaciers -../output_crop_highfreq diff --git a/cime_config/usermods_dirs/output_bgc/include_user_mods b/cime_config/usermods_dirs/output_bgc/include_user_mods index bee18982f6..f274805316 100644 --- a/cime_config/usermods_dirs/output_bgc/include_user_mods +++ b/cime_config/usermods_dirs/output_bgc/include_user_mods @@ -1 +1 @@ -../output_base +../_includes/output_base diff --git a/cime_config/usermods_dirs/output_bgc_highfreq/include_user_mods b/cime_config/usermods_dirs/output_bgc_highfreq/include_user_mods index 3d7b23c7ad..206b1ad95e 100644 --- a/cime_config/usermods_dirs/output_bgc_highfreq/include_user_mods +++ b/cime_config/usermods_dirs/output_bgc_highfreq/include_user_mods @@ -1,2 +1,2 @@ ../output_bgc -../output_base_highfreq +../_includes/output_base_highfreq diff --git a/cime_config/usermods_dirs/output_crop/user_nl_clm b/cime_config/usermods_dirs/output_crop/user_nl_clm index 26cf990d5f..638fea8815 100644 --- a/cime_config/usermods_dirs/output_crop/user_nl_clm +++ b/cime_config/usermods_dirs/output_crop/user_nl_clm @@ -13,3 +13,4 @@ hist_fincl3 += 'GRAINC_TO_FOOD' ! h3 stream (yearly average, gridcell-level) hist_fincl4 += 'PCT_CFT','CROPPROD1C:I' + diff --git a/cime_config/usermods_dirs/output_sp/include_user_mods b/cime_config/usermods_dirs/output_sp/include_user_mods index bee18982f6..f274805316 100644 --- a/cime_config/usermods_dirs/output_sp/include_user_mods +++ b/cime_config/usermods_dirs/output_sp/include_user_mods @@ -1 +1 @@ -../output_base +../_includes/output_base diff --git a/cime_config/usermods_dirs/output_sp_highfreq/include_user_mods b/cime_config/usermods_dirs/output_sp_highfreq/include_user_mods index 4a3a211b15..0915682e36 100644 --- a/cime_config/usermods_dirs/output_sp_highfreq/include_user_mods +++ b/cime_config/usermods_dirs/output_sp_highfreq/include_user_mods @@ -1,2 +1,2 @@ ../output_sp -../output_base_highfreq +../_includes/output_base_highfreq From 765e72ccde6e49fc8383b72b83f413b3f5a958c9 Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Tue, 23 Oct 2018 17:26:56 -0600 Subject: [PATCH 35/54] Add C13_NBP and C14_NBP diagnostic fields --- src/biogeochem/CNVegCarbonFluxType.F90 | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/biogeochem/CNVegCarbonFluxType.F90 b/src/biogeochem/CNVegCarbonFluxType.F90 index 2ec35353f0..3af1e71429 100644 --- a/src/biogeochem/CNVegCarbonFluxType.F90 +++ b/src/biogeochem/CNVegCarbonFluxType.F90 @@ -3125,6 +3125,13 @@ subroutine InitHistory(this, bounds, carbon_type) avgflag='A', long_name='C13 net ecosystem exchange of carbon, includes fire flux, positive for source', & ptr_gcell=this%nee_grc) + this%nbp_grc(begg:endg) = spval + call hist_addfld1d (fname='C13_NBP', units='gC13/m^2/s', & + avgflag='A', long_name='C13 net biome production, includes fire, landuse,'& + //' harvest and hrv_xsmrpool flux (latter smoothed over the year), positive for sink'& + //' (same as net carbon exchange between land and atmosphere)', & + ptr_gcell=this%nbp_grc) + endif !------------------------------- @@ -3274,6 +3281,13 @@ subroutine InitHistory(this, bounds, carbon_type) avgflag='A', long_name='C14 net ecosystem exchange of carbon, includes fire flux, positive for source', & ptr_gcell=this%nee_grc) + this%nbp_grc(begg:endg) = spval + call hist_addfld1d (fname='C14_NBP', units='gC13/m^2/s', & + avgflag='A', long_name='C14 net biome production, includes fire, landuse,'& + //' harvest and hrv_xsmrpool flux (latter smoothed over the year), positive for sink'& + //' (same as net carbon exchange between land and atmosphere)', & + ptr_gcell=this%nbp_grc) + endif end subroutine InitHistory From f5ec03babbd6eaf2a049bd3e4c1a12f49211f571 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Wed, 24 Oct 2018 10:59:21 -0600 Subject: [PATCH 36/54] Make a bunch of C isotope fields inactive by default Per comments in https://github.com/ESCOMP/ctsm/pull/527 --- src/biogeochem/CNProductsMod.F90 | 19 ++++-- src/biogeochem/CNVegCarbonFluxType.F90 | 68 +++++++++---------- src/biogeochem/CNVegCarbonStateType.F90 | 62 ++++++++--------- src/biogeochem/SpeciesBaseType.F90 | 11 +++ src/biogeochem/SpeciesIsotopeType.F90 | 11 +++ src/biogeochem/SpeciesNonIsotopeType.F90 | 11 +++ src/biogeophys/PhotosynthesisMod.F90 | 14 ++-- .../SoilBiogeochemCarbonFluxType.F90 | 8 +-- .../SoilBiogeochemCarbonStateType.F90 | 12 ++-- 9 files changed, 128 insertions(+), 88 deletions(-) diff --git a/src/biogeochem/CNProductsMod.F90 b/src/biogeochem/CNProductsMod.F90 index 59891ba330..ed2c67d56b 100644 --- a/src/biogeochem/CNProductsMod.F90 +++ b/src/biogeochem/CNProductsMod.F90 @@ -162,6 +162,7 @@ subroutine InitHistory(this, bounds) ! ! !LOCAL VARIABLES: integer :: begg,endg + character(len=:), allocatable :: active_if_non_isotope character(len=*), parameter :: subname = 'InitHistory' !----------------------------------------------------------------------- @@ -169,13 +170,19 @@ subroutine InitHistory(this, bounds) begg = bounds%begg endg = bounds%endg + if (this%species%is_isotope()) then + active_if_non_isotope = 'inactive' + else + active_if_non_isotope = 'active' + end if + this%cropprod1_grc(begg:endg) = spval call hist_addfld1d( & fname = this%species%hist_fname('CROPPROD1'), & units = 'g' // this%species%get_species() // '/m^2', & avgflag = 'A', & long_name = '1-yr grain product ' // this%species%get_species(), & - ptr_gcell = this%cropprod1_grc) + ptr_gcell = this%cropprod1_grc, default=active_if_non_isotope) this%prod10_grc(begg:endg) = spval call hist_addfld1d( & @@ -199,7 +206,7 @@ subroutine InitHistory(this, bounds) units = 'g' // this%species%get_species() // '/m^2', & avgflag = 'A', & long_name = 'total wood product ' // this%species%get_species(), & - ptr_gcell = this%tot_woodprod_grc) + ptr_gcell = this%tot_woodprod_grc, default=active_if_non_isotope) this%dwt_prod10_gain_grc(begg:endg) = spval call hist_addfld1d( & @@ -223,7 +230,7 @@ subroutine InitHistory(this, bounds) units = 'g' // this%species%get_species() // '/m^2/s', & avgflag = 'A', & long_name = 'landcover change-driven addition to wood product pools', & - ptr_gcell = this%dwt_woodprod_gain_grc) + ptr_gcell = this%dwt_woodprod_gain_grc, default=active_if_non_isotope) this%dwt_cropprod1_gain_grc(begg:endg) = spval call hist_addfld1d( & @@ -231,7 +238,7 @@ subroutine InitHistory(this, bounds) units = 'g' // this%species%get_species() // '/m^2/s', & avgflag = 'A', & long_name = 'landcover change-driven addition to 1-year crop product pool', & - ptr_gcell = this%dwt_cropprod1_gain_grc) + ptr_gcell = this%dwt_cropprod1_gain_grc, default=active_if_non_isotope) this%cropprod1_loss_grc(begg:endg) = spval call hist_addfld1d( & @@ -239,7 +246,7 @@ subroutine InitHistory(this, bounds) units = 'g' // this%species%get_species() // '/m^2/s', & avgflag = 'A', & long_name = 'loss from 1-yr grain product pool', & - ptr_gcell = this%cropprod1_loss_grc) + ptr_gcell = this%cropprod1_loss_grc, default=active_if_non_isotope) this%prod10_loss_grc(begg:endg) = spval call hist_addfld1d( & @@ -263,7 +270,7 @@ subroutine InitHistory(this, bounds) units = 'g' // this%species%get_species() // '/m^2/s', & avgflag = 'A', & long_name = 'total loss from wood product pools', & - ptr_gcell = this%tot_woodprod_loss_grc) + ptr_gcell = this%tot_woodprod_loss_grc, default=active_if_non_isotope) end subroutine InitHistory diff --git a/src/biogeochem/CNVegCarbonFluxType.F90 b/src/biogeochem/CNVegCarbonFluxType.F90 index 3af1e71429..079813d2a3 100644 --- a/src/biogeochem/CNVegCarbonFluxType.F90 +++ b/src/biogeochem/CNVegCarbonFluxType.F90 @@ -1695,17 +1695,17 @@ subroutine InitHistory(this, bounds, carbon_type) this%rr_patch(begp:endp) = spval call hist_addfld1d (fname='C13_RR', units='gC13/m^2/s', & avgflag='A', long_name='C13 root respiration (fine root MR + total root GR)', & - ptr_patch=this%rr_patch) + ptr_patch=this%rr_patch, default='inactive') this%mr_patch(begp:endp) = spval call hist_addfld1d (fname='C13_MR', units='gC13/m^2/s', & avgflag='A', long_name='C13 maintenance respiration', & - ptr_patch=this%mr_patch) + ptr_patch=this%mr_patch, default='inactive') this%gr_patch(begp:endp) = spval call hist_addfld1d (fname='C13_GR', units='gC13/m^2/s', & avgflag='A', long_name='C13 total growth respiration', & - ptr_patch=this%gr_patch) + ptr_patch=this%gr_patch, default='inactive') this%ar_patch(begp:endp) = spval call hist_addfld1d (fname='C13_AR', units='gC13/m^2/s', & @@ -1715,17 +1715,17 @@ subroutine InitHistory(this, bounds, carbon_type) this%npp_patch(begp:endp) = spval call hist_addfld1d (fname='C13_NPP', units='gC13/m^2/s', & avgflag='A', long_name='C13 net primary production', & - ptr_patch=this%npp_patch) + ptr_patch=this%npp_patch, default='inactive') this%agnpp_patch(begp:endp) = spval call hist_addfld1d (fname='C13_AGNPP', units='gC13/m^2/s', & avgflag='A', long_name='C13 aboveground NPP', & - ptr_patch=this%agnpp_patch) + ptr_patch=this%agnpp_patch, default='inactive') this%bgnpp_patch(begp:endp) = spval call hist_addfld1d (fname='C13_BGNPP', units='gC13/m^2/s', & avgflag='A', long_name='C13 belowground NPP', & - ptr_patch=this%bgnpp_patch) + ptr_patch=this%bgnpp_patch, default='inactive') this%litfall_patch(begp:endp) = spval call hist_addfld1d (fname='C13_LITFALL', units='gC13/m^2/s', & @@ -1735,7 +1735,7 @@ subroutine InitHistory(this, bounds, carbon_type) this%fire_closs_patch(begp:endp) = spval call hist_addfld1d (fname='C13_PFT_FIRE_CLOSS', units='gC13/m^2/s', & avgflag='A', long_name='C13 total patch-level fire C loss', & - ptr_patch=this%fire_closs_patch) + ptr_patch=this%fire_closs_patch, default='inactive') this%m_leafc_to_litter_patch(begp:endp) = spval call hist_addfld1d (fname='C13_M_LEAFC_TO_LITTER', units='gC13/m^2/s', & @@ -2010,12 +2010,12 @@ subroutine InitHistory(this, bounds, carbon_type) this%psnsun_to_cpool_patch(begp:endp) = spval call hist_addfld1d (fname='C13_PSNSUN_TO_CPOOL', units='gC13/m^2/s', & avgflag='A', long_name='C13 C fixation from sunlit canopy', & - ptr_patch=this%psnsun_to_cpool_patch) + ptr_patch=this%psnsun_to_cpool_patch, default='inactive') this%psnshade_to_cpool_patch(begp:endp) = spval call hist_addfld1d (fname='C13_PSNSHADE_TO_CPOOL', units='gC13/m^2/s', & avgflag='A', long_name='C13 C fixation from shaded canopy', & - ptr_patch=this%psnshade_to_cpool_patch) + ptr_patch=this%psnshade_to_cpool_patch, default='inactive') this%cpool_to_leafc_patch(begp:endp) = spval call hist_addfld1d (fname='C13_CPOOL_TO_LEAFC', units='gC13/m^2/s', & @@ -2518,12 +2518,12 @@ subroutine InitHistory(this, bounds, carbon_type) this%psnsun_to_cpool_patch(begp:endp) = spval call hist_addfld1d (fname='C14_PSNSUN_TO_CPOOL', units='gC14/m^2/s', & avgflag='A', long_name='C14 C fixation from sunlit canopy', & - ptr_patch=this%psnsun_to_cpool_patch) + ptr_patch=this%psnsun_to_cpool_patch, default='inactive') this%psnshade_to_cpool_patch(begp:endp) = spval call hist_addfld1d (fname='C14_PSNSHADE_TO_CPOOL', units='gC14/m^2/s', & avgflag='A', long_name='C14 C fixation from shaded canopy', & - ptr_patch=this%psnshade_to_cpool_patch) + ptr_patch=this%psnshade_to_cpool_patch, default='inactive') this%cpool_to_leafc_patch(begp:endp) = spval call hist_addfld1d (fname='C14_CPOOL_TO_LEAFC', units='gC14/m^2/s', & @@ -2748,17 +2748,17 @@ subroutine InitHistory(this, bounds, carbon_type) this%rr_patch(begp:endp) = spval call hist_addfld1d (fname='C14_RR', units='gC14/m^2/s', & avgflag='A', long_name='C14 root respiration (fine root MR + total root GR)', & - ptr_patch=this%rr_patch) + ptr_patch=this%rr_patch, default='inactive') this%mr_patch(begp:endp) = spval call hist_addfld1d (fname='C14_MR', units='gC14/m^2/s', & avgflag='A', long_name='C14 maintenance respiration', & - ptr_patch=this%mr_patch) + ptr_patch=this%mr_patch, default='inactive') this%gr_patch(begp:endp) = spval call hist_addfld1d (fname='C14_GR', units='gC14/m^2/s', & avgflag='A', long_name='C14 total growth respiration', & - ptr_patch=this%gr_patch) + ptr_patch=this%gr_patch, default='inactive') this%ar_patch(begp:endp) = spval call hist_addfld1d (fname='C14_AR', units='gC14/m^2/s', & @@ -2768,17 +2768,17 @@ subroutine InitHistory(this, bounds, carbon_type) this%npp_patch(begp:endp) = spval call hist_addfld1d (fname='C14_NPP', units='gC14/m^2/s', & avgflag='A', long_name='C14 net primary production', & - ptr_patch=this%npp_patch) + ptr_patch=this%npp_patch, default='inactive') this%agnpp_patch(begp:endp) = spval call hist_addfld1d (fname='C14_AGNPP', units='gC14/m^2/s', & avgflag='A', long_name='C14 aboveground NPP', & - ptr_patch=this%agnpp_patch) + ptr_patch=this%agnpp_patch, default='inactive') this%bgnpp_patch(begp:endp) = spval call hist_addfld1d (fname='C14_BGNPP', units='gC14/m^2/s', & avgflag='A', long_name='C14 belowground NPP', & - ptr_patch=this%bgnpp_patch) + ptr_patch=this%bgnpp_patch, default='inactive') this%litfall_patch(begp:endp) = spval call hist_addfld1d (fname='C14_LITFALL', units='gC14/m^2/s', & @@ -2788,7 +2788,7 @@ subroutine InitHistory(this, bounds, carbon_type) this%fire_closs_patch(begp:endp) = spval call hist_addfld1d (fname='C14_PFT_FIRE_CLOSS', units='gC14/m^2/s', & avgflag='A', long_name='C14 total patch-level fire C loss', & - ptr_patch=this%fire_closs_patch) + ptr_patch=this%fire_closs_patch, default='inactive') endif !------------------------------- @@ -3034,7 +3034,7 @@ subroutine InitHistory(this, bounds, carbon_type) call hist_addfld1d (fname='C13_DWT_CONV_CFLUX', units='gC13/m^2/s', & avgflag='A', long_name='C13 conversion C flux (immediate loss to atm) ' // & '(0 at all times except first timestep of year)', & - ptr_gcell=this%dwt_conv_cflux_grc) + ptr_gcell=this%dwt_conv_cflux_grc, default='inactive') this%dwt_conv_cflux_patch(begp:endp) = spval call hist_addfld1d (fname='C13_DWT_CONV_CFLUX_PATCH', units='gC13/m^2/s', & @@ -3048,12 +3048,12 @@ subroutine InitHistory(this, bounds, carbon_type) call hist_addfld1d (fname='C13_DWT_CONV_CFLUX_DRIBBLED', units='gC13/m^2/s', & avgflag='A', & long_name='C13 conversion C flux (immediate loss to atm), dribbled throughout the year', & - ptr_gcell=this%dwt_conv_cflux_dribbled_grc) + ptr_gcell=this%dwt_conv_cflux_dribbled_grc, default='inactive') this%dwt_slash_cflux_col(begc:endc) = spval call hist_addfld1d (fname='C13_DWT_SLASH_CFLUX', units='gC/m^2/s', & avgflag='A', long_name='C13 slash C flux to litter and CWD due to land use', & - ptr_col=this%dwt_slash_cflux_col) + ptr_col=this%dwt_slash_cflux_col, default='inactive') this%dwt_frootc_to_litr_met_c_col(begc:endc,:) = spval call hist_addfld_decomp (fname='C13_DWT_FROOTC_TO_LITR_MET_C', units='gC13/m^2/s', type2d='levdcmp', & @@ -3088,12 +3088,12 @@ subroutine InitHistory(this, bounds, carbon_type) this%sr_col(begc:endc) = spval call hist_addfld1d (fname='C13_SR', units='gC13/m^2/s', & avgflag='A', long_name='C13 total soil respiration (HR + root resp)', & - ptr_col=this%sr_col) + ptr_col=this%sr_col, default='inactive') this%er_col(begc:endc) = spval call hist_addfld1d (fname='C13_ER', units='gC13/m^2/s', & avgflag='A', long_name='C13 total ecosystem respiration, autotrophic + heterotrophic', & - ptr_col=this%er_col) + ptr_col=this%er_col, default='inactive') this%litfire_col(begc:endc) = spval call hist_addfld1d (fname='C13_LITFIRE', units='gC13/m^2/s', & @@ -3113,17 +3113,17 @@ subroutine InitHistory(this, bounds, carbon_type) this%fire_closs_col(begc:endc) = spval call hist_addfld1d (fname='C13_COL_FIRE_CLOSS', units='gC13/m^2/s', & avgflag='A', long_name='C13 total column-level fire C loss', & - ptr_col=this%fire_closs_col) + ptr_col=this%fire_closs_col, default='inactive') this%nep_col(begc:endc) = spval call hist_addfld1d (fname='C13_NEP', units='gC13/m^2/s', & avgflag='A', long_name='C13 net ecosystem production, excludes fire flux, positive for sink', & - ptr_col=this%nep_col) + ptr_col=this%nep_col, default='inactive') this%nee_grc(begg:endg) = spval call hist_addfld1d (fname='C13_NEE', units='gC13/m^2/s', & avgflag='A', long_name='C13 net ecosystem exchange of carbon, includes fire flux, positive for source', & - ptr_gcell=this%nee_grc) + ptr_gcell=this%nee_grc, default='inactive') this%nbp_grc(begg:endg) = spval call hist_addfld1d (fname='C13_NBP', units='gC13/m^2/s', & @@ -3190,7 +3190,7 @@ subroutine InitHistory(this, bounds, carbon_type) call hist_addfld1d (fname='C14_DWT_CONV_CFLUX', units='gC14/m^2/s', & avgflag='A', long_name='C14 conversion C flux (immediate loss to atm) ' // & '(0 at all times except first timestep of year)', & - ptr_gcell=this%dwt_conv_cflux_grc) + ptr_gcell=this%dwt_conv_cflux_grc, default='inactive') this%dwt_conv_cflux_patch(begp:endp) = spval call hist_addfld1d (fname='C14_DWT_CONV_CFLUX_PATCH', units='gC14/m^2/s', & @@ -3204,12 +3204,12 @@ subroutine InitHistory(this, bounds, carbon_type) call hist_addfld1d (fname='C14_DWT_CONV_CFLUX_DRIBBLED', units='gC14/m^2/s', & avgflag='A', & long_name='C14 conversion C flux (immediate loss to atm), dribbled throughout the year', & - ptr_gcell=this%dwt_conv_cflux_dribbled_grc) + ptr_gcell=this%dwt_conv_cflux_dribbled_grc, default='inactive') this%dwt_slash_cflux_col(begc:endc) = spval call hist_addfld1d (fname='C14_DWT_SLASH_CFLUX', units='gC/m^2/s', & avgflag='A', long_name='C14 slash C flux to litter and CWD due to land use', & - ptr_col=this%dwt_slash_cflux_col) + ptr_col=this%dwt_slash_cflux_col, default='inactive') this%dwt_frootc_to_litr_met_c_col(begc:endc,:) = spval call hist_addfld_decomp (fname='C14_DWT_FROOTC_TO_LITR_MET_C', units='gC14/m^2/s', type2d='levdcmp', & @@ -3244,12 +3244,12 @@ subroutine InitHistory(this, bounds, carbon_type) this%sr_col(begc:endc) = spval call hist_addfld1d (fname='C14_SR', units='gC14/m^2/s', & avgflag='A', long_name='C14 total soil respiration (HR + root resp)', & - ptr_col=this%sr_col) + ptr_col=this%sr_col, default='inactive') this%er_col(begc:endc) = spval call hist_addfld1d (fname='C14_ER', units='gC14/m^2/s', & avgflag='A', long_name='C14 total ecosystem respiration, autotrophic + heterotrophic', & - ptr_col=this%er_col) + ptr_col=this%er_col, default='inactive') this%litfire_col(begc:endc) = spval call hist_addfld1d (fname='C14_LITFIRE', units='gC14/m^2/s', & @@ -3269,17 +3269,17 @@ subroutine InitHistory(this, bounds, carbon_type) this%fire_closs_col(begc:endc) = spval call hist_addfld1d (fname='C14_COL_FIRE_CLOSS', units='gC14/m^2/s', & avgflag='A', long_name='C14 total column-level fire C loss', & - ptr_col=this%fire_closs_col) + ptr_col=this%fire_closs_col, default='inactive') this%nep_col(begc:endc) = spval call hist_addfld1d (fname='C14_NEP', units='gC14/m^2/s', & avgflag='A', long_name='C14 net ecosystem production, excludes fire flux, positive for sink', & - ptr_col=this%nep_col) + ptr_col=this%nep_col, default='inactive') this%nee_grc(begg:endg) = spval call hist_addfld1d (fname='C14_NEE', units='gC14/m^2/s', & avgflag='A', long_name='C14 net ecosystem exchange of carbon, includes fire flux, positive for source', & - ptr_gcell=this%nee_grc) + ptr_gcell=this%nee_grc, default='inactive') this%nbp_grc(begg:endg) = spval call hist_addfld1d (fname='C14_NBP', units='gC13/m^2/s', & diff --git a/src/biogeochem/CNVegCarbonStateType.F90 b/src/biogeochem/CNVegCarbonStateType.F90 index 41eb79134f..a6dd0dfd96 100644 --- a/src/biogeochem/CNVegCarbonStateType.F90 +++ b/src/biogeochem/CNVegCarbonStateType.F90 @@ -495,7 +495,7 @@ subroutine InitHistory(this, bounds, carbon_type) this%leafc_patch(begp:endp) = spval call hist_addfld1d (fname='C13_LEAFC', units='gC13/m^2', & avgflag='A', long_name='C13 leaf C', & - ptr_patch=this%leafc_patch) + ptr_patch=this%leafc_patch, default='inactive') this%leafc_storage_patch(begp:endp) = spval call hist_addfld1d (fname='C13_LEAFC_STORAGE', units='gC13/m^2', & @@ -515,7 +515,7 @@ subroutine InitHistory(this, bounds, carbon_type) this%frootc_patch(begp:endp) = spval call hist_addfld1d (fname='C13_FROOTC', units='gC13/m^2', & avgflag='A', long_name='C13 fine root C', & - ptr_patch=this%frootc_patch) + ptr_patch=this%frootc_patch, default='inactive') this%frootc_storage_patch(begp:endp) = spval call hist_addfld1d (fname='C13_FROOTC_STORAGE', units='gC13/m^2', & @@ -530,7 +530,7 @@ subroutine InitHistory(this, bounds, carbon_type) this%livestemc_patch(begp:endp) = spval call hist_addfld1d (fname='C13_LIVESTEMC', units='gC13/m^2', & avgflag='A', long_name='C13 live stem C', & - ptr_patch=this%livestemc_patch) + ptr_patch=this%livestemc_patch, default='inactive') this%livestemc_storage_patch(begp:endp) = spval call hist_addfld1d (fname='C13_LIVESTEMC_STORAGE', units='gC13/m^2', & @@ -545,7 +545,7 @@ subroutine InitHistory(this, bounds, carbon_type) this%deadstemc_patch(begp:endp) = spval call hist_addfld1d (fname='C13_DEADSTEMC', units='gC13/m^2', & avgflag='A', long_name='C13 dead stem C', & - ptr_patch=this%deadstemc_patch) + ptr_patch=this%deadstemc_patch, default='inactive') this%deadstemc_storage_patch(begp:endp) = spval call hist_addfld1d (fname='C13_DEADSTEMC_STORAGE', units='gC13/m^2', & @@ -560,7 +560,7 @@ subroutine InitHistory(this, bounds, carbon_type) this%livecrootc_patch(begp:endp) = spval call hist_addfld1d (fname='C13_LIVECROOTC', units='gC13/m^2', & avgflag='A', long_name='C13 live coarse root C', & - ptr_patch=this%livecrootc_patch) + ptr_patch=this%livecrootc_patch, default='inactive') this%livecrootc_storage_patch(begp:endp) = spval call hist_addfld1d (fname='C13_LIVECROOTC_STORAGE', units='gC13/m^2', & @@ -575,7 +575,7 @@ subroutine InitHistory(this, bounds, carbon_type) this%deadcrootc_patch(begp:endp) = spval call hist_addfld1d (fname='C13_DEADCROOTC', units='gC13/m^2', & avgflag='A', long_name='C13 dead coarse root C', & - ptr_patch=this%deadcrootc_patch) + ptr_patch=this%deadcrootc_patch, default='inactive') this%deadcrootc_storage_patch(begp:endp) = spval call hist_addfld1d (fname='C13_DEADCROOTC_STORAGE', units='gC13/m^2', & @@ -600,12 +600,12 @@ subroutine InitHistory(this, bounds, carbon_type) this%cpool_patch(begp:endp) = spval call hist_addfld1d (fname='C13_CPOOL', units='gC13/m^2', & avgflag='A', long_name='C13 temporary photosynthate C pool', & - ptr_patch=this%cpool_patch) + ptr_patch=this%cpool_patch, default='inactive') this%xsmrpool_patch(begp:endp) = spval call hist_addfld1d (fname='C13_XSMRPOOL', units='gC13/m^2', & avgflag='A', long_name='C13 temporary photosynthate C pool', & - ptr_patch=this%xsmrpool_patch) + ptr_patch=this%xsmrpool_patch, default='inactive') this%ctrunc_patch(begp:endp) = spval call hist_addfld1d (fname='C13_PFT_CTRUNC', units='gC13/m^2', & @@ -615,12 +615,12 @@ subroutine InitHistory(this, bounds, carbon_type) this%dispvegc_patch(begp:endp) = spval call hist_addfld1d (fname='C13_DISPVEGC', units='gC13/m^2', & avgflag='A', long_name='C13 displayed veg carbon, excluding storage and cpool', & - ptr_patch=this%dispvegc_patch) + ptr_patch=this%dispvegc_patch, default='inactive') this%storvegc_patch(begp:endp) = spval call hist_addfld1d (fname='C13_STORVEGC', units='gC13/m^2', & avgflag='A', long_name='C13 stored vegetation carbon, excluding cpool', & - ptr_patch=this%storvegc_patch) + ptr_patch=this%storvegc_patch, default='inactive') this%totvegc_patch(begp:endp) = spval call hist_addfld1d (fname='C13_TOTVEGC', units='gC13/m^2', & @@ -630,17 +630,17 @@ subroutine InitHistory(this, bounds, carbon_type) this%totc_patch(begp:endp) = spval call hist_addfld1d (fname='C13_TOTPFTC', units='gC13/m^2', & avgflag='A', long_name='C13 total patch-level carbon, including cpool', & - ptr_patch=this%totc_patch) + ptr_patch=this%totc_patch, default='inactive') this%seedc_grc(begg:endg) = spval call hist_addfld1d (fname='C13_SEEDC', units='gC13/m^2', & avgflag='A', long_name='C13 pool for seeding new PFTs via dynamic landcover', & - ptr_gcell=this%seedc_grc) + ptr_gcell=this%seedc_grc, default='inactive') this%totc_col(begc:endc) = spval call hist_addfld1d (fname='C13_TOTCOLC', units='gC13/m^2', & avgflag='A', long_name='C13 total column carbon, incl veg and cpool but excl product pools', & - ptr_col=this%totc_col) + ptr_col=this%totc_col, default='inactive') this%totecosysc_col(begc:endc) = spval call hist_addfld1d (fname='C13_TOTECOSYSC', units='gC13/m^2', & @@ -651,11 +651,11 @@ subroutine InitHistory(this, bounds, carbon_type) this%grainc_patch(begp:endp) = spval call hist_addfld1d (fname='C13_GRAINC', units='gC/m^2', & avgflag='A', long_name='C13 grain C (does not equal yield)', & - ptr_patch=this%grainc_patch) + ptr_patch=this%grainc_patch, default='inactive') this%cropseedc_deficit_patch(begp:endp) = spval call hist_addfld1d (fname='C13_CROPSEEDC_DEFICIT', units='gC/m^2', & avgflag='A', long_name='C13 C used for crop seed that needs to be repaid', & - ptr_patch=this%cropseedc_deficit_patch) + ptr_patch=this%cropseedc_deficit_patch, default='inactive') end if @@ -670,7 +670,7 @@ subroutine InitHistory(this, bounds, carbon_type) this%leafc_patch(begp:endp) = spval call hist_addfld1d (fname='C14_LEAFC', units='gC14/m^2', & avgflag='A', long_name='C14 leaf C', & - ptr_patch=this%leafc_patch) + ptr_patch=this%leafc_patch, default='inactive') this%leafc_storage_patch(begp:endp) = spval call hist_addfld1d (fname='C14_LEAFC_STORAGE', units='gC14/m^2', & @@ -690,7 +690,7 @@ subroutine InitHistory(this, bounds, carbon_type) this%frootc_patch(begp:endp) = spval call hist_addfld1d (fname='C14_FROOTC', units='gC14/m^2', & avgflag='A', long_name='C14 fine root C', & - ptr_patch=this%frootc_patch) + ptr_patch=this%frootc_patch, default='inactive') this%frootc_storage_patch(begp:endp) = spval call hist_addfld1d (fname='C14_FROOTC_STORAGE', units='gC14/m^2', & @@ -705,7 +705,7 @@ subroutine InitHistory(this, bounds, carbon_type) this%livestemc_patch(begp:endp) = spval call hist_addfld1d (fname='C14_LIVESTEMC', units='gC14/m^2', & avgflag='A', long_name='C14 live stem C', & - ptr_patch=this%livestemc_patch) + ptr_patch=this%livestemc_patch, default='inactive') this%livestemc_storage_patch(begp:endp) = spval call hist_addfld1d (fname='C14_LIVESTEMC_STORAGE', units='gC14/m^2', & @@ -720,7 +720,7 @@ subroutine InitHistory(this, bounds, carbon_type) this%deadstemc_patch(begp:endp) = spval call hist_addfld1d (fname='C14_DEADSTEMC', units='gC14/m^2', & avgflag='A', long_name='C14 dead stem C', & - ptr_patch=this%deadstemc_patch) + ptr_patch=this%deadstemc_patch, default='inactive') this%deadstemc_storage_patch(begp:endp) = spval call hist_addfld1d (fname='C14_DEADSTEMC_STORAGE', units='gC14/m^2', & @@ -735,7 +735,7 @@ subroutine InitHistory(this, bounds, carbon_type) this%livecrootc_patch(begp:endp) = spval call hist_addfld1d (fname='C14_LIVECROOTC', units='gC14/m^2', & avgflag='A', long_name='C14 live coarse root C', & - ptr_patch=this%livecrootc_patch) + ptr_patch=this%livecrootc_patch, default='inactive') this%livecrootc_storage_patch(begp:endp) = spval call hist_addfld1d (fname='C14_LIVECROOTC_STORAGE', units='gC14/m^2', & @@ -750,7 +750,7 @@ subroutine InitHistory(this, bounds, carbon_type) this%deadcrootc_patch(begp:endp) = spval call hist_addfld1d (fname='C14_DEADCROOTC', units='gC14/m^2', & avgflag='A', long_name='C14 dead coarse root C', & - ptr_patch=this%deadcrootc_patch) + ptr_patch=this%deadcrootc_patch, default='inactive') this%deadcrootc_storage_patch(begp:endp) = spval call hist_addfld1d (fname='C14_DEADCROOTC_STORAGE', units='gC14/m^2', & @@ -775,27 +775,27 @@ subroutine InitHistory(this, bounds, carbon_type) this%cpool_patch(begp:endp) = spval call hist_addfld1d (fname='C14_CPOOL', units='gC14/m^2', & avgflag='A', long_name='C14 temporary photosynthate C pool', & - ptr_patch=this%cpool_patch) + ptr_patch=this%cpool_patch, default='inactive') this%xsmrpool_patch(begp:endp) = spval call hist_addfld1d (fname='C14_XSMRPOOL', units='gC14/m^2', & avgflag='A', long_name='C14 temporary photosynthate C pool', & - ptr_patch=this%xsmrpool_patch) + ptr_patch=this%xsmrpool_patch, default='inactive') this%ctrunc_patch(begp:endp) = spval call hist_addfld1d (fname='C14_PFT_CTRUNC', units='gC14/m^2', & avgflag='A', long_name='C14 patch-level sink for C truncation', & - ptr_patch=this%ctrunc_patch) + ptr_patch=this%ctrunc_patch, default='inactive') this%dispvegc_patch(begp:endp) = spval call hist_addfld1d (fname='C14_DISPVEGC', units='gC14/m^2', & avgflag='A', long_name='C14 displayed veg carbon, excluding storage and cpool', & - ptr_patch=this%dispvegc_patch) + ptr_patch=this%dispvegc_patch, default='inactive') this%storvegc_patch(begp:endp) = spval call hist_addfld1d (fname='C14_STORVEGC', units='gC14/m^2', & avgflag='A', long_name='C14 stored vegetation carbon, excluding cpool', & - ptr_patch=this%storvegc_patch) + ptr_patch=this%storvegc_patch, default='inactive') this%totvegc_patch(begp:endp) = spval call hist_addfld1d (fname='C14_TOTVEGC', units='gC14/m^2', & @@ -805,17 +805,17 @@ subroutine InitHistory(this, bounds, carbon_type) this%totc_patch(begp:endp) = spval call hist_addfld1d (fname='C14_TOTPFTC', units='gC14/m^2', & avgflag='A', long_name='C14 total patch-level carbon, including cpool', & - ptr_patch=this%totc_patch) + ptr_patch=this%totc_patch, default='inactive') this%seedc_grc(begg:endg) = spval call hist_addfld1d (fname='C14_SEEDC', units='gC14/m^2', & avgflag='A', long_name='C14 pool for seeding new PFTs via dynamic landcover', & - ptr_gcell=this%seedc_grc) + ptr_gcell=this%seedc_grc, default='inactive') this%totc_col(begc:endc) = spval call hist_addfld1d (fname='C14_TOTCOLC', units='gC14/m^2', & avgflag='A', long_name='C14 total column carbon, incl veg and cpool but excl product pools', & - ptr_col=this%totc_col) + ptr_col=this%totc_col, default='inactive') this%totecosysc_col(begc:endc) = spval call hist_addfld1d (fname='C14_TOTECOSYSC', units='gC14/m^2', & @@ -826,11 +826,11 @@ subroutine InitHistory(this, bounds, carbon_type) this%grainc_patch(begp:endp) = spval call hist_addfld1d (fname='C14_GRAINC', units='gC/m^2', & avgflag='A', long_name='C14 grain C (does not equal yield)', & - ptr_patch=this%grainc_patch) + ptr_patch=this%grainc_patch, default='inactive') this%cropseedc_deficit_patch(begp:endp) = spval call hist_addfld1d (fname='C14_CROPSEEDC_DEFICIT', units='gC/m^2', & avgflag='A', long_name='C14 C used for crop seed that needs to be repaid', & - ptr_patch=this%cropseedc_deficit_patch) + ptr_patch=this%cropseedc_deficit_patch, default='inactive') end if diff --git a/src/biogeochem/SpeciesBaseType.F90 b/src/biogeochem/SpeciesBaseType.F90 index 239ca91fe3..02f8636557 100644 --- a/src/biogeochem/SpeciesBaseType.F90 +++ b/src/biogeochem/SpeciesBaseType.F90 @@ -22,6 +22,9 @@ module SpeciesBaseType ! Get the full species name procedure(get_species_interface), public, deferred :: get_species + + ! Return true if this is an isotope, false if not + procedure(is_isotope_interface), public, deferred :: is_isotope end type species_base_type abstract interface @@ -62,6 +65,14 @@ pure function get_species_interface(this) result(species_name) character(len=:), allocatable :: species_name class(species_base_type) , intent(in) :: this end function get_species_interface + + pure function is_isotope_interface(this) result(is_isotope) + ! Return true if this is an isotope, false if not + import :: species_base_type + + logical :: is_isotope ! function result + class(species_base_type), intent(in) :: this + end function is_isotope_interface end interface end module SpeciesBaseType diff --git a/src/biogeochem/SpeciesIsotopeType.F90 b/src/biogeochem/SpeciesIsotopeType.F90 index b5fb749823..8a9dcd94f5 100644 --- a/src/biogeochem/SpeciesIsotopeType.F90 +++ b/src/biogeochem/SpeciesIsotopeType.F90 @@ -39,6 +39,7 @@ module SpeciesIsotopeType procedure, public :: hist_fname procedure, public :: rest_fname procedure, public :: get_species + procedure, public :: is_isotope end type species_isotope_type interface species_isotope_type @@ -133,4 +134,14 @@ pure function get_species(this) result(species_name) end function get_species + pure function is_isotope(this) + ! Return true if this is an isotope, false if not + + logical :: is_isotope ! function result + class(species_isotope_type), intent(in) :: this + !----------------------------------------------------------------------- + + is_isotope = .true. + end function is_isotope + end module SpeciesIsotopeType diff --git a/src/biogeochem/SpeciesNonIsotopeType.F90 b/src/biogeochem/SpeciesNonIsotopeType.F90 index 0daf6b3f72..a1dc9d4e0e 100644 --- a/src/biogeochem/SpeciesNonIsotopeType.F90 +++ b/src/biogeochem/SpeciesNonIsotopeType.F90 @@ -37,6 +37,7 @@ module SpeciesNonIsotopeType procedure, public :: hist_fname procedure, public :: rest_fname procedure, public :: get_species + procedure, public :: is_isotope end type species_non_isotope_type interface species_non_isotope_type @@ -122,4 +123,14 @@ pure function get_species(this) result(species_name) end function get_species + pure function is_isotope(this) + ! Return true if this is an isotope, false if not + + logical :: is_isotope ! function result + class(species_non_isotope_type), intent(in) :: this + !----------------------------------------------------------------------- + + is_isotope = .false. + end function is_isotope + end module SpeciesNonIsotopeType diff --git a/src/biogeophys/PhotosynthesisMod.F90 b/src/biogeophys/PhotosynthesisMod.F90 index b0d8ebfb46..4206f7ae3a 100644 --- a/src/biogeophys/PhotosynthesisMod.F90 +++ b/src/biogeophys/PhotosynthesisMod.F90 @@ -405,41 +405,41 @@ subroutine InitHistory(this, bounds) this%c13_psnsun_patch(begp:endp) = spval call hist_addfld1d (fname='C13_PSNSUN', units='umolCO2/m^2/s', & avgflag='A', long_name='C13 sunlit leaf photosynthesis', & - ptr_patch=this%c13_psnsun_patch) + ptr_patch=this%c13_psnsun_patch, default='inactive') this%c13_psnsha_patch(begp:endp) = spval call hist_addfld1d (fname='C13_PSNSHA', units='umolCO2/m^2/s', & avgflag='A', long_name='C13 shaded leaf photosynthesis', & - ptr_patch=this%c13_psnsha_patch) + ptr_patch=this%c13_psnsha_patch, default='inactive') end if if ( use_c14 ) then this%c14_psnsun_patch(begp:endp) = spval call hist_addfld1d (fname='C14_PSNSUN', units='umolCO2/m^2/s', & avgflag='A', long_name='C14 sunlit leaf photosynthesis', & - ptr_patch=this%c14_psnsun_patch) + ptr_patch=this%c14_psnsun_patch, default='inactive') this%c14_psnsha_patch(begp:endp) = spval call hist_addfld1d (fname='C14_PSNSHA', units='umolCO2/m^2/s', & avgflag='A', long_name='C14 shaded leaf photosynthesis', & - ptr_patch=this%c14_psnsha_patch) + ptr_patch=this%c14_psnsha_patch, default='inactive') end if if ( use_c13 ) then this%rc13_canair_patch(begp:endp) = spval call hist_addfld1d (fname='RC13_CANAIR', units='proportion', & avgflag='A', long_name='C13/C(12+13) for canopy air', & - ptr_patch=this%rc13_canair_patch) + ptr_patch=this%rc13_canair_patch, default='inactive') this%rc13_psnsun_patch(begp:endp) = spval call hist_addfld1d (fname='RC13_PSNSUN', units='proportion', & avgflag='A', long_name='C13/C(12+13) for sunlit photosynthesis', & - ptr_patch=this%rc13_psnsun_patch) + ptr_patch=this%rc13_psnsun_patch, default='inactive') this%rc13_psnsha_patch(begp:endp) = spval call hist_addfld1d (fname='RC13_PSNSHA', units='proportion', & avgflag='A', long_name='C13/C(12+13) for shaded photosynthesis', & - ptr_patch=this%rc13_psnsha_patch) + ptr_patch=this%rc13_psnsha_patch, default='inactive') endif ! Canopy physiology diff --git a/src/soilbiogeochem/SoilBiogeochemCarbonFluxType.F90 b/src/soilbiogeochem/SoilBiogeochemCarbonFluxType.F90 index 5d169527c5..83a56eba3a 100644 --- a/src/soilbiogeochem/SoilBiogeochemCarbonFluxType.F90 +++ b/src/soilbiogeochem/SoilBiogeochemCarbonFluxType.F90 @@ -203,7 +203,7 @@ subroutine InitHistory(this, bounds, carbon_type) this%lithr_col(begc:endc) = spval call hist_addfld1d (fname='LITTERC_HR', units='gC/m^2/s', & avgflag='A', long_name='litter C heterotrophic respiration', & - ptr_col=this%lithr_col) + ptr_col=this%lithr_col, default='inactive') this%somhr_col(begc:endc) = spval call hist_addfld1d (fname='SOILC_HR', units='gC/m^2/s', & @@ -391,7 +391,7 @@ subroutine InitHistory(this, bounds, carbon_type) this%somhr_col(begc:endc) = spval call hist_addfld1d (fname='C13_SOILC_HR', units='gC13/m^2/s', & avgflag='A', long_name='C13 soil organic matter heterotrophic respiration', & - ptr_col=this%somhr_col) + ptr_col=this%somhr_col, default='inactive') this%decomp_cascade_hr_col(begc:endc,:) = spval @@ -456,12 +456,12 @@ subroutine InitHistory(this, bounds, carbon_type) this%lithr_col(begc:endc) = spval call hist_addfld1d (fname='C14_LITTERC_HR', units='gC14/m^2/s', & avgflag='A', long_name='C14 litter carbon heterotrophic respiration', & - ptr_col=this%lithr_col) + ptr_col=this%lithr_col, default='inactive') this%somhr_col(begc:endc) = spval call hist_addfld1d (fname='C14_SOILC_HR', units='gC14/m^2/s', & avgflag='A', long_name='C14 soil organic matter heterotrophic respiration', & - ptr_col=this%somhr_col) + ptr_col=this%somhr_col, default='inactive') this%decomp_cascade_hr_col(begc:endc,:) = spval this%decomp_cascade_hr_vr_col(begc:endc,:,:) = spval diff --git a/src/soilbiogeochem/SoilBiogeochemCarbonStateType.F90 b/src/soilbiogeochem/SoilBiogeochemCarbonStateType.F90 index 78be5efd44..9b1f288f63 100644 --- a/src/soilbiogeochem/SoilBiogeochemCarbonStateType.F90 +++ b/src/soilbiogeochem/SoilBiogeochemCarbonStateType.F90 @@ -233,7 +233,7 @@ subroutine InitHistory(this, bounds, carbon_type) longname = 'C13 '//trim(decomp_cascade_con%decomp_pool_name_history(l))//' C' call hist_addfld1d (fname=fieldname, units='gC13/m^2', & avgflag='A', long_name=longname, & - ptr_col=data1dptr) + ptr_col=data1dptr, default='inactive') end do this%totlitc_col(begc:endc) = spval @@ -250,14 +250,14 @@ subroutine InitHistory(this, bounds, carbon_type) this%totlitc_1m_col(begc:endc) = spval call hist_addfld1d (fname='C13_TOTLITC_1m', units='gC13/m^2', & avgflag='A', long_name='C13 total litter carbon to 1 meter', & - ptr_col=this%totlitc_1m_col) + ptr_col=this%totlitc_1m_col, default='inactive') end if if ( nlevdecomp_full > 1 ) then this%totsomc_1m_col(begc:endc) = spval call hist_addfld1d (fname='C13_TOTSOMC_1m', units='gC13/m^2', & avgflag='A', long_name='C13 total soil organic matter carbon to 1 meter', & - ptr_col=this%totsomc_1m_col) + ptr_col=this%totsomc_1m_col, default='inactive') endif this%ctrunc_col(begc:endc) = spval @@ -293,7 +293,7 @@ subroutine InitHistory(this, bounds, carbon_type) fieldname = 'C14_'//trim(decomp_cascade_con%decomp_pool_name_history(l))//'C' longname = 'C14 '//trim(decomp_cascade_con%decomp_pool_name_history(l))//' C' call hist_addfld1d (fname=fieldname, units='gC14/m^2', & - avgflag='A', long_name=longname, ptr_col=data1dptr) + avgflag='A', long_name=longname, ptr_col=data1dptr, default='inactive') if ( nlevdecomp_full > 1 ) then data1dptr => this%decomp_cpools_1m_col(:,l) @@ -318,12 +318,12 @@ subroutine InitHistory(this, bounds, carbon_type) this%totlitc_1m_col(begc:endc) = spval call hist_addfld1d (fname='C14_TOTLITC_1m', units='gC14/m^2', & avgflag='A', long_name='C14 total litter carbon to 1 meter', & - ptr_col=this%totlitc_1m_col) + ptr_col=this%totlitc_1m_col, default='inactive') this%totsomc_1m_col(begc:endc) = spval call hist_addfld1d (fname='C14_TOTSOMC_1m', units='gC14/m^2', & avgflag='A', long_name='C14 total soil organic matter carbon to 1 meter', & - ptr_col=this%totsomc_1m_col) + ptr_col=this%totsomc_1m_col, default='inactive') endif this%ctrunc_col(begc:endc) = spval From 56e41f0f152b5b5422a665d52329bb34e4b4d2ab Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Wed, 24 Oct 2018 11:05:55 -0600 Subject: [PATCH 37/54] Move and rename carbon_isotopes usermods directory As with other directories, this is only supposed to be used in conjunction with other cmip6 changes, so I have moved it to the _includes directory and put cmip6 in the name. This reliance on cmip6 isn't important yet, but will be once we add some extra history fields in this usermod. --- .../_includes/cmip6_carbon_isotopes/user_nl_clm | 8 ++++++++ cime_config/usermods_dirs/carbon_isotopes/user_nl_clm | 4 ---- cime_config/usermods_dirs/cmip6_deck/include_user_mods | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) create mode 100644 cime_config/usermods_dirs/_includes/cmip6_carbon_isotopes/user_nl_clm delete mode 100644 cime_config/usermods_dirs/carbon_isotopes/user_nl_clm diff --git a/cime_config/usermods_dirs/_includes/cmip6_carbon_isotopes/user_nl_clm b/cime_config/usermods_dirs/_includes/cmip6_carbon_isotopes/user_nl_clm new file mode 100644 index 0000000000..d2d1fb861e --- /dev/null +++ b/cime_config/usermods_dirs/_includes/cmip6_carbon_isotopes/user_nl_clm @@ -0,0 +1,8 @@ +!---------------------------------------------------------------------------------- +! Settings from cmip6_carbon_isotopes +!---------------------------------------------------------------------------------- + +use_c13 = .true. +use_c14 = .true. +use_c13_timeseries = .true. +use_c14_bombspike = .true. diff --git a/cime_config/usermods_dirs/carbon_isotopes/user_nl_clm b/cime_config/usermods_dirs/carbon_isotopes/user_nl_clm deleted file mode 100644 index 2fa530330a..0000000000 --- a/cime_config/usermods_dirs/carbon_isotopes/user_nl_clm +++ /dev/null @@ -1,4 +0,0 @@ -use_c13 = .true. -use_c14 = .true. -use_c13_timeseries = .true. -use_c14_bombspike = .true. diff --git a/cime_config/usermods_dirs/cmip6_deck/include_user_mods b/cime_config/usermods_dirs/cmip6_deck/include_user_mods index ce2439252e..2cadcc0b93 100644 --- a/cime_config/usermods_dirs/cmip6_deck/include_user_mods +++ b/cime_config/usermods_dirs/cmip6_deck/include_user_mods @@ -1,4 +1,4 @@ ../_includes/cmip6_glaciers_cplhist ../_includes/cmip6_glaciers_virtual_antarctica -../carbon_isotopes +../_includes/cmip6_carbon_isotopes ../output_crop From dbc0b35520c56569362cd93de667fdc0cfccaa1d Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Wed, 24 Oct 2018 14:42:27 -0600 Subject: [PATCH 38/54] In cmip6_carbon_isotopes usermods, add some C14 history fields Per Dave Lawrence's request here: https://github.com/ESCOMP/ctsm/pull/527 --- .../usermods_dirs/_includes/cmip6_carbon_isotopes/user_nl_clm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cime_config/usermods_dirs/_includes/cmip6_carbon_isotopes/user_nl_clm b/cime_config/usermods_dirs/_includes/cmip6_carbon_isotopes/user_nl_clm index d2d1fb861e..e7c6fbf7e8 100644 --- a/cime_config/usermods_dirs/_includes/cmip6_carbon_isotopes/user_nl_clm +++ b/cime_config/usermods_dirs/_includes/cmip6_carbon_isotopes/user_nl_clm @@ -6,3 +6,7 @@ use_c13 = .true. use_c14 = .true. use_c13_timeseries = .true. use_c14_bombspike = .true. + +! h3 stream (yearly average, gridcell-level) +hist_fincl4 += 'C14_SOIL1C_vr', 'C14_SOIL2C_vr', 'C14_SOIL3C_vr' + From 2b838ce10573ba1600999254a3a5dff75d8845bf Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Thu, 25 Oct 2018 11:31:25 -0600 Subject: [PATCH 39/54] Fix default active status of LITTERC_HR I had accidentally made LITTERC_HR inactive by default instead of C13_LITTERC_HR. This commit fixes that mistake. --- src/soilbiogeochem/SoilBiogeochemCarbonFluxType.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/soilbiogeochem/SoilBiogeochemCarbonFluxType.F90 b/src/soilbiogeochem/SoilBiogeochemCarbonFluxType.F90 index 83a56eba3a..e866ea280b 100644 --- a/src/soilbiogeochem/SoilBiogeochemCarbonFluxType.F90 +++ b/src/soilbiogeochem/SoilBiogeochemCarbonFluxType.F90 @@ -203,7 +203,7 @@ subroutine InitHistory(this, bounds, carbon_type) this%lithr_col(begc:endc) = spval call hist_addfld1d (fname='LITTERC_HR', units='gC/m^2/s', & avgflag='A', long_name='litter C heterotrophic respiration', & - ptr_col=this%lithr_col, default='inactive') + ptr_col=this%lithr_col) this%somhr_col(begc:endc) = spval call hist_addfld1d (fname='SOILC_HR', units='gC/m^2/s', & @@ -386,7 +386,7 @@ subroutine InitHistory(this, bounds, carbon_type) this%lithr_col(begc:endc) = spval call hist_addfld1d (fname='C13_LITTERC_HR', units='gC13/m^2/s', & avgflag='A', long_name='C13 fine root C litterfall to litter 3 C', & - ptr_col=this%lithr_col) + ptr_col=this%lithr_col, default='inactive') this%somhr_col(begc:endc) = spval call hist_addfld1d (fname='C13_SOILC_HR', units='gC13/m^2/s', & From 4588dae24b8e3ba98e038e09b8605a57240f223c Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Thu, 25 Oct 2018 13:26:53 -0600 Subject: [PATCH 40/54] Don't allow interpolation from a non-ciso case to a ciso case Due to https://github.com/ESCOMP/ctsm/issues/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. This commit should be backed out once ESCOMP/ctsm#67 is resolved --- .../namelist_definition_clm4_5.xml | 10 +++ .../testmods_dirs/clm/ciso/user_nl_clm | 8 +++ .../clm/ciso_flexCN_FUN/user_nl_clm | 8 +++ src/init_interp/initInterp.F90 | 67 ++++++++++++++++++- src/main/clm_varctl.F90 | 8 +++ src/main/controlMod.F90 | 4 +- 6 files changed, 103 insertions(+), 2 deletions(-) diff --git a/bld/namelist_files/namelist_definition_clm4_5.xml b/bld/namelist_files/namelist_definition_clm4_5.xml index 6919ca0120..924b6ef32d 100644 --- a/bld/namelist_files/namelist_definition_clm4_5.xml +++ b/bld/namelist_files/namelist_definition_clm4_5.xml @@ -1981,6 +1981,16 @@ Flag to use the atmospheric time series of C13 concentrations from natural abund Filename with time series of atmospheric Delta C13 data, which use CMIP6 format. variables in file are "time" and "delta13co2_in_air". time variable is in format: years since 1850-01-01 0:0:0.0. units are permil. + + +There is a bug that causes incorrect values for C isotopes if running +init_interp from a case without C isotopes to a case with C isotopes +(https://github.com/ESCOMP/ctsm/issues/67). Normally, an error-check +prevents you from doing this interpolation (until we have fixed that +bug). However, we sometimes want to bypass this error-check in system +tests. This namelist flag bypasses this error-check. + diff --git a/cime_config/testdefs/testmods_dirs/clm/ciso/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/ciso/user_nl_clm index 0a40cd33a8..3b12a2772b 100644 --- a/cime_config/testdefs/testmods_dirs/clm/ciso/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/ciso/user_nl_clm @@ -1,2 +1,10 @@ use_c13 = .true. use_c14 = .true. + + ! BUG(wjs, 2018-10-25, ESCOMP/ctsm#67) There is a bug that causes incorrect values for C + ! isotopes if running init_interp from a case without C isotopes to a case with C + ! isotopes (https://github.com/ESCOMP/ctsm/issues/67). Normally, an error-check prevents + ! you from doing this interpolation (until we have fixed that bug). However, we + ! sometimes want to bypass this error-check in system tests. This namelist flag bypasses + ! this error-check. + for_testing_allow_interp_non_ciso_to_ciso = .true. diff --git a/cime_config/testdefs/testmods_dirs/clm/ciso_flexCN_FUN/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/ciso_flexCN_FUN/user_nl_clm index 9db1957c1c..32e584af82 100644 --- a/cime_config/testdefs/testmods_dirs/clm/ciso_flexCN_FUN/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/ciso_flexCN_FUN/user_nl_clm @@ -2,3 +2,11 @@ use_c14 = .true. use_fun = .true. use_flexibleCN = .true. + + ! BUG(wjs, 2018-10-25, ESCOMP/ctsm#67) There is a bug that causes incorrect values for C + ! isotopes if running init_interp from a case without C isotopes to a case with C + ! isotopes (https://github.com/ESCOMP/ctsm/issues/67). Normally, an error-check prevents + ! you from doing this interpolation (until we have fixed that bug). However, we + ! sometimes want to bypass this error-check in system tests. This namelist flag bypasses + ! this error-check. + for_testing_allow_interp_non_ciso_to_ciso = .true. diff --git a/src/init_interp/initInterp.F90 b/src/init_interp/initInterp.F90 index a5f31584bc..21c7ddb18c 100644 --- a/src/init_interp/initInterp.F90 +++ b/src/init_interp/initInterp.F90 @@ -49,6 +49,7 @@ module initInterpMod private :: interp_1d_int private :: interp_2d_double private :: limit_snlsno + private :: check_interp_non_ciso_to_ciso ! Private data @@ -227,12 +228,14 @@ subroutine initInterp (filei, fileo, bounds, glc_behavior) end if ! -------------------------------------------- - ! Open input and output initial conditions files (both just for reading now) + ! Open input and output initial conditions files ! -------------------------------------------- call ncd_pio_openfile (ncidi, trim(filei) , 0) call ncd_pio_openfile (ncido, trim(fileo), ncd_write) + call check_interp_non_ciso_to_ciso(ncidi) + ! -------------------------------------------- ! Determine dimensions and error checks on dimensions ! -------------------------------------------- @@ -1258,4 +1261,66 @@ subroutine limit_snlsno(ncido, bounds_o) deallocate(snlsno) end subroutine limit_snlsno + !----------------------------------------------------------------------- + subroutine check_interp_non_ciso_to_ciso(ncidi) + ! + ! !DESCRIPTION: + ! BUG(wjs, 2018-10-25, ESCOMP/ctsm#67) There is a bug that causes incorrect values for + ! C isotopes if running init_interp from a case without C isotopes to a case with C + ! isotopes (https://github.com/ESCOMP/ctsm/issues/67). Here we check that the user + ! isn't trying to do an interpolation in that case. This check should be removed once + ! bug #67 is resolved. + ! + ! !USES: + use clm_varctl, only : use_c13, use_c14, for_testing_allow_interp_non_ciso_to_ciso + ! + ! !ARGUMENTS: + type(file_desc_t), intent(inout) :: ncidi + ! + ! !LOCAL VARIABLES: + type(Var_desc_t) :: vardesc ! pio variable descriptor + integer :: status ! return code + + character(len=*), parameter :: subname = 'check_interp_non_ciso_to_ciso' + !----------------------------------------------------------------------- + + if (.not. for_testing_allow_interp_non_ciso_to_ciso) then + if (use_c13) then + call pio_seterrorhandling(ncidi, PIO_BCAST_ERROR) + ! arbitrarily check leafc_13 (we could pick any c13 restart field) + status = pio_inq_varid(ncidi, name='leafc_13', vardesc=vardesc) + call pio_seterrorhandling(ncidi, PIO_INTERNAL_ERROR) + if (status /= PIO_noerr) then + if (masterproc) then + write(iulog,*) 'Cannot interpolate from a run without c13 to a run with c13,' + write(iulog,*) 'due to .' + write(iulog,*) 'Either use an input initial conditions file with c13 information,' + write(iulog,*) 'or re-spinup from cold start.' + end if + call endrun(msg='Cannot interpolate from a run without c13 to a run with c13', & + additional_msg=errMsg(sourcefile, __LINE__)) + end if + end if + + if (use_c14) then + call pio_seterrorhandling(ncidi, PIO_BCAST_ERROR) + ! arbitrarily check leafc_14 (we could pick any c14 restart field) + status = pio_inq_varid(ncidi, name='leafc_14', vardesc=vardesc) + call pio_seterrorhandling(ncidi, PIO_INTERNAL_ERROR) + if (status /= PIO_noerr) then + if (masterproc) then + write(iulog,*) 'Cannot interpolate from a run without c14 to a run with c14,' + write(iulog,*) 'due to .' + write(iulog,*) 'Either use an input initial conditions file with c14 information,' + write(iulog,*) 'or re-spinup from cold start.' + end if + call endrun(msg='Cannot interpolate from a run without c14 to a run with c14', & + additional_msg=errMsg(sourcefile, __LINE__)) + end if + end if + end if + + end subroutine check_interp_non_ciso_to_ciso + + end module initInterpMod diff --git a/src/main/clm_varctl.F90 b/src/main/clm_varctl.F90 index f7e5a793ca..ef8c25761e 100644 --- a/src/main/clm_varctl.F90 +++ b/src/main/clm_varctl.F90 @@ -189,6 +189,14 @@ module clm_varctl logical, public :: use_c13 = .false. ! true => use C-13 model logical, public :: use_c14 = .false. ! true => use C-14 model + ! BUG(wjs, 2018-10-25, ESCOMP/ctsm#67) There is a bug that causes incorrect values for C + ! isotopes if running init_interp from a case without C isotopes to a case with C + ! isotopes (https://github.com/ESCOMP/ctsm/issues/67). Normally, an error-check prevents + ! you from doing this interpolation (until we have fixed that bug). However, we + ! sometimes want to bypass this error-check in system tests. This namelist flag bypasses + ! this error-check. + logical, public :: for_testing_allow_interp_non_ciso_to_ciso = .false. + !---------------------------------------------------------- ! FATES switches !---------------------------------------------------------- diff --git a/src/main/controlMod.F90 b/src/main/controlMod.F90 index a78f56785e..d46df04a5d 100644 --- a/src/main/controlMod.F90 +++ b/src/main/controlMod.F90 @@ -214,7 +214,7 @@ subroutine control_init( ) namelist /clm_inparm/ no_frozen_nitrif_denitrif - namelist /clm_inparm/ use_c13, use_c14 + namelist /clm_inparm/ use_c13, use_c14, for_testing_allow_interp_non_ciso_to_ciso ! FATES Flags @@ -628,6 +628,7 @@ subroutine control_spmd() ! isotopes call mpi_bcast (use_c13, 1, MPI_LOGICAL, 0, mpicom, ier) call mpi_bcast (use_c14, 1, MPI_LOGICAL, 0, mpicom, ier) + call mpi_bcast (for_testing_allow_interp_non_ciso_to_ciso, 1, MPI_LOGICAL, 0, mpicom, ier) call mpi_bcast (use_fates, 1, MPI_LOGICAL, 0, mpicom, ier) @@ -864,6 +865,7 @@ subroutine control_print () write(iulog, *) ' use_c14 : ', use_c14 write(iulog, *) ' use_c14_bombspike : ', use_c14_bombspike write(iulog, *) ' atm_c14_filename : ', atm_c14_filename + write(iulog, *) ' for_testing_allow_interp_non_ciso_to_ciso : ', for_testing_allow_interp_non_ciso_to_ciso end if if (fsnowoptics == ' ') then From 9f5a79aac795f544f08b0aedd52103a7edfd6633 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Thu, 25 Oct 2018 15:52:08 -0600 Subject: [PATCH 41/54] Add a cmip6_waccm_deck usermods directory --- .../usermods_dirs/cmip6_waccm_deck/README | 16 ++++++++++++++++ .../cmip6_waccm_deck/include_user_mods | 3 +++ 2 files changed, 19 insertions(+) create mode 100644 cime_config/usermods_dirs/cmip6_waccm_deck/README create mode 100644 cime_config/usermods_dirs/cmip6_waccm_deck/include_user_mods diff --git a/cime_config/usermods_dirs/cmip6_waccm_deck/README b/cime_config/usermods_dirs/cmip6_waccm_deck/README new file mode 100644 index 0000000000..8f85af14a3 --- /dev/null +++ b/cime_config/usermods_dirs/cmip6_waccm_deck/README @@ -0,0 +1,16 @@ +WACCM DECK runs should be configured similarly to CAM DECK runs, but +without virtual elevation classes over Antarctica. + +(2018-10-22) In discussions between Bill Sacks and Bill Lipscomb: We +have decided NOT to turn on virtual Antarctica columns for any of the +WACCM simulations (DECK or ScenarioMIP): these weren't turned on in the +WACCM PI-Control or historical runs (either by accident or +intentionally: I'm not sure which, and can't find emails describing this +decision). Since this setting needs to be compatible with the REFCASE, +it's simpler if we keep it consistent for all WACCM runs, and there +seems to be only limited value in turning on virtual Antarctica columns +in the remaining WACCM runs (1% CO2, 4xCO2 and ScenarioMIP) when they +weren't on in the WACCM PI-Control or Historical runs. And Mike Mills +says that there won't be any more sharing of initial conditions between +CAM and WACCM CMIP6 runs, so it's fine if the two sets remain different +in this respect. diff --git a/cime_config/usermods_dirs/cmip6_waccm_deck/include_user_mods b/cime_config/usermods_dirs/cmip6_waccm_deck/include_user_mods new file mode 100644 index 0000000000..ad94a3093c --- /dev/null +++ b/cime_config/usermods_dirs/cmip6_waccm_deck/include_user_mods @@ -0,0 +1,3 @@ +../_includes/cmip6_glaciers_cplhist +../_includes/cmip6_carbon_isotopes +../output_crop From ceb0a382cab88dd684ba84aeb1bb1a674f2844de Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Thu, 25 Oct 2018 15:57:55 -0600 Subject: [PATCH 42/54] Unrelated change: trim error message --- src/main/abortutils.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/abortutils.F90 b/src/main/abortutils.F90 index 9f9ce56272..eb276ca044 100644 --- a/src/main/abortutils.F90 +++ b/src/main/abortutils.F90 @@ -42,7 +42,7 @@ subroutine endrun_vanilla(msg, additional_msg) !----------------------------------------------------------------------- if (present (additional_msg)) then - write(iulog,*)'ENDRUN: ', additional_msg + write(iulog,*)'ENDRUN: ', trim(additional_msg) else write(iulog,*)'ENDRUN:' end if From 00888fb98dd82eb03056cffa903937e611e2918e Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Fri, 26 Oct 2018 12:24:29 -0600 Subject: [PATCH 43/54] Add some output when for_testing_allow_interp_non_ciso_to_ciso is true Per request of Erik Kluzek --- src/init_interp/initInterp.F90 | 76 +++++++++++++++++++++------------- 1 file changed, 47 insertions(+), 29 deletions(-) diff --git a/src/init_interp/initInterp.F90 b/src/init_interp/initInterp.F90 index 21c7ddb18c..a45bda7fcc 100644 --- a/src/init_interp/initInterp.F90 +++ b/src/init_interp/initInterp.F90 @@ -1280,43 +1280,61 @@ subroutine check_interp_non_ciso_to_ciso(ncidi) ! !LOCAL VARIABLES: type(Var_desc_t) :: vardesc ! pio variable descriptor integer :: status ! return code + logical :: missing_ciso ! whether C isotope fields are missing from the input file, despite the run containing C isotopes character(len=*), parameter :: subname = 'check_interp_non_ciso_to_ciso' !----------------------------------------------------------------------- - if (.not. for_testing_allow_interp_non_ciso_to_ciso) then - if (use_c13) then - call pio_seterrorhandling(ncidi, PIO_BCAST_ERROR) - ! arbitrarily check leafc_13 (we could pick any c13 restart field) - status = pio_inq_varid(ncidi, name='leafc_13', vardesc=vardesc) - call pio_seterrorhandling(ncidi, PIO_INTERNAL_ERROR) - if (status /= PIO_noerr) then - if (masterproc) then - write(iulog,*) 'Cannot interpolate from a run without c13 to a run with c13,' - write(iulog,*) 'due to .' - write(iulog,*) 'Either use an input initial conditions file with c13 information,' - write(iulog,*) 'or re-spinup from cold start.' - end if - call endrun(msg='Cannot interpolate from a run without c13 to a run with c13', & - additional_msg=errMsg(sourcefile, __LINE__)) + missing_ciso = .false. + + if (use_c13) then + call pio_seterrorhandling(ncidi, PIO_BCAST_ERROR) + ! arbitrarily check leafc_13 (we could pick any c13 restart field) + status = pio_inq_varid(ncidi, name='leafc_13', vardesc=vardesc) + call pio_seterrorhandling(ncidi, PIO_INTERNAL_ERROR) + if (status /= PIO_noerr) then + if (masterproc) then + write(iulog,*) 'Cannot interpolate from a run without c13 to a run with c13,' + write(iulog,*) 'due to .' + write(iulog,*) 'Either use an input initial conditions file with c13 information,' + write(iulog,*) 'or re-spinup from cold start.' end if + missing_ciso = .true. end if + end if - if (use_c14) then - call pio_seterrorhandling(ncidi, PIO_BCAST_ERROR) - ! arbitrarily check leafc_14 (we could pick any c14 restart field) - status = pio_inq_varid(ncidi, name='leafc_14', vardesc=vardesc) - call pio_seterrorhandling(ncidi, PIO_INTERNAL_ERROR) - if (status /= PIO_noerr) then - if (masterproc) then - write(iulog,*) 'Cannot interpolate from a run without c14 to a run with c14,' - write(iulog,*) 'due to .' - write(iulog,*) 'Either use an input initial conditions file with c14 information,' - write(iulog,*) 'or re-spinup from cold start.' - end if - call endrun(msg='Cannot interpolate from a run without c14 to a run with c14', & - additional_msg=errMsg(sourcefile, __LINE__)) + if (use_c14) then + call pio_seterrorhandling(ncidi, PIO_BCAST_ERROR) + ! arbitrarily check leafc_14 (we could pick any c14 restart field) + status = pio_inq_varid(ncidi, name='leafc_14', vardesc=vardesc) + call pio_seterrorhandling(ncidi, PIO_INTERNAL_ERROR) + if (status /= PIO_noerr) then + if (masterproc) then + write(iulog,*) 'Cannot interpolate from a run without c14 to a run with c14,' + write(iulog,*) 'due to .' + write(iulog,*) 'Either use an input initial conditions file with c14 information,' + write(iulog,*) 'or re-spinup from cold start.' end if + missing_ciso = .true. + end if + end if + + if (for_testing_allow_interp_non_ciso_to_ciso) then + if (missing_ciso) then + write(iulog,*) ' ' + write(iulog,*) 'Proceeding despite missing c13 and/or c14 fields on input finidat file,' + write(iulog,*) 'because for_testing_allow_interp_non_ciso_to_ciso is set.' + write(iulog,*) ' ' + else + write(iulog,*) ' ' + write(iulog,*) 'for_testing_allow_interp_non_ciso_to_ciso is .true., but it appears to be unnecessary in this run' + write(iulog,*) '(this is informational only - it does not indicate a problem)' + write(iulog,*) ' ' + end if + else + if (missing_ciso) then + call endrun(msg='Cannot interpolate from a run without c13/c14 to a run with c13/c14', & + additional_msg=errMsg(sourcefile, __LINE__)) end if end if From 45c67a2d54983e3898e695fa6103ff13d8c2cb4e Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Fri, 26 Oct 2018 12:35:50 -0600 Subject: [PATCH 44/54] Add / fix CMIP6 compset modifiers (1) Add BGC-CROP-CMIP6WACCMDECK modifier (2) Point to correct directory for CMIP6DECK modifier, including being robust to whether this is a standalone checkout or within CESM --- cime_config/config_component.xml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml index 73050aafb1..edfa521d2e 100644 --- a/cime_config/config_component.xml +++ b/cime_config/config_component.xml @@ -14,9 +14,9 @@ - clm4.0: - clm4.5: - clm5.0: + clm4.0: + clm4.5: + clm5.0: Satellite phenology: CN: Carbon Nitrogen model CNDV: CN with Dynamic Vegetation @@ -30,6 +30,7 @@ BGC (vert. resol. CN and methane) with dynamic vegetation: BGC (vert. resol. CN and methane) with dynamic vegetation and prognostic crop: BGC (vert. resol. CN and methane) with prognostic crop, with modifications appropriate for CMIP6 DECK experiments: + BGC (vert. resol. CN and methane) with prognostic crop, with modifications appropriate for CMIP6 WACCM DECK experiments: @@ -230,7 +231,8 @@ - $SRCROOT/components/clm/cime_config/usermods_dirs/cmip6 + $COMP_ROOT_DIR_LND/cime_config/usermods_dirs/cmip6_deck + $COMP_ROOT_DIR_LND/cime_config/usermods_dirs/cmip6_waccm_deck run_component_clm env_case.xml From 88aa35b57aa2d9eb272362780a05b2d925fef110 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Fri, 26 Oct 2018 12:53:43 -0600 Subject: [PATCH 45/54] Add compsets exercising the new CMIP6 options This is so we can add tests covering the application of these options --- cime_config/config_compsets.xml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/cime_config/config_compsets.xml b/cime_config/config_compsets.xml index c628110a9c..4b820c1ffa 100644 --- a/cime_config/config_compsets.xml +++ b/cime_config/config_compsets.xml @@ -96,6 +96,18 @@ + + + I1850Clm50BgcCropCmip6 + 1850_DATM%GSWP3v1_CLM50%BGC-CROP-CMIP6DECK_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV + + + + + I1850Clm50BgcCropCmip6waccm + 1850_DATM%GSWP3v1_CLM50%BGC-CROP-CMIP6WACCMDECK_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV + + I1850Clm50BgcCropCru 1850_DATM%CRUv7_CLM50%BGC-CROP_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV From be984c8be09cdbdb0ffbe5591dfef7488ecf6903 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Sat, 27 Oct 2018 05:53:35 -0600 Subject: [PATCH 46/54] Change cmip6 tests to use new compsets, and change f09_g16 to f09_g17 --- cime_config/testdefs/testlist_clm.xml | 8 ++++---- cime_config/testdefs/testmods_dirs/clm/basic/README | 8 ++++++++ .../testdefs/testmods_dirs/clm/basic/shell_commands | 4 ++++ 3 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 cime_config/testdefs/testmods_dirs/clm/basic/README create mode 100644 cime_config/testdefs/testmods_dirs/clm/basic/shell_commands diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 7fef3f4d41..3899247206 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -980,13 +980,13 @@ - + - + @@ -1486,13 +1486,13 @@ - + - + diff --git a/cime_config/testdefs/testmods_dirs/clm/basic/README b/cime_config/testdefs/testmods_dirs/clm/basic/README new file mode 100644 index 0000000000..9193464848 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/basic/README @@ -0,0 +1,8 @@ +This testmods directory is for tests where we want to use the +out-of-the-box output options, but still want the minimal changes that +we apply for nearly all tests. + +("default" would probably be a good name for this, but we already use +"default" to mean "the standard output changes that are applied for most +tests" (adding some streams and fields, double precision, etc.). We may +want to consider renaming that one and using "default" for this one.) diff --git a/cime_config/testdefs/testmods_dirs/clm/basic/shell_commands b/cime_config/testdefs/testmods_dirs/clm/basic/shell_commands new file mode 100644 index 0000000000..33792ffaee --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/basic/shell_commands @@ -0,0 +1,4 @@ +#!/bin/bash + +./xmlchange BFBFLAG="TRUE" + From a6beaf99fdbfc65459a7d673254a9bf241c315d2 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Sat, 27 Oct 2018 06:02:00 -0600 Subject: [PATCH 47/54] Change compset used for testing CMIP6WACCMDECK I'll test this with a single-point case, so I need a compset compatible with that. --- cime_config/config_compsets.xml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/cime_config/config_compsets.xml b/cime_config/config_compsets.xml index 4b820c1ffa..77dda30ed6 100644 --- a/cime_config/config_compsets.xml +++ b/cime_config/config_compsets.xml @@ -102,10 +102,14 @@ 1850_DATM%GSWP3v1_CLM50%BGC-CROP-CMIP6DECK_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV - - - I1850Clm50BgcCropCmip6waccm - 1850_DATM%GSWP3v1_CLM50%BGC-CROP-CMIP6WACCMDECK_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV + + + I2000Clm50BgcCropQianGsCmip6waccm + 2000_DATM%QIA_CLM50%BGC-CROP-CMIP6WACCMDECK_SICE_SOCN_MOSART_SGLC_SWAV From 3e9b6a4fa6811704c7e3beb0cd15f9daf4f1bb37 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Sat, 27 Oct 2018 06:28:43 -0600 Subject: [PATCH 48/54] Add testmods to test new usermods directories --- .../testdefs/testmods_dirs/clm/output_bgc_highfreq/README | 1 + .../testmods_dirs/clm/output_bgc_highfreq/include_user_mods | 2 ++ .../testdefs/testmods_dirs/clm/output_crop_highfreq/README | 1 + .../testmods_dirs/clm/output_crop_highfreq/include_user_mods | 2 ++ .../testdefs/testmods_dirs/clm/output_sp_highfreq/README | 1 + .../testmods_dirs/clm/output_sp_highfreq/include_user_mods | 2 ++ 6 files changed, 9 insertions(+) create mode 100644 cime_config/testdefs/testmods_dirs/clm/output_bgc_highfreq/README create mode 100644 cime_config/testdefs/testmods_dirs/clm/output_bgc_highfreq/include_user_mods create mode 100644 cime_config/testdefs/testmods_dirs/clm/output_crop_highfreq/README create mode 100644 cime_config/testdefs/testmods_dirs/clm/output_crop_highfreq/include_user_mods create mode 100644 cime_config/testdefs/testmods_dirs/clm/output_sp_highfreq/README create mode 100644 cime_config/testdefs/testmods_dirs/clm/output_sp_highfreq/include_user_mods diff --git a/cime_config/testdefs/testmods_dirs/clm/output_bgc_highfreq/README b/cime_config/testdefs/testmods_dirs/clm/output_bgc_highfreq/README new file mode 100644 index 0000000000..7798a3ce70 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/output_bgc_highfreq/README @@ -0,0 +1 @@ +Tests the output_bgc_highfreq usermods diff --git a/cime_config/testdefs/testmods_dirs/clm/output_bgc_highfreq/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/output_bgc_highfreq/include_user_mods new file mode 100644 index 0000000000..de8b9039c8 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/output_bgc_highfreq/include_user_mods @@ -0,0 +1,2 @@ +../../../../usermods_dirs/output_bgc_highfreq +../basic diff --git a/cime_config/testdefs/testmods_dirs/clm/output_crop_highfreq/README b/cime_config/testdefs/testmods_dirs/clm/output_crop_highfreq/README new file mode 100644 index 0000000000..253d84414c --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/output_crop_highfreq/README @@ -0,0 +1 @@ +Tests the output_crop_highfreq usermods diff --git a/cime_config/testdefs/testmods_dirs/clm/output_crop_highfreq/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/output_crop_highfreq/include_user_mods new file mode 100644 index 0000000000..770abf5cf9 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/output_crop_highfreq/include_user_mods @@ -0,0 +1,2 @@ +../../../../usermods_dirs/output_crop_highfreq +../basic diff --git a/cime_config/testdefs/testmods_dirs/clm/output_sp_highfreq/README b/cime_config/testdefs/testmods_dirs/clm/output_sp_highfreq/README new file mode 100644 index 0000000000..330964f61f --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/output_sp_highfreq/README @@ -0,0 +1 @@ +Tests the output_sp_highfreq usermods diff --git a/cime_config/testdefs/testmods_dirs/clm/output_sp_highfreq/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/output_sp_highfreq/include_user_mods new file mode 100644 index 0000000000..8c117e01ed --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/output_sp_highfreq/include_user_mods @@ -0,0 +1,2 @@ +../../../../usermods_dirs/output_sp_highfreq +../basic From bc73abcba2ef454855dea43119f84528aa919c32 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Sat, 27 Oct 2018 06:37:41 -0600 Subject: [PATCH 49/54] Unrelated change: don't try to print domain%clmlevel This is unset for the domain on which domain_check is called, so it prints as garbage. As far as I can tell, this field isn't actually used anywhere. --- src/utils/domainMod.F90 | 1 - 1 file changed, 1 deletion(-) diff --git a/src/utils/domainMod.F90 b/src/utils/domainMod.F90 index 7cdd62b41f..a57d565b4d 100644 --- a/src/utils/domainMod.F90 +++ b/src/utils/domainMod.F90 @@ -215,7 +215,6 @@ subroutine domain_check(domain) write(iulog,*) ' domain_check decomped = ',domain%decomped write(iulog,*) ' domain_check ns = ',domain%ns write(iulog,*) ' domain_check ni,nj = ',domain%ni,domain%nj - write(iulog,*) ' domain_check clmlevel = ',trim(domain%clmlevel) write(iulog,*) ' domain_check nbeg,nend = ',domain%nbeg,domain%nend write(iulog,*) ' domain_check lonc = ',minval(domain%lonc),maxval(domain%lonc) write(iulog,*) ' domain_check latc = ',minval(domain%latc),maxval(domain%latc) From 6f5ae8abdf635745f053698af0472896ceecf90e Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Sat, 27 Oct 2018 06:40:38 -0600 Subject: [PATCH 50/54] Unrelated change: fix prints of C iso filenames These were being printed before they were set, leading to garbage being printed --- src/biogeochem/CNCIsoAtmTimeSeriesReadMod.F90 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/biogeochem/CNCIsoAtmTimeSeriesReadMod.F90 b/src/biogeochem/CNCIsoAtmTimeSeriesReadMod.F90 index 5e15c98d3b..83b174379e 100644 --- a/src/biogeochem/CNCIsoAtmTimeSeriesReadMod.F90 +++ b/src/biogeochem/CNCIsoAtmTimeSeriesReadMod.F90 @@ -122,13 +122,13 @@ subroutine C14_init_BombSpike() character(len=*), parameter :: vname = 'Delta14co2_in_air' ! Variable name on file !----------------------------------------------------------------------- + call getfil(atm_c14_filename, locfn, 0) + if ( masterproc ) then write(iulog, *) 'C14_init_BombSpike: preparing to open file:' write(iulog, *) trim(locfn) endif - call getfil(atm_c14_filename, locfn, 0) - call ncd_pio_openfile (ncid, trim(locfn), 0) call ncd_inqdlen(ncid,dimid,ntim,'time') @@ -241,13 +241,13 @@ subroutine C13_init_TimeSeries() character(len=*), parameter :: vname = 'delta13co2_in_air' ! Variable name on file !----------------------------------------------------------------------- + call getfil(atm_c13_filename, locfn, 0) + if ( masterproc ) then write(iulog, *) 'C13_init_TimeSeries: preparing to open file:' write(iulog, *) trim(locfn) endif - call getfil(atm_c13_filename, locfn, 0) - call ncd_pio_openfile (ncid, trim(locfn), 0) call ncd_inqdlen(ncid,dimid,ntim,'time') From 18350acfafb8d044371c0835999bd01c3fde1f0e Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Sat, 27 Oct 2018 06:49:05 -0600 Subject: [PATCH 51/54] Change compset used for testing CMIP6WACCMDECK The year-2000 test I tried picked up an finidat without C isotopes. I see that a Hist test can pick up an finidat with C isotopes, which is needed for this configuration. --- cime_config/config_compsets.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cime_config/config_compsets.xml b/cime_config/config_compsets.xml index 77dda30ed6..35b22e2ebe 100644 --- a/cime_config/config_compsets.xml +++ b/cime_config/config_compsets.xml @@ -108,8 +108,8 @@ throughput, which is particularly relevant for single-point cases (where datm dominates the runtime). --> - I2000Clm50BgcCropQianGsCmip6waccm - 2000_DATM%QIA_CLM50%BGC-CROP-CMIP6WACCMDECK_SICE_SOCN_MOSART_SGLC_SWAV + IHistClm50BgcCropQianGsCmip6waccm + HIST_DATM%QIA_CLM50%BGC-CROP-CMIP6WACCMDECK_SICE_SOCN_MOSART_SGLC_SWAV From fafbe01771915617f64baccac6cbb986391d1232 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Sat, 27 Oct 2018 20:56:32 -0600 Subject: [PATCH 52/54] Add a test of the CMIP6WACCM modifier Also change the compset exercising this modifier to one with CISM, not for a single-point resolution: this is needed for the histaux_l2x1yrg part of this configuration to work. --- cime_config/config_compsets.xml | 12 ++++-------- cime_config/testdefs/testlist_clm.xml | 9 +++++++++ 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/cime_config/config_compsets.xml b/cime_config/config_compsets.xml index 35b22e2ebe..4b820c1ffa 100644 --- a/cime_config/config_compsets.xml +++ b/cime_config/config_compsets.xml @@ -102,14 +102,10 @@ 1850_DATM%GSWP3v1_CLM50%BGC-CROP-CMIP6DECK_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV - - - IHistClm50BgcCropQianGsCmip6waccm - HIST_DATM%QIA_CLM50%BGC-CROP-CMIP6WACCMDECK_SICE_SOCN_MOSART_SGLC_SWAV + + + I1850Clm50BgcCropCmip6waccm + 1850_DATM%GSWP3v1_CLM50%BGC-CROP-CMIP6WACCMDECK_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 3899247206..d27823d50f 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -1932,4 +1932,13 @@ + + + + + + + + + From 9cd5cb04bd406eddd24b4118e6eedf9d8db7c28a Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Sat, 27 Oct 2018 21:12:43 -0600 Subject: [PATCH 53/54] Add tests of the new output usermods --- cime_config/testdefs/testlist_clm.xml | 32 ++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index d27823d50f..b559ed1539 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -1938,7 +1938,37 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 2e633aed6a5a0f49ce5813976bdd16ddfdbc53fa Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Sun, 28 Oct 2018 14:29:43 -0600 Subject: [PATCH 54/54] Update changelog --- doc/ChangeLog | 174 ++++++++++++++++++++++++++++++++++++++++++++++++++ doc/ChangeSum | 1 + 2 files changed, 175 insertions(+) diff --git a/doc/ChangeLog b/doc/ChangeLog index fb8ba6e937..4b86b54b5c 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,4 +1,178 @@ =============================================================== +Tag name: ctsm1.0.dev015 +Originator(s): sacks (Bill Sacks) +Date: Sun Oct 28 14:29:30 MDT 2018 +One-line Summary: CMIP6 compset modifiers, usermods for typical output, and other output enhancements + +Purpose of changes +------------------ + +(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/ctsm#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 + https://github.com/ESCOMP/ctsm/issues/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 + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +- Fixes #24 for real (ncd_io_1d_log_glob is broken) +- Fixes #529 (Organize usermods_dirs to facilitate running cases with + the right output) + + +Significant changes to scientifically-supported configurations +-------------------------------------------------------------- + +Does this tag change answers significantly for any of the following physics configurations? +(Details of any changes will be given in the "Answer changes" section below.) + + [Put an [X] in the box for any configuration with significant answer changes.] + +[ ] clm5_0 + +[ ] clm4_5 + +[ ] clm4_0 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): +- New namelist variable, just for testing purposes: + for_testing_allow_interp_non_ciso_to_ciso. This bypasses an error + check, and should only be used in tests. + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: none + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in ../CTSMMasterChecklist as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: +- Reworked tests of cmip6_deck usermods to use the new + %BGC-CROP-CMIP6DECK compset modifier, and changed f09_g16 to f09_g17 +- Added a test of the %BGC-CROP-CMIP6WACCMDECK compset modifier +- Added tests of output_crop_highfreq, output_bgc_highfreq and + output_sp_highfreq usermods directories +- Note that there are NO tests covering the cmip6_evolving_icesheet + usermods: this usermod directory adds very little beyond cmip6_deck, + so it didn't seem worth its own test + +Code reviewed by: Erik Kluzek + + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + unit-tests (components/clm/src): + + cheyenne - pass + + tools-tests (components/clm/test/tools): + + cheyenne - not run + + PTCLM testing (components/clm/tools/shared/PTCLM/test): + + cheyenne - not run + + regular tests (aux_clm): + + cheyenne_intel ---- pass + cheyenne_gnu ------ pass + hobart_nag -------- pass + hobart_pgi -------- pass + hobart_intel ------ pass + + ERI_D_Ld9.T31_g37.I2000Clm50Sp.cheyenne_intel.clm-SNICARFRC + initially failed COMPARE_base_hybrid, COMPARE_base_rest and BASELINE + comparisons. I reran it and it passed. + + Manually compared all history files from + ERS_Ly3.f10_f10_musgs.I1850Clm50BgcCropCmip6.cheyenne_intel.clm-basic + with baseline + ERS_Ly3.f10_f10_musgs.I1850Clm50BgcCrop.cheyenne_intel.clm-cmip6. They + were all identical. Also compared all history files from + SMS_Ld5_D.f09_g17.I1850Clm50BgcCropCmip6.cheyenne_intel.clm-basic + with baseline + SMS_Ld5_D.f09_g17.I1850Clm50BgcCrop.cheyenne_intel.clm-cmip6. They + were all identical (but note that this basically just compared the + cpl.hi file: the test was too short to produce monthly files.) + +CTSM tag used for the baseline comparisons: ctsm1.0.dev014 + + +Answer changes +-------------- + +Changes answers relative to baseline: NO + + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): +- https://github.com/ESCOMP/ctsm/pull/536 - Allow holes in the number of + history tapes and reorganize cmip6 usermods (main PR containing all of + these changes) +- https://github.com/ESCOMP/ctsm/pull/527 - Add carbon_isotope user-mod + directory to turn on c13 and c14 +- https://github.com/ESCOMP/ctsm/pull/539 - Support a %CMIP6DECK compset + modifier + +=============================================================== +=============================================================== Tag name: ctsm1.0.dev014 Originator(s): sacks (Bill Sacks) Date: Fri Oct 26 06:20:34 MDT 2018 diff --git a/doc/ChangeSum b/doc/ChangeSum index 035cdbbbfd..08f3d84349 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,6 @@ Tag Who Date Summary ============================================================================================================================ + ctsm1.0.dev015 sacks 10/28/2018 CMIP6 compset modifiers, usermods for typical output, and other output enhancements ctsm1.0.dev014 sacks 10/26/2018 Miscellaneous minor, bit-for-bit bug fixes ctsm1.0.dev013 erik 10/25/2018 Fix the fact that transient Bgc and SP cases had constant crop area in time ctsm1.0.dev012 erik 09/29/2018 Add snow-free fields for snowmip, fix several issues