Skip to content

Commit

Permalink
clm4_5_18_r272
Browse files Browse the repository at this point in the history
Bring in the latest version of FATES from NGEET/fates-release and the associated interface
changes in CLM from NGEET/fates-clm. The new version is 1.4.1 for science and version 3.0 of
the API updated from 1.3.0 for science and 1.0.0 for the API.
  • Loading branch information
ekluzek authored and bjandre committed Jan 25, 2018
1 parent 0052110 commit b837fc3
Show file tree
Hide file tree
Showing 43 changed files with 1,490 additions and 1,121 deletions.
2 changes: 1 addition & 1 deletion SVN_EXTERNAL_DIRECTORIES
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
src/fates https://github.com/NCAR/fates-release/tags/fates_s1.3.0_a1.0.0_rev3
src/fates https://github.com/NCAR/fates-release/tags/fates_s1.4.1_a3.0.0_rev2
tools/PTCLM https://github.com/ESCOMP/ptclm/tags/PTCLM2_171216c
4 changes: 2 additions & 2 deletions SVN_EXTERNAL_DIRECTORIES.standalone
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cime https://github.com/CESM-Development/cime/tags/clm4518/n02/cime5.4.0-alpha.03
components/cism https://svn-ccsm-models.cgd.ucar.edu/glc/trunk_tags/cism2_1_40
components/rtm https://github.com/ESCOMP/rtm/tags/rtm1_0_64
components/mosart https://github.com/ESCOMP/mosart/tags/mosart1_0_29
components/rtm https://github.com/ESCOMP/rtm/tags/rtm1_0_65
components/mosart https://github.com/ESCOMP/mosart/tags/mosart1_0_30
46 changes: 31 additions & 15 deletions bld/CLMBuildNamelist.pm
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@ sub setup_cmdl_fates_mode {

# The following variables may be set by the user and are compatible with use_fates
# no need to set defaults, covered in a different routine
my @list = ( "use_fates_spitfire", "use_vertsoilc", "use_century_decomp", "use_lch4" );
my @list = ( "use_vertsoilc", "use_century_decomp", "use_lch4" );
foreach my $var ( @list ) {
if ( defined($nl->get_value($var)) ) {
$nl_flags->{$var} = $nl->get_value($var);
Expand All @@ -754,15 +754,14 @@ sub setup_cmdl_fates_mode {
}
}
}

# add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_vertsoilc', 'use_fates'=>$nl_flags->{'use_fates'} );


} else {
# we only dis-allow fates_spit_fire with non-fates runs
$var = "use_fates_spitfire";
if ( defined($nl->get_value($var)) ) {
$log->fatal_error("$var is being set, but can ONLY be set when -bgc fates option is used.");
# dis-allow fates specific namelist items with non-fates runs
my @list = ( "use_fates_spitfire", "use_fates_planthydro", "use_fates_ed_st3", "use_fates_ed_prescribed_phys",
"use_fates_inventory_init", "fates_inventory_ctrl_filename","use_fates_logging" );
foreach my $var ( @list ) {
if ( defined($nl->get_value($var)) ) {
$log->fatal_error("$var is being set, but can ONLY be set when -bgc fates option is used.\n");
}
}
}
}
Expand Down Expand Up @@ -1244,14 +1243,14 @@ sub setup_cmdl_run_type {
if (defined $opts->{$var}) {
if ($opts->{$var} eq "default" ) {
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var,
'use_cndv'=>$nl_flags->{'use_cndv'} );
'use_cndv'=>$nl_flags->{'use_cndv'}, 'use_fates'=>$nl_flags->{'use_fates'} );
} else {
my $group = $definition->get_group_name($var);
$nl->set_variable_value($group, $var, quote_string( $opts->{$var} ) );
}
} else {
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var,
'use_cndv'=>$nl_flags->{'use_cndv'} );
'use_cndv'=>$nl_flags->{'use_cndv'}, 'use_fates'=>$nl_flags->{'use_fates'} );
}
$nl_flags->{'clm_start_type'} = $nl->get_value($var);
}
Expand Down Expand Up @@ -2339,7 +2338,7 @@ sub setup_logic_initial_conditions {
}
} else {
foreach my $item ( "mask", "maxpft", "irrigate", "glc_nec", "use_crop", "use_cn", "use_cndv",
"use_nitrif_denitrif", "use_vertsoilc", "use_century_decomp"
"use_nitrif_denitrif", "use_vertsoilc", "use_century_decomp", "use_fates"
) {
$settings{$item} = $nl_flags->{$item};
}
Expand Down Expand Up @@ -2381,7 +2380,8 @@ sub setup_logic_initial_conditions {
}
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $useinitvar,
'use_cndv'=>$nl_flags->{'use_cndv'}, 'phys'=>$physv->as_string(),
'sim_year'=>$settings{'sim_year'}, 'nofail'=>1 );
'sim_year'=>$settings{'sim_year'}, 'nofail'=>1,
'use_fates'=>$nl_flags->{'use_fates'} );
$settings{$useinitvar} = $nl->get_value($useinitvar);
if ( $try > 1 ) {
my $group = $definition->get_group_name($useinitvar);
Expand All @@ -2390,7 +2390,8 @@ sub setup_logic_initial_conditions {
if ( &value_is_true($nl->get_value($useinitvar) ) ) {

add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, "init_interp_attributes",
'sim_year'=>$settings{'sim_year'}, 'use_cndv'=>$nl_flags->{'use_cndv'},
'sim_year'=>$settings{'sim_year'}, 'use_cndv'=>$nl_flags->{'use_cndv'},
'glc_nec'=>$nl_flags->{'glc_nec'}, 'use_fates'=>$nl_flags->{'use_fates'},
'use_cn'=>$nl_flags->{'use_cn'}, 'nofail'=>1 );
my $attributes_string = remove_leading_and_trailing_quotes($nl->get_value("init_interp_attributes"));
foreach my $pair ( split( /\s/, $attributes_string) ) {
Expand Down Expand Up @@ -3679,8 +3680,23 @@ sub setup_logic_fates {
my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_;

if ($physv->as_long() >= $physv->as_long("clm4_5") && &value_is_true( $nl_flags->{'use_fates'}) ) {
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_fates_spitfire', 'use_fates'=>$nl_flags->{'use_fates'} );
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'fates_paramfile', 'phys'=>$nl_flags->{'phys'});
my @list = ( "use_fates_spitfire", "use_fates_planthydro", "use_fates_ed_st3", "use_fates_ed_prescribed_phys",
"use_fates_inventory_init", "use_fates_logging" );
foreach my $var ( @list ) {
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, 'use_fates'=>$nl_flags->{'use_fates'} );
}
my $var = "use_fates_inventory_init";
if ( defined($nl->get_value($var)) ) {
if ( &value_is_true($nl->get_value($var)) ) {
$var = "fates_inventory_ctrl_filename";
if ( ! defined($nl->get_value($var)) ) {
$log->fatal_error("$var is required when use_fates_inventory_init is set" );
} elsif ( ! -f "$nl->get_value($var)" ) {
$log->fatal_error("$var does NOT point to a valid filename" );
}
}
}
}
}

Expand Down
42 changes: 33 additions & 9 deletions bld/namelist_files/namelist_defaults_clm4_5.xml
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,11 @@ attributes from the config_cache.xml file (with keys converted to upper-case).
<paramfile phys="clm5_0">lnd/clm2/paramdata/clm5_params.c171117.nc</paramfile>
<paramfile phys="clm4_5">lnd/clm2/paramdata/clm_params.c170913.nc</paramfile>

<fates_paramfile>lnd/clm2/paramdata/fates_params.c170331.nc</fates_paramfile>
<!-- ================================================================== -->
<!-- FATES default parameter file -->
<!-- ================================================================== -->

<fates_paramfile>lnd/clm2/paramdata/fates_params_2troppftclones.c171018.nc</fates_paramfile>

<!-- ======================================================================================== -->
<!-- clm 5.0 BGC nitrogen model -->
Expand Down Expand Up @@ -449,21 +452,21 @@ attributes from the config_cache.xml file (with keys converted to upper-case).
<init_interp_sim_years>1850,2000</init_interp_sim_years>

<!-- Interpolate from an initial condition file at startup? -->
<use_init_interp use_cndv=".false." sim_year="1850">.true.</use_init_interp>
<use_init_interp use_cndv=".false." sim_year="2000">.true.</use_init_interp>
<use_init_interp >.false.</use_init_interp>
<use_init_interp use_cndv=".false." use_fates=".false." sim_year="1850">.true.</use_init_interp>
<use_init_interp use_cndv=".false." use_fates=".false." sim_year="2000">.true.</use_init_interp>
<use_init_interp >.false.</use_init_interp>

<!--
Set attributes to find specific matching finidat files below
Each of these settings will correspond to a specific finidat that is
set up. If more finidat files are added you may need to add more of these.
Or one specific file will be chosen over another.
-->
<init_interp_attributes sim_year="1850" use_cndv=".false."
<init_interp_attributes sim_year="1850" use_cndv=".false." use_fates=".false."
>hgrid=1.9x2.5 maxpft=79 mask=gx1v6 use_cn=.true. use_nitrif_denitrif=.true. use_vertsoilc=.true. use_crop=.true. irrigate=.false. glc_nec=10
</init_interp_attributes>

<init_interp_attributes sim_year="2000" use_cndv=".false."
<init_interp_attributes sim_year="2000" use_cndv=".false." use_fates=".false."
>hgrid=1.9x2.5 maxpft=79 mask=gx1v6 use_cn=.true. use_nitrif_denitrif=.true. use_vertsoilc=.true. use_crop=.true. irrigate=.true. glc_nec=10
</init_interp_attributes>

Expand All @@ -472,7 +475,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case).
-->

<!-- File from Dave Lawrence for a spinup of 2-degree at 1850 with crop on -->
<finidat hgrid="1.9x2.5" maxpft="79" mask="gx1v6" use_cn=".true." use_cndv=".false."
<finidat hgrid="1.9x2.5" maxpft="79" mask="gx1v6" use_cn=".true." use_cndv=".false." use_fates=".false."
ic_ymd="18500101" use_nitrif_denitrif=".true." use_vertsoilc=".true." sim_year="1850"
ic_tod="0" glc_nec="10" use_crop=".true." irrigate=".false." use_init_interp=".true."
>lnd/clm2/initdata_map/clmi.IGM1850GSWCLM50BGCCROP.0481-01-01.1.9x2.5_gx1v6_gl5_simyr1850_c170419.nc
Expand All @@ -483,12 +486,26 @@ attributes from the config_cache.xml file (with keys converted to upper-case).
-->

<!-- Present day crop spinup at 2-degree with irrigation on -->
<finidat hgrid="1.9x2.5" maxpft="79" mask="gx1v6" use_cn=".true." use_cndv=".false."
<finidat hgrid="1.9x2.5" maxpft="79" mask="gx1v6" use_cn=".true." use_cndv=".false." use_fates=".false."
ic_ymd="20110101" use_nitrif_denitrif=".true." use_vertsoilc=".true." sim_year="2000"
ic_tod="0" glc_nec="10" use_crop=".true." irrigate=".true." use_init_interp=".true."
>lnd/clm2/initdata_map/clmi.IGM2000GSWP3CLM50BGCCROPIRR.2011-01-01.1.9x2.5_gx1v6_gl5_simyr2000_c170419.nc
</finidat>

<!-- FATES on for 2000 -->
<finidat hgrid="4x5" maxpft="17" mask="gx3v7" use_cn=".false." use_fates=".true."
ic_ymd="20000101" use_nitrif_denitrif=".false." use_vertsoilc=".true." sim_year="2000"
ic_tod="0" glc_nec="10" use_crop=".false." irrigate=".true." use_init_interp=".false."
>lnd/clm2/initdata_map/clmi.I2000Clm45Fates.0121-01-01.4x5_mgx3v7_simyr2000_c180122.nc
</finidat>

<finidat hgrid="1x1_brazil" maxpft="17" mask="navy" use_cn=".false." use_fates=".true."
ic_ymd="20000101" use_nitrif_denitrif=".false." use_vertsoilc=".true." sim_year="2000"
ic_tod="0" glc_nec="0" use_crop=".false." irrigate=".true." use_init_interp=".false."
>lnd/clm2/initdata_map/clmi.I2000Clm45Fates.0101-01-01.1x1_brazil_simyr2000_c180120.nc
</finidat>


<!-- for present day simulations - year 2000 -->
<fsurdat hgrid="360x720cru" sim_year="2000" use_crop=".false." irrigate=".true.">
lnd/clm2/surfdata_map/surfdata_360x720cru_16pfts_Irrig_CMIP6_simyr2000_c170824.nc</fsurdat>
Expand Down Expand Up @@ -1004,6 +1021,7 @@ lnd/clm2/surfdata_map/surfdata_ne120np4_78pfts_CMIP6_simyr1850_c170824.nc</fsurd
<create_crop_landunit use_fates=".false.">.true.</create_crop_landunit>
<create_crop_landunit use_fates=".true." >.false.</create_crop_landunit>


<!-- ========================================= -->
<!-- Performance issues -->
<!-- ========================================= -->
Expand Down Expand Up @@ -2299,6 +2317,12 @@ lnd/clm2/surfdata_map/surfdata_ne120np4_78pfts_CMIP6_simyr1850_c170824.nc</fsurd
<use_lch4 bgc_mode="fates" >.false.</use_lch4>
<use_nitrif_denitrif bgc_mode="fates" >.false.</use_nitrif_denitrif>

<use_fates_spitfire use_fates=".true.">.false.</use_fates_spitfire>
<!-- ===== FATES DEFAULTS =========== -->
<use_fates_spitfire use_fates=".true.">.false.</use_fates_spitfire>
<use_fates_planthydro use_fates=".true.">.false.</use_fates_planthydro>
<use_fates_ed_st3 use_fates=".true.">.false.</use_fates_ed_st3>
<use_fates_ed_prescribed_phys use_fates=".true.">.false.</use_fates_ed_prescribed_phys>
<use_fates_logging use_fates=".true.">.false.</use_fates_logging>
<use_fates_inventory_init use_fates=".true.">.false.</use_fates_inventory_init>

</namelist_defaults>
14 changes: 8 additions & 6 deletions bld/namelist_files/namelist_defaults_overall.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@ determine default values for namelists.
-->

<!-- Default CLM start-type -->
<clm_start_type phys="clm4_5" >startup</clm_start_type>
<clm_start_type phys="clm5_0" >startup</clm_start_type>
<clm_start_type phys="clm5_0" use_cndv=".true.">arb_ic</clm_start_type>
<clm_start_type phys="clm4_5" use_cndv=".true.">arb_ic</clm_start_type>
<clm_start_type phys="clm4_0" >arb_ic</clm_start_type>
<clm_start_type bgc_spinup="on" >cold</clm_start_type> <!-- CLM 4.5 -->
<clm_start_type phys="clm4_5" >startup</clm_start_type>
<clm_start_type phys="clm5_0" >startup</clm_start_type>
<clm_start_type phys="clm5_0" use_cndv=".true." >arb_ic</clm_start_type>
<clm_start_type phys="clm4_5" use_cndv=".true." >arb_ic</clm_start_type>
<clm_start_type phys="clm5_0" use_fates=".true.">arb_ic</clm_start_type>
<clm_start_type phys="clm4_5" use_fates=".true.">arb_ic</clm_start_type>
<clm_start_type phys="clm4_0" >arb_ic</clm_start_type>
<clm_start_type bgc_spinup="on" >cold</clm_start_type> <!-- CLM 4.5 -->

<!-- Default location of {csmdata} -->
<csmdata>/fs/cgd/csm/inputdata</csmdata>
Expand Down
43 changes: 38 additions & 5 deletions bld/namelist_files/namelist_definition_clm4_5.xml
Original file line number Diff line number Diff line change
Expand Up @@ -582,15 +582,48 @@ set to 3 meaning branch.

<entry id="use_fates" type="logical" category="physics"
group="clm_inparm" valid_values="" value=".false.">
Toggle to turn on the ED
(ED = 'on' is EXPERIMENTAL NOT SUPPORTED!)
Toggle to turn on the FATES model
(use_fates= '.true.' is EXPERIMENTAL NOT SUPPORTED!)
</entry>

<entry id="use_fates_spitfire" type="logical" category="physics"
group="clm_inparm" valid_values="" value=".false.">
Toggle to turn on spit fire (only relevant if ED is being used).
Toggle to turn on spitfire module for modeling fire (only relevant if FATES is being used).
</entry>

<entry id="use_fates_logging" type="logical" category="physics"
group="clm_inparm" valid_values="" value=".false.">
Toggle to turn on the logging module (only relevant if FATES is being used).
</entry>

<entry id="use_fates_planthydro" type="logical" category="physics"
group="clm_inparm" valid_values="" value=".false.">
Toggle to turn on plant hydraulics (only relevant if FATES is on).
(use_fates_planthydro=".true." is EXPERIMENTAL NOT SUPPORTED! Nor is it Tested!)
</entry>

<entry id="use_fates_ed_st3" type="logical" category="physics"
group="clm_inparm" valid_values="" value=".false.">
Toggle to turn on Static Stand Structure Mode (only relevant if FATES is being used).
(use_fates_ed_st3=".true." is EXPERIMENTAL NOT SUPPORTED! Nor is it Tested!)
</entry>

<entry id="use_fates_ed_prescribed_phys" type="logical" category="physics"
group="clm_inparm" valid_values="" value=".false.">
Toggle to turn on prescribed physiology (only relevant if FATES is being used).
</entry>

<entry id="use_fates_inventory_init" type="logical" category="physics"
group="clm_inparm" valid_values="" value=".false.">
Toggle to turn on inventory initialization to startup FATES (only relevant if FATES is being used).
(use_fates_inventory_init=".true." is EXPERIMENTAL NOT SUPPORTED! Nor is it Tested!)
</entry>

<entry id="fates_inventory_ctrl_filename" type="char*256" category="datasets"
input_pathname="abs" group="clm_inparm" valid_values="" >
Full pathname to the inventory initialization control file.
(Required, if use_fates_inventory_init=T)
</entry>

<entry id="use_luna" type="logical" category="physics"
group="clm_inparm" valid_values="" value=".false.">
Expand Down Expand Up @@ -871,13 +904,13 @@ Maximum nitrification rate constant (1/s)
<entry id="use_vertsoilc" type="logical" category="bgc"
group="clm_inparm" valid_values="" value=".false.">
Turn on vertical soil carbon.
Requires the CN or ED model to work (either CN or CNDV).
Requires the CN or FATES model to work (either CN or CNDV).
</entry>

<entry id="use_century_decomp" type="logical" category="bgc"
group="clm_inparm" valid_values="" value=".false.">
Use parameters for decomposition from the CENTURY Carbon model
Requires the CN or ED model to work (either CN or CNDV).
Requires the CN or FATES model to work (either CN or CNDV).
</entry>

<entry id="use_extralakelayers" type="logical" category="physics"
Expand Down
Loading

0 comments on commit b837fc3

Please sign in to comment.