From e0c2dcbf0ebaea104207631c3b551c1a93bd0139 Mon Sep 17 00:00:00 2001 From: "Pedro A. Jimenez" Date: Fri, 30 Jan 2026 15:09:31 -0700 Subject: [PATCH 1/5] Impro memory ussage for atm z0 --- io/wrf_mod.F90 | 4 ++-- state/state_mod.F90 | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/io/wrf_mod.F90 b/io/wrf_mod.F90 index 9d92d23..b82306b 100644 --- a/io/wrf_mod.F90 +++ b/io/wrf_mod.F90 @@ -1129,10 +1129,10 @@ subroutine Update_atm_state (this, datetime_now, config_flags) call this%Get_q2 (datetime_now) call this%Get_psfc (datetime_now) call this%Get_rain (datetime_now) - call this%Get_z0 (datetime_now) select case (config_flags%wind_vinterp_opt) case (VINTERP_WINDS_FROM_3D_WINDS) + call this%Get_z0 (datetime_now) call this%Get_u3d (datetime_now) call this%Get_v3d (datetime_now) call this%Get_phl (datetime_now) @@ -1164,7 +1164,7 @@ subroutine Update_atm_state (this, datetime_now, config_flags) call this%Destroy_u3d () call this%Destroy_v3d () call this%Destroy_phl () -! call this%Destroy_z0 () + call this%Destroy_z0 () case (VINTERP_WINDS_FROM_10M_WINDS) call this%Get_u10 (datetime_now) diff --git a/state/state_mod.F90 b/state/state_mod.F90 index 9e3af27..0c8c7a7 100644 --- a/state/state_mod.F90 +++ b/state/state_mod.F90 @@ -780,9 +780,9 @@ subroutine Interpolate_vars_atm_to_fire (this, wrf, config_flags) if (.not. allocated (this%lats) .or. .not. allocated (this%lons)) & call Stop_simulation ('Init lats/lons before calling hinterp atm variables') - if (this%datetime_now == this%datetime_start) call wrf%Interp_var2grid (this%lats, this%lons, & - this%ifms, this%ifme, this%jfms, this%jfme, config_flags%num_tiles, this%i_start, this%i_end, & - this%j_start, this%j_end, 'fz0', config_flags%hinterp_opt, this%fz0) +! if (this%datetime_now == this%datetime_start) call wrf%Interp_var2grid (this%lats, this%lons, & +! this%ifms, this%ifme, this%jfms, this%jfme, config_flags%num_tiles, this%i_start, this%i_end, & +! this%j_start, this%j_end, 'fz0', config_flags%hinterp_opt, this%fz0) call wrf%Interp_var2grid (this%lats, this%lons, this%ifms, this%ifme, this%jfms, this%jfme, & config_flags%num_tiles, this%i_start, this%i_end, this%j_start, this%j_end, & From b399e839faba340986b09ebe7f4765f7f7e2196e Mon Sep 17 00:00:00 2001 From: "Pedro A. Jimenez" Date: Fri, 30 Jan 2026 15:15:59 -0700 Subject: [PATCH 2/5] More readable code for interpolation of atm vars --- io/wrf_mod.F90 | 7 ++----- state/state_mod.F90 | 8 ++------ 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/io/wrf_mod.F90 b/io/wrf_mod.F90 index b82306b..639e170 100644 --- a/io/wrf_mod.F90 +++ b/io/wrf_mod.F90 @@ -728,13 +728,10 @@ subroutine Interp_var2grid (this, lats_out, lons_out, ifms, ifme, jfms, jfme, & case ('rain') var_wrf = this%rain - case ('fz0') - var_wrf = this%z0 - - case ('uf') + case ('ua') var_wrf = this%ua - case ('vf') + case ('va') var_wrf = this%va case default diff --git a/state/state_mod.F90 b/state/state_mod.F90 index 0c8c7a7..343cc7c 100644 --- a/state/state_mod.F90 +++ b/state/state_mod.F90 @@ -780,17 +780,13 @@ subroutine Interpolate_vars_atm_to_fire (this, wrf, config_flags) if (.not. allocated (this%lats) .or. .not. allocated (this%lons)) & call Stop_simulation ('Init lats/lons before calling hinterp atm variables') -! if (this%datetime_now == this%datetime_start) call wrf%Interp_var2grid (this%lats, this%lons, & -! this%ifms, this%ifme, this%jfms, this%jfme, config_flags%num_tiles, this%i_start, this%i_end, & -! this%j_start, this%j_end, 'fz0', config_flags%hinterp_opt, this%fz0) - call wrf%Interp_var2grid (this%lats, this%lons, this%ifms, this%ifme, this%jfms, this%jfme, & config_flags%num_tiles, this%i_start, this%i_end, this%j_start, this%j_end, & - 'uf', config_flags%hinterp_opt, this%uf) + 'ua', config_flags%hinterp_opt, this%uf) call wrf%Interp_var2grid (this%lats, this%lons, this%ifms, this%ifme, this%jfms, this%jfme, & config_flags%num_tiles, this%i_start, this%i_end, this%j_start, this%j_end, & - 'vf', config_flags%hinterp_opt, this%vf) + 'va', config_flags%hinterp_opt, this%vf) if (config_flags%wind_vinterp_opt == 1) then call this%Apply_wafs () From b4884aa363d0ded6f350a53f3a6ec725226805be Mon Sep 17 00:00:00 2001 From: "Pedro A. Jimenez" Date: Fri, 30 Jan 2026 15:55:30 -0700 Subject: [PATCH 3/5] Set bilinear hinterp as default for offline simulations --- io/namelist_mod.F90 | 4 ++-- tests/test8.s | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/io/namelist_mod.F90 b/io/namelist_mod.F90 index 5ff35b4..ab241c7 100644 --- a/io/namelist_mod.F90 +++ b/io/namelist_mod.F90 @@ -50,7 +50,7 @@ module namelist_mod real :: fire_wind_height = 6.096 ! "height of uah,vah wind in fire spread formula" "m" integer :: wind_vinterp_opt = 0 ! "mid-flame height wind interpolation option: 0) Interp to specified height, 1) Use WAFs" - integer :: hinterp_opt = 1 ! "Horizontal interpolation from atm to fire (offline option): 1) ngp, 2)bi-linear" + integer :: hinterp_opt = 2 ! "Horizontal interpolation from atm to fire (offline option): 1) ngp, 2)bi-linear" logical :: fire_lsm_zcoupling = .false. ! "flag to activate reference velocity at a different height from fire_wind_height" real :: fire_lsm_zcoupling_ref = 50.0 ! "reference height from wich u at fire_wind_hegiht is calculated using a logarithmic profile" "m" @@ -412,7 +412,7 @@ subroutine Init_fire_block (this, file_name) real :: fmoist_dt = 600 ! "moisture model time step" "s" real :: fire_wind_height = 6.096 ! "height of uah,vah wind in fire spread formula" "m" integer :: wind_vinterp_opt = 0 ! "mid-flame height wind interpolation option: 0) Interp to specified height, 1) Use WAFs" - integer :: hinterp_opt = 1 ! "Horizontal interpolation from atm to fire (offline option): 1) ngp, 2) bi-linear" + integer :: hinterp_opt = 2 ! "Horizontal interpolation from atm to fire (offline option): 1) ngp, 2) bi-linear" logical :: fire_is_real_perim = .false. ! .false. = point/line ignition, .true. = observed perimeter" real :: frac_fburnt_to_smoke = 0.02 ! "parts per unit of burned fuel becoming smoke " "g_smoke/kg_air" real :: fuelmc_g = 0.08 ! Fuel moisture content ground (Dead FMC) diff --git a/tests/test8.s b/tests/test8.s index b9a304e..940235f 100755 --- a/tests/test8.s +++ b/tests/test8.s @@ -80,7 +80,7 @@ then test=$(diff ./file1.dat ./file2.dat | wc -l) # Here we allow one difference since we are not expecting bit4bit results - echo $test +# echo $test if [ $test -eq 4 ] then echo ' Ignore this difference:' @@ -105,8 +105,9 @@ then grep "$var" $file_wrf | awk '{print $2, $7}' > ./file2.dat test=$(diff ./file1.dat ./file2.dat | wc -l) - echo $test - if [ $test -eq 8 ] +# echo $test + # Here we allow one difference since we are not expecting bit4bit results + if [ $test -eq 4 ] then echo ' Ignore this difference:' diff ./file1.dat ./file2.dat @@ -130,12 +131,11 @@ then grep "$var" $file_wrf | awk '{print $2, $7}' > ./file2.dat test=$(diff ./file1.dat ./file2.dat | wc -l) - echo $test - # Here we allow one difference since we are not expecting bit4bit results - if [ $test -eq 4 ] +# echo $test + if [ $test -eq 0 ] then - echo ' Ignore this difference:' - diff ./file1.dat ./file2.dat +# echo ' Ignore this difference:' +# diff ./file1.dat ./file2.dat echo ' Test8.4 PASSED' n_test_passed=$(expr $n_test_passed + 1) else @@ -157,7 +157,7 @@ then test=$(diff ./file1.dat ./file2.dat | wc -l) # Here we allow one difference since we are not expecting bit4bit results - echo $test +# echo $test if [ $test -eq 8 ] then echo ' Ignore this difference:' From e3c2969cb43fb73553772faa0464f4f0bb01d649 Mon Sep 17 00:00:00 2001 From: "Pedro A. Jimenez" Date: Fri, 30 Jan 2026 16:03:58 -0700 Subject: [PATCH 4/5] Set as default 10 m + wafs to calc mid-flame winds --- io/namelist_mod.F90 | 4 ++-- tests/test7/namelist.fire | 1 + tests/test8/namelist.fire | 1 + tests/testx/namelist.fire | 1 + 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/io/namelist_mod.F90 b/io/namelist_mod.F90 index ab241c7..aeb0ee0 100644 --- a/io/namelist_mod.F90 +++ b/io/namelist_mod.F90 @@ -49,7 +49,7 @@ module namelist_mod integer :: fast_dist_reinit_freq = 600 ! Number of time steps to perform a reinit with fast distance reinit method real :: fire_wind_height = 6.096 ! "height of uah,vah wind in fire spread formula" "m" - integer :: wind_vinterp_opt = 0 ! "mid-flame height wind interpolation option: 0) Interp to specified height, 1) Use WAFs" + integer :: wind_vinterp_opt = 1 ! "mid-flame height wind interpolation option: 0) Interp to specified height, 1) Use WAFs" integer :: hinterp_opt = 2 ! "Horizontal interpolation from atm to fire (offline option): 1) ngp, 2)bi-linear" logical :: fire_lsm_zcoupling = .false. ! "flag to activate reference velocity at a different height from fire_wind_height" real :: fire_lsm_zcoupling_ref = 50.0 ! "reference height from wich u at fire_wind_hegiht is calculated using a logarithmic profile" "m" @@ -411,7 +411,7 @@ subroutine Init_fire_block (this, file_name) integer :: fmoist_freq = 0 ! "frequency to run moisture model 0: use fmoist_dt, k>0: every k timesteps" "1" real :: fmoist_dt = 600 ! "moisture model time step" "s" real :: fire_wind_height = 6.096 ! "height of uah,vah wind in fire spread formula" "m" - integer :: wind_vinterp_opt = 0 ! "mid-flame height wind interpolation option: 0) Interp to specified height, 1) Use WAFs" + integer :: wind_vinterp_opt = 1 ! "mid-flame height wind interpolation option: 0) Interp to specified height, 1) Use WAFs" integer :: hinterp_opt = 2 ! "Horizontal interpolation from atm to fire (offline option): 1) ngp, 2) bi-linear" logical :: fire_is_real_perim = .false. ! .false. = point/line ignition, .true. = observed perimeter" real :: frac_fburnt_to_smoke = 0.02 ! "parts per unit of burned fuel becoming smoke " "g_smoke/kg_air" diff --git a/tests/test7/namelist.fire b/tests/test7/namelist.fire index 58ce971..43db030 100644 --- a/tests/test7/namelist.fire +++ b/tests/test7/namelist.fire @@ -35,5 +35,6 @@ fire_atm_feedback = 1.0, ! real, multiplier for heat fluxes, 1.=normal, 0.=turn off two-way coupling fire_viscosity = 0.4, ! artificial viscosity in level set method (max 1, needed with fire_upwinding=0) fire_upwinding = 9, ! 0=none, 1=standard, 2=godunov, 3=eno, 4=sethian + wind_vinterp_opt = 0, / diff --git a/tests/test8/namelist.fire b/tests/test8/namelist.fire index ba75bdf..1df4976 100644 --- a/tests/test8/namelist.fire +++ b/tests/test8/namelist.fire @@ -37,5 +37,6 @@ fire_upwinding = 9, ! 0=none, 1=standard, 2=godunov, 3=eno, 4=sethian fmoist_run = .true., ! Run fuel moisture model fmoist_freq = 1, ! Fuel moisture model updated every time step + wind_vinterp_opt = 0 / diff --git a/tests/testx/namelist.fire b/tests/testx/namelist.fire index fffaea8..6b08cd7 100644 --- a/tests/testx/namelist.fire +++ b/tests/testx/namelist.fire @@ -35,6 +35,7 @@ fire_atm_feedback = 1.0, ! real, multiplier for heat fluxes, 1.=normal, 0.=turn off two-way coupling fire_viscosity = 0.4, ! artificial viscosity in level set method (max 1, needed with fire_upwinding=0) fire_upwinding = 9, ! 0=none, 1=standard, 2=godunov, 3=eno, 4=sethian + wind_vinterp_opt = 0 / &ideal From c7ea8d33197140c9da75e692be522860e4406c18 Mon Sep 17 00:00:00 2001 From: "Pedro A. Jimenez" Date: Fri, 30 Jan 2026 16:07:40 -0700 Subject: [PATCH 5/5] Tests configure to run on 16 tiles --- tests/test7/namelist.fire | 1 + tests/test8/namelist.fire | 1 + tests/testx/namelist.fire | 1 + 3 files changed, 3 insertions(+) diff --git a/tests/test7/namelist.fire b/tests/test7/namelist.fire index 43db030..d6931c7 100644 --- a/tests/test7/namelist.fire +++ b/tests/test7/namelist.fire @@ -13,6 +13,7 @@ end_second = 10 dt = 0.5 interval_output = 1 + num_tiles = 16, / &atm diff --git a/tests/test8/namelist.fire b/tests/test8/namelist.fire index 1df4976..502787d 100644 --- a/tests/test8/namelist.fire +++ b/tests/test8/namelist.fire @@ -13,6 +13,7 @@ end_second = 10 dt = 0.5 interval_output = 1 + num_tiles = 16, / &atm diff --git a/tests/testx/namelist.fire b/tests/testx/namelist.fire index 6b08cd7..5dfd895 100644 --- a/tests/testx/namelist.fire +++ b/tests/testx/namelist.fire @@ -13,6 +13,7 @@ end_second = 10 dt = 0.5 interval_output = 1 + num_tiles = 16, / &atm