Skip to content

Commit

Permalink
adding moisture equilibrium and tendency diagnostic variables
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Mandel committed Mar 1, 2012
1 parent af8bfc6 commit 594a473
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 25 deletions.
2 changes: 2 additions & 0 deletions wrfv2_fire/Registry/registry.fire
Expand Up @@ -53,6 +53,8 @@ state real fcanqfx *i*j fire 1 z hr "FCANQFX"
dimspec num_fmc - namelist=nfmc z fuel_moisture_classes
rconfig integer nfmc namelist,fire 1 5 - "nfmc" "number of fuel moisture classes"
state real fmc_gc i{num_fmc}j fire 1 z i102hr "FMC_GC" "fuel moisture contents by class" "1"
state real fmc_equi i{num_fmc}j fire 1 z hr "FMC_EQUI" "fuel moisture contents by class equilibrium (diagnostics only)" "1"
state real fmc_tend i{num_fmc}j fire 1 z hr "FMC_TEND" "fuel moisture contents by class tendency (diagnostics only)" "1/s"
state real rain_old ij fire 1 z hr "RAIN_OLD" "previous value of accumulated rain" "mm"
state real t2_old ij fire 1 z hr "T2_OLD" "previous value of accumulated rain" "mm"
state real q2_old ij fire 1 z hr "Q2_OLD" "previous value of accumulated rain" "mm"
Expand Down
21 changes: 17 additions & 4 deletions wrfv2_fire/phys/module_fr_sfire_driver.F
Expand Up @@ -334,6 +334,8 @@ subroutine sfire_driver_em ( grid , config_flags &
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%fmc_gc, & ! fuel moisture fields updated, by class, assumed set to something reasonable
grid%fmc_equi, & ! fuel moisture fields updated, by class, equilibrium diagnostic
grid%fmc_tend, & ! 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 @@ -407,6 +409,8 @@ subroutine sfire_driver_phys (ifun, &
rain_old, & ! previous value of accumulated rain
t2_old, q2_old, psfc_old, & ! previous values of the atmospheric state at surface
fmc_gc, & ! fuel moisture fields updated, by class, assumed set to something reasonable
fmc_equi, & ! fuel moisture fields updated, by class equilibrium diagnostic
fmc_tend, & ! fuel moisture fields updated, by class tendency diagnostic
fmc_g) ! fuel moisture, alias of fp%fmc_g


Expand Down Expand Up @@ -492,6 +496,7 @@ subroutine sfire_driver_phys (ifun, &
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(out), dimension(ims:ime,nfmc,jms:jme):: fmc_equi,fmc_tend
real, intent(inout), dimension(ifms:ifme,jfms:jfme):: fmc_g


Expand Down Expand Up @@ -711,7 +716,9 @@ subroutine sfire_driver_phys (ifun, &
ims,ime, jms,jme, & ! memory dimensions
its,ite, jts,jte, & ! tile dimensions
nfmc, & ! number of moisture fields
fmc_gc & ! fuel moisture fields updated, by class, assumed set to something reasonable
fmc_gc, & ! fuel moisture fields updated, by class, assumed set to something reasonable
fmc_equi, & ! fuel moisture fields equilibrium by class
fmc_tend & ! fuel moisture fields tendency by class
)
endif
call print_3d_stats_by_slice(its,ite,1,moisture_classes,jts,jte,ims,ime,1,nfmc,jms,jme,fmc_gc,'initial fmc_gc')
Expand All @@ -725,9 +732,13 @@ subroutine sfire_driver_phys (ifun, &
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
fmc_gc & ! fuel moisture fields updated, by class, assumed set to something reasonable
fmc_gc, & ! fuel moisture fields updated, by class, assumed set to something reasonable
fmc_equi, & ! fuel moisture fields equilibrium by class
fmc_tend & ! fuel moisture fields tendency by class
)
call print_3d_stats_by_slice(its,ite,1,moisture_classes,jts,jte,ims,ime,1,nfmc,jms,jme,fmc_gc,'after advance: fmc_gc')
call print_3d_stats_by_slice(its,ite,1,moisture_classes,jts,jte,ims,ime,1,nfmc,jms,jme,fmc_equi,'equilibrium fmc_equi')
call print_3d_stats_by_slice(its,ite,1,moisture_classes,jts,jte,ims,ime,1,nfmc,jms,jme,fmc_tend,'tendency fmc_tend')
call print_3d_stats_by_slice(its,ite,1,moisture_classes,jts,jte,ims,ime,1,nfmc,jms,jme,fmc_gc,'after advance fmc_gc')
endif

elseif(ifun.eq.3)then ! interpolate winds to the fire grid
Expand Down Expand Up @@ -808,7 +819,9 @@ subroutine sfire_driver_phys (ifun, &
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
fmc_gc & ! fuel moisture fields updated, by class, assumed set to something reasonable
fmc_gc, & ! fuel moisture fields updated, by class, assumed set to something reasonable
fmc_equi, & ! fuel moisture fields updated, by class equilibrium diagnostic
fmc_tend & ! fuel moisture fields updated, by class tendency diagnostic
)
call print_3d_stats_by_slice(its,ite,1,moisture_classes,jts,jte,ims,ime,1,nfmc,jms,jme,fmc_gc,'after advance fmc_gc')
endif
Expand Down
63 changes: 42 additions & 21 deletions wrfv2_fire/phys/module_fr_sfire_phys.F
Expand Up @@ -318,15 +318,18 @@ end subroutine fuel_moisture
subroutine initialize_moisture_classes( &
ims,ime, jms,jme, & ! memory dimensions
its,ite, jts,jte, & ! tile dimensions
nfmc, & ! number of moisture fields
fmc_gc & ! fuel moisture fields updated, by class, assumed set to something reasonable
nfmc, & ! dimension of moisture fields
fmc_gc, & ! fuel moisture by class, updated
fmc_equi, & ! fuel moisture equilibrium by classe, for diagnostics
fmc_tend & ! fuel moisture tendency by classe, for diagnostics
)
!*** arguments
integer, intent(in):: &
ims,ime, jms,jme, & ! memory dimensions
its,ite, jts,jte, & ! tile dimensions
nfmc ! number of moisture fields
real, intent(out), dimension(ims:ime,nfmc,jms:jme):: fmc_gc
real, intent(out), dimension(ims:ime,nfmc,jms:jme):: fmc_equi, fmc_tend
!*** module variables
! fuelmc_g
!*** local
Expand All @@ -335,24 +338,28 @@ subroutine initialize_moisture_classes( &
do j=jts,jte
do k=1,nfmc
do i=its,ite
fmc_gc(i,k,j)=fuelmc_g ! from module
fmc_gc(i,k,j)=fuelmc_g ! global value from module
fmc_equi(i,k,j)=-9999 ! avoid uninitialized arrays
fmc_tend(i,k,j)=-9999 ! avoid uninitialized arrays
enddo
enddo
enddo
call message('moisture contents in all classes initialized from namelist.fire')
end subroutine initialize_moisture_classes

subroutine advance_moisture( &
initialize, & ! initialize timestepping
ims,ime, jms,jme, & ! memory dimensions
its,ite, jts,jte, & ! tile dimensions
nfmc, & ! number of moisture fields
moisture_dt, & ! timestep = time step time elapsed from the last call
initialize, & ! initialize timestepping
ims,ime, jms,jme, & ! memory dimensions
its,ite, jts,jte, & ! tile dimensions
nfmc, & ! dimension of moisture fields
moisture_dt, & ! timestep = time step time elapsed from the last call
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
fmc_gc & ! fuel moisture fields updated, by class, assumed set to something reasonable
fmc_gc, & ! fuel moisture by class, updated
fmc_equi, & ! fuel moisture equilibrium by class, for diagnostics
fmc_tend & ! fuel moisture tendency by classe, for diagnostics
)

!*** arguments
Expand All @@ -365,10 +372,11 @@ subroutine advance_moisture( &
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(out), dimension(ims:ime,nfmc,jms:jme):: fmc_equi, fmc_tend

!*** local
integer:: i,j,k
real::rain_int, T, P, Q, QRS, ES, RH, tend, EMC_d, EMC_w, EMC, R, rain_diff, fmc
real::rain_int, T, P, Q, QRS, ES, RH, tend, EMC_d, EMC_w, EMC, R, rain_diff, fmc, tlag, equi, d, w
character(len=128)::msg
integer::msglevel=2

Expand Down Expand Up @@ -402,7 +410,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
tend=(saturation_moisture(k)-fmc)/wetting_lag(k) * (1. - exp(-R/saturation_rain(k)))
equi=saturation_moisture(k)
tlag=wetting_lag(k) * (1. - exp(-R/saturation_rain(k)))
end select
else ! not raining
! average the inputs for second order accuracy
Expand All @@ -415,18 +424,30 @@ subroutine advance_moisture( &
RH = 100.*Q/QRS
select case(drying_model(k))
case(1) ! Van Wagner (1972) per Viney (1991)
EMC_d=0.924*RH**0.679 + 0.000499*exp(0.1*RH) + 0.18*(21.1+273.15-T)*(1-exp(-0.115*RH)) ! equilibrium moisture for drying
EMC_w=0.618*RH**0.753 + 0.000454*exp(0.1*RH) + 0.18*(21.1+273.15-T)*(1-exp(-0.115*RH)) ! equilibrium moisture for adsorbtion
if (fmc > EMC_d) then
tend = (EMC_d - fmc) / drying_lag(k)
elseif(fmc < EMC_w)then
tend = (EMC_w - fmc) / drying_lag(k)
else
tend = 0.
endif
d=0.924*RH**0.679 + 0.000499*exp(0.1*RH) + 0.18*(21.1+273.15-T)*(1-exp(-0.115*RH)) ! equilibrium moisture for drying
w=0.618*RH**0.753 + 0.000454*exp(0.1*RH) + 0.18*(21.1+273.15-T)*(1-exp(-0.115*RH)) ! equilibrium moisture for adsorbtion
EMC_d = max(d,w)
EMC_w = min(d,w)
tlag=drying_lag(k)
if (fmc > EMC_d)then ! drying, fmc going down to equilibrium
equi=EMC_d
elseif(fmc < EMC_w)then ! wetting, fmc going up to equilibrium
equi=EMC_w
else
equi=fmc
endif
end select
endif
fmc_gc(i,k,j) = fmc + moisture_dt * tend
!*** MODELS THAT ARE NOT OF THE EXPONENTIAL TIMELAG KIND NEED TO
!COMPUTE THE OUTPUT fmc_gc(i,k,j) AND SET TLAG <=0
!
if(tlag > 0.0)then
tend=(equi-fmc)/tlag
fmc_gc(i,k,j) = fmc + moisture_dt * tend
! diagnostics out
fmc_equi(i,k,j)=equi
fmc_tend(i,k,j)=tend
endif
enddo
enddo
enddo
Expand Down

0 comments on commit 594a473

Please sign in to comment.