Browse files

fire_time_step_ratio implemented as a single commit

  • Loading branch information...
1 parent f11b8eb commit 773cacd01f4401f69d5ab4a0877e3a0a5a32abad @jbeezley jbeezley committed Mar 30, 2012
Showing with 47 additions and 1 deletion.
  1. +1 −0 wrfv2_fire/Registry/registry.fire
  2. +46 −1 wrfv2_fire/phys/module_fr_sfire_driver_wrf.F
View
1 wrfv2_fire/Registry/registry.fire
@@ -187,6 +187,7 @@ rconfig integer fire_fuel_cat namelist,fire max_domains
rconfig integer fire_print_msg namelist,fire max_domains 0 - "fire_write_msg" "write fire statistics, 0 no writes, 1+ for more" ""
rconfig integer fire_print_file namelist,fire max_domains 0 - "fire_write_file" "write fire output text files, 0 no writes, 1+ for more" ""
rconfig logical fire_restart namelist,fire max_domains .false. - "fire_restart" "restart run, do not initialize state" ""
+rconfig integer fire_time_step_ratio namelist,fire max_domains 1 - "fire_time_step_ratio" "number of fire time steps per atmospheric step" ""
# method selection
rconfig integer fire_fuel_left_method namelist,fire max_domains 1 - "fire_fuel_left_method" "1 or 2, compute fuel_left" ""
View
47 wrfv2_fire/phys/module_fr_sfire_driver_wrf.F
@@ -110,21 +110,42 @@ subroutine sfire_driver_em_step (grid , config_flags &
integer:: ij
real::time_step_start,dt
+ integer::fire_time_step_ratio,itime_step,i,j
+ real,dimension( ips:ipe , jps:jpe ) :: grnhfx_save, grnqfx_save, &
+ canhfx_save, canqfx_save
+
! executable
call message('sfire_driver_em_step: SFIRE step start')
! times in seconds
+ ! get fire time step refinement from namelist
+ fire_time_step_ratio=config_flags%fire_time_step_ratio
+
+ if(fire_time_step_ratio.lt.1)then
+ call crash('fire_time_step_ratio must be >= 1')
+ endif
+
time_step_start=TimeInterval2Sec(domain_get_time_since_sim_start(grid))
- dt=TimeInterval2Sec(domain_get_time_step(grid))
+ dt=TimeInterval2Sec(domain_get_time_step(grid))/fire_time_step_ratio
+
! get fire mesh dimensions
CALL get_ijk_from_subgrid ( grid , &
ifds,ifde, jfds,jfde,kfds,kfde, &
ifms,ifme, jfms,jfme,kfms,kfme, &
ifps,ifpe, jfps,jfpe,kfps,kfpe)
+ ! save fluxes for tendency
+ grnhfx_save(:,:)=0.
+ grnqfx_save(:,:)=0.
+ canhfx_save(:,:)=0.
+ canqfx_save(:,:)=0.
+
+ ! fire time step loop
+ do itime_step = 1,fire_time_step_ratio
+
call sfire_driver_em ( grid , config_flags &
,time_step_start,dt &
,3,6,fire_test_steps &
@@ -136,6 +157,30 @@ subroutine sfire_driver_em_step (grid , config_flags &
,ifps,ifpe, jfps,jfpe &
)
+ ! accumulate fluxes for atmospheric tendency
+ do j=jps,jpe
+ do i=ips,ipe
+ grnhfx_save(i,j)=grnhfx_save(i,j) + grid%grnhfx(i,j)
+ grnqfx_save(i,j)=grnqfx_save(i,j) + grid%grnqfx(i,j)
+ canhfx_save(i,j)=canhfx_save(i,j) + grid%canhfx(i,j)
+ canqfx_save(i,j)=canqfx_save(i,j) + grid%canqfx(i,j)
+ enddo
+ enddo
+
+ time_step_start=time_step_start+dt
+ enddo
+
+ ! copy fluxes back to grid structure
+ do j=jps,jpe
+ do i=ips,ipe
+ grid%grnhfx(i,j)=grnhfx_save(i,j)/fire_time_step_ratio
+ grid%grnqfx(i,j)=grnqfx_save(i,j)/fire_time_step_ratio
+ grid%canhfx(i,j)=canhfx_save(i,j)/fire_time_step_ratio
+ grid%canqfx(i,j)=canqfx_save(i,j)/fire_time_step_ratio
+ enddo
+ enddo
+
+
call print_chsum(0,ims,ime,kms,kme,jms,jme,ids,ide,kds,kde,jds,jde,ips,ipe,kps,kpe-1,jps,jpe,0,0,0,z_at_w,'z_at_w')
call print_chsum(0,ims,ime,kms,kme,jms,jme,ids,ide,kds,kde,jds,jde,ips,ipe,kps,kpe-1,jps,jpe,0,0,0,dz8w,'dz8w')
call print_chsum(0,ims,ime,kms,kme,jms,jme,ids,ide,kds,kde,jds,jde,ips,ipe,kps,kpe-1,jps,jpe,0,0,0,rho,'rho')

0 comments on commit 773cacd

Please sign in to comment.