26 character(len=16),
pointer :: cname => null()
27 character(len=60),
pointer :: cdatafmp => null()
28 integer(I4B),
pointer :: idataun => null()
29 character(len=1),
pointer :: editdesc => null()
30 integer(I4B),
pointer :: nvaluesp => null()
31 integer(I4B),
pointer :: nwidthp => null()
32 real(dp),
pointer :: dnodata => null()
33 integer(I4B),
pointer :: inodata => null()
34 real(dp),
dimension(:),
pointer,
contiguous :: dblvec => null()
35 integer(I4B),
dimension(:),
pointer,
contiguous :: intvec => null()
63 call ocdobj%allocate_scalars()
80 integer(I4B),
intent(in) :: inunit
82 character(len=LINELENGTH) :: errmsg
84 character(len=*),
parameter :: fmtocsaveerr = &
85 "(1X,'REQUESTING TO SAVE ',A,' BUT ',A,' SAVE FILE NOT SPECIFIED. ', &
86 &A,' SAVE FILE MUST BE SPECIFIED IN OUTPUT CONTROL OPTIONS.')"
89 if (this%psmobj%save_detected)
then
90 if (this%idataun == 0)
then
91 write (errmsg, fmtocsaveerr) trim(adjustl(this%cname)), &
92 trim(adjustl(this%cname)), &
93 trim(adjustl(this%cname))
112 subroutine ocd_ot(this, ipflg, kstp, endofperiod, iout, iprint_opt, isav_opt)
115 integer(I4B),
intent(inout) :: ipflg
116 integer(I4B),
intent(in) :: kstp
117 logical(LGP),
intent(in) :: endofperiod
118 integer(I4B),
intent(in) :: iout
119 integer(I4B),
optional,
intent(in) :: iprint_opt
120 integer(I4B),
optional,
intent(in) :: isav_opt
122 integer(I4B) :: iprint
123 integer(I4B) :: idataun
132 if (
present(iprint_opt))
then
133 if (iprint_opt /= 0)
then
138 if (this%psmobj%kstp_to_print(kstp, endofperiod))
then
145 if (
present(isav_opt))
then
146 if (isav_opt /= 0)
then
147 idataun = this%idataun
150 if (this%psmobj%kstp_to_save(kstp, endofperiod)) idataun = this%idataun
154 if (
associated(this%dblvec)) &
155 call this%dis%record_array(this%dblvec, iout, iprint, idataun, &
156 this%cname, this%cdatafmp, this%nvaluesp, &
157 this%nwidthp, this%editdesc, this%dnodata)
181 deallocate (this%cname)
182 deallocate (this%cdatafmp)
183 deallocate (this%idataun)
184 deallocate (this%editdesc)
185 deallocate (this%nvaluesp)
186 deallocate (this%nwidthp)
187 deallocate (this%dnodata)
188 deallocate (this%inodata)
189 deallocate (this%psmobj)
200 subroutine init_dbl(this, cname, dblvec, dis, cdefpsm, cdeffmp, iout, &
204 character(len=*),
intent(in) :: cname
205 real(DP),
dimension(:),
pointer,
contiguous,
intent(in) :: dblvec
207 character(len=*),
intent(in) :: cdefpsm
208 character(len=*),
intent(in) :: cdeffmp
209 integer(I4B),
intent(in) :: iout
210 real(DP),
intent(in) :: dnodata
213 this%dblvec => dblvec
215 this%dnodata = dnodata
216 call this%psmobj%init()
217 if (cdefpsm /=
'')
call this%psmobj%rp(cdefpsm, iout)
219 this%editdesc, this%nvaluesp, this%nwidthp, 0)
230 subroutine init_int(this, cname, intvec, dis, cdefpsm, cdeffmp, iout, &
234 character(len=*),
intent(in) :: cname
235 integer(I4B),
dimension(:),
pointer,
contiguous,
intent(in) :: intvec
237 character(len=*),
intent(in) :: cdefpsm
238 character(len=*),
intent(in) :: cdeffmp
239 integer(I4B),
intent(in) :: iout
240 integer(I4B),
intent(in) :: inodata
243 this%intvec => intvec
245 this%inodata = inodata
247 call this%psmobj%init()
248 if (cdefpsm /=
'')
call this%psmobj%rp(cdefpsm, iout)
249 call print_format(cdeffmp, this%cdatafmp, this%editdesc, this%nvaluesp, &
267 allocate (this%cname)
268 allocate (this%cdatafmp)
269 allocate (this%idataun)
270 allocate (this%editdesc)
271 allocate (this%nvaluesp)
272 allocate (this%nwidthp)
273 allocate (this%dnodata)
274 allocate (this%inodata)
275 allocate (this%psmobj)
303 character(len=*),
intent(in) :: linein
304 integer(I4B),
intent(in) :: inunit
305 integer(I4B),
intent(in) :: iout
307 character(len=len(linein)) :: line
308 integer(I4B) :: lloc, istart, istop, ival
311 character(len=*),
parameter :: fmtocsave = &
312 "(4X,A,' INFORMATION WILL BE WRITTEN TO:', &
313 &/,6X,'UNIT NUMBER: ', I0,/,6X, 'FILE NAME: ', A)"
317 call urword(line, lloc, istart, istop, 1, ival, rval, 0, 0)
318 select case (line(istart:istop))
320 call urword(line, lloc, istart, istop, 0, ival, rval, 0, 0)
322 write (iout, fmtocsave) trim(adjustl(this%cname)), this%idataun, &
324 call openfile(this%idataun, iout, line(istart:istop),
'DATA(BINARY)', &
326 case (
'PRINT_FORMAT')
327 call urword(line, lloc, istart, istop, 1, ival, rval, 0, 0)
328 call print_format(line(istart:), this%cdatafmp, this%editdesc, &
329 this%nvaluesp, this%nwidthp, inunit)
331 call store_error(
'Looking for FILEOUT or PRINT_FORMAT. Found:')
This module contains simulation constants.
integer(i4b), parameter linelength
maximum length of a standard line
@ mnormal
normal output mode
real(dp), parameter dzero
real constant zero
This module defines variable data types.
This module contains the OutputControlDataModule.
subroutine init_dbl(this, cname, dblvec, dis, cdefpsm, cdeffmp, iout, dnodata)
@ brief Initialize this OutputControlDataType as double precision data
subroutine ocd_da(this)
@ brief Deallocate OutputControlDataType
subroutine ocd_rp_check(this, inunit)
@ brief Check OutputControlDataType object
subroutine ocd_ot(this, ipflg, kstp, endofperiod, iout, iprint_opt, isav_opt)
@ brief Output data
subroutine set_option(this, linein, inunit, iout)
@ brief Set options for this object based on an input string
subroutine init_int(this, cname, intvec, dis, cdefpsm, cdeffmp, iout, inodata)
@ brief Initialize this OutputControlDataType as integer data
subroutine allocate_scalars(this)
@ brief Allocate OutputControlDataType members
subroutine, public ocd_cr(ocdobj)
@ brief Create OutputControlDataType
This module contains the PrintSaveManagerModule.
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.
@ brief OutputControlDataType
@ brief PrintSaveManagerType