From 5b8403b28367761dd99bf11bbf48215f97ac1eb2 Mon Sep 17 00:00:00 2001 From: "Pedro A. Jimenez" Date: Fri, 30 Jan 2026 16:46:59 -0700 Subject: [PATCH 1/6] Better default settings in the time nml block --- io/namelist_mod.F90 | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/io/namelist_mod.F90 b/io/namelist_mod.F90 index aeb0ee0..5091a2d 100644 --- a/io/namelist_mod.F90 +++ b/io/namelist_mod.F90 @@ -670,22 +670,23 @@ subroutine Init_time_block (this, file_name) num_tiles - start_year = 0 - start_month = 0 - start_day = 0 - start_hour = 0 - start_minute = 0 - start_second = 0 - end_year = 0 - end_month = 0 - end_day = 0 - end_hour = 0 - end_minute = 0 - end_second = 0 - dt = 2.0 - interval_output = 0 - num_tiles = 1 - tile_strategy = 0 + start_year = this%start_year + start_month = this%start_month + start_day = this%start_day + start_hour = this%start_hour + start_minute = this%start_minute + start_second = this%start_second + end_year = this%end_year + end_month = this%end_month + end_day = this%end_day + end_hour = this%end_hour + end_minute = this%end_minute + end_second = this%end_second + dt = this%dt + interval_output = this%interval_output + + num_tiles = this%num_tiles + tile_strategy = this%tile_strategy open (newunit = unit_nml, file = trim (file_name), action = 'read', iostat = io_stat) if (io_stat /= 0) then From f136f7ea791e3b0b7b29e513b5a0e15dc13a4456 Mon Sep 17 00:00:00 2001 From: "Pedro A. Jimenez" Date: Fri, 30 Jan 2026 17:07:04 -0700 Subject: [PATCH 2/6] Improved doc namelist and atm block --- io/namelist_mod.F90 | 48 +++++++++++++++++++++++++++------------------ 1 file changed, 29 insertions(+), 19 deletions(-) diff --git a/io/namelist_mod.F90 b/io/namelist_mod.F90 index 5091a2d..f1bd06b 100644 --- a/io/namelist_mod.F90 +++ b/io/namelist_mod.F90 @@ -20,14 +20,27 @@ module namelist_mod integer, parameter :: NO_FMC_MODEL = -1 type :: namelist_t - integer :: start_year = -1, start_month = -1, start_day = -1, start_hour = -1, start_minute = -1, start_second = -1, & - end_year = -1, end_month = -1, end_day = -1, end_hour = -1, end_minute = -1, end_second = -1, interval_output = -1, & - interval_atm = -1 - real :: dt = 2.0 - - integer :: num_tiles = 1 - integer :: tile_strategy = 0 - + ! time block + integer :: start_year = -1 ! start year of the simulation + integer :: start_month = -1 ! Start month + integer :: start_day = -1 ! Start day + integer :: start_hour = -1 ! Start hour + integer :: start_minute = -1 ! Start minute + integer :: start_second = -1 ! Start sencond + integer :: end_year = -1 ! End year of the simulation + integer :: end_month = -1 ! End month + integer :: end_day = -1 ! End day + integer :: end_hour = -1 ! End hour + integer :: end_minute = -1 ! End minute + integer :: end_second = -1 ! End second + + integer :: interval_output = -1 ! Frequency to save the output [s] + real :: dt = 2.0 ! Time step of the fire model [s] + + integer :: num_tiles = 1 ! Number of tiles in each patch + integer :: tile_strategy = 0 ! Strategy for the tile decomposition: 0) ... + + ! fire block integer :: fire_print_msg = 0 ! "write fire statistics, 0 no writes, 1+ for more" "" real :: fire_atm_feedback = 1.0 ! "the heat fluxes to the atmosphere are multiplied by this" "1" logical :: fire_is_real_perim = .false. ! .false. = point/line ignition, .true. = observed perimeter" @@ -138,8 +151,9 @@ module namelist_mod real :: true_lat_1 = LAT_DEFAULT real :: true_lat_2 = LAT_DEFAULT - ! Atmosphere - integer :: kde = 1 + ! Atm block + integer :: interval_atm = -1 ! Time step [s] of the atm (or frequency to read atm data if offline) + integer :: kde = 1 ! Number of atm vertical levels contains procedure, public :: Broadcast_nml => Broadcast_nml procedure, public :: Check_nml => Check_nml @@ -147,7 +161,7 @@ module namelist_mod procedure, public :: Init_fire_block => Init_fire_block procedure, public :: Init_ideal_block => Init_ideal_block procedure, public :: Init_time_block => Init_time_block - procedure, public :: Init_atm_block => Init_atm_block_legacy + procedure, public :: Init_atm_block => Init_atm_block end type namelist_t contains @@ -349,7 +363,7 @@ subroutine Check_nml (this) end subroutine Check_nml - subroutine Init_atm_block_legacy (this, file_name) + subroutine Init_atm_block (this, file_name) implicit none @@ -360,13 +374,11 @@ subroutine Init_atm_block_legacy (this, file_name) integer :: unit_nml, io_stat character (len = :), allocatable :: msg - namelist /atm/ kde, interval_atm - interval_atm = 0 - ! The following vars are legacy vars - kde = 2 + interval_atm = this%interval_atm + kde = this%kde open (newunit = unit_nml, file = trim (file_name), action = 'read', iostat = io_stat) if (io_stat /= 0) then @@ -379,11 +391,9 @@ subroutine Init_atm_block_legacy (this, file_name) close (unit_nml) this%interval_atm = interval_atm - - ! Legacy vars this%kde = kde - end subroutine Init_atm_block_legacy + end subroutine Init_atm_block subroutine Init_fire_block (this, file_name) From e5cf9f1a8b642bf1487ebeb28b7d52fab817218e Mon Sep 17 00:00:00 2001 From: "Pedro A. Jimenez" Date: Fri, 30 Jan 2026 17:16:22 -0700 Subject: [PATCH 3/6] More generic default settings for ideal nml block --- io/namelist_mod.F90 | 78 +++++++++++++++++++++------------------------ 1 file changed, 37 insertions(+), 41 deletions(-) diff --git a/io/namelist_mod.F90 b/io/namelist_mod.F90 index f1bd06b..8f43c92 100644 --- a/io/namelist_mod.F90 +++ b/io/namelist_mod.F90 @@ -12,10 +12,7 @@ module namelist_mod public :: namelist_t, FIRE_MAX_IGNITIONS_IN_NAMELIST integer, parameter :: FIRE_MAX_IGNITIONS_IN_NAMELIST = 5 - ! Default ideal block - real, parameter :: DX_DEFAULT = 100.0, U_DEFAULT = 5.0, V_DEFAULT = 0.0, LAT_DEFAULT = 40.3636, LON_DEFAULT = -4.4035, & - DZ_DX_DEFAULT = 0.0, ELEVATION_DEFAULT = 0.0 - integer, parameter :: IDEAL_OPT_DEFAULT = 0, NX_DEFAULT = 100, FUEL_CAT_DEFAULT = 1 + ! Default options integer, parameter :: NO_FMC_MODEL = -1 @@ -76,7 +73,7 @@ module namelist_mod integer :: fmoist_freq = 0 ! frequency to run moisture model 0: use fmoist_dt, k>0: every k timesteps real :: fmoist_dt = 600.0 ! moisture model time step [s] - integer :: ideal_opt = IDEAL_OPT_DEFAULT ! 0) real world, 1) ideal + integer :: ideal_opt = 0 ! 0) real world, 1) ideal ! Objects integer :: fuel_opt = 1 ! Fuel model @@ -133,23 +130,23 @@ module namelist_mod real :: fire_ignition_radius5 = 0.0 ! Ideal block - real :: dx = DX_DEFAULT - real :: dy = DX_DEFAULT - integer :: nx = NX_DEFAULT - integer :: ny = NX_DEFAULT - - real :: zonal_wind = U_DEFAULT - real :: meridional_wind = V_DEFAULT - integer :: fuel_cat = FUEL_CAT_DEFAULT - real :: dz_dx = DZ_DX_DEFAULT - real :: dz_dy = DZ_DX_DEFAULT - real :: elevation = ELEVATION_DEFAULT - - real :: cen_lat = LAT_DEFAULT - real :: cen_lon = LON_DEFAULT - real :: stand_lon = LON_DEFAULT - real :: true_lat_1 = LAT_DEFAULT - real :: true_lat_2 = LAT_DEFAULT + real :: dx = 100.0 + real :: dy = 100.0 + integer :: nx = 100 + integer :: ny = 100 + + real :: zonal_wind = 5.0 + real :: meridional_wind = 0.0 + integer :: fuel_cat = 1 + real :: dz_dx = 0.0 + real :: dz_dy = 0.0 + real :: elevation = 0.0 + + real :: cen_lat = 40.3636 + real :: cen_lon = -4.4035 + real :: stand_lon = -4.4035 + real :: true_lat_1 = 40.363 + real :: true_lat_2 = 40.363 ! Atm block integer :: interval_atm = -1 ! Time step [s] of the atm (or frequency to read atm data if offline) @@ -429,7 +426,7 @@ subroutine Init_fire_block (this, file_name) real :: fuelmc_g_live = 0.30 ! Fuel moisture content ground (Live FMC). 30% Completely cured, treat as dead fuel real :: fuelmc_c = 1.00 ! Fuel moisture content canopy - integer :: ideal_opt = IDEAL_OPT_DEFAULT + integer :: ideal_opt = 0 ! Objects integer :: fuel_opt = 1 ! Fuel model @@ -611,23 +608,23 @@ subroutine Init_ideal_block (this, file_name) ! Set default values - dx = DX_DEFAULT - dy = DX_DEFAULT - nx = NX_DEFAULT - ny = NX_DEFAULT - - zonal_wind = U_DEFAULT - meridional_wind = V_DEFAULT - fuel_cat = FUEL_CAT_DEFAULT - dz_dx = DZ_DX_DEFAULT - dz_dy = DZ_DX_DEFAULT - elevation = ELEVATION_DEFAULT - - cen_lat = LAT_DEFAULT - cen_lon = LON_DEFAULT - stand_lon = LON_DEFAULT - true_lat_1 = LAT_DEFAULT - true_lat_2 = LAT_DEFAULT + dx = this%dx + dy = this%dy + nx = this%nx + ny = this%ny + + zonal_wind = this%zonal_wind + meridional_wind = this%meridional_wind + fuel_cat = this%fuel_cat + dz_dx = this%dz_dx + dz_dy = this%dz_dy + elevation = this%elevation + + cen_lat = this%cen_lat + cen_lon = this%cen_lon + stand_lon = this%stand_lon + true_lat_1 = this%true_lat_1 + true_lat_2 = this%true_lat_2 open (newunit = unit_nml, file = trim (file_name), action = 'read', iostat = io_stat) if (io_stat /= 0) then @@ -641,7 +638,6 @@ subroutine Init_ideal_block (this, file_name) this%dx = dx this%dy = dy - this%nx = nx this%ny = ny From a0e0dd6548645f5534793cf3113549d623fbdf94 Mon Sep 17 00:00:00 2001 From: "Pedro A. Jimenez" Date: Fri, 30 Jan 2026 17:27:05 -0700 Subject: [PATCH 4/6] More doc in the namelist + default options --- io/namelist_mod.F90 | 55 ++++++++++++++++++++++++--------------------- 1 file changed, 29 insertions(+), 26 deletions(-) diff --git a/io/namelist_mod.F90 b/io/namelist_mod.F90 index 8f43c92..bf2bcf9 100644 --- a/io/namelist_mod.F90 +++ b/io/namelist_mod.F90 @@ -14,7 +14,10 @@ module namelist_mod integer, parameter :: FIRE_MAX_IGNITIONS_IN_NAMELIST = 5 ! Default options - integer, parameter :: NO_FMC_MODEL = -1 + integer, parameter :: DEFAULT_FUEL_OPT = 1 + integer, parameter :: DEFAULT_ROS_OPT = 0 + integer, parameter :: DEFAULT_FMC_OPT = -1 + integer, parameter :: DEFAULT_EMIS_OPT = 0 type :: namelist_t ! time block @@ -64,7 +67,7 @@ module namelist_mod 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" - real :: frac_fburnt_to_smoke = 0.02 ! "parts per unit of burned fuel becoming smoke" "g_smoke/kg_air" + 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) real :: fuelmc_g_live = 0.30 ! Fuel moisture content ground (Live FMC). 30% Completely cured, treat as dead fuel real :: fuelmc_c = 1.00 ! Fuel moisture content canopy @@ -76,13 +79,13 @@ module namelist_mod integer :: ideal_opt = 0 ! 0) real world, 1) ideal ! Objects - integer :: fuel_opt = 1 ! Fuel model - integer :: ros_opt = 0 ! ROS parameterization - integer :: fmc_opt = NO_FMC_MODEL ! FMC model - integer :: emis_opt = 0 ! Object to be added. 0) WRF-Fire emiss, 1) PM2.5 as a function of FMC + integer :: fuel_opt = DEFAULT_FUEL_OPT ! Fuel model + integer :: ros_opt = DEFAULT_ROS_OPT ! ROS parameterization + integer :: fmc_opt = DEFAULT_FMC_OPT ! FMC model + integer :: emis_opt = DEFAULT_EMIS_OPT ! Object to be added. 0) WRF-Fire emiss, 1) PM2.5 as a function of FMC ! Ignitions - integer :: fire_num_ignitions = 0 ! "number of ignition lines" + integer :: fire_num_ignitions = 0 ! "number of ignition lines" real :: fire_ignition_start_lon1 = 0.0 ! "long coord of start of ignition line" "deg" real :: fire_ignition_start_lat1 = 0.0 ! "lat coord of start of ignition line" "deg" @@ -130,27 +133,27 @@ module namelist_mod real :: fire_ignition_radius5 = 0.0 ! Ideal block - real :: dx = 100.0 - real :: dy = 100.0 - integer :: nx = 100 - integer :: ny = 100 - - real :: zonal_wind = 5.0 - real :: meridional_wind = 0.0 - integer :: fuel_cat = 1 - real :: dz_dx = 0.0 - real :: dz_dy = 0.0 - real :: elevation = 0.0 - - real :: cen_lat = 40.3636 - real :: cen_lon = -4.4035 - real :: stand_lon = -4.4035 - real :: true_lat_1 = 40.363 - real :: true_lat_2 = 40.363 + real :: dx = 100.0 ! grid spacing in x direction [m] + real :: dy = 100.0 ! grid spacing in y direction [m] + integer :: nx = 100 ! number of grid points in x direction + integer :: ny = 100 ! number of grid points in y direction + + real :: zonal_wind = 5.0 ! zonal wind [m s-1] + real :: meridional_wind = 0.0 ! meridional wind [m s-1] + integer :: fuel_cat = 1 ! fuel type + real :: dz_dx = 0.0 ! slope in x direction + real :: dz_dy = 0.0 ! slope in y direction + real :: elevation = 0.0 ! Elevation [m] + + real :: cen_lat = 40.3636 ! center latitude of the grid + real :: cen_lon = -4.4035 ! center longitude of the grid + real :: stand_lon = -4.4035 ! standard longitude + real :: true_lat_1 = 40.363 ! true latitude 1 + real :: true_lat_2 = 40.363 ! true latitude 2 ! Atm block - integer :: interval_atm = -1 ! Time step [s] of the atm (or frequency to read atm data if offline) - integer :: kde = 1 ! Number of atm vertical levels + integer :: interval_atm = -1 ! Time step [s] of the atm (or frequency to read atm data if offline) + integer :: kde = 1 ! Number of atm vertical levels contains procedure, public :: Broadcast_nml => Broadcast_nml procedure, public :: Check_nml => Check_nml From 339fa122f3a791780eab0aa4cd7a1ce27bc85c56 Mon Sep 17 00:00:00 2001 From: "Pedro A. Jimenez" Date: Fri, 30 Jan 2026 17:54:38 -0700 Subject: [PATCH 5/6] Better initialization of settings in the fire block --- io/namelist_mod.F90 | 176 ++++++++++++++++++++++++++------------------ 1 file changed, 104 insertions(+), 72 deletions(-) diff --git a/io/namelist_mod.F90 b/io/namelist_mod.F90 index bf2bcf9..172df6d 100644 --- a/io/namelist_mod.F90 +++ b/io/namelist_mod.F90 @@ -402,81 +402,32 @@ subroutine Init_fire_block (this, file_name) class (namelist_t), intent (in out) :: this character (len = *), intent (in) :: file_name - integer :: fire_print_msg = 0 ! "write fire statistics, 0 no writes, 1+ for more" "" - real :: fire_atm_feedback = 1.0 ! "the heat fluxes to the atmosphere are multiplied by this" "1" - integer :: fire_upwinding = 9 ! "upwind normal spread: 1=standard, 2=godunov, 3=eno, 4=sethian, 5=2nd-order, 6=WENO3, 7=WENO5, 8=hybrid WENO3/ENO1, 9=hybrid WENO5/ENO1" "1" - real :: fire_viscosity = 0.4 ! "artificial viscosity in level set method" "1" - logical :: fire_lsm_reinit = .true. ! "flag to activate reinitialization of level set method" - integer :: fire_lsm_reinit_iter = 1 ! "number of iterations for the reinitialization PDE" - integer :: fire_upwinding_reinit = 4 ! "numerical scheme (space) for reinitialization PDE: 1=WENO3, 2=WENO5, 3=hybrid WENO3-ENO1, 4=hybrid WENO5-ENO1" - integer :: fire_lsm_band_ngp = 4 ! "number of grid points around lfn=0 that WENO5/3 is used (ENO1 elsewhere), for fire_upwinding_reinit=4,5 and fire_upwinding=8,9 options" - integer :: fast_dist_reinit_opt = 0 ! Fast distance reinit method: 0) None, 1) FSM - integer :: fast_dist_reinit_freq = 600 ! Number of time steps to perform a reinit with fast distance reinit method - 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" - real :: fire_viscosity_bg = 0.4 ! "artificial viscosity in the near-front region" "1" - real :: fire_viscosity_band = 0.5 ! "number of times the hybrid advection band to transition from fire_viscosity_bg to fire_viscosity" "1" - integer :: fire_viscosity_ngp = 2 ! "number of grid points around lfn=0 where low artificial viscosity is used = fire_viscosity_bg" - logical :: fmoist_run = .false. ! "run moisture model (on the atmospheric grid), output to fmc_gc" - 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 = 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" - real :: fuelmc_g = 0.08 ! Fuel moisture content ground (Dead FMC) - real :: fuelmc_g_live = 0.30 ! Fuel moisture content ground (Live FMC). 30% Completely cured, treat as dead fuel - real :: fuelmc_c = 1.00 ! Fuel moisture content canopy - - integer :: ideal_opt = 0 - - ! Objects - integer :: fuel_opt = 1 ! Fuel model - integer :: ros_opt = 0 ! ROS parameterization - integer :: fmc_opt = -1 ! FMC model - integer :: emis_opt = 0 ! Smoke emissions + integer :: fire_print_msg, fire_upwinding, fire_lsm_reinit_iter, fire_upwinding_reinit, fire_lsm_band_ngp, & + fast_dist_reinit_opt, fast_dist_reinit_freq, fire_viscosity_ngp, wind_vinterp_opt, hinterp_opt, ideal_opt, & + fuel_opt, ros_opt, fmc_opt, emis_opt, fmoist_freq + real :: fire_atm_feedback, fire_viscosity, fire_lsm_zcoupling_ref, fire_viscosity_bg, fire_viscosity_band, & + fmoist_dt, fire_wind_height, frac_fburnt_to_smoke, fuelmc_g, fuelmc_g_live, fuelmc_c + logical :: fire_lsm_reinit, fire_lsm_zcoupling, fmoist_run, fire_is_real_perim ! ignitions - integer :: fire_num_ignitions = 0 - - real :: fire_ignition_start_lon1 = 0.0 ! "long coord of start of ignition line" "deg" - real :: fire_ignition_start_lat1 = 0.0 ! "lat coord of start of ignition line" "deg" - real :: fire_ignition_end_lon1 = 0.0 ! "long coord of end of ignition line" "deg" - real :: fire_ignition_end_lat1 = 0.0 ! "lat coord of end of ignition line" "deg" - real :: fire_ignition_ros1 = 0.01 ! "rate of spread during ignition" "m/s" - real :: fire_ignition_start_time1 = 0.0 ! "ignition line start time" "s" - real :: fire_ignition_end_time1 = 0.0 ! "ignition line end time" "s" - real :: fire_ignition_radius1 = 0.0 ! "ignite all within the radius" "m" + integer :: fire_num_ignitions + real :: fire_ignition_start_lon1, fire_ignition_start_lat1, fire_ignition_end_lon1, fire_ignition_end_lat1, & + fire_ignition_ros1, fire_ignition_start_time1, fire_ignition_end_time1, fire_ignition_radius1 + real :: fire_ignition_start_lon2, fire_ignition_start_lat2, fire_ignition_end_lon2, fire_ignition_end_lat2, & + fire_ignition_ros2, fire_ignition_start_time2, fire_ignition_end_time2, fire_ignition_radius2 + real :: fire_ignition_start_lon3, fire_ignition_start_lat3, fire_ignition_end_lon3, fire_ignition_end_lat3, & + fire_ignition_ros3, fire_ignition_start_time3, fire_ignition_end_time3, fire_ignition_radius3 + real :: fire_ignition_start_lon4, fire_ignition_start_lat4, fire_ignition_end_lon4, fire_ignition_end_lat4, & + fire_ignition_ros4, fire_ignition_start_time4, fire_ignition_end_time4, fire_ignition_radius4 + real :: fire_ignition_start_lon5, fire_ignition_start_lat5, fire_ignition_end_lon5, fire_ignition_end_lat5, & + fire_ignition_ros5, fire_ignition_start_time5, fire_ignition_end_time5, fire_ignition_radius5 - real :: fire_ignition_start_lon2 = 0.0, fire_ignition_start_lat2 = 0.0, fire_ignition_end_lon2 = 0.0, & - fire_ignition_end_lat2 = 0.0, & - fire_ignition_ros2 = 0.01, fire_ignition_start_time2 = 0.0, fire_ignition_end_time2 = 0.0, fire_ignition_radius2 = 0.0 - - real :: fire_ignition_start_lon3 = 0.0, fire_ignition_start_lat3 = 0.0, fire_ignition_end_lon3 = 0.0, & - fire_ignition_end_lat3 = 0.0, & - fire_ignition_ros3 = 0.01, fire_ignition_start_time3 = 0.0, fire_ignition_end_time3 = 0.0, fire_ignition_radius3 = 0.0 - - real :: fire_ignition_start_lon4 = 0.0, fire_ignition_start_lat4 = 0.0, fire_ignition_end_lon4 = 0.0, & - fire_ignition_end_lat4 = 0.0, & - fire_ignition_ros4 = 0.01, fire_ignition_start_time4 = 0.0, fire_ignition_end_time4 = 0.0, fire_ignition_radius4 = 0.0 - - real :: fire_ignition_start_lon5 = 0.0, fire_ignition_start_lat5 = 0.0, fire_ignition_end_lon5 = 0.0, & - fire_ignition_end_lat5 = 0.0, & - fire_ignition_ros5 = 0.01, fire_ignition_start_time5 = 0.0, fire_ignition_end_time5 = 0.0, fire_ignition_radius5 = 0.0 - - namelist /fire/ fire_print_msg, fire_atm_feedback, & - fire_upwinding, fire_viscosity, fire_lsm_reinit, fast_dist_reinit_opt, fast_dist_reinit_freq, & - fire_lsm_reinit_iter, fire_upwinding_reinit, fire_lsm_band_ngp, fire_lsm_zcoupling, fire_lsm_zcoupling_ref, & - fire_viscosity_bg, fire_viscosity_band, fire_viscosity_ngp, fmoist_run, & - fmoist_freq, fmoist_dt, & - fire_wind_height, fire_is_real_perim, frac_fburnt_to_smoke, fuelmc_g, & - fuelmc_g_live, fuelmc_c, & - ideal_opt, & - ! objects - fuel_opt, ros_opt, fmc_opt, emis_opt, & - wind_vinterp_opt, & - hinterp_opt, & + namelist /fire/ fire_print_msg, fire_atm_feedback, fire_upwinding, fire_viscosity, fire_lsm_reinit, & + fast_dist_reinit_opt, fast_dist_reinit_freq, fire_lsm_reinit_iter, fire_upwinding_reinit, & + fire_lsm_band_ngp, fire_lsm_zcoupling, fire_lsm_zcoupling_ref, fire_viscosity_bg, fire_viscosity_band, & + fire_viscosity_ngp, fmoist_run, fmoist_freq, fmoist_dt, fire_wind_height, fire_is_real_perim, & + frac_fburnt_to_smoke, fuelmc_g, fuelmc_g_live, fuelmc_c, ideal_opt, fuel_opt, ros_opt, fmc_opt, emis_opt, & + wind_vinterp_opt, hinterp_opt, & ! Ignitions fire_num_ignitions, & ! Ignition 1 @@ -499,6 +450,87 @@ subroutine Init_fire_block (this, file_name) character (len = :), allocatable :: msg + fire_print_msg = this%fire_print_msg + fire_atm_feedback = this%fire_atm_feedback + fire_upwinding = this%fire_upwinding + fire_viscosity = this%fire_viscosity + fire_lsm_reinit = this%fire_lsm_reinit + fire_lsm_reinit_iter = this%fire_lsm_reinit_iter + fire_upwinding_reinit = this%fire_upwinding_reinit + fire_lsm_band_ngp = this%fire_lsm_band_ngp + fast_dist_reinit_opt = this%fast_dist_reinit_opt + fast_dist_reinit_freq = this%fast_dist_reinit_freq + fire_lsm_zcoupling = this%fire_lsm_zcoupling + fire_lsm_zcoupling_ref = this%fire_lsm_zcoupling_ref + fire_viscosity_bg = this%fire_viscosity_bg + fire_viscosity_band = this%fire_viscosity_band + fire_viscosity_ngp = this%fire_viscosity_ngp + fmoist_run = this%fmoist_run + fmoist_freq = this%fmoist_freq + fmoist_dt = this%fmoist_dt + fire_wind_height = this%fire_wind_height + fire_is_real_perim = this%fire_is_real_perim + frac_fburnt_to_smoke = this%frac_fburnt_to_smoke + fuelmc_g = this%fuelmc_g + fuelmc_g_live = this%fuelmc_g_live + fuelmc_c = this%fuelmc_c + + ideal_opt = this%ideal_opt + + fuel_opt = this%fuel_opt + ros_opt = this%ros_opt + fmc_opt = this%fmc_opt + emis_opt = this%emis_opt + wind_vinterp_opt = this%wind_vinterp_opt + hinterp_opt = this%hinterp_opt + + fire_num_ignitions = this%fire_num_ignitions + + fire_ignition_start_lon1 = this%fire_ignition_start_lon1 + fire_ignition_start_lat1 = this%fire_ignition_start_lat1 + fire_ignition_end_lon1 = this%fire_ignition_end_lon1 + fire_ignition_end_lat1 = this%fire_ignition_end_lat1 + fire_ignition_ros1 = this%fire_ignition_ros1 + fire_ignition_start_time1 = this%fire_ignition_start_time1 + fire_ignition_end_time1 = this%fire_ignition_end_time1 + fire_ignition_radius1 = this%fire_ignition_radius1 + + fire_ignition_start_lon2 = this%fire_ignition_start_lon2 + fire_ignition_start_lat2 = this%fire_ignition_start_lat2 + fire_ignition_end_lon2 = this%fire_ignition_end_lon2 + fire_ignition_end_lat2 = this%fire_ignition_end_lat2 + fire_ignition_ros2 = this%fire_ignition_ros2 + fire_ignition_start_time2 = this%fire_ignition_start_time2 + fire_ignition_end_time2 = this%fire_ignition_end_time2 + fire_ignition_radius2 = this%fire_ignition_radius2 + + fire_ignition_start_lon3 = this%fire_ignition_start_lon3 + fire_ignition_start_lat3 = this%fire_ignition_start_lat3 + fire_ignition_end_lon3 = this%fire_ignition_end_lon3 + fire_ignition_end_lat3 = this%fire_ignition_end_lat3 + fire_ignition_ros3 = this%fire_ignition_ros3 + fire_ignition_start_time3 = this%fire_ignition_start_time3 + fire_ignition_end_time3 = this%fire_ignition_end_time3 + fire_ignition_radius3 = this%fire_ignition_radius3 + + fire_ignition_start_lon4 = this%fire_ignition_start_lon4 + fire_ignition_start_lat4 = this%fire_ignition_start_lat4 + fire_ignition_end_lon4 = this%fire_ignition_end_lon4 + fire_ignition_end_lat4 = this%fire_ignition_end_lat4 + fire_ignition_ros4 = this%fire_ignition_ros4 + fire_ignition_start_time4 = this%fire_ignition_start_time4 + fire_ignition_end_time4 = this%fire_ignition_end_time4 + fire_ignition_radius4 = this%fire_ignition_radius4 + + fire_ignition_start_lon5 = this%fire_ignition_start_lon5 + fire_ignition_start_lat5 = this%fire_ignition_start_lat5 + fire_ignition_end_lon5 = this%fire_ignition_end_lon5 + fire_ignition_end_lat5 = this%fire_ignition_end_lat5 + fire_ignition_ros5 = this%fire_ignition_ros5 + fire_ignition_start_time5 = this%fire_ignition_start_time5 + fire_ignition_end_time5 = this%fire_ignition_end_time5 + fire_ignition_radius5 = this%fire_ignition_radius5 + open (newunit = unit_nml, file = trim (file_name), action = 'read', iostat = io_stat) if (io_stat /= 0) then msg = 'Problems opening namelist file ' // trim (file_name) From a34bd9f2c0eb9bb73a5697905c64c15ebd683e0d Mon Sep 17 00:00:00 2001 From: "Pedro A. Jimenez" Date: Mon, 2 Feb 2026 11:48:41 -0700 Subject: [PATCH 6/6] Clearer nml default settings and comments --- io/namelist_mod.F90 | 37 ++++++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/io/namelist_mod.F90 b/io/namelist_mod.F90 index 172df6d..8e71ef4 100644 --- a/io/namelist_mod.F90 +++ b/io/namelist_mod.F90 @@ -3,6 +3,12 @@ module namelist_mod #ifdef DM_PARALLEL use mpi_f08 #endif + ! Get access to default options + use interp_mod, only : HINTERP_BILINEAR, VINTERP_WINDS_FROM_10M_WINDS + use fuel_mod, only : FUEL_ANDERSON + use ros_mod, only : ROS_WRFFIRE + use fmc_mod, only : FMC_WRFFIRE + use emis_mod, only : EMIS_WRFFIRE use stderrout_mod, only : Stop_simulation, Print_message implicit none @@ -13,12 +19,6 @@ module namelist_mod integer, parameter :: FIRE_MAX_IGNITIONS_IN_NAMELIST = 5 - ! Default options - integer, parameter :: DEFAULT_FUEL_OPT = 1 - integer, parameter :: DEFAULT_ROS_OPT = 0 - integer, parameter :: DEFAULT_FMC_OPT = -1 - integer, parameter :: DEFAULT_EMIS_OPT = 0 - type :: namelist_t ! time block integer :: start_year = -1 ! start year of the simulation @@ -45,7 +45,7 @@ module namelist_mod real :: fire_atm_feedback = 1.0 ! "the heat fluxes to the atmosphere are multiplied by this" "1" logical :: fire_is_real_perim = .false. ! .false. = point/line ignition, .true. = observed perimeter" - integer :: fire_upwinding = 9 ! "upwind normal spread: 1=standard, 2=godunov, 3=eno, 4=sethian, 5=2nd-order, + integer :: fire_upwinding = 9 ! "Numerical method for normal spread: 1=standard, 2=godunov, 3=eno, 4=sethian, 5=2nd-order, ! 6=WENO3, 7=WENO5, 8=hybrid WENO3/ENO1, 9=hybrid WENO5/ENO1" "1" real :: fire_viscosity = 0.4 ! artificial viscosity in level set method farm from near-front region real :: fire_viscosity_bg = 0.4 ! artificial viscosity in level set method the near-front region. Should be lower/equal to fire_viscosity @@ -62,8 +62,8 @@ 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 = 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" + integer :: wind_vinterp_opt = VINTERP_WINDS_FROM_10M_WINDS ! "mid-flame height wind interpolation option: 0) Interp to specified height, 1) Use WAFs" + integer :: hinterp_opt = HINTERP_BILINEAR ! "Horizontal interpolation from atm to fire (offline option): 1) nearest neighbour, 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" @@ -79,10 +79,10 @@ module namelist_mod integer :: ideal_opt = 0 ! 0) real world, 1) ideal ! Objects - integer :: fuel_opt = DEFAULT_FUEL_OPT ! Fuel model - integer :: ros_opt = DEFAULT_ROS_OPT ! ROS parameterization - integer :: fmc_opt = DEFAULT_FMC_OPT ! FMC model - integer :: emis_opt = DEFAULT_EMIS_OPT ! Object to be added. 0) WRF-Fire emiss, 1) PM2.5 as a function of FMC + integer :: fuel_opt = FUEL_ANDERSON ! 1) Anderson 13 + integer :: ros_opt = ROS_WRFFIRE ! 0) WRF-Fire ROS + integer :: fmc_opt = FMC_WRFFIRE ! -1) WRF-Fire FMC + integer :: emis_opt = EMIS_WRFFIRE ! 0) WRF-Fire emiss, 1) PM2.5 as a function of FMC. Objects to be added ! Ignitions integer :: fire_num_ignitions = 0 ! "number of ignition lines" @@ -450,6 +450,7 @@ subroutine Init_fire_block (this, file_name) character (len = :), allocatable :: msg + ! Set default values fire_print_msg = this%fire_print_msg fire_atm_feedback = this%fire_atm_feedback fire_upwinding = this%fire_upwinding @@ -531,6 +532,7 @@ subroutine Init_fire_block (this, file_name) fire_ignition_end_time5 = this%fire_ignition_end_time5 fire_ignition_radius5 = this%fire_ignition_radius5 + ! Read namelist open (newunit = unit_nml, file = trim (file_name), action = 'read', iostat = io_stat) if (io_stat /= 0) then msg = 'Problems opening namelist file ' // trim (file_name) @@ -539,8 +541,10 @@ subroutine Init_fire_block (this, file_name) read (unit_nml, nml = fire) if (io_stat /= 0) call Stop_simulation ('Problems reading namelist fire block') + close (unit_nml) + ! Assign namelist values this%fire_print_msg = fire_print_msg this%fire_atm_feedback = fire_atm_feedback this%fire_upwinding = fire_upwinding @@ -661,6 +665,7 @@ subroutine Init_ideal_block (this, file_name) true_lat_1 = this%true_lat_1 true_lat_2 = this%true_lat_2 + ! Read namelist open (newunit = unit_nml, file = trim (file_name), action = 'read', iostat = io_stat) if (io_stat /= 0) then msg = 'Problems opening namelist file ' // trim (file_name) @@ -669,8 +674,10 @@ subroutine Init_ideal_block (this, file_name) read (unit_nml, nml = ideal, iostat = io_stat) if (io_stat /= 0) call Stop_simulation ('Problems reading namelist ideal block') + close (unit_nml) + ! Assign namelist values this%dx = dx this%dy = dy this%nx = nx @@ -711,6 +718,7 @@ subroutine Init_time_block (this, file_name) num_tiles + ! Set default values start_year = this%start_year start_month = this%start_month start_day = this%start_day @@ -729,6 +737,7 @@ subroutine Init_time_block (this, file_name) num_tiles = this%num_tiles tile_strategy = this%tile_strategy + ! Read namelist open (newunit = unit_nml, file = trim (file_name), action = 'read', iostat = io_stat) if (io_stat /= 0) then msg = 'Problems opening namelist file ' // trim (file_name) @@ -737,8 +746,10 @@ subroutine Init_time_block (this, file_name) read (unit_nml, nml = time, iostat = io_stat) if (io_stat /= 0) call Stop_simulation ('Problems reading namelist time block') + close (unit_nml) + ! Set namelist values this%start_year = start_year this%start_month = start_month this%start_day = start_day