diff --git a/SVN_EXTERNAL_DIRECTORIES b/SVN_EXTERNAL_DIRECTORIES index 40ac793f7f..06d710da44 100644 --- a/SVN_EXTERNAL_DIRECTORIES +++ b/SVN_EXTERNAL_DIRECTORIES @@ -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 diff --git a/SVN_EXTERNAL_DIRECTORIES.standalone b/SVN_EXTERNAL_DIRECTORIES.standalone index d27f56de83..dc37d702cc 100644 --- a/SVN_EXTERNAL_DIRECTORIES.standalone +++ b/SVN_EXTERNAL_DIRECTORIES.standalone @@ -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 diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index 01118dab67..4c0d7df810 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -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); @@ -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"); + } } } } @@ -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); } @@ -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}; } @@ -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); @@ -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) ) { @@ -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" ); + } + } + } } } diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml index 9cc36f3857..d9a498adb4 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5.xml @@ -347,8 +347,11 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/paramdata/clm5_params.c171117.nc lnd/clm2/paramdata/clm_params.c170913.nc -lnd/clm2/paramdata/fates_params.c170331.nc + + + +lnd/clm2/paramdata/fates_params_2troppftclones.c171018.nc @@ -449,9 +452,9 @@ attributes from the config_cache.xml file (with keys converted to upper-case). 1850,2000 -.true. -.true. -.false. +.true. +.true. +.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 -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 @@ -472,7 +475,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). --> -lnd/clm2/initdata_map/clmi.IGM1850GSWCLM50BGCCROP.0481-01-01.1.9x2.5_gx1v6_gl5_simyr1850_c170419.nc @@ -483,12 +486,26 @@ attributes from the config_cache.xml file (with keys converted to upper-case). --> -lnd/clm2/initdata_map/clmi.IGM2000GSWP3CLM50BGCCROPIRR.2011-01-01.1.9x2.5_gx1v6_gl5_simyr2000_c170419.nc + +lnd/clm2/initdata_map/clmi.I2000Clm45Fates.0121-01-01.4x5_mgx3v7_simyr2000_c180122.nc + + +lnd/clm2/initdata_map/clmi.I2000Clm45Fates.0101-01-01.1x1_brazil_simyr2000_c180120.nc + + + lnd/clm2/surfdata_map/surfdata_360x720cru_16pfts_Irrig_CMIP6_simyr2000_c170824.nc @@ -1004,6 +1021,7 @@ lnd/clm2/surfdata_map/surfdata_ne120np4_78pfts_CMIP6_simyr1850_c170824.nc.true. .false. + @@ -2299,6 +2317,12 @@ lnd/clm2/surfdata_map/surfdata_ne120np4_78pfts_CMIP6_simyr1850_c170824.nc.false. .false. -.false. + +.false. +.false. +.false. +.false. +.false. +.false. diff --git a/bld/namelist_files/namelist_defaults_overall.xml b/bld/namelist_files/namelist_defaults_overall.xml index a21a0c006e..20158c7dd4 100644 --- a/bld/namelist_files/namelist_defaults_overall.xml +++ b/bld/namelist_files/namelist_defaults_overall.xml @@ -13,12 +13,14 @@ determine default values for namelists. --> -startup -startup -arb_ic -arb_ic -arb_ic -cold +startup +startup +arb_ic +arb_ic +arb_ic +arb_ic +arb_ic +cold /fs/cgd/csm/inputdata diff --git a/bld/namelist_files/namelist_definition_clm4_5.xml b/bld/namelist_files/namelist_definition_clm4_5.xml index e8318d60c1..ea00f3babe 100644 --- a/bld/namelist_files/namelist_definition_clm4_5.xml +++ b/bld/namelist_files/namelist_definition_clm4_5.xml @@ -582,15 +582,48 @@ set to 3 meaning branch. -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!) -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). + +Toggle to turn on the logging module (only relevant if FATES is being used). + + + +Toggle to turn on plant hydraulics (only relevant if FATES is on). +(use_fates_planthydro=".true." is EXPERIMENTAL NOT SUPPORTED! Nor is it Tested!) + + + +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!) + + + +Toggle to turn on prescribed physiology (only relevant if FATES is being used). + + + +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!) + + + +Full pathname to the inventory initialization control file. +(Required, if use_fates_inventory_init=T) + @@ -871,13 +904,13 @@ Maximum nitrification rate constant (1/s) 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). 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). "TRUE", conopts=>"-phys clm4_0", }, - "useEDContradict" =>{ options=>"-bgc fates -envxml_dir . -no-megan", + "useFATESContradict" =>{ options=>"-bgc fates -envxml_dir . -no-megan", namelst=>"use_fates=.false.", GLC_TWO_WAY_COUPLING=>"FALSE", conopts=>"-phys clm4_5", }, - "useEDContradict2" =>{ options=>"-envxml_dir . -no-megan", + "useFATESContradict2" =>{ options=>"-envxml_dir . -no-megan", namelst=>"use_fates=.true.", GLC_TWO_WAY_COUPLING=>"FALSE", conopts=>"-phys clm4_5", }, - "useEDWCN" =>{ options=>"-bgc fates -envxml_dir . -no-megan", + "useFATESWCN" =>{ options=>"-bgc fates -envxml_dir . -no-megan", namelst=>"use_cn=.true.", GLC_TWO_WAY_COUPLING=>"FALSE", conopts=>"-phys clm5_0", }, - "useEDWcreatecrop" =>{ options=>"-bgc fates -envxml_dir . -no-megan", + "useFATESWcreatecrop" =>{ options=>"-bgc fates -envxml_dir . -no-megan", namelst=>"create_crop_landunit=.true.", GLC_TWO_WAY_COUPLING=>"FALSE", conopts=>"-phys clm5_0", }, - "useEDWTransient" =>{ options=>"-bgc fates -use_case 20thC_transient -envxml_dir . -no-megan -res 10x15", + "useFATESWTransient" =>{ options=>"-bgc fates -use_case 20thC_transient -envxml_dir . -no-megan -res 10x15", namelst=>"", GLC_TWO_WAY_COUPLING=>"FALSE", conopts=>"-phys clm5_0", }, - "useEDclm40" =>{ options=>"-bgc fates -envxml_dir . -no-megan", + "useFATESclm40" =>{ options=>"-bgc fates -envxml_dir . -no-megan", namelst=>"", GLC_TWO_WAY_COUPLING=>"FALSE", conopts=>"-phys clm4_0", }, - "usespitfireButNOTED" =>{ options=>"-envxml_dir . -no-megan", + "usespitfireButNOTFATES" =>{ options=>"-envxml_dir . -no-megan", namelst=>"use_fates_spitfire=.true.", GLC_TWO_WAY_COUPLING=>"FALSE", conopts=>"-phys clm4_5", }, - "useMEGANwithED" =>{ options=>"-bgc fates -envxml_dir . -megan", + "useloggingButNOTFATES" =>{ options=>"-envxml_dir . -no-megan", + namelst=>"use_fates_logging=.true.", + GLC_TWO_WAY_COUPLING=>"FALSE", + conopts=>"-phys clm4_5", + }, + "useinventorybutnotfile" =>{ options=>"-bgc fates -envxml_dir . -no-megan", + namelst=>"use_fates_inventory_init=.true.", + GLC_TWO_WAY_COUPLING=>"FALSE", + conopts=>"-phys clm4_5", + }, + "inventoryfileDNE" =>{ options=>"-bgc fates -envxml_dir . -no-megan", + namelst=>"use_fates_inventory_init=.true., fates_inventory_ctrl_filename='zztop'", + GLC_TWO_WAY_COUPLING=>"FALSE", + conopts=>"-phys clm4_5", + }, + "useMEGANwithFATES" =>{ options=>"-bgc fates -envxml_dir . -megan", namelst=>"", GLC_TWO_WAY_COUPLING=>"FALSE", conopts=>"-phys clm4_5", }, - "useHYDSTwithED" =>{ options=>"-bgc fates -envxml_dir . -no-megan", + "useHYDSTwithFATES" =>{ options=>"-bgc fates -envxml_dir . -no-megan", namelst=>"use_hydrstress=.true.", GLC_TWO_WAY_COUPLING=>"FALSE", conopts=>"-phys clm5_0", diff --git a/cime_config/config_compsets.xml b/cime_config/config_compsets.xml index c98bf7b72b..5a633daab8 100644 --- a/cime_config/config_compsets.xml +++ b/cime_config/config_compsets.xml @@ -104,10 +104,15 @@ 2000_DATM%GSWP3v1_CLM50%SP_SICE_SOCN_RTM%FLOOD_CISM2%NOEVOLVE_SWAV + I2000Clm50Fates 2000_DATM%GSWP3v1_CLM50%FATES_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV + + I2000Clm50FatesCruGs + 2000_DATM%CRUv7_CLM50%FATES_SICE_SOCN_MOSART_SGLC_SWAV + @@ -277,6 +282,7 @@ 2000_DATM%CRU_CLM40%SP_SICE_SOCN_RTM_SGLC_SWAV + diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index 23763b95a4..2d51f524f2 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -13,5 +13,17 @@ FAIL ERP_D.f10_f10_musgs.IHistClm50Bgc.cheyenne_gnu.clm-decStart RUN FAIL ERS_Ly5_P72x1.f10_f10_musgs.IHistClm45BgcCrop.cheyenne_intel.clm-cropMonthOutput RUN FAIL ERS_Lm20_Mmpi-serial.1x1_smallvilleIA.I2000Clm50BgcCropGs.cheyenne_gnu.clm-monthly RUN + FAIL SMS_D_Ld5.f45_f45_mg37.I2000Clm50Fates.cheyenne_intel.clm-Fates RUN + FAIL SMS_D_Lm6.f45_f45_mg37.I2000Clm50Fates.cheyenne_intel.clm-Fates RUN + FAIL SMS_D_Lm6_P144x1.f45_f45_mg37.I2000Clm50Fates.cheyenne_intel.clm-Fates RUN FAIL ERP_Ld5.f10_f10_musgs.I2000Clm50Vic.cheyenne_gnu.clm-decStart COMPARE_base_rest + FAIL ERP_Ld9.f45_f45.I2000Clm45Fates.hobart_nag.clm-FatesAllVars COMPARE_base_rest + FAIL ERS_Ld60.f45_f45.I2000Clm45Fates.cheyenne_intel.clm-FatesLogging COMPARE_base_rest + FAIL ERS_Ld60.f45_f45.I2000Clm45Fates.cheyenne_intel.clm-Fates COMPARE_base_rest + FAIL ERS_Ld60.f45_f45.I2000Clm45Fates.cheyenne_intel.clm-FatesNoFire COMPARE_base_rest + FAIL ERS_Ld60.f45_f45.I2000Clm45Fates.cheyenne_intel.clm-FatesPPhys COMPARE_base_rest + FAIL ERS_Ld60.f45_f45.I2000Clm45Fates.cheyenne_intel.clm-FatesST3 COMPARE_base_rest + FAIL ERP_Ld9.f45_f45.I2000Clm45Fates.cheyenne_intel.clm-FatesAllVars COMPARE_base_rest + FAIL ERS_Ld60.f45_f45.I2000Clm45Fates.cheyenne_gnu.clm-Fates COMPARE_base_rest + FAIL ERS_D_Mmpi-serial_Ld5.1x1_brazil.I2000Clm50FatesGs.yellowstone_pgi.clm-fates COMPARE_base_rest diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index b68d0d256b..12a0d7361e 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -3,102 +3,94 @@ - - - - - - - - - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + @@ -106,264 +98,264 @@ - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - - + + + + - - - + + + - - - + + + - - - + + + - - - - + + + + @@ -371,426 +363,425 @@ - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - - - + + + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - - + + + + - - - - + + + + - - - + + + - - - + + + - - - + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - + + + - - - + + + - - - - + + + + - - - + + + - - - - + + + + - - - + + + - - - + + + - - - + + + - - - - + + + + - - - + + + - - - + + + - - - - + + + + - - - - + + + + - - - + + + - - - - + + + + - - - - + + + + - - - + + + - - - + + + @@ -798,562 +789,375 @@ - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - - - - - - - - - - - - - - - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - - + + + - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - + + + - - - - + + + + - - - + + + - - - - + + + + - - - - + + + + - - - + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - - + + + + - - - + + + - - - - + + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + @@ -1363,617 +1167,718 @@ - - - + + + - - - + + + - - - + + + - - - + + + - - - - + + + + - - - - + + + - - - + + + - - - - + + + + - - - + + + - - - + + + - - - - + + + + - + - - - - - + + + - + - - - + + + + - + - - - - - + + + + - + - - - + + + - + - - - - - + + + + - + - - - - + + + + + - + - - - - - + + + + + - + - - - - + + + + - + - - - + + + - + - - - - + + + - + - - - - + + + + - + - - - + + + - + - - - + + + - + - - - - + + + + - + - - - - + + + + + + - + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - + - - - - - + + + + + + + + + + + + + - + - - - - + + + - + - - - - - + + + + + - + - - - - - + + + + - + - - - - + + + - + - - - + + + - + - - - + + + - + - - - + + + + - + - - - - - + + + + - + - - - + + + + - + - - - + + + - + - - - - + + + + - + - - - - - + + + + - + - - - - + + + + - + + + + + + + + + + + - - - + + + + - + - - - - + + + + + - + + + - - - - + + + - + - - - - - + + + + - + - - - - + + + + + - + - - - - + + + - + - - - - + + + + - + - - - - + + + + - + - - - - + + + - + - - - - + + + + + + - + - - - - + + + + - + - - - - + + + + + + - + - - - - + + + + - + + - - - + + + - + - - - - + + + - + - - - - + + + + - + - - - - + + + + - + - - - + + + - + - - - + + + + - + - - - - + + + + - + + - - - + + + - + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - + - - - - - + + + + - + - - - - + + + + + - + - - - - + + + + + - + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/cime_config/testdefs/testmods_dirs/clm/fates/shell_commands b/cime_config/testdefs/testmods_dirs/clm/Fates/shell_commands similarity index 56% rename from cime_config/testdefs/testmods_dirs/clm/fates/shell_commands rename to cime_config/testdefs/testmods_dirs/clm/Fates/shell_commands index cbe7a32650..d81ed7dbc5 100644 --- a/cime_config/testdefs/testmods_dirs/clm/fates/shell_commands +++ b/cime_config/testdefs/testmods_dirs/clm/Fates/shell_commands @@ -1,2 +1 @@ ./xmlchange CLM_BLDNML_OPTS="-no-megan" --append -./xmlchange CLM_FORCE_COLDSTART="on" diff --git a/cime_config/testdefs/testmods_dirs/clm/Fates/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/Fates/user_nl_clm new file mode 100644 index 0000000000..487ad09863 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/Fates/user_nl_clm @@ -0,0 +1,11 @@ +!!finidat = '$DIN_LOC_ROOT/lnd/clm2/initdata_map/iclm45fates-finit-s1.4.0-a3.0.0-1x1br.clm2.r.0111-01-01-00000.nc' +hist_mfilt = 365 +hist_nhtfrq = -24 +hist_empty_htapes = .true. +use_fates_spitfire= .true. +hist_fincl1 = 'NPP','GPP','BTRAN','H2OSOI','TLAI','LITTER_IN','LITTER_OUT', + 'FIRE_AREA','SCORCH_HEIGHT','FIRE_INTENSITY','FIRE_TFC_ROS','fire_fuel_mef', + 'fire_fuel_bulkd','fire_fuel_sav','FIRE_NESTEROV_INDEX','PFTbiomass', + 'PFTleafbiomass','FIRE_ROS','WIND','AREA_TREES','AREA_PLANT', + 'TOTSOMC','TOTLITC','T_SCALAR','NEP','NBP','HR','TOTECOSYSC','NPLANT_SCAG','NPLANT_SCPF', + 'BA_SCLS','NPP_BY_AGE','CWD_AG_CWDSC','PARSUN_Z_CNLF','PARSUN_Z_CNLFPFT','PARSHA_Z_CAN' diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesAllVars/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/FatesAllVars/include_user_mods new file mode 100644 index 0000000000..4c7aa0f2b4 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/FatesAllVars/include_user_mods @@ -0,0 +1 @@ +../Fates diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesAllVars/shell_commands b/cime_config/testdefs/testmods_dirs/clm/FatesAllVars/shell_commands new file mode 100644 index 0000000000..2a9f09bd75 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/FatesAllVars/shell_commands @@ -0,0 +1 @@ +./xmlchange CLM_FORCE_COLDSTART="on" diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesAllVars/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesAllVars/user_nl_clm new file mode 100644 index 0000000000..a869310636 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/FatesAllVars/user_nl_clm @@ -0,0 +1,31 @@ +!finidat = '$DIN_LOC_ROOT/lnd/clm2/initdata_map/iclm45fates-finit-s1.4.0-a3.0.0-f45.clm2.r.0111-01-01-00000.nc' +hist_mfilt = 365 +hist_nhtfrq = -24 +hist_empty_htapes = .false. +use_fates_spitfire= .true. +hist_fincl1 = 'NCL_BY_AGE','NPATCH_BY_AGE','BIOMASS_BY_AGE','NPP_BY_AGE','GPP_BY_AGE','PARSUN_Z_CNLF','PARSHA_Z_CNLF','PARSUN_Z_CNLFPFT', + 'PARSHA_Z_CNLFPFT','PARSUN_Z_CAN','PARSHA_Z_CAN','LAISUN_Z_CNLF','LAISHA_Z_CNLF','LAISUN_Z_CNLFPFT','LAISHA_Z_CNLFPFT', + 'LAISUN_TOP_CAN','LAISHA_TOP_CAN','FABD_SUN_CNLFPFT','FABD_SHA_CNLFPFT','FABI_SUN_CNLFPFT','FABI_SHA_CNLFPFT', + 'FABD_SUN_CNLF','FABD_SHA_CNLF','FABI_SUN_CNLF','FABI_SHA_CNLF','FABD_SUN_TOPLF_BYCANLAYER','FABD_SHA_TOPLF_BYCANLAYER', + 'FABI_SUN_TOPLF_BYCANLAYER','FABI_SHA_TOPLF_BYCANLAYER','TS_NET_UPTAKE_CNLF','YEAR_NET_UPTAKE_CNLF','CROWNAREA_CNLF', + 'MORTALITY_CARBONFLUX_CANOPY','MORTALITY_CARBONFLUX_UNDERSTORY','NPLANT_SCAG','NPLANT_CANOPY_SCAG','NPLANT_UNDERSTORY_SCAG', + 'DDBH_CANOPY_SCAG','DDBH_UNDERSTORY_SCAG','MORTALITY_CANOPY_SCAG','MORTALITY_UNDERSTORY_SCAG','GPP_SCPF','GPP_CANOPY_SCPF', + 'AR_CANOPY_SCPF','GPP_UNDERSTORY_SCPF','AR_UNDERSTORY_SCPF','NPP_SCPF','NPP_LEAF_SCPF','NPP_SEED_SCPF','NPP_FNRT_SCPF', + 'NPP_BGSW_SCPF','NPP_BGDW_SCPF','NPP_AGSW_SCPF','NPP_AGDW_SCPF','NPP_STOR_SCPF','DDBH_SCPF','DDBH_CANOPY_SCPF', + 'DDBH_UNDERSTORY_SCPF','BA_SCPF','NPLANT_SCPF','M1_SCPF','M2_SCPF','M3_SCPF','M4_SCPF','M5_SCPF','M6_SCPF','M7_SCPF', + 'MORTALITY_CANOPY_SCPF','BSTOR_CANOPY_SCPF','BLEAF_CANOPY_SCPF','NPLANT_CANOPY_SCPF','MORTALITY_UNDERSTORY_SCPF', + 'BSTOR_UNDERSTORY_SCPF','BLEAF_UNDERSTORY_SCPF','NPLANT_UNDERSTORY_SCPF','CWD_AG_CWDSC','CWD_BG_CWDSC','CWD_AG_IN_CWDSC', + 'CWD_BG_IN_CWDSC','CWD_AG_OUT_CWDSC','CWD_BG_OUT_CWDSC','AR_SCPF','AR_GROW_SCPF','AR_MAINT_SCPF','AR_DARKM_SCPF','AR_AGSAPM_SCPF', + 'AR_CROOTM_SCPF','AR_FROOTM_SCPF','DDBH_CANOPY_SCLS','DDBH_UNDERSTORY_SCLS','YESTERDAYCANLEV_CANOPY_SCLS', + 'YESTERDAYCANLEV_UNDERSTORY_SCLS','BA_SCLS','DEMOTION_RATE_SCLS','PROMOTION_RATE_SCLS','NPLANT_CANOPY_SCLS', + 'MORTALITY_CANOPY_SCLS','NPLANT_UNDERSTORY_SCLS','MORTALITY_UNDERSTORY_SCLS','TRIMMING_CANOPY_SCLS','TRIMMING_UNDERSTORY_SCLS', + 'CROWN_AREA_CANOPY_SCLS','CROWN_AREA_UNDERSTORY_SCLS','LEAF_MD_CANOPY_SCLS','ROOT_MD_CANOPY_SCLS','CARBON_BALANCE_CANOPY_SCLS', + 'SEED_PROD_CANOPY_SCLS','DBALIVEDT_CANOPY_SCLS','DBDEADDT_CANOPY_SCLS','DBSTOREDT_CANOPY_SCLS','STORAGE_FLUX_CANOPY_SCLS', + 'NPP_LEAF_CANOPY_SCLS','NPP_FROOT_CANOPY_SCLS','NPP_BSW_CANOPY_SCLS','NPP_BDEAD_CANOPY_SCLS','NPP_BSEED_CANOPY_SCLS', + 'NPP_STORE_CANOPY_SCLS','RDARK_CANOPY_SCLS','LIVESTEM_MR_CANOPY_SCLS','LIVECROOT_MR_CANOPY_SCLS','FROOT_MR_CANOPY_SCLS', + 'RESP_G_CANOPY_SCLS','RESP_M_CANOPY_SCLS','LEAF_MD_UNDERSTORY_SCLS','ROOT_MD_UNDERSTORY_SCLS','CARBON_BALANCE_UNDERSTORY_SCLS', + 'SEED_PROD_UNDERSTORY_SCLS','DBALIVEDT_UNDERSTORY_SCLS','DBDEADDT_UNDERSTORY_SCLS','DBSTOREDT_UNDERSTORY_SCLS', + 'STORAGE_FLUX_UNDERSTORY_SCLS','NPP_LEAF_UNDERSTORY_SCLS','NPP_FROOT_UNDERSTORY_SCLS','NPP_BSW_UNDERSTORY_SCLS', + 'NPP_BDEAD_UNDERSTORY_SCLS','NPP_BSEED_UNDERSTORY_SCLS','NPP_STORE_UNDERSTORY_SCLS','RDARK_UNDERSTORY_SCLS', + 'LIVESTEM_MR_UNDERSTORY_SCLS','LIVECROOT_MR_UNDERSTORY_SCLS','FROOT_MR_UNDERSTORY_SCLS','RESP_G_UNDERSTORY_SCLS', + 'RESP_M_UNDERSTORY_SCLS' diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdDef/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/FatesColdDef/include_user_mods new file mode 100644 index 0000000000..4c7aa0f2b4 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdDef/include_user_mods @@ -0,0 +1 @@ +../Fates diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdDef/shell_commands b/cime_config/testdefs/testmods_dirs/clm/FatesColdDef/shell_commands new file mode 100644 index 0000000000..2a9f09bd75 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdDef/shell_commands @@ -0,0 +1 @@ +./xmlchange CLM_FORCE_COLDSTART="on" diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdDef/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesColdDef/user_nl_clm new file mode 100644 index 0000000000..144569c412 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdDef/user_nl_clm @@ -0,0 +1,6 @@ +hist_fincl1 = 'NPP','GPP','BTRAN','H2OSOI','TLAI','LITTER_IN','LITTER_OUT', + 'FIRE_AREA','SCORCH_HEIGHT','FIRE_INTENSITY','FIRE_TFC_ROS','fire_fuel_mef', + 'fire_fuel_bulkd','fire_fuel_sav','FIRE_NESTEROV_INDEX','PFTbiomass', + 'PFTleafbiomass','FIRE_ROS','WIND','AREA_TREES','AREA_PLANT', + 'TOTSOMC','TOTLITC','T_SCALAR','NEP','NBP','HR','TOTECOSYSC','NPLANT_SCAG','NPLANT_SCPF', + 'BA_SCLS','NPP_BY_AGE','CWD_AG_CWDSC','PARSUN_Z_CNLF','PARSUN_Z_CNLFPFT','PARSHA_Z_CAN' diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesLogging/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/FatesLogging/include_user_mods new file mode 100644 index 0000000000..4c7aa0f2b4 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/FatesLogging/include_user_mods @@ -0,0 +1 @@ +../Fates diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesLogging/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesLogging/user_nl_clm new file mode 100644 index 0000000000..3b74a4fd37 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/FatesLogging/user_nl_clm @@ -0,0 +1 @@ +use_fates_logging= .true. diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesNoFire/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/FatesNoFire/include_user_mods new file mode 100644 index 0000000000..4c7aa0f2b4 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/FatesNoFire/include_user_mods @@ -0,0 +1 @@ +../Fates diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesNoFire/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesNoFire/user_nl_clm new file mode 100644 index 0000000000..dfdb775ec5 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/FatesNoFire/user_nl_clm @@ -0,0 +1 @@ +use_fates_spitfire= .false. diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesPPhys/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/FatesPPhys/include_user_mods new file mode 100644 index 0000000000..4c7aa0f2b4 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/FatesPPhys/include_user_mods @@ -0,0 +1 @@ +../Fates diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesPPhys/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesPPhys/user_nl_clm new file mode 100644 index 0000000000..9da01bc3fe --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/FatesPPhys/user_nl_clm @@ -0,0 +1 @@ +use_fates_ed_prescribed_phys= .true. diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesST3/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/FatesST3/include_user_mods new file mode 100644 index 0000000000..4c7aa0f2b4 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/FatesST3/include_user_mods @@ -0,0 +1 @@ +../Fates diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesST3/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesST3/user_nl_clm new file mode 100644 index 0000000000..eca76c4b9c --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/FatesST3/user_nl_clm @@ -0,0 +1 @@ +use_fates_ed_st3= .true. diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesShortList/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/FatesShortList/include_user_mods new file mode 100644 index 0000000000..4c7aa0f2b4 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/FatesShortList/include_user_mods @@ -0,0 +1 @@ +../Fates diff --git a/cime_config/testdefs/testmods_dirs/clm/fates/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesShortList/user_nl_clm similarity index 69% rename from cime_config/testdefs/testmods_dirs/clm/fates/user_nl_clm rename to cime_config/testdefs/testmods_dirs/clm/FatesShortList/user_nl_clm index 4dab7ec39e..f9d31eecbb 100644 --- a/cime_config/testdefs/testmods_dirs/clm/fates/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/FatesShortList/user_nl_clm @@ -1,8 +1,5 @@ -hist_mfilt = 365 -hist_nhtfrq = -24 -hist_empty_htapes = .true. hist_fincl1 = 'NPP','GPP','BTRAN','H2OSOI','TLAI','LITTER_IN','LITTER_OUT', 'FIRE_AREA','SCORCH_HEIGHT','FIRE_INTENSITY','FIRE_TFC_ROS','fire_fuel_mef', 'fire_fuel_bulkd','fire_fuel_sav','FIRE_NESTEROV_INDEX','PFTbiomass', 'PFTleafbiomass','FIRE_ROS','WIND','AREA_TREES','AREA_PLANT', - 'TOTSOMC','TOTLITC','T_SCALAR','NEP','NBP','TOTECOSYSC' + 'TOTSOMC','TOTLITC','T_SCALAR','NEP','NBP','HR','TOTECOSYSC' diff --git a/doc/ChangeLog b/doc/ChangeLog index 4eaf4ebd68..9aa280dfc1 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,4 +1,175 @@ =============================================================== +Tag name: clm4_5_18_r272 +Originator(s): erik (Erik Kluzek) +Date: Thu Jan 25 01:17:01 MST 2018 +One-line Summary: Bring in latest FATES release version to CLM trunk: fates_s1.4.1_a3.0.0_rev2 + +Purpose of changes +------------------ + +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. + + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CCTSM Issue #): #219 + #219 -- Options listed incorrectly in testlist_clm.xml + +Known bugs introduced in this tag (include github issue ID): (or found) + #216 -- PE layout for hcru_hcru needs to be increased so that it can run + #213 -- CPLHIST case is matching the wrong CLM_NML_USE_CASE + #212 -- Can't use a non-fates restart file to interpolate to a simulation with fates + #211 -- Can't handle interpolating from a fates restart file because of the cohort dimension + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): Simple FATES initial-condition + files were added for present day at f45 and 1x1_brazil. FATES IC can't be interpolated from + so you either have to have an exact match or do a cold start. + +Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): New FATES namelist items: + use_fates_planthydro, use_fates_ed_st3, use_fates_ed_prescribed_phys, + use_fates_inventory_init, fates_inventory_ctrl_filename,use_fates_logging + +Changes made to namelist defaults (e.g., changed parameter values): when FATES on, non-fates finidat + files won't be matched + +Changes to the datasets (e.g., parameter, surface or initial files): New fates param file + and finidat files for f45 and 1x1_brazil + +Substantial timing or memory changes: None + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): + +Changes to tests or testing: ed test list removed and updated fates list added in + with new version=2.0 format, fates test list now sets machine/compiler rather than + using generic "fates" for both. + +Code reviewed by: self, rgknox, ckoven + +Did you follow the steps in .CLMTrunkChecklist: yes + +CLM testing: regular + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - PASS (33 fates namelist tests are different) + + unit-tests (components/clm/src): + + cheyenne - PASS + + regular tests (aux_clm): + + cheyenne_intel ---- OK + cheyenne_gnu ------ OK + hobart_nag -------- OK + hobart_pgi -------- OK + hobart_intel ------ OK + +CLM tag used for the baseline comparisons: clm4_5_18_r271 + + +Answer changes +-------------- + +Changes answers relative to baseline: Only simulations with fates on + + Summarize any changes to answers, i.e., + - what code configurations: Only "-bgc fates" + - what platforms/compilers: All + - nature of change: new climate, fates science updated from 1.3.0 to 1.4.1 + +Detailed list of changes +------------------------ + +List any svn externals directories updated (cime, rtm, mosart, cism, etc.): rtm, mosart, fates + rtm to rtm1_0_65 + mosart to mosart1_0_30 + fates to fates_s1.4.1_a3.0.0_rev2 + +List all files eliminated: + + fates test directory changed to one capitolized to be similar to new tests added + D components/clm/cime_config/testdefs/testmods_dirs/clm/fates/user_nl_clm + D components/clm/cime_config/testdefs/testmods_dirs/clm/fates/shell_commands + +List all files added and what they do: + + New tests for exercising more Fates options, all are based on the Fates test-mod + and add a few changes on top of it + A components/clm/cime_config/testdefs/testmods_dirs/clm/FatesShortList/user_nl_clm ------- Short list of hist_fincl1 + A components/clm/cime_config/testdefs/testmods_dirs/clm/FatesShortList/include_user_mods + A components/clm/cime_config/testdefs/testmods_dirs/clm/FatesST3/user_nl_clm ------------- use_fates_ed_st3=T + A components/clm/cime_config/testdefs/testmods_dirs/clm/FatesST3/include_user_mods + A components/clm/cime_config/testdefs/testmods_dirs/clm/FatesAllVars/user_nl_clm --------- Long list of FATES variables + A components/clm/cime_config/testdefs/testmods_dirs/clm/FatesAllVars/include_user_mods + A components/clm/cime_config/testdefs/testmods_dirs/clm/FatesAllVars/shell_commands ----- Cold-start + A components/clm/cime_config/testdefs/testmods_dirs/clm/FatesLogging/user_nl_clm -------- use_fates_logging=T + A components/clm/cime_config/testdefs/testmods_dirs/clm/FatesLogging/include_user_mods + A components/clm/cime_config/testdefs/testmods_dirs/clm/FatesColdDef/user_nl_clm -------- Longer list of hist_fincl1 + A components/clm/cime_config/testdefs/testmods_dirs/clm/FatesColdDef/include_user_mods + A components/clm/cime_config/testdefs/testmods_dirs/clm/FatesColdDef/shell_commands ----- Cold-start + A components/clm/cime_config/testdefs/testmods_dirs/clm/FatesPPhys/user_nl_clm ---------- use_fates_ed_prescribed_phys=T + A components/clm/cime_config/testdefs/testmods_dirs/clm/FatesPPhys/include_user_mods + A components/clm/cime_config/testdefs/testmods_dirs/clm/Fates/user_nl_clm -------------- Moved from fates directory, longer + hist_fincl1 list + A components/clm/cime_config/testdefs/testmods_dirs/clm/Fates/shell_commands ----------- Moved from fates directory, no longer + a cold-start + A components/clm/cime_config/testdefs/testmods_dirs/clm/FatesNoFire/user_nl_clm -------- use_fates_spitfire=F + A components/clm/cime_config/testdefs/testmods_dirs/clm/FatesNoFire/include_user_mods + +List all existing files that have been modified, and describe the changes: + + M components/clm/bld/CLMBuildNamelist.pm - Handle new FATES namelist items, send + use_fates down for setting of finidat, if use_fates_inventory_init=T, make + sure fates_inventory_ctrl_filename is set + + M components/clm/bld/unit_testers/build-namelist_test.pl - Change ED to FATES, test new FATES features + + M components/clm/bld/namelist_files/namelist_defaults_overall.xml -- clm_start_type is arb_ic when use_fates=T + M components/clm/bld/namelist_files/namelist_definition_clm4_5.xml - Update fates var descriptsion, and add + new namelist items: use_fates_logging, use_fates_planthydro, use_fates_ed_st3, use_fates_ed_prescribed_phys, + use_fates_inventory_init, fates_inventory_ctrl_filename, remove use of ED for FATES + M components/clm/bld/namelist_files/namelist_defaults_clm4_5.xml --- Update fates_paramfile, use_init_interp=T + only if use_fates=F, add use_fates=F to init_interp_attributes, add use_fates setting for finidat files, + and add new f45 and 1x1_brazil FATES finidat files, by default new use_fates_* options are False. + + M components/clm/cime_config/config_compsets.xml ------------- Add a stub-GLC FATES compset: I2000Clm50FatesCruGs + M components/clm/cime_config/testdefs/ExpectedTestFails.xml -- Many new expected fails for #221 and NGEET/fates#315 + M components/clm/cime_config/testdefs/testlist_clm.xml ------- Remove "ed" test-category, new "fates" test category + Move to after rather than nested inside (issue #219). + + M components/clm/src/utils/clmfates_paraminterfaceMod.F90 - Add write about dimension shape on abort + M components/clm/src/utils/clmfates_interfaceMod.F90 ------ New interface control variables, add call to + FatesReportParameters, use_fates_plant_hydro=>use_fates_planthydro, fix restart_map, zero_site=>init_site_vars + use numpft_ed + + M components/clm/src/main/decompInitMod.F90 --------- Set gi rather than ci for cohorts + M components/clm/src/main/subgridMod.F90 ------------ Add call subgrid_get_info_cohort, change subgrid_get_info_natveg call + M components/clm/src/main/histFileMod.F90 ----------- Change some of the parameter names, EDTypesMod interfaces get moved + to FatesInterfaceMod, nlevsclass_ed=>nlevsclass, maxpft=>numpft_ed, + M components/clm/src/main/controlMod.F90 ------------ Add new fates flags to namelist and broadcast/print them + M components/clm/src/main/clm_varctl.F90 ------------ New FATES flags, change ED=>FATES and some formatting + M components/clm/src/main/initGridCellsMod.F90 ------ ncohorts=>npatches + M components/clm/src/main/initVerticalMod.F90 ------- Remove call to ed_hist_scpfmaps + M components/clm/src/main/readParamsMod.F90 --------- Remove call to FatesReadParameters + M components/clm/src/biogeophys/CanopyFluxesMod.F90 - Add blank line + M components/clm/src/biogeophys/OzoneMod.F90 -------- Comment out setting of o3* variables to spval + + M components/clm/src/CMakeLists.txt -- Add fates/main to unit-test directories + +=============================================================== +=============================================================== Tag name: clm4_5_18_r271 Originator(s): erik (Erik Kluzek) Date: Sat Jan 20 20:27:00 MST 2018 diff --git a/doc/ChangeSum b/doc/ChangeSum index 24def568e2..d0df950aaf 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,6 @@ Tag Who Date Summary ============================================================================================================================ + clm4_5_18_r272 erik 01/25/2018 Bring in latest FATES release version to CLM trunk: fates_s1.4.1_a3.0.0_rev2 clm4_5_18_r271 erik 01/20/2018 Update testlist to v2 and remove yellowstone clm4_5_18_r270 sacks 12/20/2017 Always use multiple elevation classes for glacier, even with stub glc clm4_5_18_r269 erik 12/16/2017 Move externals to version in github diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4d392b1fb1..21f15b3aff 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -36,6 +36,7 @@ add_subdirectory(${CLM_ROOT}/src/biogeophys clm_biogeophys) add_subdirectory(${CLM_ROOT}/src/dyn_subgrid clm_dyn_subgrid) add_subdirectory(${CLM_ROOT}/src/main clm_main) add_subdirectory(${CLM_ROOT}/src/init_interp clm_init_interp) +add_subdirectory(${CLM_ROOT}/src/fates/main fates_main) # Add general unit test directories (stubbed out files, etc.) add_subdirectory(unit_test_stubs) diff --git a/src/biogeophys/CanopyFluxesMod.F90 b/src/biogeophys/CanopyFluxesMod.F90 index 7ddf8047b2..7c9feb8a25 100644 --- a/src/biogeophys/CanopyFluxesMod.F90 +++ b/src/biogeophys/CanopyFluxesMod.F90 @@ -1265,6 +1265,7 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp, if ( use_fates ) then + call clm_fates%wrap_accumulatefluxes(nc,fn,filterp(1:fn)) call clm_fates%wrap_hydraulics_drive(bounds,nc,soilstate_inst, & waterstate_inst,waterflux_inst,solarabs_inst,energyflux_inst) diff --git a/src/biogeophys/OzoneMod.F90 b/src/biogeophys/OzoneMod.F90 index 4124ced958..29b94fa34f 100644 --- a/src/biogeophys/OzoneMod.F90 +++ b/src/biogeophys/OzoneMod.F90 @@ -381,6 +381,19 @@ subroutine CalcOzoneStress(this, bounds, num_exposedvegp, filter_exposedvegp, & tlai_old(p) = tlai(p) +! else +! ! FATES is fundamentlaly incompatible with this type of patch-level +! ! association with plant functional type, so for the time +! ! being, fates patches will just push these values to invalid +! o3uptakesha(p) = spval +! o3coefvsha(p) = spval +! o3coefgsha(p) = spval +! o3uptakesun(p) = spval +! o3coefvsun(p) = spval +! o3coefgsun(p) = spval +! +! end if + ! else ! ! FATES is fundamentlaly incompatible with this type of patch-level ! ! association with plant functional type, so for the time diff --git a/src/main/clm_varctl.F90 b/src/main/clm_varctl.F90 index 6e3c9310fe..a8362dd8aa 100644 --- a/src/main/clm_varctl.F90 +++ b/src/main/clm_varctl.F90 @@ -187,11 +187,19 @@ module clm_varctl logical, public :: use_c14 = .false. ! true => use C-14 model !---------------------------------------------------------- - ! fates switches + ! FATES switches !---------------------------------------------------------- - logical, public :: use_fates = .false. ! true => use ED - logical, public :: use_fates_spitfire = .false. ! true => use spitfire model + logical, public :: use_fates = .false. ! true => use fates + + ! These are INTERNAL to the FATES module + logical, public :: use_fates_spitfire = .false. ! true => use spitfire model + logical, public :: use_fates_logging = .false. ! true => turn on logging module + logical, public :: use_fates_planthydro = .false. ! true => turn on fates hydro + logical, public :: use_fates_ed_st3 = .false. ! true => static stand structure + logical, public :: use_fates_ed_prescribed_phys = .false. ! true => prescribed physiology + logical, public :: use_fates_inventory_init = .false. ! true => initialize fates from inventory + character(len=256), public :: fates_inventory_ctrl_filename = '' ! filename for inventory control !---------------------------------------------------------- ! LUNA switches @@ -294,7 +302,7 @@ module clm_varctl logical, public :: hist_wrtch4diag = .false. !---------------------------------------------------------- - ! ED/FATES + ! FATES !---------------------------------------------------------- character(len=fname_len), public :: fates_paramfile = ' ' diff --git a/src/main/controlMod.F90 b/src/main/controlMod.F90 index 917121c255..daa16205b7 100644 --- a/src/main/controlMod.F90 +++ b/src/main/controlMod.F90 @@ -210,7 +210,14 @@ subroutine control_init( ) namelist /clm_inparm/ use_c13, use_c14 - namelist /clm_inparm/ fates_paramfile, use_fates, use_fates_spitfire + ! FATES Flags + namelist /clm_inparm/ fates_paramfile, use_fates, & + use_fates_spitfire, use_fates_logging, & + use_fates_planthydro, use_fates_ed_st3, & + use_fates_ed_prescribed_phys, & + use_fates_inventory_init, & + fates_inventory_ctrl_filename + ! CLM 5.0 nitrogen flags namelist /clm_inparm/ use_flexibleCN, use_luna @@ -220,7 +227,7 @@ subroutine control_init( ) CNratio_floating, lnc_opt, reduce_dayl_factor, vcmax_opt, CN_residual_opt, & CN_partition_opt, CN_evergreen_phenology_opt, carbon_resp_opt - namelist /clm_inparm / use_lai_streams + namelist /clm_inparm/ use_lai_streams namelist /clm_inparm/ use_bedrock @@ -298,6 +305,7 @@ subroutine control_init( ) else call endrun(msg='ERROR finding clm_nitrogen namelist'//errMsg(sourcefile, __LINE__)) end if + call relavu( unitn ) ! ---------------------------------------------------------------------- @@ -613,6 +621,12 @@ subroutine control_spmd() call mpi_bcast (use_fates, 1, MPI_LOGICAL, 0, mpicom, ier) call mpi_bcast (use_fates_spitfire, 1, MPI_LOGICAL, 0, mpicom, ier) + call mpi_bcast (use_fates_logging, 1, MPI_LOGICAL, 0, mpicom, ier) + call mpi_bcast (use_fates_planthydro, 1, MPI_LOGICAL, 0, mpicom, ier) + call mpi_bcast (use_fates_ed_st3, 1, MPI_LOGICAL, 0, mpicom, ier) + call mpi_bcast (use_fates_ed_prescribed_phys, 1, MPI_LOGICAL, 0, mpicom, ier) + call mpi_bcast (use_fates_inventory_init, 1, MPI_LOGICAL, 0, mpicom, ier) + call mpi_bcast (fates_inventory_ctrl_filename, len(fates_inventory_ctrl_filename), MPI_CHARACTER, 0, mpicom, ier) call mpi_bcast (fates_paramfile, len(fates_paramfile) , MPI_CHARACTER, 0, mpicom, ier) ! flexibleCN nitrogen model @@ -938,7 +952,13 @@ subroutine control_print () write(iulog, *) ' use_fates = ', use_fates if (use_fates) then write(iulog, *) ' use_fates_spitfire = ', use_fates_spitfire + write(iulog, *) ' use_fates_logging = ', use_fates_logging write(iulog, *) ' fates_paramfile = ', fates_paramfile + write(iulog, *) ' use_fates_planthydro = ', use_fates_planthydro + write(iulog, *) ' use_fates_ed_st3 = ',use_fates_ed_st3 + write(iulog, *) ' use_fates_ed_prescribed_phys = ',use_fates_ed_prescribed_phys + write(iulog, *) ' use_fates_inventory_init = ',use_fates_inventory_init + write(iulog, *) ' fates_inventory_ctrl_filename = ',fates_inventory_ctrl_filename end if end subroutine control_print diff --git a/src/main/decompInitMod.F90 b/src/main/decompInitMod.F90 index e938c27d70..709c0b5e36 100644 --- a/src/main/decompInitMod.F90 +++ b/src/main/decompInitMod.F90 @@ -730,12 +730,11 @@ subroutine decompInit_glcp(lns,lni,lnj,glc_behavior) if ( use_fates ) then allocate(gindex(begCohort:endCohort)) ioff(:) = 0 - ci = begc + gi = begg do coi = begCohort,endCohort - if ( mod(coi, fates_maxElementsPerSite ) == 0 ) ci = ci + 1 - gi = col%gridcell(ci) ! convert column into gridcell gindex(coi) = coStart(gi) + ioff(gi) ioff(gi) = ioff(gi) + 1 + if ( mod(coi, fates_maxElementsPerSite ) == 0 ) gi = gi + 1 enddo locsize = endCohort-begCohort+1 globsize = numCohort diff --git a/src/main/histFileMod.F90 b/src/main/histFileMod.F90 index 778c436c93..d1636f5d6c 100644 --- a/src/main/histFileMod.F90 +++ b/src/main/histFileMod.F90 @@ -20,11 +20,12 @@ module histFileMod use LandunitType , only : lun use ColumnType , only : col use PatchType , only : patch - use ncdio_pio - use EDtypesMod , only : nlevsclass_ed, nlevage_ed - use EDtypesMod , only : nfsc, ncwd - use EDtypesMod , only : nlevleaf, nclmax, numpft_ed - use EDTypesMod , only : maxpft + use EDTypesMod , only : nclmax + use EDTypesMod , only : nlevleaf + use FatesInterfaceMod , only : nlevsclass, nlevage + use EDTypesMod , only : nfsc, ncwd + use FatesInterfaceMod , only : numpft_ed => numpft + use ncdio_pio ! implicit none @@ -2029,13 +2030,13 @@ subroutine htape_create (t, histrest) call ncd_defdim( lnfid, 'levdcmp', nlevdecomp_full, dimid) if(use_fates)then - call ncd_defdim(lnfid, 'fates_levscag', nlevsclass_ed * nlevage_ed, dimid) - call ncd_defdim(lnfid, 'fates_levscls', nlevsclass_ed, dimid) - call ncd_defdim(lnfid, 'fates_levpft', maxpft, dimid) - call ncd_defdim(lnfid, 'fates_levage', nlevage_ed, dimid) + call ncd_defdim(lnfid, 'fates_levscag', nlevsclass * nlevage, dimid) + call ncd_defdim(lnfid, 'fates_levscls', nlevsclass, dimid) + call ncd_defdim(lnfid, 'fates_levpft', numpft_ed, dimid) + call ncd_defdim(lnfid, 'fates_levage', nlevage, dimid) call ncd_defdim(lnfid, 'fates_levfuel', nfsc, dimid) call ncd_defdim(lnfid, 'fates_levcwdsc', ncwd, dimid) - call ncd_defdim(lnfid, 'fates_levscpf', nlevsclass_ed*maxpft, dimid) + call ncd_defdim(lnfid, 'fates_levscpf', nlevsclass*numpft_ed, dimid) call ncd_defdim(lnfid, 'fates_levcan', nclmax, dimid) call ncd_defdim(lnfid, 'fates_levcnlf', nlevleaf * nclmax, dimid) call ncd_defdim(lnfid, 'fates_levcnlfpf', nlevleaf * nclmax * numpft_ed, dimid) @@ -2452,12 +2453,21 @@ subroutine htape_timeconst(t, mode) use domainMod , only : ldomain, lon1d, lat1d use clm_time_manager, only : get_nstep, get_curr_date, get_curr_time use clm_time_manager, only : get_ref_date, get_calendar, NO_LEAP_C, GREGORIAN_C - use EDTypesMod, only : fates_hdim_levsclass, fates_hdim_pfmap_levscpf, fates_hdim_scmap_levscpf - use EDTypesMod, only : fates_hdim_levage, fates_hdim_levpft - use EDTypesMod, only : fates_hdim_scmap_levscag, fates_hdim_agmap_levscag - use EDTypesMod, only : fates_hdim_levfuel, fates_hdim_levcwdsc - use EDTypesMod, only : fates_hdim_levcan, fates_hdim_canmap_levcnlf, fates_hdim_lfmap_levcnlf - use EDTypesMod, only : fates_hdim_canmap_levcnlfpf, fates_hdim_lfmap_levcnlfpf, fates_hdim_pftmap_levcnlfpf + use FatesInterfaceMod, only : fates_hdim_levsclass + use FatesInterfaceMod, only : fates_hdim_pfmap_levscpf + use FatesInterfaceMod, only : fates_hdim_scmap_levscpf + use FatesInterfaceMod, only : fates_hdim_levage + use FatesInterfaceMod, only : fates_hdim_levpft + use FatesInterfaceMod, only : fates_hdim_scmap_levscag + use FatesInterfaceMod, only : fates_hdim_agmap_levscag + use FatesInterfaceMod, only : fates_hdim_levfuel + use FatesInterfaceMod, only : fates_hdim_levcwdsc + use FatesInterfaceMod, only : fates_hdim_levcan + use FatesInterfaceMod, only : fates_hdim_canmap_levcnlf + use FatesInterfaceMod, only : fates_hdim_lfmap_levcnlf + use FatesInterfaceMod, only : fates_hdim_canmap_levcnlfpf + use FatesInterfaceMod, only : fates_hdim_lfmap_levcnlfpf + use FatesInterfaceMod, only : fates_hdim_pftmap_levcnlfpf ! ! !ARGUMENTS: integer, intent(in) :: t ! tape index @@ -4705,19 +4715,19 @@ subroutine hist_addfld2d (fname, type2d, units, avgflag, long_name, type1d_out, case ('levdcmp') num2d = nlevdecomp_full case ('fates_levscls') - num2d = nlevsclass_ed + num2d = nlevsclass case ('fates_levpft') - num2d = maxpft + num2d = numpft_ed case ('fates_levage') - num2d = nlevage_ed + num2d = nlevage case ('fates_levfuel') num2d = nfsc case ('fates_levcwdsc') num2d = ncwd case ('fates_levscpf') - num2d = nlevsclass_ed*maxpft + num2d = nlevsclass*numpft_ed case ('fates_levscag') - num2d = nlevsclass_ed*nlevage_ed + num2d = nlevsclass*nlevage case ('fates_levcan') num2d = nclmax case ('fates_levcnlf') diff --git a/src/main/initGridCellsMod.F90 b/src/main/initGridCellsMod.F90 index 8e1a140fa4..def9631a8a 100644 --- a/src/main/initGridCellsMod.F90 +++ b/src/main/initGridCellsMod.F90 @@ -234,7 +234,6 @@ subroutine set_landunit_veg_compete (ltype, gi, li, ci, pi) ! ! !LOCAL VARIABLES: integer :: m ! index - integer :: ncohorts integer :: npatches ! number of patches in landunit integer :: ncols integer :: nlunits @@ -245,7 +244,7 @@ subroutine set_landunit_veg_compete (ltype, gi, li, ci, pi) ! Set decomposition properties call subgrid_get_info_natveg(gi, & - ncohorts=ncohorts, npatches=npatches, ncols=ncols, nlunits=nlunits) + npatches=npatches, ncols=ncols, nlunits=nlunits) wtlunit2gcell = wt_lunit(gi, ltype) if (npatches > 0) then diff --git a/src/main/initVerticalMod.F90 b/src/main/initVerticalMod.F90 index 9a82b123f0..9ba2f2711c 100644 --- a/src/main/initVerticalMod.F90 +++ b/src/main/initVerticalMod.F90 @@ -28,7 +28,6 @@ module initVerticalMod use ColumnType , only : col use glcBehaviorMod , only : glc_behavior_type use SnowHydrologyMod , only : InitSnowLayers - use EDTypesMod , only : ed_hist_scpfmaps use abortUtils , only : endrun use ncdio_pio ! @@ -311,11 +310,6 @@ subroutine initVertical(bounds, glc_behavior, snow_depth, thick_wall, thick_roof end if end if - if(use_fates)then - call ed_hist_scpfmaps - end if - - ! Column level initialization for urban wall and roof layers and interfaces do l = bounds%begl,bounds%endl diff --git a/src/main/readParamsMod.F90 b/src/main/readParamsMod.F90 index f5776c2605..7fbea89531 100644 --- a/src/main/readParamsMod.F90 +++ b/src/main/readParamsMod.F90 @@ -43,8 +43,6 @@ subroutine readParameters (nutrient_competition_method, photosyns_inst) use NutrientCompetitionMethodMod , only : nutrient_competition_method_type use clm_varctl, only : NLFilename_in use PhotosynthesisMod , only : photosyns_type - - use CLMFatesParamInterfaceMod , only : FatesReadParameters ! ! !ARGUMENTS: type(photosyns_type) , intent(in) :: photosyns_inst @@ -104,8 +102,6 @@ subroutine readParameters (nutrient_competition_method, photosyns_inst) ! call ncd_pio_closefile(ncid) - call FatesReadParameters() - end subroutine readParameters end module readParamsMod diff --git a/src/main/subgridMod.F90 b/src/main/subgridMod.F90 index d8477a73d2..c5552cca5e 100644 --- a/src/main/subgridMod.F90 +++ b/src/main/subgridMod.F90 @@ -28,6 +28,7 @@ module subgridMod ! Routines to get info for each landunit: public :: subgrid_get_info_natveg + public :: subgrid_get_info_cohort public :: subgrid_get_info_urban_tbd public :: subgrid_get_info_urban_hd public :: subgrid_get_info_urban_md @@ -78,7 +79,7 @@ subroutine subgrid_get_gcellinfo (gi, glc_behavior, & nlunits = 0 ncohorts = 0 - call subgrid_get_info_natveg(gi, ncohorts, npatches_temp, ncols_temp, nlunits_temp) + call subgrid_get_info_natveg(gi, npatches_temp, ncols_temp, nlunits_temp) call accumulate_counters() call subgrid_get_info_urban_tbd(gi, npatches_temp, ncols_temp, nlunits_temp) @@ -103,6 +104,7 @@ subroutine subgrid_get_gcellinfo (gi, glc_behavior, & call subgrid_get_info_crop(gi, npatches_temp, ncols_temp, nlunits_temp) call accumulate_counters() + call subgrid_get_info_cohort(gi,ncohorts) contains subroutine accumulate_counters @@ -119,7 +121,7 @@ end subroutine accumulate_counters end subroutine subgrid_get_gcellinfo !----------------------------------------------------------------------- - subroutine subgrid_get_info_natveg(gi, ncohorts, npatches, ncols, nlunits) + subroutine subgrid_get_info_natveg(gi, npatches, ncols, nlunits) ! ! !DESCRIPTION: ! Obtain properties for natural vegetated landunit in this grid cell @@ -129,7 +131,6 @@ subroutine subgrid_get_info_natveg(gi, ncohorts, npatches, ncols, nlunits) ! ! !ARGUMENTS: integer, intent(in) :: gi ! grid cell index - integer, intent(out) :: ncohorts ! number of nat veg cohorts in this grid cell integer, intent(out) :: npatches ! number of nat veg patches in this grid cell integer, intent(out) :: ncols ! number of nat veg columns in this grid cell integer, intent(out) :: nlunits ! number of nat veg landunits in this grid cell @@ -150,18 +151,42 @@ subroutine subgrid_get_info_natveg(gi, ncohorts, npatches, ncols, nlunits) nlunits = 1 ncols = 1 + end subroutine subgrid_get_info_natveg + + ! ----------------------------------------------------------------------------- + + subroutine subgrid_get_info_cohort(gi, ncohorts) + ! + ! !DESCRIPTION: + ! Obtain cohort counts per each gridcell. + ! + ! !USES + use clm_varpar, only : natpft_size + ! + ! !ARGUMENTS: + integer, intent(in) :: gi ! grid cell index + integer, intent(out) :: ncohorts ! number of cohorts in this grid cell + ! + ! !LOCAL VARIABLES: + + character(len=*), parameter :: subname = 'subgrid_get_info_cohort' + !----------------------------------------------------------------------- + ! ------------------------------------------------------------------------- ! Number of cohorts is set here - ! fates cohorts (via FATES) populate all natural vegetation columns. - ! Current implementations mostly assume that only one column contains - ! natural vegetation, which is synonomous with the soil column. - ! For restart output however, we will allocate the cohort vector space - ! based on all columns. + ! FATES cohorts populate all natural vegetation columns. + ! There is only one natural vegetation column per grid-cell. So allocations + ! are mapped to the gridcell. In the future we may have more than one site + ! per gridcell, and we just multiply that factor here. + ! It is possible that there may be gridcells that don't have a naturally + ! vegetated column. That case should be fine, as the cohort + ! restart vector will just be a little sparse. ! ------------------------------------------------------------------------- + + ncohorts = fates_maxElementsPerSite + + end subroutine subgrid_get_info_cohort - ncohorts = ncols*fates_maxElementsPerSite - - end subroutine subgrid_get_info_natveg !----------------------------------------------------------------------- subroutine subgrid_get_info_urban_tbd(gi, npatches, ncols, nlunits) diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index 72d02ad66d..fbbfbf99ea 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -45,12 +45,19 @@ module CLMFatesInterfaceMod use clm_varctl , only : iulog use clm_varctl , only : use_vertsoilc use clm_varctl , only : use_fates_spitfire + use clm_varctl , only : use_fates_planthydro + use clm_varctl , only : use_fates_ed_st3 + use clm_varctl , only : use_fates_ed_prescribed_phys + use clm_varctl , only : use_fates_logging + use clm_varctl , only : use_fates_inventory_init + use clm_varctl , only : fates_inventory_ctrl_filename + use clm_varcon , only : tfrz use clm_varcon , only : spval use clm_varcon , only : denice use clm_varcon , only : ispval - use clm_varpar , only : numpft + use clm_varpar , only : natpft_size use clm_varpar , only : numrad use clm_varpar , only : ivis use clm_varpar , only : inir @@ -102,15 +109,14 @@ module CLMFatesInterfaceMod use ChecksBalancesMod , only : SummarizeNetFluxes, FATES_BGC_Carbon_BalanceCheck use EDTypesMod , only : ed_patch_type use FatesHydraulicsMemMod , only : nlevsoi_hyd - use EDTypesMod , only : use_fates_plant_hydro use FatesInterfaceMod , only : hlm_numlevgrnd, hlm_numlevsoil, hlm_numlevdecomp_full use EDMainMod , only : ed_ecosystem_dynamics use EDMainMod , only : ed_update_site use EDInitMod , only : zero_site + use EDInitMod , only : init_site_vars use EDInitMod , only : init_patches use EDInitMod , only : set_site_properties use EDPftVarcon , only : EDpftvarcon_inst - use EDEcophysConType , only : EDecophysconInit use EDSurfaceRadiationMod , only : ED_SunShadeFracs, ED_Norman_Radiation use EDBtranMod , only : btran_ed, & get_active_suction_layers @@ -217,8 +223,8 @@ subroutine init(this, bounds_proc ) ! is not turned on ! --------------------------------------------------------------------------------- - use FatesInterfaceMod, only : FatesInterfaceInit - use EDTypesMod , only : numpft_ed + use FatesInterfaceMod, only : FatesInterfaceInit, FatesReportParameters + use FatesInterfaceMod, only : numpft_ed => numpft use FatesParameterDerivedMod, only : param_derived implicit none @@ -229,11 +235,16 @@ subroutine init(this, bounds_proc ) ! local variables integer :: nclumps ! Number of threads - logical :: verbose_output - integer :: pass_masterproc - integer :: pass_vertsoilc - integer :: pass_spitfire - integer :: pass_is_restart + logical :: verbose_output + integer :: pass_masterproc + integer :: pass_vertsoilc + integer :: pass_spitfire + integer :: pass_ed_st3 + integer :: pass_ed_prescribed_phys + integer :: pass_logging + integer :: pass_planthydro + integer :: pass_inventory_init + integer :: pass_is_restart integer :: nc ! thread index integer :: s ! FATES site index integer :: c ! HLM column index @@ -248,8 +259,11 @@ subroutine init(this, bounds_proc ) ! This involves to stages ! 1) allocate the vectors ! 2) add the history variables defined in clm_inst to the history machinery - call EDecophysconInit( EDpftvarcon_inst, numpft ) + + + ! Parameter Routines call param_derived%Init( numpft_ed ) + verbose_output = .false. call FatesInterfaceInit(iulog, verbose_output) @@ -278,6 +292,9 @@ subroutine init(this, bounds_proc ) call set_fates_ctrlparms('hlm_name',cval='CLM') call set_fates_ctrlparms('hio_ignore_val',rval=spval) call set_fates_ctrlparms('soilwater_ipedof',ival=get_ipedof(0)) + call set_fates_ctrlparms('max_patch_per_site',ival=(natpft_size-1)) ! RGK: FATES IGNORES + ! AND DOESNT TOUCH + ! THE BARE SOIL PATCH if(is_restart()) then pass_is_restart = 1 @@ -300,6 +317,44 @@ subroutine init(this, bounds_proc ) end if call set_fates_ctrlparms('use_spitfire',ival=pass_spitfire) + if(use_fates_ed_st3) then + pass_ed_st3 = 1 + else + pass_ed_st3 = 0 + end if + call set_fates_ctrlparms('use_ed_st3',ival=pass_ed_st3) + + if(use_fates_ed_prescribed_phys) then + pass_ed_prescribed_phys = 1 + else + pass_ed_prescribed_phys = 0 + end if + call set_fates_ctrlparms('use_ed_prescribed_phys',ival=pass_ed_prescribed_phys) + + if(use_fates_planthydro) then + pass_planthydro = 1 + else + pass_planthydro = 0 + end if + call set_fates_ctrlparms('use_planthydro',ival=pass_planthydro) + + if(use_fates_logging) then + pass_logging = 1 + else + pass_logging = 0 + end if + call set_fates_ctrlparms('use_logging',ival=pass_logging) + + if(use_fates_inventory_init) then + pass_inventory_init = 1 + else + pass_inventory_init = 0 + end if + call set_fates_ctrlparms('use_inventory_init',ival=pass_inventory_init) + + call set_fates_ctrlparms('inventory_ctrl_file',cval=fates_inventory_ctrl_filename) + + if(masterproc)then pass_masterproc = 1 else @@ -406,7 +461,7 @@ subroutine init(this, bounds_proc ) call this%init_soil_depths(nc) - if (use_fates_plant_hydro) call InitHydrSites(this%fates(nc)%sites) + if (use_fates_planthydro) call InitHydrSites(this%fates(nc)%sites) if( this%fates(nc)%nsites == 0 ) then @@ -434,6 +489,8 @@ subroutine init(this, bounds_proc ) call this%init_history_io(bounds_proc) + ! Report Fates Parameters (debug flag in lower level routines) + call FatesReportParameters(masterproc) end subroutine init @@ -575,7 +632,7 @@ subroutine dynamics_driv(this, nc, bounds_clump, & end do - if(use_fates_plant_hydro)then + if(use_fates_planthydro)then this%fates(nc)%bc_in(s)%hksat_sisl(1:nlevsoi) = soilstate_inst%hksat_col(c,1:nlevsoi) this%fates(nc)%bc_in(s)%watsat_sisl(1:nlevsoi) = soilstate_inst%watsat_col(c,1:nlevsoi) this%fates(nc)%bc_in(s)%watres_sisl(1:nlevsoi) = soilstate_inst%watres_col(c,1:nlevsoi) @@ -718,7 +775,7 @@ subroutine wrap_update_hlmfates_dyn(this, nc, bounds_clump, & ! ! Diagnose water storage in canopy if hydraulics is on ! ! This updates the internal value and the bc_out value. ! ! If hydraulics is off, it returns 0 storage - ! if ( use_fates_plant_hydro ) then + ! if ( use_fates_planthydro ) then ! call UpdateH2OVeg(this%fates(nc)%nsites, & ! this%fates(nc)%sites, & ! this%fates(nc)%bc_out) @@ -853,6 +910,7 @@ subroutine restart( this, bounds_proc, ncid, flag, waterstate_inst, & type(fates_bounds_type) :: fates_clump integer :: c ! HLM column index integer :: s ! Fates site index + integer :: g ! grid-cell index integer :: dk_index character(len=fates_long_string_length) :: ioname integer :: nvar @@ -907,16 +965,17 @@ subroutine restart( this, bounds_proc, ncid, flag, waterstate_inst, & end do !$OMP END PARALLEL DO - !$OMP PARALLEL DO PRIVATE (nc,s,c) + !$OMP PARALLEL DO PRIVATE (nc,s,c,g,bounds_clump) do nc = 1,nclumps - + + call get_clump_bounds(nc, bounds_clump) allocate(this%fates_restart%restart_map(nc)%site_index(this%fates(nc)%nsites)) allocate(this%fates_restart%restart_map(nc)%cohort1_index(this%fates(nc)%nsites)) do s=1,this%fates(nc)%nsites c = this%f2hmap(nc)%fcolumn(s) this%fates_restart%restart_map(nc)%site_index(s) = c - this%fates_restart%restart_map(nc)%cohort1_index(s) = & - bounds_proc%begCohort + (c-bounds_proc%begc)*fates_maxElementsPerSite + 1 + g = col%gridcell(c) + this%fates_restart%restart_map(nc)%cohort1_index(s) = (g-1)*fates_maxElementsPerSite + 1 end do end do @@ -1094,6 +1153,7 @@ subroutine init_coldstart(this, waterstate_inst, canopystate_inst, soilstate_ins call get_clump_bounds(nc, bounds_clump) do s = 1,this%fates(nc)%nsites + call init_site_vars(this%fates(nc)%sites(s)) call zero_site(this%fates(nc)%sites(s)) end do @@ -1104,7 +1164,7 @@ subroutine init_coldstart(this, waterstate_inst, canopystate_inst, soilstate_ins ! Called prior to init_patches(). Site level rhizosphere shells must ! be set prior to cohort initialization. ! ---------------------------------------------------------------------------- - if (use_fates_plant_hydro) then + if (use_fates_planthydro) then do s = 1,this%fates(nc)%nsites c = this%f2hmap(nc)%fcolumn(s) @@ -1136,7 +1196,7 @@ subroutine init_coldstart(this, waterstate_inst, canopystate_inst, soilstate_ins end do - if (use_fates_plant_hydro) call HydrSiteColdStart(this%fates(nc)%sites,this%fates(nc)%bc_in) + if (use_fates_planthydro) call HydrSiteColdStart(this%fates(nc)%sites,this%fates(nc)%bc_in) end if call init_patches(this%fates(nc)%nsites, this%fates(nc)%sites, & @@ -1470,9 +1530,8 @@ subroutine wrap_photosynthesis(this, nc, bounds, fn, filterp, & use perf_mod , only : t_startf, t_stopf use PatchType , only : patch use quadraticMod , only : quadratic - use EDTypesMod , only : numpft_ed, dinc_ed - use EDtypesMod , only : ed_patch_type, ed_cohort_type, ed_site_type, numpft_ed - use EDEcophysContype , only : EDecophyscon + use EDTypesMod , only : dinc_ed + use EDtypesMod , only : ed_patch_type, ed_cohort_type, ed_site_type ! ! !ARGUMENTS: @@ -2111,7 +2170,7 @@ subroutine ComputeRootSoilFlux(this, bounds_clump, num_filterc, filterc, & integer :: num_filter_fates - if( .not. use_fates_plant_hydro ) return + if( .not. use_fates_planthydro ) return nc = bounds_clump%clump_index @@ -2154,7 +2213,7 @@ end subroutine ComputeRootSoilFlux ! integer :: s ! integer :: c ! -! if (.not. (use_fates .and. use_fates_plant_hydro) ) return +! if (.not. (use_fates .and. use_fates_planthydro) ) return ! ! do s = 1, this%fates(nc)%nsites ! c = this%f2hmap(nc)%fcolumn(s) @@ -2193,7 +2252,7 @@ subroutine wrap_hydraulics_drive(this, bounds_clump, nc, & real(r8) :: dtime - if ( .not.use_fates_plant_hydro ) return + if ( .not.use_fates_planthydro ) return dtime = get_step_size() @@ -2262,10 +2321,10 @@ end subroutine wrap_hydraulics_drive subroutine hlm_bounds_to_fates_bounds(hlm, fates) use FatesIODimensionsMod, only : fates_bounds_type - use EDtypesMod, only : nlevsclass_ed, nlevage_ed + use FatesInterfaceMod, only : nlevsclass, nlevage use EDtypesMod, only : nfsc, ncwd - use EDtypesMod, only : nlevleaf, nclmax, numpft_ed - use EDTypesMod, only : maxpft + use EDtypesMod, only : nlevleaf, nclmax + use FatesInterfaceMod, only : numpft_ed => numpft use clm_varpar, only : nlevgrnd implicit none @@ -2286,19 +2345,19 @@ subroutine hlm_bounds_to_fates_bounds(hlm, fates) fates%ground_end = nlevgrnd fates%sizepft_class_begin = 1 - fates%sizepft_class_end = nlevsclass_ed * maxpft + fates%sizepft_class_end = nlevsclass * numpft_ed fates%size_class_begin = 1 - fates%size_class_end = nlevsclass_ed + fates%size_class_end = nlevsclass fates%pft_class_begin = 1 - fates%pft_class_end = maxpft + fates%pft_class_end = numpft_ed fates%age_class_begin = 1 - fates%age_class_end = nlevage_ed + fates%age_class_end = nlevage fates%sizeage_class_begin = 1 - fates%sizeage_class_end = nlevsclass_ed * nlevage_ed + fates%sizeage_class_end = nlevsclass * nlevage fates%fuel_begin = 1 fates%fuel_end = nfsc diff --git a/src/utils/clmfates_paraminterfaceMod.F90 b/src/utils/clmfates_paraminterfaceMod.F90 index ff70fc8c03..4fc12fdc31 100644 --- a/src/utils/clmfates_paraminterfaceMod.F90 +++ b/src/utils/clmfates_paraminterfaceMod.F90 @@ -223,7 +223,9 @@ subroutine ParametersFromNetCDF(filename, is_host_file, fates_params) size_dim_1 = dimension_sizes(1) size_dim_2 = dimension_sizes(2) case default + write(fates_log(),*) 'dimension shape:',dimension_shape call endrun(msg='unsupported number of dimensions reading parameters.') + end select write(fates_log(), *) 'clmfates_interfaceMod.F90:: reading '//trim(name) call readNcdio(ncid, name, dimension_shape, dimension_names, subname, data(1:size_dim_1, 1:size_dim_2))