Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend CNFireMethodMod with a FATESFireData class #991

Merged
merged 34 commits into from
Jul 23, 2020
Merged
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
51f3107
Extend CNFireMethodMod with a FATESFireData class
slevis-lmwg Apr 24, 2020
af1f812
Revisions based on code review by @ekluzek
slevis-lmwg Apr 27, 2020
4e7a95a
Revisions part 2 based on comments by @ekluzek @jkshuman @lmkueppers
slevis-lmwg Apr 29, 2020
fb2119b
Revisions part 3 based on @ekluzek's review
slevis-lmwg Apr 29, 2020
78fb2db
Move InterpFileInputs and Init2 to clmfates_interfaceMod
slevis-lmwg May 7, 2020
67b82a1
Added if (use_cn) around reading/interpolating population density
slevis-lmwg May 7, 2020
2fc0ede
Corrections that reduce the number of compilation errors to two
slevis-lmwg May 8, 2020
49d2ee6
Corrections for the code to compile
slevis-lmwg May 8, 2020
c6fdf8c
Changes needed so that fates_fire_data_method is local to clmfates_in…
ekluzek May 8, 2020
261a01c
Update to Sam's FATES branch for the lightning reading
ekluzek May 8, 2020
35ec07f
Make lnfm24 data private add an get method for it
ekluzek May 8, 2020
9866d97
Get everything consistent and building
ekluzek May 29, 2020
8446296
Use integer value for use_fates_spitfire now
ekluzek May 29, 2020
f530c99
Add FATES fire base class
ekluzek May 29, 2020
754b1dc
Minor corrections for clm-fates to run with a lightning dataset
slevis-lmwg Jun 4, 2020
3f643ef
Merge branch 'fates_next_api' into lightning_v2_ctsm
slevis-lmwg Jun 5, 2020
e3c4bc7
Additional conflicts resolved; revisions in response to rgknox's review
slevis-lmwg Jun 5, 2020
d6c9b70
Merge branch 'fates_next_api' into lightning_v2_ctsm
slevis-lmwg Jun 6, 2020
0629073
Correction to part of a previous conflict resolution
slevis-lmwg Jun 6, 2020
e542dfe
Added new FATES test that exercises the lightning dataset code
slevis-lmwg Jun 7, 2020
ffd5edb
Minor corrections from self-reviewing the PR
slevis-lmwg Jun 8, 2020
e011c10
Reassigned expected test fail to issue #667
slevis-lmwg Jun 8, 2020
35c9b8a
Updates needed for anthropogenic ignitions in FATES-SPITFIRE
slevis-lmwg Jul 11, 2020
ee8a91d
Minor clean-up
slevis-lmwg Jul 11, 2020
e125730
Small corrections to get test simulation to run
slevis-lmwg Jul 12, 2020
b583b4f
Added some comments to the code
slevis-lmwg Jul 12, 2020
3a08127
Changed walltime on new test to avoid timeout
slevis-lmwg Jul 12, 2020
4cd75f6
Update bld/namelist_files/namelist_definition_clm4_5.xml
slevis-lmwg Jul 14, 2020
d1b7f16
Update cime_config/testdefs/testmods_dirs/clm/Fates_nat_and_anthro_ig…
slevis-lmwg Jul 14, 2020
f68ac40
Update src/main/clm_varctl.F90
slevis-lmwg Jul 14, 2020
89cdc67
Update src/main/clm_varctl.F90
slevis-lmwg Jul 15, 2020
8f3d430
Made spitfire_mode flags public for use throughout CTSM-FATES
slevis-lmwg Jul 18, 2020
4596717
updating externals_clm configuration
glemieux Jul 22, 2020
4bed6e2
Merge pull request #2 from glemieux/lightning_v2_ctsm-externals
slevis-lmwg Jul 23, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Externals_CLM.cfg
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[fates]
local_path = src/fates
protocol = git
repo_url = https://github.com/NGEET/fates
tag = sci.1.36.0_api.11.2.0
repo_url = https://github.com/slevisconsulting/fates
branch = lightning_v2_fates
required = True

[PTCLM]
Expand Down
11 changes: 6 additions & 5 deletions bld/CLMBuildNamelist.pm
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,7 @@ sub setup_cmdl_fates_mode {
}
} else {
# 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",
my @list = ( "fates_spitfire_mode", "use_fates_planthydro", "use_fates_ed_st3", "use_fates_ed_prescribed_phys",
"use_fates_cohort_age_tracking",
"use_fates_inventory_init","use_fates_fixed_biogeog", "fates_inventory_ctrl_filename","use_fates_logging","fates_parteh_mode" );
foreach my $var ( @list ) {
Expand Down Expand Up @@ -940,12 +940,13 @@ sub setup_cmdl_fire_light_res {
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'fire_method');
}
my $fire_method = remove_leading_and_trailing_quotes( $nl->get_value('fire_method') );
if ( defined($fire_method) && ! &value_is_true($nl_flags->{'use_cn'}) ) {
$log->fatal_error("fire_method is being set even though bgc is NOT cn or bgc.");
if ( defined($fire_method) && ! &value_is_true($nl_flags->{'use_cn'}) && ! &value_is_true($nl_flags->{'use_fates'}) ) {
$log->fatal_error("fire_method is being set while use_cn and use_fates are both false.");
}
if ( defined($fire_method) && $fire_method eq "nofire" ) {
$nl_flags->{$var} = ".false.";
} elsif ( &value_is_true($nl->get_value('use_cn')) ) {
# } elsif ( &value_is_true($nl->get_value('use_cn')) || $nl_flags->{'fates_spitfire_mode'} > 1 ) {
} elsif ( &value_is_true($nl->get_value('use_cn')) || &value_is_true($nl->get_value('use_fates')) ) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New line 949 works

    } elsif ( &value_is_true($nl->get_value('use_cn')) || &value_is_true($nl->get_value('use_fates')) ) {

However, I wish the commented-out line above it would work because it would narrow things down, but it doesn't work. The run proceeds to the next else and sets cnfireson = .false..

@ekluzek do you see an obvious problem with new line 948?

$nl_flags->{$var} = ".true.";
} else {
$nl_flags->{$var} = ".false.";
Expand Down Expand Up @@ -3897,7 +3898,7 @@ sub setup_logic_fates {

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, 'fates_paramfile', 'phys'=>$nl_flags->{'phys'});
my @list = ( "use_fates_spitfire", "use_fates_planthydro", "use_fates_ed_st3", "use_fates_ed_prescribed_phys",
my @list = ( "fates_spitfire_mode", "use_fates_planthydro", "use_fates_ed_st3", "use_fates_ed_prescribed_phys",
"use_fates_inventory_init","use_fates_fixed_biogeog", "use_fates_logging","fates_parteh_mode", "use_fates_cohort_age_tracking" );
foreach my $var ( @list ) {
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, 'use_fates'=>$nl_flags->{'use_fates'} );
Expand Down
54 changes: 53 additions & 1 deletion bld/namelist_files/namelist_defaults_clm4_5.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1134,14 +1134,20 @@ lnd/clm2/surfdata_map/landuse.timeseries_ne30np4_hist_16pfts_Irrig_CMIP6_simyr18
<light_res use_cn=".true." fire_method="nofire" >none</light_res>
<light_res use_cn=".true." phys="clm4_5" >94x192</light_res>
<light_res use_cn=".true." phys="clm5_0" >94x192</light_res>
<light_res use_fates=".true." phys="clm4_5" >360x720</light_res>
<light_res use_fates=".true." phys="clm5_0" >360x720</light_res>
ekluzek marked this conversation as resolved.
Show resolved Hide resolved

<stream_year_first_lightng use_cn=".true." >0001</stream_year_first_lightng>
<stream_year_last_lightng use_cn=".true." >0001</stream_year_last_lightng>
<stream_year_first_lightng use_fates=".true.">0001</stream_year_first_lightng>
<stream_year_last_lightng use_fates=".true.">0001</stream_year_last_lightng>

<stream_fldfilename_lightng hgrid="94x192" use_cn=".true." >atm/datm7/NASA_LIS/clmforc.Li_2012_climo1995-2011.T62.lnfm_Total_c140423.nc</stream_fldfilename_lightng>
<stream_fldfilename_lightng hgrid="360x720" use_cn=".true." >atm/datm7/NASA_LIS/clmforc.Li_2016_climo1995-2013.360x720.lnfm_Total_c160825.nc</stream_fldfilename_lightng>
<stream_fldfilename_lightng use_fates=".true." >atm/datm7/NASA_LIS/clmforc.Li_2016_climo1995-2013.360x720.lnfm_Total_c160825.nc</stream_fldfilename_lightng>

<lightngmapalgo use_cn=".true." >bilinear</lightngmapalgo>
<lightngmapalgo use_fates=".true." >bilinear</lightngmapalgo>

<lightngmapalgo use_cn=".true." hgrid="1x1_brazil" >nn</lightngmapalgo>
<lightngmapalgo use_cn=".true." hgrid="1x1_mexicocityMEX" >nn</lightngmapalgo>
Expand Down Expand Up @@ -1178,6 +1184,24 @@ lnd/clm2/surfdata_map/landuse.timeseries_ne30np4_hist_16pfts_Irrig_CMIP6_simyr18
<stream_year_first_popdens use_cn=".true." sim_year="constant" sim_year_range="1000-1004" >2000</stream_year_first_popdens>
<stream_year_last_popdens use_cn=".true." sim_year="constant" sim_year_range="1000-1004" >2000</stream_year_last_popdens>

<stream_year_first_popdens use_fates=".true." sim_year="2010" >2010</stream_year_first_popdens>
<stream_year_last_popdens use_fates=".true." sim_year="2010" >2010</stream_year_last_popdens>

<stream_year_first_popdens use_fates=".true." sim_year="2000" >2000</stream_year_first_popdens>
<stream_year_last_popdens use_fates=".true." sim_year="2000" >2000</stream_year_last_popdens>

<stream_year_first_popdens use_fates=".true." sim_year="1850" >1850</stream_year_first_popdens>
<stream_year_last_popdens use_fates=".true." sim_year="1850" >1850</stream_year_last_popdens>

<stream_year_first_popdens use_fates=".true." sim_year="1000" >2000</stream_year_first_popdens>
<stream_year_last_popdens use_fates=".true." sim_year="1000" >2000</stream_year_last_popdens>

<stream_year_first_popdens use_fates=".true." sim_year="constant" sim_year_range="1000-1002" >2000</stream_year_first_popdens>
<stream_year_last_popdens use_fates=".true." sim_year="constant" sim_year_range="1000-1002" >2000</stream_year_last_popdens>

<stream_year_first_popdens use_fates=".true." sim_year="constant" sim_year_range="1000-1004" >2000</stream_year_first_popdens>
<stream_year_last_popdens use_fates=".true." sim_year="constant" sim_year_range="1000-1004" >2000</stream_year_last_popdens>

<stream_fldfilename_popdens hgrid="0.5x0.5" use_cn=".true." >lnd/clm2/firedata/clmforc.Li_2017_HYDEv3.2_CMIP6_hdm_0.5x0.5_AVHRR_simyr1850-2016_c180202.nc</stream_fldfilename_popdens>
<stream_fldfilename_popdens hgrid="0.5x0.5" use_cn=".true." ssp_rcp="SSP1-1.9" >lnd/clm2/firedata/clmforc.Li_2018_SSP1_CMIP6_hdm_0.5x0.5_AVHRR_simyr1850-2100_c181205.nc
</stream_fldfilename_popdens>
Expand All @@ -1196,6 +1220,24 @@ lnd/clm2/surfdata_map/landuse.timeseries_ne30np4_hist_16pfts_Irrig_CMIP6_simyr18
<stream_fldfilename_popdens hgrid="0.5x0.5" use_cn=".true." ssp_rcp="SSP5-3.4" >lnd/clm2/firedata/clmforc.Li_2018_SSP5_CMIP6_hdm_0.5x0.5_AVHRR_simyr1850-2100_c181205.nc
</stream_fldfilename_popdens>

<stream_fldfilename_popdens hgrid="0.5x0.5" use_fates=".true." >lnd/clm2/firedata/clmforc.Li_2017_HYDEv3.2_CMIP6_hdm_0.5x0.5_AVHRR_simyr1850-2016_c180202.nc</stream_fldfilename_popdens>
<stream_fldfilename_popdens hgrid="0.5x0.5" use_fates=".true." ssp_rcp="SSP1-1.9" >lnd/clm2/firedata/clmforc.Li_2018_SSP1_CMIP6_hdm_0.5x0.5_AVHRR_simyr1850-2100_c181205.nc
</stream_fldfilename_popdens>
<stream_fldfilename_popdens hgrid="0.5x0.5" use_fates=".true." ssp_rcp="SSP1-2.6" >lnd/clm2/firedata/clmforc.Li_2018_SSP1_CMIP6_hdm_0.5x0.5_AVHRR_simyr1850-2100_c181205.nc
</stream_fldfilename_popdens>
<stream_fldfilename_popdens hgrid="0.5x0.5" use_fates=".true." ssp_rcp="SSP2-4.5" >lnd/clm2/firedata/clmforc.Li_2018_SSP2_CMIP6_hdm_0.5x0.5_AVHRR_simyr1850-2100_c181205.nc
</stream_fldfilename_popdens>
<stream_fldfilename_popdens hgrid="0.5x0.5" use_fates=".true." ssp_rcp="SSP3-7.0" >lnd/clm2/firedata/clmforc.Li_2018_SSP3_CMIP6_hdm_0.5x0.5_AVHRR_simyr1850-2100_c181205.nc
</stream_fldfilename_popdens>
<stream_fldfilename_popdens hgrid="0.5x0.5" use_fates=".true." ssp_rcp="SSP4-6.0" >lnd/clm2/firedata/clmforc.Li_2018_SSP4_CMIP6_hdm_0.5x0.5_AVHRR_simyr1850-2100_c181205.nc
</stream_fldfilename_popdens>
<stream_fldfilename_popdens hgrid="0.5x0.5" use_fates=".true." ssp_rcp="SSP4-3.4" >lnd/clm2/firedata/clmforc.Li_2018_SSP4_CMIP6_hdm_0.5x0.5_AVHRR_simyr1850-2100_c181205.nc
</stream_fldfilename_popdens>
<stream_fldfilename_popdens hgrid="0.5x0.5" use_fates=".true." ssp_rcp="SSP5-8.5" >lnd/clm2/firedata/clmforc.Li_2018_SSP5_CMIP6_hdm_0.5x0.5_AVHRR_simyr1850-2100_c181205.nc
</stream_fldfilename_popdens>
<stream_fldfilename_popdens hgrid="0.5x0.5" use_fates=".true." ssp_rcp="SSP5-3.4" >lnd/clm2/firedata/clmforc.Li_2018_SSP5_CMIP6_hdm_0.5x0.5_AVHRR_simyr1850-2100_c181205.nc
</stream_fldfilename_popdens>

<popdensmapalgo use_cn=".true." >bilinear</popdensmapalgo>

<popdensmapalgo use_cn=".true." hgrid="1x1_brazil" >nn</popdensmapalgo>
Expand All @@ -1206,6 +1248,16 @@ lnd/clm2/surfdata_map/landuse.timeseries_ne30np4_hist_16pfts_Irrig_CMIP6_simyr18
<popdensmapalgo use_cn=".true." hgrid="1x1_asphaltjungleNJ" >nn</popdensmapalgo>
<popdensmapalgo use_cn=".true." hgrid="5x5_amazon" >nn</popdensmapalgo>

<popdensmapalgo use_fates=".true." >bilinear</popdensmapalgo>

<popdensmapalgo use_fates=".true." hgrid="1x1_brazil" >nn</popdensmapalgo>
<popdensmapalgo use_fates=".true." hgrid="1x1_mexicocityMEX" >nn</popdensmapalgo>
<popdensmapalgo use_fates=".true." hgrid="1x1_vancouverCAN" >nn</popdensmapalgo>
<popdensmapalgo use_fates=".true." hgrid="1x1_urbanc_alpha" >nn</popdensmapalgo>
<popdensmapalgo use_fates=".true." hgrid="1x1_camdenNJ" >nn</popdensmapalgo>
<popdensmapalgo use_fates=".true." hgrid="1x1_asphaltjungleNJ" >nn</popdensmapalgo>
<popdensmapalgo use_fates=".true." hgrid="5x5_amazon" >nn</popdensmapalgo>

<!-- Urban time varying streams namelist defaults -->
<stream_year_first_urbantv phys="clm5_0" sim_year_range="1850-2100" >2015</stream_year_first_urbantv>
<stream_year_last_urbantv phys="clm5_0" sim_year_range="1850-2100" >2106</stream_year_last_urbantv>
Expand Down Expand Up @@ -2639,7 +2691,7 @@ lnd/clm2/surfdata_map/landuse.timeseries_ne30np4_hist_16pfts_Irrig_CMIP6_simyr18
<use_nitrif_denitrif bgc_mode="fates" >.false.</use_nitrif_denitrif>

<!-- ===== FATES DEFAULTS =========== -->
<use_fates_spitfire use_fates=".true.">.false.</use_fates_spitfire>
<fates_spitfire_mode use_fates=".true.">0</fates_spitfire_mode>
<use_fates_planthydro use_fates=".true.">.false.</use_fates_planthydro>
<use_fates_cohort_age_tracking use_fates=".true.">.false.</use_fates_cohort_age_tracking>
<use_fates_ed_st3 use_fates=".true.">.false.</use_fates_ed_st3>
Expand Down
14 changes: 10 additions & 4 deletions bld/namelist_files/namelist_definition_clm4_5.xml
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ formulation (1).
</entry>

<entry id="fire_method" type="char*80" category="clm_physics"
group="cnfire_inparm" valid_values="nofire,li2014qianfrc,li2016crufrc" >
group="cnfire_inparm" valid_values="nofire,li2014qianfrc,li2016crufrc,spitfire" >
The method type to use for CNFire

nofire: Turn fire effects off
Expand Down Expand Up @@ -618,9 +618,15 @@ Toggle to turn on the FATES model
Switch deciding which nutrient model to use in FATES.
</entry>

<entry id="use_fates_spitfire" type="logical" category="physics"
group="clm_inparm" valid_values="" value=".false.">
Toggle to turn on spitfire module for modeling fire (only relevant if FATES is being used).
<entry id="fates_spitfire_mode" type="integer" category="physics"
group="clm_inparm" valid_values="0,1,2,3,4" value=".false.">
Turn on spitfire module to simulate fire by setting fates_spitfire_mode > 0.
Relevant only if use_fates = .true.. Set to 1 for no external ignition
inputs and use of a global constant lightning rate found in fates_params.
Set to 2 to use an external lightning dataset. Set to 3 to use an
external confirmed ignitions dataset. Set to 4 to use external lightning
and population datasets so as to simulate both natural and anthropogenic
ignitions.
slevis-lmwg marked this conversation as resolved.
Show resolved Hide resolved
</entry>

<entry id="use_fates_fixed_biogeog" type="logical" category="physics"
Expand Down
2 changes: 1 addition & 1 deletion bld/unit_testers/build-namelist_test.pl
Original file line number Diff line number Diff line change
Expand Up @@ -822,7 +822,7 @@ sub make_env_run {
conopts=>"-phys clm4_0",
},
"usespitfireButNOTFATES" =>{ options=>"-envxml_dir . -no-megan",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this allow use spitfire without FATES? The name suggests that to me...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jkshuman this belongs to a list of options that trigger namelist FAILs. The specific one triggers a failure if fates_spitfire_mode > 0 and -bgc has not been set to fates.

namelst=>"use_fates_spitfire=.true.",
namelst=>"fates_spitfire_mode>0",
GLC_TWO_WAY_COUPLING=>"FALSE",
conopts=>"-phys clm4_5",
},
Expand Down
2 changes: 1 addition & 1 deletion cime_config/testdefs/ExpectedTestFails.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</category>
<category name="fates">
<entry issue="NGEET/fates/#559" >FAIL SMS_Lm3_D_Mmpi-serial.1x1_brazil.I2000Clm50FatesCruGs.cheyenne_intel.clm-FatesHydro RUN</entry>
<entry issue="667" >FAIL ERS_D_Ld5.1x1_brazil.I2000Clm50FatesCruGs.cheyenne_intel.clm-FatesHydro COMPARE_base_rest</entry>
<entry issue="667" >FAIL ERS_D_Lm12.1x1_brazil.I2000Clm50FatesCruGs.cheyenne_intel.clm-Fates_nat_and_anthro_ignitions COMPARE_base_rest</entry>
<entry issue="667" >FAIL ERS_D_Ld5.1x1_brazil.I2000Clm50FatesCruGs.hobart_nag.clm-FatesHydro RUN</entry>
<entry issue="667" >FAIL ERS_D_Ld5.1x1_brazil.I2000Clm50FatesCruGs.izumi_nag.clm-FatesHydro RUN</entry>
<entry issue="NGEET/fates/#510" >FAIL SMS_Lm3_D_Mmpi-serial.1x1_brazil.I2000Clm50FatesCruGs.hobart_nag.clm-FatesHydro MEMLEAK</entry>
Expand Down
8 changes: 8 additions & 0 deletions cime_config/testdefs/testlist_clm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2018,6 +2018,14 @@
<option name="wallclock">00:40:00</option>
</options>
</test>
<test name="ERS_D_Lm12" grid="1x1_brazil" compset="I2000Clm50FatesCruGs" testmods="clm/Fates_nat_and_anthro_ignitions">
<machines>
<machine name="cheyenne" compiler="intel" category="fates"/>
</machines>
<options>
<option name="wallclock">01:00:00</option>
</options>
</test>
<test name="SMS_Lm1" grid="f10_f10_musgs" compset="I1850Clm50BgcCropCmip6waccm" testmods="clm/basic">
<machines>
<machine name="cheyenne" compiler="gnu" category="aux_clm"/>
Expand Down
2 changes: 1 addition & 1 deletion cime_config/testdefs/testmods_dirs/clm/Fates/user_nl_clm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
hist_mfilt = 365
hist_nhtfrq = -24
hist_empty_htapes = .true.
use_fates_spitfire= .true.
fates_spitfire_mode = 1
hist_fincl1 = 'NPP','GPP','BTRAN','H2OSOI','TLAI','LITTER_IN_ELEM','LITTER_OUT_ELEM',
'FIRE_AREA','SCORCH_HEIGHT','FIRE_INTENSITY','FIRE_TFC_ROS','FIRE_FUEL_MEF',
'FIRE_FUEL_BULKD','FIRE_FUEL_SAV','FIRE_NESTEROV_INDEX','PFTbiomass',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
hist_mfilt = 365
hist_nhtfrq = -24
hist_empty_htapes = .false.
use_fates_spitfire= .true.
fates_spitfire_mode = 1
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',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
hist_mfilt = 365
hist_nhtfrq = -24
hist_empty_htapes = .true.
use_fates_spitfire= .true.
fates_spitfire_mode = 1
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',
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
use_fates_spitfire= .false.
fates_spitfire_mode = 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Testing capability to read/use lightning frequency & population density
datasets. Calculates natural ignitions from lightning using the SPITFIRE
formulation and anthropogenic ignitions using the Li et al. formulation
copied from CTSM-CN's fire model.
slevis-lmwg marked this conversation as resolved.
Show resolved Hide resolved

Testing does not include a separate test for reading/using a successful
ignitions dataset which uses the same format and units so handling
is the same until you're in subroutine area_burnt_intensity where for
"successful ignitions" the model selects
currentSite%FDI = 1.0_r8
cloud_to_ground_strikes = 1.0_r8
while for lightning the model can use values < 1 for both.

Lara Kueppers (UC-Berkeley) has access to a "successful ignitions"
dataset for California that has not been placed in the repository of
CTSM datasets as of 2020/6/6. That dataset can be used with the
following settings:

fire_method = 'spitfire'
fates_spitfire_mode = 3
stream_fldfilename_lightng = '.../data_UCB/observed/CA_monthly_ignition_number_1980-2016/ignition_1980_to_2016_monthly_20190801.nc'
stream_year_first_lightng = 1980
stream_year_last_lightng = 2016
model_year_align_lightng = 1980

where {...} = /fs/cgd/data0/slevis on izumi and /glade/work/slevis on cheyenne.

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
fire_method = 'spitfire'
fates_spitfire_mode = 4
hist_nhtfrq = 0
hist_mfilt = 1
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
use_fates_spitfire = .true.
fates_spitfire_mode = 1

48 changes: 48 additions & 0 deletions src/biogeochem/CNFireFactoryMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ module CNFireFactoryMod
! !PUBLIC ROUTINES:
public :: CNFireReadNML ! read the fire namelist
public :: create_cnfire_method ! create an object of class cnfire_method_type
public :: create_fates_fire_data_method ! create an object of class cnfire_method_type

! !PRIVATE DATA MEMBERS:
character(len=80), private :: fire_method = "li2014qianfrc"
Expand Down Expand Up @@ -121,5 +122,52 @@ function create_cnfire_method( NLFilename ) result(cnfire_method)
call cnfire_method%CNFireReadNML( NLFilename )

end function create_cnfire_method
!-----------------------------------------------------------------------

!-----------------------------------------------------------------------
subroutine create_fates_fire_data_method( fates_fire_data_method )
!
! !DESCRIPTION:
! Create and return an object of fates_fire_data_method_type.
! The particular type is determined based on a namelist parameter.
!
! !USES:
use clm_varctl, only: fates_spitfire_mode
use CNFireMethodMod, only: cnfire_method_type
use FATESFireBase, only: fates_fire_base_type
use FATESFireNoDataMod, only: fates_fire_no_data_type
use FATESFireDataMod, only: fates_fire_data_type
!
! !ARGUMENTS:
class(fates_fire_base_type), allocatable, intent(inout) :: fates_fire_data_method ! function result
!
! !LOCAL VARIABLES:
integer :: current_case
! The following parameters set the ranges of the cases below.
! NB. The same parameters are set in /fates/fire/SFMainMod
integer, parameter :: no_fire = 0 ! value of no_fire mode
integer, parameter :: scalar_lightning = 1 ! value of scalar_lightning mode
integer, parameter :: lightning_data = 2 ! value of lightning_data mode
integer, parameter :: anthro_ignitions = 4 ! value of anthro_ignitions mode

character(len=*), parameter :: subname = 'create_fates_fire_data_method'
!-----------------------------------------------------------------------

current_case = fates_spitfire_mode

select case (current_case)

case (no_fire:scalar_lightning)
allocate(fates_fire_no_data_type :: fates_fire_data_method)
case (lightning_data:anthro_ignitions)
allocate(fates_fire_data_type :: fates_fire_data_method)

case default
write(iulog,*) subname//' ERROR: unknown method: ', fates_spitfire_mode
call endrun(msg=errMsg(sourcefile, __LINE__))

end select

end subroutine create_fates_fire_data_method

end module CNFireFactoryMod
Loading