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()
49 call ocdobj%allocate_scalars()
59 character(len=*) :: input_fname
61 character(len=LINELENGTH) :: errmsg
63 character(len=*),
parameter :: fmtocsaveerr = &
64 "(1X,'REQUESTING TO SAVE ',A,' BUT ',A,' SAVE FILE NOT SPECIFIED. ', &
65 &A,' SAVE FILE MUST BE SPECIFIED IN OUTPUT CONTROL OPTIONS.')"
68 if (this%psm%save_steps%any())
then
69 if (this%idataun == 0)
then
70 write (errmsg, fmtocsaveerr) trim(adjustl(this%cname)), &
71 trim(adjustl(this%cname)), &
72 trim(adjustl(this%cname))
83 subroutine ocd_ot(this, ipflg, kstp, endofperiod, iout, iprint_opt, isav_opt)
86 integer(I4B),
intent(inout) :: ipflg
87 integer(I4B),
intent(in) :: kstp
88 logical(LGP),
intent(in) :: endofperiod
89 integer(I4B),
intent(in) :: iout
90 integer(I4B),
optional,
intent(in) :: iprint_opt
91 integer(I4B),
optional,
intent(in) :: isav_opt
93 integer(I4B) :: iprint
94 integer(I4B) :: idataun
103 if (
present(iprint_opt))
then
104 if (iprint_opt /= 0)
then
109 if (this%psm%should_print(kstp, endofperiod))
then
116 if (
present(isav_opt))
then
117 if (isav_opt /= 0)
then
118 idataun = this%idataun
121 if (this%psm%should_save(kstp, endofperiod)) idataun = this%idataun
125 if (
associated(this%dbldata)) &
126 call this%dis%record_array(this%dbldata, iout, iprint, idataun, &
127 this%cname, this%cdatafmp, this%nvaluesp, &
128 this%nwidthp, this%editdesc, this%dnodata)
141 deallocate (this%cname)
142 deallocate (this%cdatafmp)
143 deallocate (this%idataun)
144 deallocate (this%editdesc)
145 deallocate (this%nvaluesp)
146 deallocate (this%nwidthp)
147 deallocate (this%dnodata)
148 deallocate (this%inodata)
152 subroutine init_dbl(this, cname, dblvec, dis, cdefpsm, cdeffmp, iout, &
155 character(len=*),
intent(in) :: cname
156 real(DP),
dimension(:),
pointer,
contiguous,
intent(in) :: dblvec
158 character(len=*),
intent(in) :: cdefpsm
159 character(len=*),
intent(in) :: cdeffmp
160 integer(I4B),
intent(in) :: iout
161 real(DP),
intent(in) :: dnodata
164 this%dbldata => dblvec
166 this%dnodata = dnodata
167 if (cdefpsm /=
'')
call this%psm%read(cdefpsm, iout)
169 this%editdesc, this%nvaluesp, this%nwidthp, 0)
173 subroutine init_int(this, cname, intvec, dis, cdefpsm, cdeffmp, iout, &
176 character(len=*),
intent(in) :: cname
177 integer(I4B),
dimension(:),
pointer,
contiguous,
intent(in) :: intvec
179 character(len=*),
intent(in) :: cdefpsm
180 character(len=*),
intent(in) :: cdeffmp
181 integer(I4B),
intent(in) :: iout
182 integer(I4B),
intent(in) :: inodata
185 this%intdata => intvec
187 this%inodata = inodata
189 if (cdefpsm /=
'')
call this%psm%read(cdefpsm, iout)
190 call print_format(cdeffmp, this%cdatafmp, this%editdesc, this%nvaluesp, &
201 allocate (this%cname)
202 allocate (this%cdatafmp)
203 allocate (this%idataun)
204 allocate (this%editdesc)
205 allocate (this%nvaluesp)
206 allocate (this%nwidthp)
207 allocate (this%dnodata)
208 allocate (this%inodata)
227 character(len=*),
intent(in) :: prnfmt
228 integer(I4B),
intent(in) :: inunit
230 call print_format(prnfmt, this%cdatafmp, this%editdesc, &
231 this%nvaluesp, this%nwidthp, inunit)
240 character(len=*),
intent(in) :: ocfile
241 integer(I4B),
intent(in) :: iout
243 character(len=*),
parameter :: fmtocsave = &
244 "(4X,A,' INFORMATION WILL BE WRITTEN TO:', &
245 &/,6X,'UNIT NUMBER: ', I0,/,6X, 'FILE NAME: ', A)"
247 write (iout, fmtocsave) trim(adjustl(this%cname)), this%idataun, &
249 call openfile(this%idataun, iout, ocfile,
'DATA(BINARY)', &
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 set_prnfmt(this, prnfmt, inunit)
@ brief Set PRINT_FORMAT based on an input string.
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 ocd_rp_check(this, input_fname)
@ brief Check the output control data type for consistency.
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.
subroutine set_ocfile(this, ocfile, iout)
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_filename(filename, terminate)
Store the erroring file name.
Output control data type.