Skip to content

Commit

Permalink
Merge branch 'fates_landuse' of https://github.com/ckoven/CTSM into f…
Browse files Browse the repository at this point in the history
…ates_landuse
  • Loading branch information
ckoven committed Jul 28, 2020
2 parents 22d3e39 + 70282d8 commit 2922c98
Show file tree
Hide file tree
Showing 24 changed files with 873 additions and 71 deletions.
2 changes: 1 addition & 1 deletion Externals_CLM.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
local_path = src/fates
protocol = git
repo_url = https://github.com/NGEET/fates
tag = sci.1.36.0_api.11.2.0
tag = sci.1.40.0_api.13.0.0
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')) ) {
$nl_flags->{$var} = ".true.";
} else {
$nl_flags->{$var} = ".false.";
Expand Down Expand Up @@ -3892,7 +3893,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>

<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
15 changes: 11 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,16 @@ 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.
Allowed values are:
1 : use a global constant lightning rate found in fates_params.
2 : use an external lightning dataset.
3 : use an external confirmed ignitions dataset.
4 : use external lightning and population datasets to simulate both natural and anthropogenic
ignitions.
</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",
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,26 @@
Testing capability to read/use lightning frequency & population density
datasets. Calculates lightning ignitions using the SPITFIRE
formulation and anthropogenic ignitions using the Li et al. 2012 formulation
based on human population density implemented in CTSM-CN's fire model.

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

53 changes: 53 additions & 0 deletions src/biogeochem/CNFireFactoryMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,18 @@ 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

! These parameters set the ranges of the cases in subroutine
! create_fates_fire_data_method. We declare them public in order to
! use them as flags elsewhere in the CTSM and FATES-SPITFIRE.
! They correspond one-to-one to the fates_spitfire_mode options listed
! in bld/namelist_files/namelist_definition_clm4_5.xml
integer, public, parameter :: no_fire = 0 ! value of no_fire mode
integer, public, parameter :: scalar_lightning = 1 ! value of scalar_lightning mode
integer, public, parameter :: lightning_from_data = 2 ! value of lightning_from_data mode
integer, public, parameter :: successful_ignitions = 3 ! value of successful_ignitions mode
integer, public, parameter :: anthro_ignitions = 4 ! value of anthro_ignitions mode

! !PRIVATE DATA MEMBERS:
character(len=80), private :: fire_method = "li2014qianfrc"
Expand Down Expand Up @@ -121,5 +133,46 @@ 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

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_from_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

0 comments on commit 2922c98

Please sign in to comment.