Skip to content

Commit

Permalink
Merge pull request #676 from rgknox/rgknox-fix-lning-interf
Browse files Browse the repository at this point in the history
Added interface for spitfire definitions
  • Loading branch information
glemieux authored Jul 30, 2020
2 parents e9f6327 + 647c78b commit 3248e63
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 11 deletions.
23 changes: 12 additions & 11 deletions fire/SFMainMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,13 @@ module SFMainMod
use FatesInterfaceTypesMod , only : hlm_masterproc ! 1= master process, 0=not master process
use EDTypesMod , only : numWaterMem
use FatesGlobals , only : fates_log

use FatesInterfaceTypesMod , only : bc_in_type

use FatesInterfaceTypesMod, only : hlm_spitfire_mode
use FatesInterfaceTypesMod, only : hlm_sf_nofire_def
use FatesInterfaceTypesMod, only : hlm_sf_scalar_lightning_def
use FatesInterfaceTypesMod, only : hlm_sf_successful_ignitions_def
use FatesInterfaceTypesMod, only : hlm_sf_anthro_ignitions_def
use FatesInterfaceTypesMod, only : bc_in_type

use EDPftvarcon , only : EDPftvarcon_inst

use EDTypesMod , only : element_pos
Expand Down Expand Up @@ -41,9 +45,6 @@ module SFMainMod
use PRTGenericMod, only : SetState
use FatesInterfaceTypesMod , only : numpft

use CNFireFactoryMod, only: no_fire, scalar_lightning, &
lightning_from_data, successful_ignitions, anthro_ignitions

implicit none
private

Expand Down Expand Up @@ -75,7 +76,7 @@ module SFMainMod
! ============================================================================
subroutine fire_model( currentSite, bc_in)

use FatesInterfaceTypesMod, only : hlm_spitfire_mode


type(ed_site_type) , intent(inout), target :: currentSite
type(bc_in_type) , intent(in) :: bc_in
Expand All @@ -95,7 +96,7 @@ subroutine fire_model( currentSite, bc_in)
write(fates_log(),*) 'spitfire_mode', hlm_spitfire_mode
endif

if( hlm_spitfire_mode > no_fire )then
if( hlm_spitfire_mode > hlm_sf_nofire_def )then
call fire_danger_index(currentSite, bc_in)
call wind_effect(currentSite, bc_in)
call charecteristics_of_fuel(currentSite)
Expand Down Expand Up @@ -698,7 +699,7 @@ subroutine area_burnt_intensity ( currentSite, bc_in )

! Equation 7 from Venevsky et al GCB 2002 (modification of equation 8 in Thonicke et al. 2010)
! FDI 0.1 = low, 0.3 moderate, 0.75 high, and 1 = extreme ignition potential for alpha 0.000337
if (hlm_spitfire_mode == successful_ignitions) then
if (hlm_spitfire_mode == hlm_sf_successful_ignitions_def) then
currentSite%FDI = 1.0_r8 ! READING "SUCCESSFUL IGNITION" DATA
! force ignition potential to be extreme
cloud_to_ground_strikes = 1.0_r8 ! cloud_to_ground = 1 = use 100% incoming observed ignitions
Expand All @@ -709,7 +710,7 @@ subroutine area_burnt_intensity ( currentSite, bc_in )

!NF = number of lighting strikes per day per km2 scaled by cloud to ground strikes
iofp = currentSite%oldest_patch%patchno
if (hlm_spitfire_mode == scalar_lightning) then
if (hlm_spitfire_mode == hlm_sf_scalar_lightning_def ) then
currentSite%NF = ED_val_nignitions * years_per_day * cloud_to_ground_strikes
else ! use external daily lightning ignition data
currentSite%NF = bc_in%lightning24(iofp) * cloud_to_ground_strikes
Expand All @@ -720,7 +721,7 @@ subroutine area_burnt_intensity ( currentSite, bc_in )

! Calculate anthropogenic ignitions according to Li et al. (2012)
! Add to ignitions by lightning
if (hlm_spitfire_mode == anthro_ignitions) then
if (hlm_spitfire_mode == hlm_sf_anthro_ignitions_def) then
! anthropogenic ignitions (count/km2/day)
! = ignitions/person/month * 6.8 * population_density **0.43 /approximate days per month
anthro_ign_count = pot_hmn_ign_counts_alpha * 6.8_r8 * bc_in%pop_density(iofp)**0.43_r8 / 30._r8
Expand Down
55 changes: 55 additions & 0 deletions main/FatesInterfaceMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1000,6 +1000,10 @@ subroutine set_fates_ctrlparms(tag,ival,rval,cval)
hlm_use_vertsoilc = unset_int
hlm_parteh_mode = unset_int
hlm_spitfire_mode = unset_int
hlm_sf_nofire_def = unset_int
hlm_sf_scalar_lightning_def = unset_int
hlm_sf_successful_ignitions_def = unset_int
hlm_sf_anthro_ignitions_def = unset_int
hlm_use_planthydro = unset_int
hlm_use_lu_harvest = unset_int
hlm_num_lu_harvest_cats = unset_int
Expand Down Expand Up @@ -1222,7 +1226,33 @@ subroutine set_fates_ctrlparms(tag,ival,rval,cval)
end if
call endrun(msg=errMsg(sourcefile, __LINE__))
end if
if(hlm_sf_nofire_def .eq. unset_int) then
if (fates_global_verbose()) then
write(fates_log(), *) 'definition of no-fire mode unset: hlm_sf_nofire_def, exiting'
end if
call endrun(msg=errMsg(sourcefile, __LINE__))
end if
if(hlm_sf_scalar_lightning_def .eq. unset_int) then
if (fates_global_verbose()) then
write(fates_log(), *) 'definition of scalar lightning mode unset: hlm_sf_scalltng_def, exiting'
end if
call endrun(msg=errMsg(sourcefile, __LINE__))
end if
if(hlm_sf_successful_ignitions_def .eq. unset_int) then
if (fates_global_verbose()) then
write(fates_log(), *) 'definition of successful ignition mode unset: hlm_sf_successful, exiting'
end if
call endrun(msg=errMsg(sourcefile, __LINE__))
end if
if(hlm_sf_anthro_ignitions_def .eq. unset_int) then
if (fates_global_verbose()) then
write(fates_log(), *) 'definition of anthro-ignition mode unset: hlm_sf_anthig_def, exiting'
end if
call endrun(msg=errMsg(sourcefile, __LINE__))
end if



if(hlm_use_fixed_biogeog.eq.unset_int) then
if(fates_global_verbose()) then
write(fates_log(), *) 'switch for fixed biogeog unset: him_use_fixed_biogeog, exiting'
Expand Down Expand Up @@ -1320,8 +1350,33 @@ subroutine set_fates_ctrlparms(tag,ival,rval,cval)
hlm_spitfire_mode = ival
if (fates_global_verbose()) then
write(fates_log(),*) 'Transfering hlm_spitfire_mode =',ival,' to FATES'
end if

case('sf_nofire_def')
hlm_sf_nofire_def = ival
if (fates_global_verbose()) then
write(fates_log(),*) 'Transfering hlm_sf_nofire_def =',ival,' to FATES'
end if

case('sf_scalar_lightning_def')
hlm_sf_scalar_lightning_def = ival
if (fates_global_verbose()) then
write(fates_log(),*) 'Transfering hlm_sf_scalar_lightning_def =',ival,' to FATES'
end if

case('sf_successful_ignitions_def')
hlm_sf_successful_ignitions_def = ival
if (fates_global_verbose()) then
write(fates_log(),*) 'Transfering hlm_sf_successful_ignition_def =',ival,' to FATES'
end if

case('sf_anthro_ignitions_def')
hlm_sf_anthro_ignitions_def = ival
if (fates_global_verbose()) then
write(fates_log(),*) 'Transfering hlm_sf_anthro_ignition_def =',ival,' to FATES'
end if


case('use_fixed_biogeog')
hlm_use_fixed_biogeog = ival
if (fates_global_verbose()) then
Expand Down
7 changes: 7 additions & 0 deletions main/FatesInterfaceTypesMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,13 @@ module FatesInterfaceTypesMod
! harvest_rates in dynHarvestMod
! bc_in%hlm_harvest_rates and bc_in%hlm_harvest_catnames


integer, public :: hlm_sf_nofire_def ! Definition of a no-fire case for hlm_spitfire_mode
integer, public :: hlm_sf_scalar_lightning_def ! Definition of a scalar-lightning case for hlm_spitfire_mode
integer, public :: hlm_sf_successful_ignitions_def ! Definition of a successful-ignition dataset case for hlm_spitfire_mode
integer, public :: hlm_sf_anthro_ignitions_def ! Definition of an anthropogenic-ignition dataset case for hlm_spitfire_mode


integer, public :: hlm_use_logging ! This flag signals whether or not to use
! the logging module
! If hlm_use_lu_harvest is zero,
Expand Down

0 comments on commit 3248e63

Please sign in to comment.