Read a period data block.
105 class(OutputControlType) :: this
107 integer(I4B) :: ierr, ival, ipos
108 logical :: isfound, found, endOfBlock
109 character(len=:),
allocatable :: line
110 character(len=LINELENGTH) :: ermsg, keyword1, keyword2
111 character(len=LINELENGTH) :: printsave
112 class(OutputControlDataType),
pointer :: ocdobjptr
114 character(len=*),
parameter :: fmtboc = &
115 &
"(1X,/1X,'BEGIN READING OUTPUT CONTROL FOR STRESS PERIOD ',I0)"
116 character(len=*),
parameter :: fmteoc = &
117 &
"(/,1X,'END READING OUTPUT CONTROL FOR STRESS PERIOD ',I0)"
118 character(len=*),
parameter :: fmterr = &
119 &
"(' ERROR READING OUTPUT CONTROL PERIOD BLOCK: ')"
120 character(len=*),
parameter :: fmtroc = &
121 "(1X,/1X,'OUTPUT CONTROL FOR STRESS PERIOD ',I0, &
122 &' IS REPEATED USING SETTINGS FROM A PREVIOUS STRESS PERIOD.')"
123 character(len=*),
parameter :: fmtpererr = &
124 &
"(1x,'CURRENT STRESS PERIOD GREATER THAN PERIOD IN OUTPUT CONTROL.')"
125 character(len=*),
parameter :: fmtpererr2 = &
126 &
"(1x,'CURRENT STRESS PERIOD: ',I0,' SPECIFIED STRESS PERIOD: ',I0)"
129 if (this%iperoc <
kper)
then
132 call this%parser%GetBlock(
'PERIOD', isfound, ierr, &
133 supportopenclose=.true., &
134 blockrequired=.false.)
138 this%iperoc =
nper + 1
139 write (this%iout,
'(/,1x,a)')
'END OF FILE DETECTED IN OUTPUT CONTROL.'
140 write (this%iout,
'(1x,a)')
'CURRENT OUTPUT CONTROL SETTINGS WILL BE '
141 write (this%iout,
'(1x,a)')
'REPEATED UNTIL THE END OF THE SIMULATION.'
145 ival = this%parser%GetInteger()
148 if (ival <= 0 .or. ival >
nper)
then
149 write (ermsg,
'(a,i0)')
'PERIOD NOT VALID IN OUTPUT CONTROL: ', ival
151 write (ermsg,
'(a, a)')
'LINE: ', trim(adjustl(line))
156 if (ival <
kper)
then
157 write (ermsg, fmtpererr)
159 write (ermsg, fmtpererr2)
kper, ival
161 write (ermsg,
'(a, a)')
'LINE: ', trim(adjustl(line))
167 call this%parser%StoreErrorUnit()
174 if (this%iperoc ==
kper)
then
177 do ipos = 1,
size(this%ocdobj)
178 ocdobjptr => this%ocdobj(ipos)
179 call ocdobjptr%psmobj%init()
183 write (this%iout, fmtboc) this%iperoc
189 call this%parser%GetNextLine(endofblock)
191 call this%parser%GetStringCaps(keyword1)
196 call this%parser%GetStringCaps(keyword2)
202 do ipos = 1,
size(this%ocdobj)
203 ocdobjptr => this%ocdobj(ipos)
204 if (keyword2 == trim(ocdobjptr%cname))
then
209 if (.not. found)
then
210 call this%parser%GetCurrentLine(line)
211 write (ermsg, fmterr)
213 call store_error(
'UNRECOGNIZED KEYWORD: '//keyword2)
215 call this%parser%StoreErrorUnit()
217 call this%parser%GetRemainingLine(line)
218 call ocdobjptr%psmobj%rp(trim(printsave)//
' '//line, &
220 call ocdobjptr%ocd_rp_check(this%parser%iuactive)
224 write (this%iout, fmteoc) this%iperoc
229 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