Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean-up variable initialization #47

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions src/share/dateTimeUtilsModule.f90
Original file line number Diff line number Diff line change
Expand Up @@ -862,8 +862,8 @@ subroutine calendar_date (jdate, day, month, year)

integer, intent (in) :: jdate
integer, intent (out) :: day, month, year
integer :: y = 4716, j = 1401, m = 2, n = 12, r = 4, p = 1461
integer :: v = 3, u = 5, s = 153, w = 2, b = 274277, c = - 38
integer,parameter :: y = 4716, j = 1401, m = 2, n = 12, r = 4, p = 1461
integer,parameter :: v = 3, u = 5, s = 153, w = 2, b = 274277, c = - 38
integer :: f, e, g, h
f = jdate + j + (((4*jdate+b)/146097)*3) / 4 + c
e = r * f + v
Expand Down
12 changes: 8 additions & 4 deletions src/share/ioModule.f90
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@ subroutine read_snow17_parameters(this, param_file_name, runinfo)
! local variables
character(len=400) :: readline
character(len=50) :: param
integer :: ios=0 ! specify i4b with nrtype?
integer :: ios
integer :: pos
integer :: n_params_read, nh ! counters

ios = 0
! open parameter file
open(unit=51,file=trim(param_file_name),status='old')

Expand Down Expand Up @@ -163,7 +164,7 @@ SUBROUTINE init_forcing_files(namelist, runinfo, parameters)
! local variables
character*480 :: filename
logical :: lexist ! logical for whether the file specified by filename exists
integer :: ierr=0 ! error code returned by open(iostat = ierr)
integer :: ierr ! error code returned by open(iostat = ierr)
integer :: nh ! loop counter

! local variables
Expand All @@ -174,6 +175,7 @@ SUBROUTINE init_forcing_files(namelist, runinfo, parameters)
print*, 'Initializing forcing files'
ios = 0
found_start = 0
ierr = 0
do nh=1, runinfo%n_hrus

! make filename to read
Expand Down Expand Up @@ -260,12 +262,13 @@ subroutine read_areal_forcing(namelist, parameters, runinfo, forcing)
type (forcing_type), intent(inout) :: forcing

! local variables
integer :: nh, ierr=0
integer :: nh, ierr
integer :: yr, mnth, dy, hr
character(len=10) :: forcing_datehr

!print*, "---"; print*, 'Current run datehr is ', runinfo%curr_datehr

ierr = 0
! loop over sub-areas and read their forcings
do nh=1, runinfo%n_hrus

Expand Down Expand Up @@ -429,14 +432,15 @@ subroutine read_snow17_statefiles (modelvar, namelist, parameters, runinfo)

! local variables
integer :: hru
integer :: ios = 0
integer :: ios
character(len=480) :: state_filename
character(len=10) :: statefile_datehr
character(len=10) :: state_datehr ! string to match date in input states
real :: prev_datetime ! for reading state file
integer :: states_found ! counter to match hrus

! ---- code -----
ios = 0
print*, 'Reading restart files'

! starting statefiles match format of statefile outputs (date then variables)
Expand Down