Skip to content

Commit

Permalink
added dependence on fuel moisture extended model assimilated differen…
Browse files Browse the repository at this point in the history
…ces to equilibria to moisture model (var fmep), added logic to decay the assimilated differences via (fmep_decay_tlag)
  • Loading branch information
0xshipthecode committed Mar 10, 2014
1 parent 35916e6 commit 92930c8
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 16 deletions.
20 changes: 14 additions & 6 deletions wrfv2_fire/phys/module_fr_sfire_driver.F
Expand Up @@ -440,12 +440,14 @@ subroutine sfire_driver_em ( grid , config_flags &
fp, & ! structure with pointers passed to spread rate calculation
config_flags%nfmc, & ! moisture model variables start
run_advance_moisture,run_fuel_moisture,dt_moisture, & ! moisture model control
config_flags%fmep_decay_tlag, & ! moisture extended model assim. diffs decay time lag
grid%rainc, grid%rainnc, & ! accumulated rain from different sources
grid%t2, grid%q2, grid%psfc, & ! temperature (K), vapor contents (kg/kg), pressure (Pa) at the surface
grid%rain_old, & ! previous value of accumulated rain
grid%t2_old, grid%q2_old, grid%psfc_old, & ! previous values of the atmospheric state at surface
grid%rh_fire, & ! relative humidity, diagnostics
grid%fmc_gc, & ! fuel moisture fields updated, by class, assumed set to something reasonable
grid%fmep, & ! fuel moisture extended model parameters
grid%fmc_equi, & ! fuel moisture fields updated, by class, equilibrium diagnostic
grid%fmc_lag, & ! fuel moisture fields updated, by class, tendency diagnostic
fp%fmc_g ) ! write-only alias. need to exit before using fp again
Expand Down Expand Up @@ -539,16 +541,18 @@ subroutine sfire_driver_phys (ifun, &
fp, & ! fire params
nfmc, & ! number of fuel moisture classes
run_advance_moisture,run_fuel_moisture,dt_moisture,& ! moisture model control
rainc,rainnc, & ! accumulated rain from different sources
fmep_decay_tlag, & ! moist. extended model assim. diffs time lag
rainc,rainnc, & ! accumulated rain from different sources
t2, q2, psfc, & ! temperature (K), vapor contents (kg/kg), pressure (Pa) at the surface
rain_old, & ! previous value of accumulated rain
t2_old, q2_old, psfc_old, & ! previous values of the atmospheric state at surface
rh_fire, & ! relative humidity, diagnostics
fmc_gc, & ! fuel moisture fields updated, by class, assumed set to something reasonable
fmc_equi, & ! fuel moisture fields updated, by class equilibrium diagnostic
fmc_gc, & ! fuel moisture fields updated, by class, assumed set to something reasonable
fmep, & ! fuel moisture extended model parameters
fmc_equi, & ! fuel moisture fields updated, by class equilibrium diagnostic
fmc_lag, & ! fuel moisture fields updated, by class tendency diagnostic
fmc_g) ! fuel moisture, alias of fp%fmc_g


implicit none

Expand Down Expand Up @@ -632,10 +636,12 @@ subroutine sfire_driver_phys (ifun, &
! moisture model arguments
logical, intent(in)::run_advance_moisture,run_fuel_moisture
real, intent(in)::dt_moisture
real, intent(in)::fmep_decay_tlag
real, intent(in), dimension(ims:ime,jms:jme):: t2, q2, psfc, rainc, rainnc
real, intent(inout), dimension(ims:ime,jms:jme):: t2_old, q2_old, psfc_old, rain_old
real, intent(out),dimension(ims:ime,jms:jme):: rh_fire
real, intent(inout), dimension(ims:ime,nfmc,jms:jme):: fmc_gc
real, intent(inout), dimension(ims:ime,2,jms:jme):: fmep
real, intent(out), dimension(ims:ime,nfmc,jms:jme):: fmc_equi,fmc_lag
real, intent(inout), dimension(ifms:ifme,jfms:jfme):: fmc_g

Expand Down Expand Up @@ -783,14 +789,16 @@ subroutine sfire_driver_phys (ifun, &
its,ite, jts,jte, & ! tile dimensions
nfmc, & ! number of moisture fields
dt_moisture, & ! moisture model time step
fmep_decay_tlag, & ! moisture extended model assim. diffs decay tlag
rainc, rainnc, & ! accumulated rain
t2, q2, psfc, & ! temperature (K), vapor contents (kg/kg), pressure (Pa) at the surface
rain_old, & ! previous value of accumulated rain
t2_old, q2_old, psfc_old, & ! previous values of the atmospheric state at surface
rh_fire, & ! relative humidity, diagnostics
fmc_gc, & ! fuel moisture fields updated, by class, assumed set to something reasonable
fmc_equi, & ! fuel moisture fields updated, by class equilibrium diagnostic
fmc_lag & ! fuel moisture fields updated, by class tendency diagnostic
fmep, & ! fuel moisture extended model parameters
fmc_equi, & ! fuel moisture fields updated, by class equilibrium diagnostic
fmc_lag & ! fuel moisture fields updated, by class tendency diagnostic
)
call message('advance_moisture end')
endif
Expand Down
43 changes: 33 additions & 10 deletions wrfv2_fire/phys/module_fr_sfire_phys.F
Expand Up @@ -335,12 +335,14 @@ subroutine advance_moisture( &
its,ite, jts,jte, & ! tile dimensions
nfmc, & ! dimension of moisture fields
moisture_dt, & ! timestep = time step time elapsed from the last call
fmep_decay_tlag, & ! moisture extended model assimilated diffs. decay time lag
rainc, rainnc, & ! accumulated rain
t2, q2, psfc, & ! temperature (K), vapor contents (kg/kg), pressure (Pa) at the surface
rain_old, & ! previous value of accumulated rain
t2_old, q2_old, psfc_old, & ! previous values of the atmospheric state at surface
rh_fire, & ! relative humidity at surface, for diagnostic only
fmc_gc, & ! fuel moisture by class, updated
fmep, & ! fuel moisture extended model parameters
fmc_equi, & ! fuel moisture equilibrium by class, for diagnostics only
fmc_lag & ! fuel moisture tendency by classe, for diagnostics only
)
Expand All @@ -353,10 +355,11 @@ subroutine advance_moisture( &
ims,ime, jms,jme, & ! memory dimensions
its,ite, jts,jte, & ! tile dimensions
nfmc ! number of moisture fields
real, intent(in):: moisture_dt
real, intent(in):: moisture_dt, fmep_decay_tlag
real, intent(in), dimension(ims:ime,jms:jme):: t2, q2, psfc, rainc, rainnc
real, intent(inout), dimension(ims:ime,jms:jme):: t2_old, q2_old, psfc_old, rain_old
real, intent(inout), dimension(ims:ime,nfmc,jms:jme):: fmc_gc
real, intent(inout), dimension(ims:ime,2,jms:jme):: fmep
real, intent(out), dimension(ims:ime,nfmc,jms:jme):: fmc_equi, fmc_lag
real, intent(out), dimension(ims:ime,jms:jme)::rh_fire

Expand All @@ -366,7 +369,7 @@ subroutine advance_moisture( &
!*** local
integer:: i,j,k
real::rain_int, T, P, Q, QRS, ES, RH, tend, EMC_d, EMC_w, EMC, R, rain_diff, fmc, rlag, equi, &
d, w, rhmax, rhmin, change, rainmax,rainmin, fmc_old, H
d, w, rhmax, rhmin, change, rainmax,rainmin, fmc_old, H, deltaS, deltaE
real, parameter::tol=1e-2 ! relative change larger than that will switch to exponential ode solver
character(len=256)::msg
logical::bad_wrf
Expand Down Expand Up @@ -486,8 +489,12 @@ subroutine advance_moisture( &
!realtive humidity [1]
RH = Pw/Pws
rh_fire(i,j)=RH
rhmax=max(RH,rhmax)
rhmin=min(RH,rhmin)
rhmax=max(RH,rhmax)
rhmin=min(RH,rhmin)

deltaE = fmep(i,1,j)
deltaS = fmep(i,2,j)

if(.not.check_rh)then
RH = min(RH,1.0)
else
Expand All @@ -505,8 +512,8 @@ subroutine advance_moisture( &
if (R > 0.) then
select case(wetting_model(k))
case(1) ! saturation_moisture=2.5 wetting_lag=14h saturation_rain=8 mm/h calibrated to VanWagner&Pickett 1985 per 24 hours
EMC_w=saturation_moisture(k)
EMC_d=saturation_moisture(k)
EMC_w=saturation_moisture(k) + deltaS
EMC_d=saturation_moisture(k) + deltaS
rlag=rec_wetting_lag_sec(k) * (1. - exp(-R/saturation_rain(k)))
end select
else ! not raining
Expand All @@ -518,8 +525,8 @@ subroutine advance_moisture( &
if(d.ne.d.or.w.ne.w)call crash('equilibrium moisture calculation failed, result is NaN')
d = d*0.01
w = w*0.01
EMC_d = max(d,w)
EMC_w = min(d,w)
EMC_d = max(max(d,w)+deltaE,0.0)
EMC_w = max(min(d,w)+deltaE,0.0)
rlag=rec_drying_lag_sec(k)
end select
endif
Expand All @@ -540,7 +547,7 @@ subroutine advance_moisture( &
endif
equi = max(min(fmc_old, EMC_d),EMC_w) ! take lower or upper equilibrium value

change = moisture_dt * rlag
change = moisture_dt * rlag

if(change < tol)then
if(fire_print_msg.ge.3)call message('midpoint method')
Expand All @@ -554,7 +561,7 @@ subroutine advance_moisture( &
! diagnostics out
fmc_equi(i,k,j)=equi
fmc_lag(i,k,j)=1.0/(3600.0*rlag)

! diagnostic prints
if(fire_print_msg.ge.3)then
!$OMP CRITICAL(SFIRE_PHYS_CRIT)
Expand All @@ -570,6 +577,22 @@ subroutine advance_moisture( &
enddo
enddo


! assimilated differences decay
do j=jts,jte
do k=1,2
do i=its,ite
change = moisture_dt / (fmep_decay_tlag * 3600.)
if(change < tol) then
fmep(i,k,j) = fmep(i,k,j)*(1.0 - change * (1.0 - 0.5 * change))
else
fmep(i,k,j) = fmep(i,k,j)*exp(-change)
endif
enddo
enddo
enddo


if(fire_print_msg.ge.2)then
!$OMP CRITICAL(SFIRE_PHYS_CRIT)
write(msg,2)'Rain intensity min',rainmin, ' max',rainmax,' mm/h'
Expand Down

0 comments on commit 92930c8

Please sign in to comment.