18 character(len=LINELENGTH),
pointer :: tag => null()
19 integer(I4B),
pointer :: width => null()
20 integer(I4B),
pointer :: alignment => null()
21 integer(I4B),
pointer :: nheader_lines => null()
23 character(len=LINELENGTH),
dimension(:),
pointer :: initial_lines => null()
24 character(len=LINELENGTH),
dimension(:),
pointer :: header_lines => null()
51 character(len=*),
intent(in) :: tag
52 integer(I4B),
intent(in) :: width
53 integer(I4B),
intent(in),
optional :: alignment
55 character(len=LINELENGTH) :: string
56 character(len=LINELENGTH) :: tstring
57 character(len=LINELENGTH),
allocatable,
dimension(:) :: words
58 integer(I4B) :: nwords
66 call this%allocate_scalars()
71 if (
present(alignment))
then
72 this%alignment = alignment
85 ilen = len(trim(words(i)))
86 if (ilen > width)
then
87 words(i) (width:width) =
'.'
88 do j = width + 1, ilen
101 string = trim(adjustl(words(i)))
104 if (len(trim(adjustl(string))) > 0)
then
105 tstring = trim(adjustl(tstring))//
' '//trim(adjustl(words(j)))
107 tstring = trim(adjustl(words(j)))
109 ilen = len(trim(adjustl(tstring)))
112 else if (ilen <= width)
then
124 ilen = len(trim(adjustl(words(i))))
126 this%nheader_lines = this%nheader_lines + 1
131 allocate (this%initial_lines(this%nheader_lines))
132 do i = 1, this%nheader_lines
133 this%initial_lines(i) = words(i) (1:width)
218 allocate (this%alignment)
219 allocate (this%width)
220 allocate (this%nheader_lines)
223 this%nheader_lines = 0
244 deallocate (this%tag)
245 deallocate (this%alignment)
246 deallocate (this%width)
247 deallocate (this%nheader_lines)
248 deallocate (this%header_lines)
263 integer(I4B),
intent(in) :: nlines
265 character(len=this%width) :: string
266 integer(I4B) :: idiff
276 allocate (this%header_lines(nlines))
280 this%header_lines(i) = string
285 idiff = nlines - this%nheader_lines
287 do i = this%nheader_lines, 1, -1
289 this%header_lines(j) = this%initial_lines(i)
293 deallocate (this%initial_lines)
296 this%nheader_lines = nlines
311 integer(I4B),
intent(in) :: iline
312 character(len=*),
intent(inout) :: cval
318 cval = this%header_lines(iline) (1:this%width)
This module contains simulation constants.
integer(i4b), parameter linelength
maximum length of a standard line
@ tabcenter
centered table column
@ tabright
right justified table column
@ tableft
left justified table column
@ tabucstring
upper case string table data
@ tabstring
string table data
@ tabinteger
integer table data
real(dp), parameter dzero
real constant zero
integer(i4b), parameter lenbudtxt
maximum length of a budget component names
This module defines variable data types.
subroutine get_header(this, iline, cval)
integer(i4b) function get_alignment(this)
integer(i4b) function get_width(this)
subroutine initialize(this, tag, width, alignment)
subroutine allocate_scalars(this)
subroutine set_header(this, nlines)
integer(i4b) function get_header_lines(this)