Skip to content

Commit

Permalink
model_mod_check test NCAR#1
Browse files Browse the repository at this point in the history
Edited input.nml and successfully ran the first test
in model_mod_check.
  • Loading branch information
mgharamti committed Feb 22, 2024
1 parent 606d2d5 commit 421e7ae
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 9 deletions.
18 changes: 11 additions & 7 deletions models/seir/model_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -80,22 +80,20 @@ module model_mod
real(r8) :: beta = 1.36e-9_r8 ! Transmission rate (per day)
real(r8) :: kappa = 0.00308 ! Mortality rate
real(r8) :: delta_t = 0.04167_r8 ! Model time step; 1/24 := 1 hour
integer(i8) :: num_pop = 331996199 ! Population

real(r8) :: gama, delta, lambda, rho

! Other related model parameters
integer, parameter :: num_pop = 331996199 ! Population

real(r8), parameter :: E0 = 1.0_r8 ! Exposed (not yet infected)
real(r8), parameter :: I0 = 1.0_r8 ! Infected (not yet quarantined)
real(r8), parameter :: Q0 = 1.0_r8 ! Quarantined (confirmed and infected)
real(r8), parameter :: R0 = 1.0_r8 ! Recovered
real(r8), parameter :: D0 = 1.0_r8 ! Dead
real(r8), parameter :: V0 = 1.0_r8 ! Vaccinated
real(r8), parameter :: S0 = num_pop - E0 - I0 - Q0 - R0 - D0 ! Susceptible

namelist /model_nml/ model_size, time_step_days, time_step_seconds, &
delta_t, &
delta_t, num_pop, &
t_incub, t_infec, t_recov, t_death, &
alpha, theta, beta, sigma, kappa, mu

Expand All @@ -122,9 +120,11 @@ subroutine static_init_model()
allocate(state_loc(model_size))

! Define the locations of the model state variables
! Example location following lorenz_96
! The SEIR variables have no physical location,
! and so I'm placing all 7 variables at the same
! virtual point in space.
x_loc = 0.5_r8
do i = 1, model_size
x_loc = (i - 1.0_r8) / model_size
state_loc(i) = set_location(x_loc)
end do

Expand Down Expand Up @@ -212,7 +212,11 @@ end subroutine seir_eqns
subroutine init_conditions(x)

real(r8), dimension (model_size) :: x0
real(r8), intent(out) :: x(:)
real(r8), intent(out) :: x(:)
real(r8) :: S0 ! Susceptible

S0 = num_pop - E0 - I0 - Q0 - R0 - D0


x0 = (/S0, E0, I0, Q0, R0, D0, V0/)
x = x0
Expand Down
16 changes: 14 additions & 2 deletions models/seir/work/input.nml
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,21 @@
/

&model_nml
model_size = 40,
model_size = 7,
delta_t = 0.04167,
time_step_days = 0,
time_step_seconds = 3600,
num_pop = 331996199,
t_incub = 5.6,
t_infec = 3.8,
t_recov = 14.0,
t_death = 7.0,
alpha = 0.007,
theta = 12467,
mu = 0.000025,
sigma = 0.05,
beta = 0.00000000136,
kappa = 0.00308,
/

&utilities_nml
Expand Down Expand Up @@ -224,7 +236,7 @@
num_ens = 1
single_file = .false.
test1thru = 0
run_tests = 1,2,3,4,5,6,7
run_tests = 1
x_ind = 2
loc_of_interest = 0.3
quantity_of_interest = 'QTY_STATE_VARIABLE'
Expand Down

0 comments on commit 421e7ae

Please sign in to comment.