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()
47 character(len=*),
intent(in) :: tag
48 integer(I4B),
intent(in) :: width
49 integer(I4B),
intent(in),
optional :: alignment
51 character(len=LINELENGTH) :: string
52 character(len=LINELENGTH) :: tstring
53 character(len=LINELENGTH),
allocatable,
dimension(:) :: words
54 integer(I4B) :: nwords
61 call this%allocate_scalars()
66 if (
present(alignment))
then
67 this%alignment = alignment
80 ilen = len(trim(words(i)))
81 if (ilen > width)
then
82 words(i) (width:width) =
'.'
83 do j = width + 1, ilen
96 string = trim(adjustl(words(i)))
99 if (len(trim(adjustl(string))) > 0)
then
100 tstring = trim(adjustl(tstring))//
' '//trim(adjustl(words(j)))
102 tstring = trim(adjustl(words(j)))
104 ilen = len(trim(adjustl(tstring)))
107 else if (ilen <= width)
then
119 ilen = len(trim(adjustl(words(i))))
121 this%nheader_lines = this%nheader_lines + 1
126 allocate (this%initial_lines(this%nheader_lines))
127 do i = 1, this%nheader_lines
128 this%initial_lines(i) = words(i) (1:width)
184 allocate (this%alignment)
185 allocate (this%width)
186 allocate (this%nheader_lines)
189 this%nheader_lines = 0
202 deallocate (this%tag)
203 deallocate (this%alignment)
204 deallocate (this%width)
205 deallocate (this%nheader_lines)
206 deallocate (this%header_lines)
217 integer(I4B),
intent(in) :: nlines
219 character(len=this%width) :: string
220 integer(I4B) :: idiff
229 allocate (this%header_lines(nlines))
233 this%header_lines(i) = string
238 idiff = nlines - this%nheader_lines
240 do i = this%nheader_lines, 1, -1
242 this%header_lines(j) = this%initial_lines(i)
246 deallocate (this%initial_lines)
249 this%nheader_lines = nlines
260 integer(I4B),
intent(in) :: iline
261 character(len=*),
intent(inout) :: cval
266 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)