Skip to content

Commit

Permalink
wrapping up: conditional call to moisture model, checking number of c…
Browse files Browse the repository at this point in the history
…lasses
  • Loading branch information
janmandel committed Feb 26, 2012
1 parent caebced commit 0690147
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
14 changes: 10 additions & 4 deletions wrfv2_fire/phys/module_fr_sfire_driver.F
Expand Up @@ -641,7 +641,8 @@ subroutine sfire_driver_phys (ifun, &
call print_2d_stats(ifts,ifte,jfts,jfte,ifms,ifme,jfms,jfme,fp%zsf,'driver_phys:zsf')

! initialize the moisture model
call advance_moisture( &
if(run_moisture)then
call advance_moisture( &
.true., & ! initialize timestepping
initialize_fmc, & ! if true, set initial moisture to fuelmc_g
ims,ime, jms,jme, & ! memory dimensions
Expand All @@ -654,6 +655,7 @@ subroutine sfire_driver_phys (ifun, &
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
)
endif

elseif(ifun.eq.3)then ! interpolate winds to the fire grid

Expand Down Expand Up @@ -721,7 +723,8 @@ subroutine sfire_driver_phys (ifun, &
! still with ifun=3

! one timestep of the moisture model
call advance_moisture( &
if(run_moisture)then
call advance_moisture( &
.false., &
.false., &
ims,ime, jms,jme, & ! memory dimensions
Expand All @@ -734,11 +737,13 @@ subroutine sfire_driver_phys (ifun, &
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
)
endif

elseif(ifun.eq.4)then

! interpolate and compute weighted average to get the fuel moisture
call fuel_moisture( &
if(run_moisture)then
call fuel_moisture( &
id, & ! for prints and maybe file names
nfmc, &
ids,ide, jds,jde, & ! atm grid dimensions
Expand All @@ -752,7 +757,8 @@ subroutine sfire_driver_phys (ifun, &
nfuel_cat, & ! fuel data
fmc_gc, & ! moisture contents by class on atmospheric grid
fmc_g & ! weighted fuel moisture contents on fire grid
)
)
endif

endif

Expand Down
9 changes: 9 additions & 0 deletions wrfv2_fire/phys/module_fr_sfire_phys.F
Expand Up @@ -329,9 +329,18 @@ 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
character(len=128)::msg

!*** executable

if(moisture_classes > nfmc .or. moisture_classes > max_moisture_classes)then
!$OMP CRITICAL(SFIRE_PHYS_CRIT)
write(msg,*)'moisture_classes=',moisture_classes,' > nfmc=',nfmc,' or > max_moisture_classes=',max_moisture_classes
!$OMP END CRITICAL(SFIRE_PHYS_CRIT)
call message(msg)
call crash('advance_moisture: bad number of moisture classes')
endif

if(initialize)then
call copy2old
if(initialize_fmc)then
Expand Down

0 comments on commit 0690147

Please sign in to comment.