Skip to content
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions doc/README.cfbm
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@

WRF should be compiled with CMake in order to use the Community Fire Behavior model:
git clone --recurse-submodules https://github.com/wrf-model/WRF
./configure_new -- -DENABLE_CFBM=ON
./compile_new

To activate the model you need to set ifire = 1 in the fire block of the WRF namelist.
This instructs WRF to read the CFBM namelist: namelist.cfbm

In a given WRF simulation, CFBM can only be activated in one domain.


This is an example of the namelist.cfbm:

&time
dt = 2 ! WRF time step [s] for the nest CFBM is active
interval_output = 2 ! Frequency [s] saving fire output
/

&atm
/

&fire
fire_num_ignitions = 1,
fire_ignition_ros1 = 1.2,
fire_ignition_start_lat1 = 39.68,
fire_ignition_start_lon1 = -103.58,
fire_ignition_end_lat1 = 39.68,
fire_ignition_end_lon1 = -103.58,
fire_ignition_radius1 = 2000.0,
fire_ignition_start_time1 = 6.0,
fire_ignition_end_time1 = 60.0,
fire_wind_height = 1.0,
/

8 changes: 7 additions & 1 deletion dyn_em/module_first_rk_step_part1.F
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ SUBROUTINE first_rk_step_part1 ( grid , config_flags &
#ifdef DM_PARALLEL
USE module_dm, ONLY : local_communicator, mytask, ntasks, ntasks_x, ntasks_y, local_communicator_periodic, wrf_dm_maxval
USE module_comm_dm, ONLY : halo_em_phys_a_sub,halo_em_fdda_sfc_sub,halo_pwp_sub,halo_em_chem_e_3_sub, &
halo_em_chem_e_5_sub, halo_em_hydro_noahmp_sub
halo_em_chem_e_5_sub, halo_em_hydro_noahmp_sub, halo_em_tracer_e_5_sub
#if ( WRFPLUS == 1 )
USE module_comm_dm, ONLY : halo_em_phys_a_bl_surf_sub
#endif
Expand Down Expand Up @@ -1475,6 +1475,12 @@ SUBROUTINE first_rk_step_part1 ( grid , config_flags &
grid%rthfrten, grid%rqvfrten) ! theta and Qv tendencies
end do
!$OMP END PARALLEL DO

if (config_flags%tracer_opt == 3) then
Comment thread
dudhia marked this conversation as resolved.
#ifdef DM_PARALLEL
# include "HALO_EM_TRACER_E_5.inc"
#endif
end if
else
call wrf_error_fatal ('num_tiles in WRF and CFBM should match')
endif
Expand Down
18 changes: 17 additions & 1 deletion dyn_em/start_em.F
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ SUBROUTINE start_domain_em ( grid, allowed_to_read &
USE module_dm, ONLY : wrf_dm_min_real, wrf_dm_max_real, wrf_dm_maxval, &
ntasks_x, ntasks_y, &
local_communicator_periodic, local_communicator, mytask, ntasks

#else
USE module_dm, ONLY : wrf_dm_min_real, wrf_dm_max_real
#endif
Expand Down Expand Up @@ -145,6 +146,7 @@ SUBROUTINE start_domain_em ( grid, allowed_to_read &
ifms, ifme, jfms, jfme, kfms, kfme, &
ifps, ifpe, jfps, jfpe, kfps, kfpe
real :: cen_lat, cen_lon, truelat1, truelat2, stand_lon
logical :: is_cfbm_initialized = .false.
#endif


Expand Down Expand Up @@ -2246,6 +2248,16 @@ SUBROUTINE start_domain_em ( grid, allowed_to_read &
! Community Fire Behavior model
case (1)
#ifdef WRF_CFBM
Init_cfbm: if (.not. is_cfbm_initialized) then
#ifdef DM_PARALLEL
! Broadcast the namelist
call grid%cfbm_namelist%Broadcast_nml (grid%communicator)
#endif

if (abs (grid%dt - grid%cfbm_namelist%dt) > 1.0e-5) then
call wrf_error_fatal ('CFBM dt should match WRF dt for the fire domain')
end if

! Get fire dims
call get_ijk_from_subgrid (grid, ifds, ifde, jfds, jfde, kfds, kfde, &
ifms, ifme, jfms, jfme, kfms, kfme, &
Expand Down Expand Up @@ -2280,7 +2292,11 @@ SUBROUTINE start_domain_em ( grid, allowed_to_read &
sr_x = config_flags%sr_x, sr_y = config_flags%sr_y, &
map_proj = config_flags%map_proj, cen_lat = cen_lat, cen_lon = cen_lon, truelat1 = truelat1, &
truelat2 = truelat2, stand_lon = stand_lon, nfuel_cat = grid%nfuel_cat, zsf = grid%zsf, &
dzdxf = grid%dzdxf, dzdyf = grid%dzdyf)
dzdxf = grid%dzdxf, dzdyf = grid%dzdyf, communicator = grid%communicator)

is_cfbm_initialized = .true.

end if Init_cfbm
#else
call wrf_error_fatal ('CFBM requires compilation with CMake')
#endif
Expand Down
18 changes: 18 additions & 0 deletions share/module_check_a_mundo.F
Original file line number Diff line number Diff line change
Expand Up @@ -2774,6 +2774,24 @@ END FUNCTION bep_bem_ngr_u
count_fatal_error = count_fatal_error + 1
END IF

!-----------------------------------------------------------------------
! CFBM checks
!-----------------------------------------------------------------------

! CFBM can be active in only one domain
oops = 0
DO i = 1, model_config_rec % max_dom
IF (model_config_rec%ifire(i) == 1) THEN
oops = oops + 1
END IF
END DO

IF ( oops .GT. 1 ) THEN
wrf_err_message = '--- ERROR: CFBM can be active in only one domain'
CALL wrf_debug ( 0, TRIM( wrf_err_message ) )
count_fatal_error = count_fatal_error + 1
END IF

!-----------------------------------------------------------------------
! This WRF version does not support trajectories on a global domain
!-----------------------------------------------------------------------
Expand Down