22 character(len=16),
pointer :: cname => null()
23 character(len=60),
pointer :: cdatafmp => null()
24 character(len=1),
pointer :: editdesc => null()
25 integer(I4B),
pointer :: idataun => null()
26 integer(I4B),
pointer :: nvaluesp => null()
27 integer(I4B),
pointer :: nwidthp => null()
28 integer(I4B),
pointer :: inodata => null()
29 real(dp),
pointer :: dnodata => null()
30 integer(I4B),
pointer,
contiguous :: intdata(:) => null()
31 real(dp),
pointer,
contiguous :: dbldata(:) => null()
48 call ocdobj%allocate_scalars()
58 integer(I4B),
intent(in) :: inunit
60 character(len=LINELENGTH) :: errmsg
62 character(len=*),
parameter :: fmtocsaveerr = &
63 "(1X,'REQUESTING TO SAVE ',A,' BUT ',A,' SAVE FILE NOT SPECIFIED. ', &
64 &A,' SAVE FILE MUST BE SPECIFIED IN OUTPUT CONTROL OPTIONS.')"
67 if (this%psm%save_steps%any())
then
68 if (this%idataun == 0)
then
69 write (errmsg, fmtocsaveerr) trim(adjustl(this%cname)), &
70 trim(adjustl(this%cname)), &
71 trim(adjustl(this%cname))
82 subroutine ocd_ot(this, ipflg, kstp, endofperiod, iout, iprint_opt, isav_opt)
85 integer(I4B),
intent(inout) :: ipflg
86 integer(I4B),
intent(in) :: kstp
87 logical(LGP),
intent(in) :: endofperiod
88 integer(I4B),
intent(in) :: iout
89 integer(I4B),
optional,
intent(in) :: iprint_opt
90 integer(I4B),
optional,
intent(in) :: isav_opt
92 integer(I4B) :: iprint
93 integer(I4B) :: idataun
102 if (
present(iprint_opt))
then
103 if (iprint_opt /= 0)
then
108 if (this%psm%should_print(kstp, endofperiod))
then
115 if (
present(isav_opt))
then
116 if (isav_opt /= 0)
then
117 idataun = this%idataun
120 if (this%psm%should_save(kstp, endofperiod)) idataun = this%idataun
124 if (
associated(this%dbldata)) &
125 call this%dis%record_array(this%dbldata, iout, iprint, idataun, &
126 this%cname, this%cdatafmp, this%nvaluesp, &
127 this%nwidthp, this%editdesc, this%dnodata)
140 deallocate (this%cname)
141 deallocate (this%cdatafmp)
142 deallocate (this%idataun)
143 deallocate (this%editdesc)
144 deallocate (this%nvaluesp)
145 deallocate (this%nwidthp)
146 deallocate (this%dnodata)
147 deallocate (this%inodata)
151 subroutine init_dbl(this, cname, dblvec, dis, cdefpsm, cdeffmp, iout, &
154 character(len=*),
intent(in) :: cname
155 real(DP),
dimension(:),
pointer,
contiguous,
intent(in) :: dblvec
157 character(len=*),
intent(in) :: cdefpsm
158 character(len=*),
intent(in) :: cdeffmp
159 integer(I4B),
intent(in) :: iout
160 real(DP),
intent(in) :: dnodata
163 this%dbldata => dblvec
165 this%dnodata = dnodata
166 if (cdefpsm /=
'')
call this%psm%read(cdefpsm, iout)
168 this%editdesc, this%nvaluesp, this%nwidthp, 0)
172 subroutine init_int(this, cname, intvec, dis, cdefpsm, cdeffmp, iout, &
175 character(len=*),
intent(in) :: cname
176 integer(I4B),
dimension(:),
pointer,
contiguous,
intent(in) :: intvec
178 character(len=*),
intent(in) :: cdefpsm
179 character(len=*),
intent(in) :: cdeffmp
180 integer(I4B),
intent(in) :: iout
181 integer(I4B),
intent(in) :: inodata
184 this%intdata => intvec
186 this%inodata = inodata
188 if (cdefpsm /=
'')
call this%psm%read(cdefpsm, iout)
189 call print_format(cdeffmp, this%cdatafmp, this%editdesc, this%nvaluesp, &
200 allocate (this%cname)
201 allocate (this%cdatafmp)
202 allocate (this%idataun)
203 allocate (this%editdesc)
204 allocate (this%nvaluesp)
205 allocate (this%nwidthp)
206 allocate (this%dnodata)
207 allocate (this%inodata)
229 character(len=*),
intent(in) :: linein
230 integer(I4B),
intent(in) :: inunit
231 integer(I4B),
intent(in) :: iout
233 character(len=len(linein)) :: line
234 integer(I4B) :: lloc, istart, istop, ival
237 character(len=*),
parameter :: fmtocsave = &
238 "(4X,A,' INFORMATION WILL BE WRITTEN TO:', &
239 &/,6X,'UNIT NUMBER: ', I0,/,6X, 'FILE NAME: ', A)"
243 call urword(line, lloc, istart, istop, 1, ival, rval, 0, 0)
244 select case (line(istart:istop))
246 call urword(line, lloc, istart, istop, 0, ival, rval, 0, 0)
248 write (iout, fmtocsave) trim(adjustl(this%cname)), this%idataun, &
250 call openfile(this%idataun, iout, line(istart:istop),
'DATA(BINARY)', &
252 case (
'PRINT_FORMAT')
253 call urword(line, lloc, istart, istop, 1, ival, rval, 0, 0)
254 call print_format(line(istart:), this%cdatafmp, this%editdesc, &
255 this%nvaluesp, this%nwidthp, inunit)
257 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.
Output control data module.
subroutine init_dbl(this, cname, dblvec, dis, cdefpsm, cdeffmp, iout, dnodata)
Initialize the output control data type for double precision data.
subroutine ocd_da(this)
Deallocate the output control data type.
subroutine ocd_rp_check(this, inunit)
@ brief Check the output control data type for consistency.
subroutine ocd_ot(this, ipflg, kstp, endofperiod, iout, iprint_opt, isav_opt)
Write to list file and/or save to binary file, depending on settings.
subroutine allocate(this)
@ brief Allocate scalar variables
subroutine set_option(this, linein, inunit, iout)
@ brief Set FILEOUT and PRINT_FORMAT based on an input string.
subroutine init_int(this, cname, intvec, dis, cdefpsm, cdeffmp, iout, inodata)
@ brief Initialize the output control data type for integer data.
subroutine, public ocd_cr(ocdobj)
@ brief Create a new output control data type.
Print/save manager module.
type(printsavemanagertype) function, pointer, public create_psm()
Initialize or clear the print/save manager.
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.
Output control data type.