diff --git a/wrfv2_fire/Registry/registry.fire b/wrfv2_fire/Registry/registry.fire index 39767676..9b09d24c 100644 --- a/wrfv2_fire/Registry/registry.fire +++ b/wrfv2_fire/Registry/registry.fire @@ -17,7 +17,7 @@ state real nfuel_cat *i*j fire 1 z i012hr "NFU state real zsf *i*j fire 1 z i012hr "ZSF" "height of surface above sea level" "m" state real dzdxf *i*j fire 1 z i012hr "DZDXF" "surface gradient x" "1" state real dzdyf *i*j fire 1 z i012hr "DZDYF" "surface gradient y" "1" -state real tign_g *i*j fire 1 z hr "TIGN_G" "ignition time on ground" "s" +state real tign_g *i*j fire 1 z i012hr "TIGN_G" "ignition time on ground" "s" # fire variables on atm grid # diff --git a/wrfv2_fire/dyn_em/module_initialize_fire.F b/wrfv2_fire/dyn_em/module_initialize_fire.F index f2d5b1ee..3efa17ea 100644 --- a/wrfv2_fire/dyn_em/module_initialize_fire.F +++ b/wrfv2_fire/dyn_em/module_initialize_fire.F @@ -119,6 +119,7 @@ SUBROUTINE init_domain_rk ( grid & ifts,ifte, kfts,kfte, jfts,jfte REAL :: mtn_ht, mtn_max, mtn_x, mtn_y, mtn_z, grad_max + REAL :: tign_max,tign_min REAL :: mtn_axs, mtn_ays, mtn_axe, mtn_aye REAL :: mtn_fxs, mtn_fys, mtn_fxe, mtn_fye REAL :: mtn_xs, mtn_ys, mtn_xe, mtn_ye @@ -201,13 +202,6 @@ SUBROUTINE init_domain_rk ( grid & CALL wrf_dm_bcast_bytes( jcm , IWORDSIZE ) #endif -! JM read ignition time from file if we are replaying fire history up to the specified time - if(config_flags%fire_replay_time > 0.) then - write(6,*)'SFIRE will replay fire from given ignition times until ',config_flags%fire_replay_time,'s.' - write(6,*)'Reading the ground ignition times at every point into array TIGN_G from file.' - call read_array_2d_real('input_tign_g',grid%tign_g,ids,ide,jds,jde,ims,ime,jms,jme) - endif - !AK/ak land use initialization (USGS) IF (sfc_init) THEN mminlu2=' ' @@ -409,7 +403,7 @@ SUBROUTINE init_domain_rk ( grid & ifms,ifme, jfms,jfme,kfms,kfme, & ifts,ifte, jfts,jfte,kfts,kfte) - write (6,*)' ******** SFIRE ideal initialization ********' + write (6,*)' ******** SFIRE ideal initialization start ********' ! fire grid step size fdx = grid%dx/grid%sr_x @@ -624,6 +618,27 @@ SUBROUTINE init_domain_rk ( grid & ENDDO write(6, *)' Max terrain height on the fire mesh ',mtn_max write(6, *)' Max terrain gradient on the fire mesh ',grad_max + +! JM read ignition time from file if we are replaying fire history up to the specified time + ! write(6,*)'fire_replay_time=',config_flags%fire_replay_time + if(config_flags%fire_replay_time > 0.) then + write(6,*)'Reading ignition times from file input_tign_g for replay of the fire.' + call read_array_2d_real('input_tign_g',grid%tign_g,ifds,ifde,jfds,jfde,ifms,ifme,jfms,jfme) + tign_max = -huge(tign_max) + tign_min = huge(tign_min) + k=0 + do j=jfds,jfde + do i=ifds,ifde + tign_max=max(tign_max,grid%tign_g(i,j)) + tign_min=min(tign_min,grid%tign_g(i,j)) + if(grid%tign_g(i,j) < config_flags%fire_replay_time) k=k+1 + enddo + enddo + write(6,*)'min max ignition time given ',tign_min,tign_max + write(6,*)k,real(k)/((ifde-ifds+1)*(jfde-jfds+1)),'% cells ignited at time ',config_flags%fire_replay_time + endif + + write (6,*)' ******** SFIRE ideal initialization complete ********' ! the rest of initialization dependent on the atmosphere grid terrain height set diff --git a/wrfv2_fire/test/em_fire/hill/README.txt b/wrfv2_fire/test/em_fire/hill/README.txt new file mode 100644 index 00000000..26c10ffb --- /dev/null +++ b/wrfv2_fire/test/em_fire/hill/README.txt @@ -0,0 +1,7 @@ +Link namelist.input to one of the supplied files: + +namelist.input.hill the original hill example with line ignition +namelist.input.tign ellipsoidal ignition up to specified time; run create_tign.m first to make the input file +namelist.input.smallhil a smaller hill example + + diff --git a/wrfv2_fire/test/em_fire/hill/create_tign.m b/wrfv2_fire/test/em_fire/hill/create_tign.m new file mode 100644 index 00000000..9e99251b --- /dev/null +++ b/wrfv2_fire/test/em_fire/hill/create_tign.m @@ -0,0 +1,26 @@ +function tign=create_tign +% nodify to your liking +[ii,jj]=meshgrid(1:420); +tign=sqrt(2*(ii-200).^2+(jj-171).^2)+1; +% mesh(tign) +write_array_2d('input_tign_g',tign) +end +function write_array_2d(filename,a) +% write_array_2d(filename,a) +% Purpose: write 2d matrix as input to WRF-Fire +% +% Arguments +% filename string, the name of the file +% a 2d matrix, the array to be written +% +% Example: write_array_2d('input_ht',ht) +% +% See also: +% read_array_2d read the file back by a=read_array_2d(filename) +% image_array_2d visualize the array by image_array_2d(a) +[m,n]=size(a); +h=fopen(filename,'w'); +fprintf(h,'%i\n',m,n); +fprintf(h,'%.7g\n',a'); +fclose(h); +end \ No newline at end of file diff --git a/wrfv2_fire/test/em_fire/hill/namelist.input b/wrfv2_fire/test/em_fire/hill/namelist.input.hill similarity index 100% rename from wrfv2_fire/test/em_fire/hill/namelist.input rename to wrfv2_fire/test/em_fire/hill/namelist.input.hill diff --git a/wrfv2_fire/test/em_fire/hill/namelist.input.tign b/wrfv2_fire/test/em_fire/hill/namelist.input.tign new file mode 100644 index 00000000..01c332ba --- /dev/null +++ b/wrfv2_fire/test/em_fire/hill/namelist.input.tign @@ -0,0 +1,197 @@ +! this is namelist input for perimeter ignition by specifying time of ignition in file input_tign_g +! this file has format: m=number of points in x direction, n=number of points in y direction, all tign(i,j) with i varying faster +! and it can be created by running create_tign.m in matlab or octave + + + &time_control + run_days = 0, + run_hours = 0, + run_minutes = 5, + run_seconds = 0, + start_year = 0001, 0001, 0001, + start_month = 01, 01, 01, + start_day = 01, 01, 01, + start_hour = 00, 00, 00, + start_minute = 00, 00, 00, + start_second = 00, 00, 00, + end_year = 0001, 0001, 0001, + end_month = 01, 01, 01, + end_day = 01, 01, 01, + end_hour = 00, 00, 00, + end_minute = 600, 600, 600, + end_second = 00, 00, 00, + history_interval_s = 5, 30, 30, + frames_per_outfile = 10, 1000, 1000, + restart = .false., + restart_interval = 1 + io_form_history = 2 + io_form_restart = 2 + io_form_input = 2 + io_form_boundary = 2 + debug_level = 1 + / + + &domains + time_step = 0, + !time_step = 5, + time_step_fract_num = 25, + time_step_fract_den = 100, + max_dom = 1, + s_we = 1, 1, 1, + e_we = 42, 43, 43, + s_sn = 1, 1, 1, + e_sn = 42, 43, 43, + s_vert = 1, 1, 1, + e_vert = 41, 41, 41, + dx = 60, 30, 10, + dy = 60, 30, 10, + ztop = 1500, 1500, 1500, + grid_id = 1, 2, 3, + parent_id = 0, 1, 2, + i_parent_start = 0, 1, 1, + j_parent_start = 0, 1, 1, + parent_grid_ratio = 1, 2, 3, + parent_time_step_ratio = 1, 2, 3, + feedback = 1, + smooth_option = 0 + sr_x = 10, 0, 0 + sr_y = 10, 0, 0 + / + + &physics + mp_physics = 0, 0, 0, + ra_lw_physics = 0, 0, 0, + ra_sw_physics = 0, 0, 0, + radt = 30, 30, 30, + sf_sfclay_physics = 0, 0, 0, + sf_surface_physics = 0, 0, 0, + bl_pbl_physics = 0, 0, 0, + bldt = 0, 0, 0, + cu_physics = 0, 0, 0, + cudt = 0, 0, 0, + isfflx = 1, + ifsnow = 0, + icloud = 0, + num_soil_layers = 5, + mp_zero_out = 0, + / + + &fdda + / + + &dynamics + rk_ord = 3, + diff_opt = 2, + km_opt = 2, + damp_opt = 0, + zdamp = 5000., 5000., 5000., + dampcoef = 0.2, 0.2, 0.2 + khdif = 0.05, 0.05, 0.05, + kvdif = 0.05, 0.05, 0.05, + smdiv = 0.1, 0.1, 0.1, + emdiv = 0.01, 0.01, 0.01, + epssm = 0.1, 0.1, 0.1 + mix_full_fields = .true., .true., .true., + non_hydrostatic = .true., .true., .true., + h_mom_adv_order = 5, 5, 5, + v_mom_adv_order = 3, 3, 3, + h_sca_adv_order = 5, 5, 5, + v_sca_adv_order = 3, 3, 3, + time_step_sound = 20, 20, 20, + moist_adv_opt = 1, 1, 1, + scalar_adv_opt = 1, 1, 1, + / + + &bdy_control + periodic_x = .false.,.false.,.false., + symmetric_xs = .false.,.false.,.false., + symmetric_xe = .false.,.false.,.false., + open_xs = .true., .false.,.false., + open_xe = .true., .false.,.false., + periodic_y = .false.,.false.,.false., + symmetric_ys = .false.,.false.,.false., + symmetric_ye = .false.,.false.,.false., + open_ys = .true., .false.,.false., + open_ye = .true., .false.,.false., + nested = .false., .true., .true., + / + + &grib2 + / + + &namelist_quilt + nio_tasks_per_group = 0, + nio_groups = 1, + / + + &fire ! be sure to set sr_x,sr_y in domains-namelist (to set refinement in x,y) + ifire = 2, ! integer, = 0: no fire, 2=turn on fire model + fire_fuel_read = 0, ! integer, -1: from WPS, 0= use fire_fuel_cat, 1= by altitude + fire_fuel_cat = 3, ! integer, if specified which fuel category? +! ignition + fire_replay_time =20, ! replay fire from input_tign_g until this, or set to 0 or less for no replay + fire_num_ignitions = 0, ! integer, only the first fire_num_ignition used, up to 5 allowed + fire_ignition_ros1 = 0.1, ! ignition rate of spread, m/s + fire_ignition_start_x1 = 1005, ! start points of ignition lines, in m from lower left corner + fire_ignition_start_y1 = 500, ! start points of ignition lines, in m from lower left corner + fire_ignition_end_x1 = 1005, ! end points of ignition lines, in m from lower left corner + fire_ignition_end_y1 = 1900, ! end points of ignition lines, in m from lower left corner + fire_ignition_radius1 = 18, ! all within this radius will ignite, > fire mesh step + fire_ignition_start_time1 = 2, ! sec for ignition from the start + fire_ignition_end_time1 =502, ! sec for ignition from the start + fire_ignition_ros2 = 0.01, ! ignition rate of spread, m/s + fire_ignition_start_x2 = 1503, ! start points of ignition lines, in m from lower left corner + fire_ignition_start_y2 = 500, ! start points of ignition lines, in m from lower left corner + fire_ignition_end_x2 = 1503, ! end points of ignition lines, in m from lower left corner + fire_ignition_end_y2 = 1900, ! end points of ignition lines, in m from lower left corner + fire_ignition_radius2 = 18, ! all within this radius will ignite, > fire mesh step + fire_ignition_start_time2 = 3, ! sec for ignition from the start! end ignition for sfire + fire_ignition_end_time2 =503, ! sec for ignition from the start! end ignition for sfire + fire_ignition_ros3 = 0.1, ! ignition rate of spread, m/s + !fire_ignition_start_x3 = 1400, ! start points of ignition lines, in m from lower left corner + !fire_ignition_start_y3 = 1400, ! start points of ignition lines, in m from lower left corner + !fire_ignition_end_x3 = 1400, ! end points of ignition lines, in m from lower left corner + !fire_ignition_end_y3 = 1400, ! end points of ignition lines, in m from lower left corner + !fire_ignition_radius3 = 50, ! all within this radius will ignite, > fire mesh step + !fire_ignition_start_time3 = 4, ! sec for ignition from the start! end ignition for sfire + !fire_ignition_end_time3 = 4, ! sec for ignition from the start! end ignition for sfire +! +! verbosity + fire_print_msg = 1, ! 1 print fire debugging messages + fire_print_file = 0, ! 1 write files for matlab +! +! experiments +! + + fire_const_time = -1., ! (s) if >0, time from start to stop fire evolution and keep heat output constant + fire_const_grnhfx = -1, ! (W/s) if both >=0, use this flux (meant to be used when fire_const_time=ignition time) + fire_const_grnqfx = -1, ! (W/s) if both >=0, use this flux (meant to be used when fire_const_time=ignition time) + fire_test_steps=0, ! >0 = on first call, do specified number of steps and terminate (testing only) + fire_mountain_type=1, ! in ideal: 0=none, 1= hill, 2=EW ridge, 3=NS ridge + fire_mountain_height=100., ! (m) ideal mountain height + fire_mountain_start_x=900., ! (m) coord of start of the mountain from lower left corder (just like ignition) + fire_mountain_start_y=1000., ! (m) coord of start of the mountain from lower left corder (just like ignition) + fire_mountain_end_x=1400., ! (m) coord of end of the mountain from lower left corder (just like ignition) + fire_mountain_end_y=1600., ! (m) coord of end of the mountain from lower left corder (just like ignition) + fire_topo_from_atm=0, ! 0 = fire mesh topo set from fine-res data, 1 = populate by interpolating from atmosphere + !delt_perturbation = 3.0, ! Temperature perturbation for creating cold (negative) / warm (positive) bubble [K], 0 turns it off + !xrad_perturbation = 10000.0, ! Horizontal radius of the bubble in E-W direction [m] + !yrad_perturbation = 10000.0, ! Horizontal radius of the bubble in N-S direction [m] + !zrad_perturbation = 1500.0, ! Vertical radius of the bubble [m] + !hght_perturbation = 1500.0, ! Perturbation height - height at which the warm/cold bubble will be suspended [m] + +! +! method switches for developers only, do not change! +! + fire_boundary_guard = -1, ! integer, number of cells to stop when fire close to the domain boundary, -1 turn off + fire_fuel_left_irl=2, ! refinement to integrate fuel_left, must be even + fire_fuel_left_jrl=2, ! refinement to integrate fuel_left, must be even + fire_atm_feedback=1.0, ! real, multiplier for heat fluxes, 1.=normal, 0.=turn off two-way coupling + fire_back_weight=0.5, ! RK timestepping coefficient, 0=forward, 0.5=Heun + fire_grows_only=1, ! if >0 level set function cannot increase = fire can only grow + fire_viscosity=0.4, ! artificial viscosity in level set method (max 1, needed with fire_upwinding=0) + fire_upwinding=3, ! 0=none, 1=standard, 2=godunov, 3=eno, 4=sethian + fire_fuel_left_method=1, ! for now, use 1 only + fire_lfn_ext_up=1.0, ! 0.=extend level set function at boundary by reflection, 1.=always up + fire_advection=0, ! 0 = cawfe, 1 = use abs speed/slope in spread rate, then project on normal to fireline +/