Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer | :: | year |
subroutine time_initialise_year(year)
! ----------------------------------------------------------------------
use input, only : read_real_column
use crop, only : &
arylda, &
avylda, &
mcrdb, &
iyrrot, &
nrotyrs
use subbasin, only : &
bRunoffdat, &
discharge_input_file_id, &
obs_discharge, &
nqobs
integer year, jj, k, skip
! iy - current year
! mo - current month
! nt - =1 if 365 days, =0 if 366 days
! nd - number of days in the current year
iy = year
mo = 1
nt = 1
if (mod(iyr, 4) .eq. 0) nt = 0
ida = 1
nd = 366 - nt
ndsum = ndsum + nd
!#### INITIALIZE CROPS: CALL INITCROP
do jj = 1, mcrdb
avylda(iy, jj) = 0.
arylda(iy, jj) = 0.
end do
if (bRunoffdat) then
! read all columns by index (+1 for date column)
! skipping back up before reading except for 1st
do k = 1, nqobs
skip = -nd
if (k == 1) skip = 0
call read_real_column(discharge_input_file_id, array=obs_discharge(:nd, k), index=k+1, skip=skip)
end do
end if
! count year of rotation (1-3)
if (iyrrot < nrotyrs) then
iyrrot = iyrrot + 1
else
iyrrot = 1
end if
if (iy == 1) iyrrot = 0
end subroutine time_initialise_year