Skip to content

Commit

Permalink
Autoselect FDI and NF according to lightning/ignition data availability
Browse files Browse the repository at this point in the history
1. If user sets stream_fldfilename_lightng = 'nofile' in user_nl_clm,
   then FATES will use ED_val_nignitions from FATES params to calculate
   NF, i.e. the FATES default lightning value that is constant in time
   and space.
2. If user does not set stream_fldfilename_lightng in user_nl_clm, then
   FATES will read the Li 2016 lightning data set to calculate NF. This
   is a 1-degree x 1-degree 3-hourly climatological data set, so it
   varies in time and space without interannual variability.
3. If user sets stream_fldfilename_lightng to a lightning data set, then
   FATES will read the corresponding data set as in (2).
4. If user sets stream_fldfilename_lightng to a file name that contains
   the string "ignition", then FATES will do as in (2) and set FDI = 1
   because the data represent successful ignitions rather than
   lightning.
  • Loading branch information
slevis-lmwg committed Aug 9, 2019
1 parent c1903de commit dc8f83a
Showing 1 changed file with 58 additions and 49 deletions.
107 changes: 58 additions & 49 deletions fire/SFMainMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ module SFMainMod

type(shr_strdata_type) :: sdat_lnfm ! Lightning input data stream

character(len=CL) :: stream_fldFileName_lightng ! lightning stream filename to read
character(len=*), parameter, private :: sourcefile = &
__FILE__

Expand Down Expand Up @@ -151,7 +152,6 @@ subroutine InitAccVars(this, bounds)
type(bounds_type), intent(in) :: bounds
!
! !LOCAL VARIABLES:
integer :: g
integer :: begg, endg
integer :: nstep
integer :: ier
Expand Down Expand Up @@ -190,7 +190,6 @@ subroutine UpdateAccVars (this, bounds)
type(bounds_type), intent(in) :: bounds
!
! !LOCAL VARIABLES:
integer :: g
integer :: dtime ! timestep size [seconds]
integer :: nstep ! timestep number
integer :: ier ! error status
Expand Down Expand Up @@ -297,7 +296,6 @@ subroutine lnfm_init( bounds, NLFilename )
integer :: nu_nml ! unit for namelist file
integer :: nml_error ! namelist i/o error flag
type(mct_ggrid) :: dom_clm ! domain information
character(len=CL) :: stream_fldFileName_lightng ! lightning stream filename to read
character(len=CL) :: lightngmapalgo = 'bilinear'! Mapping alogrithm
character(*), parameter :: subName = "('lnfmdyn_init')"
character(*), parameter :: F00 = "('(lnfmdyn_init) ',4a)"
Expand Down Expand Up @@ -346,42 +344,44 @@ subroutine lnfm_init( bounds, NLFilename )
write(iulog,*) ' '
endif

call clm_domain_mct (bounds, dom_clm)

call shr_strdata_create(sdat_lnfm,name="clmlnfm", &
pio_subsystem=pio_subsystem, &
pio_iotype=shr_pio_getiotype(inst_name), &
mpicom=mpicom, compid=comp_id, &
gsmap=gsmap_lnd_gdc2glo, ggrid=dom_clm, &
nxg=ldomain%ni, nyg=ldomain%nj, &
yearFirst=stream_year_first_lightng, &
yearLast=stream_year_last_lightng, &
yearAlign=model_year_align_lightng, &
offset=0, &
domFilePath='', &
domFileName=trim(stream_fldFileName_lightng), &
domTvarName='time', &
domXvarName='lon' , &
domYvarName='lat' , &
domAreaName='area', &
domMaskName='mask', &
filePath='', &
filename=(/trim(stream_fldFileName_lightng)/),&
fldListFile='lnfm', &
fldListModel='lnfm', &
fillalgo='none', &
mapalgo=lightngmapalgo, &
calendar=get_calendar(), &
taxmode='cycle' )

if (masterproc) then
call shr_strdata_print(sdat_lnfm,'Lightning data')
endif

! Add history fields
call hist_addfld1d (fname='LNFM', units='counts/km^2/hr', &
avgflag='A', long_name='Lightning frequency', &
ptr_lnd=forc_lnfm, default='inactive')
if (index(stream_fldFileName_lightng, 'nofile') == 0) then
call clm_domain_mct (bounds, dom_clm)

call shr_strdata_create(sdat_lnfm,name="clmlnfm", &
pio_subsystem=pio_subsystem, &
pio_iotype=shr_pio_getiotype(inst_name), &
mpicom=mpicom, compid=comp_id, &
gsmap=gsmap_lnd_gdc2glo, ggrid=dom_clm, &
nxg=ldomain%ni, nyg=ldomain%nj, &
yearFirst=stream_year_first_lightng, &
yearLast=stream_year_last_lightng, &
yearAlign=model_year_align_lightng, &
offset=0, &
domFilePath='', &
domFileName=trim(stream_fldFileName_lightng), &
domTvarName='time', &
domXvarName='lon' , &
domYvarName='lat' , &
domAreaName='area', &
domMaskName='mask', &
filePath='', &
filename=(/trim(stream_fldFileName_lightng)/),&
fldListFile='lnfm', &
fldListModel='lnfm', &
fillalgo='none', &
mapalgo=lightngmapalgo, &
calendar=get_calendar(), &
taxmode='cycle' )

if (masterproc) then
call shr_strdata_print(sdat_lnfm,'Lightning data')
endif

! Add history fields
call hist_addfld1d (fname='LNFM', units='counts/km^2/hr', &
avgflag='A', long_name='Lightning frequency', &
ptr_lnd=forc_lnfm, default='inactive')
end if

end subroutine lnfm_init

Expand Down Expand Up @@ -409,13 +409,15 @@ subroutine lnfm_interp( bounds )
call get_curr_date(year, mon, day, sec)
mcdate = year*10000 + mon*100 + day

call shr_strdata_advance(sdat_lnfm, mcdate, sec, mpicom, 'lnfmdyn')
if (index(stream_fldFileName_lightng, 'nofile') == 0) then
call shr_strdata_advance(sdat_lnfm, mcdate, sec, mpicom, 'lnfmdyn')

ig = 0
do g = bounds%begg,bounds%endg
ig = ig+1
forc_lnfm(g) = sdat_lnfm%avs(1)%rAttr(1,ig)
end do
ig = 0
do g = bounds%begg,bounds%endg
ig = ig+1
forc_lnfm(g) = sdat_lnfm%avs(1)%rAttr(1,ig)
end do
end if

end subroutine lnfm_interp

Expand Down Expand Up @@ -1032,7 +1034,12 @@ subroutine fire_intensity ( currentSite )

! 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
currentSite%FDI = 1.0_r8 - exp(-SF_val_fdi_alpha*currentSite%acc_NI)
if (index(stream_fldFileName_lightng, 'ignition') > 0) then
currentSite%FDI = 1._r8 ! READING "SUCCESSFUL IGNITION" DATA
else
currentSite%FDI = 1.0_r8 - exp(-SF_val_fdi_alpha*currentSite%acc_NI)
end if

! Equation 14 in Thonicke et al. 2010
! fire duration in minutes

Expand Down Expand Up @@ -1120,9 +1127,11 @@ subroutine area_burnt ( currentSite, bc_in )
! NF = number of lighting strikes per day per km2
! ED_val_nignitions is from the params file
! lightning is the daily avg from a lightning dataset
! currentPatch%NF = ED_val_nignitions * currentPatch%area/area /365
currentPatch%NF = bc_in%lightning24 * 24._r8 ! #/km2/hr to #/km2/day
! currentSite%FDI = 1._r8 ! IF READING SUCCESSFUL IGNITION DATA
if (index(stream_fldFileName_lightng, 'nofile') > 0) then
currentPatch%NF = ED_val_nignitions * currentPatch%area/area /365
else
currentPatch%NF = bc_in%lightning24 * 24._r8 ! #/km2/hr to #/km2/day
end if

! If there are 15 lightening strickes per year, per km2. (approx from NASA product)
! then there are 15/365 s/km2 each day.
Expand Down

1 comment on commit dc8f83a

@slevis-lmwg
Copy link
Owner Author

@slevis-lmwg slevis-lmwg commented on dc8f83a Aug 9, 2019

Choose a reason for hiding this comment

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

@rgknox @jkshuman @lmkueppers @pollybuotte
This commit has the changes that Lara, Polly, and I talked about in today's meeting that allow the user to decide between:

  • default ignitions
  • Li 2016 lightning
  • other lightning (e.g. FMEC)
  • successful ignitions (Bin's data set)

This is my second commit with code changes related to NGEET/fates#562

Please sign in to comment.