67 class(OutputControlType) :: this
69 integer(I4B) :: ierr, ival, ipos
70 logical :: isfound, found, endOfBlock
71 character(len=:),
allocatable :: line
72 character(len=LINELENGTH) :: ermsg, keyword1, keyword2
73 character(len=LINELENGTH) :: printsave
74 class(OutputControlDataType),
pointer :: ocdobjptr
76 character(len=*),
parameter :: fmtboc = &
77 &
"(1X,/1X,'BEGIN READING OUTPUT CONTROL FOR STRESS PERIOD ',I0)"
78 character(len=*),
parameter :: fmteoc = &
79 &
"(/,1X,'END READING OUTPUT CONTROL FOR STRESS PERIOD ',I0)"
80 character(len=*),
parameter :: fmterr = &
81 &
"(' ERROR READING OUTPUT CONTROL PERIOD BLOCK: ')"
82 character(len=*),
parameter :: fmtroc = &
83 "(1X,/1X,'OUTPUT CONTROL FOR STRESS PERIOD ',I0, &
84 &' IS REPEATED USING SETTINGS FROM A PREVIOUS STRESS PERIOD.')"
85 character(len=*),
parameter :: fmtpererr = &
86 &
"(1x,'CURRENT STRESS PERIOD GREATER THAN PERIOD IN OUTPUT CONTROL.')"
87 character(len=*),
parameter :: fmtpererr2 = &
88 &
"(1x,'CURRENT STRESS PERIOD: ',I0,' SPECIFIED STRESS PERIOD: ',I0)"
91 if (this%iperoc <
kper)
then
94 call this%parser%GetBlock(
'PERIOD', isfound, ierr, &
95 supportopenclose=.true., &
96 blockrequired=.false.)
100 this%iperoc =
nper + 1
101 write (this%iout,
'(/,1x,a)')
'END OF FILE DETECTED IN OUTPUT CONTROL.'
102 write (this%iout,
'(1x,a)')
'CURRENT OUTPUT CONTROL SETTINGS WILL BE '
103 write (this%iout,
'(1x,a)')
'REPEATED UNTIL THE END OF THE SIMULATION.'
107 ival = this%parser%GetInteger()
110 if (ival <= 0 .or. ival >
nper)
then
111 write (ermsg,
'(a,i0)')
'PERIOD NOT VALID IN OUTPUT CONTROL: ', ival
113 write (ermsg,
'(a, a)')
'LINE: ', trim(adjustl(line))
118 if (ival <
kper)
then
119 write (ermsg, fmtpererr)
121 write (ermsg, fmtpererr2)
kper, ival
123 write (ermsg,
'(a, a)')
'LINE: ', trim(adjustl(line))
129 call this%parser%StoreErrorUnit()
136 if (this%iperoc ==
kper)
then
139 do ipos = 1,
size(this%ocds)
140 ocdobjptr => this%ocds(ipos)
141 call ocdobjptr%psm%init()
145 write (this%iout, fmtboc) this%iperoc
151 call this%parser%GetNextLine(endofblock)
153 call this%parser%GetStringCaps(keyword1)
158 call this%parser%GetStringCaps(keyword2)
164 do ipos = 1,
size(this%ocds)
165 ocdobjptr => this%ocds(ipos)
166 if (keyword2 == trim(ocdobjptr%cname))
then
171 if (.not. found)
then
172 call this%parser%GetCurrentLine(line)
173 write (ermsg, fmterr)
175 call store_error(
'UNRECOGNIZED KEYWORD: '//keyword2)
177 call this%parser%StoreErrorUnit()
179 call this%parser%GetRemainingLine(line)
180 call ocdobjptr%psm%read(trim(printsave)//
' '//line, &
182 call ocdobjptr%ocd_rp_check(this%parser%iuactive)
184 write (this%iout, fmteoc) this%iperoc
189 write (this%iout, fmtroc)
kper
This module contains simulation constants.
integer(i4b), parameter linelength
maximum length of a standard line
This module contains simulation methods.
subroutine, public store_error(msg, terminate)
Store an error message.
integer(i4b) function, public count_errors()
Return number of errors.
subroutine, public store_error_unit(iunit, terminate)
Store the file unit number.
integer(i4b), pointer, public kper
current stress period number
integer(i4b), pointer, public nper
number of stress period