MODFLOW 6  version 6.5.0.dev2
MODFLOW 6 Code Documentation
tablemodule Module Reference

Data Types

type  tabletype
 

Functions/Subroutines

subroutine, public table_cr (this, name, title)
 
subroutine table_df (this, maxbound, ntableterm, iout, transient, lineseparator, separator, finalize)
 
subroutine initialize_column (this, text, width, alignment)
 
subroutine set_header (this)
 
subroutine allocate_strings (this, width, nlines)
 
subroutine write_header (this)
 
subroutine write_line (this)
 
subroutine finalize (this)
 
subroutine finalize_table (this)
 
subroutine table_da (this)
 
subroutine line_to_columns (this, line)
 
subroutine add_error (this)
 
subroutine add_integer (this, ival)
 
subroutine add_long_integer (this, long_ival)
 
subroutine add_real (this, rval)
 
subroutine add_string (this, cval)
 
subroutine set_maxbound (this, maxbound)
 
subroutine set_kstpkper (this, kstp, kper)
 
subroutine set_title (this, title)
 
subroutine set_iout (this, iout)
 
subroutine print_list_entry (this, i, nodestr, q, bname)
 
subroutine print_separator (this, iextralines)
 
subroutine reset (this)
 

Function/Subroutine Documentation

◆ add_error()

subroutine tablemodule::add_error ( class(tabletype this)

Definition at line 609 of file Table.f90.

610 ! ******************************************************************************
611 ! add_error -- evaluate if error condition occurs when adding data to dataline
612 ! ******************************************************************************
613 !
614 ! SPECIFICATIONS:
615 ! ------------------------------------------------------------------------------
616  ! -- modules
617  ! -- dummy
618  class(TableType) :: this
619  ! -- local
620 ! ------------------------------------------------------------------------------
621  !
622  ! -- check that ientry is within bounds
623  if (this%ientry > this%ntableterm) then
624  write (errmsg, '(a,1x,i0,5(1x,a),1x,i0,1x,a)') &
625  'Trying to add data to column ', this%ientry, 'in the', &
626  trim(adjustl(this%name)), 'table (', trim(adjustl(this%title)), &
627  ') that only has', this%ntableterm, 'columns.'
628  call store_error(errmsg, terminate=.true.)
629  end if
630  !
631  ! -- Return
632  return
Here is the call graph for this function:

◆ add_integer()

subroutine tablemodule::add_integer ( class(tabletype this,
integer(i4b), intent(in)  ival 
)

Definition at line 635 of file Table.f90.

636 ! ******************************************************************************
637 ! add_integer -- add integer value to the dataline
638 ! ******************************************************************************
639 !
640 ! SPECIFICATIONS:
641 ! ------------------------------------------------------------------------------
642  ! -- modules
643  ! -- dummy
644  class(TableType) :: this
645  integer(I4B), intent(in) :: ival
646  ! -- local
647  logical :: line_end
648  character(len=LINELENGTH) :: cval
649  real(DP) :: rval
650  integer(I4B) :: width
651  integer(I4B) :: alignment
652  integer(I4B) :: j
653 ! ------------------------------------------------------------------------------
654  !
655  ! -- write header
656  if (this%icount == 0 .and. this%ientry == 0) then
657  call this%write_header()
658  end if
659  !
660  ! -- update index for tableterm
661  this%ientry = this%ientry + 1
662  !
663  ! -- check that ientry is within bounds
664  call this%add_error()
665  !
666  ! -- initialize local variables
667  j = this%ientry
668  width = this%tableterm(j)%get_width()
669  alignment = this%tableterm(j)%get_alignment()
670  line_end = .false.
671  if (j == this%ntableterm) then
672  line_end = .true.
673  end if
674  !
675  ! -- add data to line
676  if (this%write_csv) then
677  if (j == 1) then
678  write (this%dataline, '(G0)') ival
679  else
680  write (this%dataline, '(a,",",G0)') trim(this%dataline), ival
681  end if
682  else
683  if (j == this%ntableterm) then
684  call uwword(this%dataline, this%iloc, width, tabinteger, &
685  cval, ival, rval, alignment=alignment)
686  else
687  call uwword(this%dataline, this%iloc, width, tabinteger, &
688  cval, ival, rval, alignment=alignment, sep=this%sep)
689  end if
690  end if
691  !
692  ! -- write the data line, if necessary
693  if (line_end) then
694  call this%write_line()
695  end if
696  !
697  ! -- finalize the table, if necessary
698  if (this%allow_finalization) then
699  call this%finalize()
700  end if
701  !
702  ! -- Return
703  return
Here is the call graph for this function:
Here is the caller graph for this function:

◆ add_long_integer()

subroutine tablemodule::add_long_integer ( class(tabletype this,
integer(i8b), intent(in)  long_ival 
)

Definition at line 706 of file Table.f90.

707 ! ******************************************************************************
708 ! add_long_integer -- add long integer value to the dataline
709 ! ******************************************************************************
710 !
711 ! SPECIFICATIONS:
712 ! ------------------------------------------------------------------------------
713  ! -- modules
714  ! -- dummy
715  class(TableType) :: this
716  integer(I8B), intent(in) :: long_ival
717  ! -- local
718  logical :: line_end
719  character(len=LINELENGTH) :: cval
720  real(DP) :: rval
721  integer(I4B) :: ival
722  integer(I4B) :: width
723  integer(I4B) :: alignment
724  integer(I4B) :: j
725 ! ------------------------------------------------------------------------------
726  !
727  ! -- write header
728  if (this%icount == 0 .and. this%ientry == 0) then
729  call this%write_header()
730  end if
731  !
732  ! -- update index for tableterm
733  this%ientry = this%ientry + 1
734  !
735  ! -- check that ientry is within bounds
736  call this%add_error()
737  !
738  ! -- initialize local variables
739  j = this%ientry
740  width = this%tableterm(j)%get_width()
741  alignment = this%tableterm(j)%get_alignment()
742  line_end = .false.
743  if (j == this%ntableterm) then
744  line_end = .true.
745  end if
746  !
747  ! -- add data to line
748  if (this%write_csv) then
749  if (j == 1) then
750  write (this%dataline, '(G0)') long_ival
751  else
752  write (this%dataline, '(a,",",G0)') trim(this%dataline), long_ival
753  end if
754  else
755  write (cval, '(i0)') long_ival
756  if (j == this%ntableterm) then
757  call uwword(this%dataline, this%iloc, width, tabstring, &
758  trim(cval), ival, rval, alignment=alignment)
759  else
760  call uwword(this%dataline, this%iloc, width, tabstring, &
761  trim(cval), ival, rval, alignment=alignment, sep=this%sep)
762  end if
763  end if
764  !
765  ! -- write the data line, if necessary
766  if (line_end) then
767  call this%write_line()
768  end if
769  !
770  ! -- finalize the table, if necessary
771  if (this%allow_finalization) then
772  call this%finalize()
773  end if
774  !
775  ! -- Return
776  return
Here is the call graph for this function:
Here is the caller graph for this function:

◆ add_real()

subroutine tablemodule::add_real ( class(tabletype this,
real(dp), intent(in)  rval 
)

Definition at line 779 of file Table.f90.

780 ! ******************************************************************************
781 ! add_real -- add real value to the dataline
782 ! ******************************************************************************
783 !
784 ! SPECIFICATIONS:
785 ! ------------------------------------------------------------------------------
786  ! -- modules
787  ! -- dummy
788  class(TableType) :: this
789  real(DP), intent(in) :: rval
790  ! -- local
791  logical :: line_end
792  character(len=LINELENGTH) :: cval
793  integer(I4B) :: ival
794  integer(I4B) :: j
795  integer(I4B) :: width
796  integer(I4B) :: alignment
797 ! ------------------------------------------------------------------------------
798 !
799  if (rval == dhnoflo) then
800  call this%add_string("INACTIVE")
801  else if (rval == dhdry) then
802  call this%add_string("DRY")
803  else
804  !
805  ! -- write header
806  if (this%icount == 0 .and. this%ientry == 0) then
807  call this%write_header()
808  end if
809  !
810  ! -- update index for tableterm
811  this%ientry = this%ientry + 1
812  !
813  ! -- check that ientry is within bounds
814  call this%add_error()
815  !
816  ! -- initialize local variables
817  j = this%ientry
818  width = this%tableterm(j)%get_width()
819  alignment = this%tableterm(j)%get_alignment()
820  line_end = .false.
821  if (j == this%ntableterm) then
822  line_end = .true.
823  end if
824  !
825  ! -- add data to line
826  if (this%write_csv) then
827  if (j == 1) then
828  write (this%dataline, '(G0)') rval
829  else
830  write (this%dataline, '(a,",",G0)') trim(this%dataline), rval
831  end if
832  else
833  if (j == this%ntableterm) then
834  call uwword(this%dataline, this%iloc, width, tabreal, &
835  cval, ival, rval, alignment=alignment)
836  else
837  call uwword(this%dataline, this%iloc, width, tabreal, &
838  cval, ival, rval, alignment=alignment, sep=this%sep)
839  end if
840  end if
841  !
842  ! -- write the data line, if necessary
843  if (line_end) then
844  call this%write_line()
845  end if
846  !
847  ! -- finalize the table, if necessary
848  if (this%allow_finalization) then
849  call this%finalize()
850  end if
851  end if
852  !
853  ! -- Return
854  return
Here is the call graph for this function:
Here is the caller graph for this function:

◆ add_string()

subroutine tablemodule::add_string ( class(tabletype this,
character(len=*)  cval 
)

Definition at line 857 of file Table.f90.

858 ! ******************************************************************************
859 ! add_string -- add string value to the dataline
860 ! ******************************************************************************
861 !
862 ! SPECIFICATIONS:
863 ! ------------------------------------------------------------------------------
864  ! -- modules
865  ! -- dummy
866  class(TableType) :: this
867  character(len=*) :: cval
868  ! -- local
869  logical :: line_end
870  integer(I4B) :: j
871  integer(I4B) :: ival
872  real(DP) :: rval
873  integer(I4B) :: width
874  integer(I4B) :: alignment
875 ! ------------------------------------------------------------------------------
876  !
877  ! -- write header
878  if (this%icount == 0 .and. this%ientry == 0) then
879  call this%write_header()
880  end if
881  !
882  ! -- update index for tableterm
883  this%ientry = this%ientry + 1
884  !
885  ! -- check that ientry is within bounds
886  call this%add_error()
887  !
888  ! -- initialize local variables
889  j = this%ientry
890  width = this%tableterm(j)%get_width()
891  alignment = this%tableterm(j)%get_alignment()
892  line_end = .false.
893  if (j == this%ntableterm) then
894  line_end = .true.
895  end if
896  !
897  ! -- add data to line
898  if (this%write_csv) then
899  if (j == 1) then
900  write (this%dataline, '(a)') trim(adjustl(cval))
901  else
902  write (this%dataline, '(a,",",a)') &
903  trim(this%dataline), trim(adjustl(cval))
904  end if
905  else
906  if (j == this%ntableterm) then
907  call uwword(this%dataline, this%iloc, width, tabstring, &
908  cval, ival, rval, alignment=alignment)
909  else
910  call uwword(this%dataline, this%iloc, width, tabstring, &
911  cval, ival, rval, alignment=alignment, sep=this%sep)
912  end if
913  end if
914  !
915  ! -- write the data line, if necessary
916  if (line_end) then
917  call this%write_line()
918  end if
919  !
920  ! -- finalize the table, if necessary
921  if (this%allow_finalization) then
922  call this%finalize()
923  end if
924  !
925  ! -- Return
926  return
Here is the call graph for this function:
Here is the caller graph for this function:

◆ allocate_strings()

subroutine tablemodule::allocate_strings ( class(tabletype this,
integer(i4b), intent(in)  width,
integer(i4b), intent(in)  nlines 
)

Definition at line 333 of file Table.f90.

334 ! ******************************************************************************
335 ! allocate_strings -- Allocate allocatable character arrays
336 ! ******************************************************************************
337 !
338 ! SPECIFICATIONS:
339 ! ------------------------------------------------------------------------------
340  ! -- modules
341  ! -- dummy
342  class(TableType) :: this
343  integer(I4B), intent(in) :: width
344  integer(I4B), intent(in) :: nlines
345  ! -- local
346  character(len=width) :: string
347  character(len=width) :: linesep
348  integer(I4B) :: n
349 ! ------------------------------------------------------------------------------
350  !
351  ! -- initialize local variables
352  string = ''
353  linesep = repeat('-', width)
354  !
355  ! -- initialize variables
356  this%nheaderlines = nlines
357  if (this%add_linesep) then
358  this%nheaderlines = this%nheaderlines + 2
359  end if
360  this%nlinewidth = width
361  !
362  ! -- allocate deferred length strings
363  allocate (this%header(this%nheaderlines))
364  allocate (this%linesep)
365  allocate (this%dataline)
366  !
367  ! -- initialize lines
368  this%linesep = linesep(1:width)
369  this%dataline = string(1:width)
370  do n = 1, this%nheaderlines
371  this%header(n) = string(1:width)
372  end do
373  !
374  ! -- fill first and last header line with
375  ! linesep
376  if (this%add_linesep) then
377  this%header(1) = linesep(1:width)
378  this%header(nlines + 2) = linesep(1:width)
379  end if
380  !
381  ! -- return
382  return

◆ finalize()

subroutine tablemodule::finalize ( class(tabletype this)

Definition at line 460 of file Table.f90.

461 ! ******************************************************************************
462 ! finalize -- Private method that test for last line. If last line the
463 ! public finalize_table method is called
464 ! ******************************************************************************
465 !
466 ! SPECIFICATIONS:
467 ! ------------------------------------------------------------------------------
468  ! -- modules
469  ! -- dummy
470  class(TableType) :: this
471  ! -- local
472 ! ------------------------------------------------------------------------------
473  !
474  ! -- finalize table if last entry
475  if (this%icount == this%maxbound) then
476  call this%finalize_table()
477  end if
478  !
479  ! -- return
480  return

◆ finalize_table()

subroutine tablemodule::finalize_table ( class(tabletype this)

Definition at line 483 of file Table.f90.

484 ! ******************************************************************************
485 ! finalize -- Public method to finalize the table
486 ! ******************************************************************************
487 !
488 ! SPECIFICATIONS:
489 ! ------------------------------------------------------------------------------
490  ! -- modules
491  ! -- dummy
492  class(TableType) :: this
493  ! -- local
494 ! ------------------------------------------------------------------------------
495  !
496  ! -- write the final table separator
497  call this%print_separator(iextralines=1)
498  !
499  ! -- flush file
500  flush (this%iout)
501  !
502  ! -- reinitialize variables
503  call this%reset()
504  !
505  ! -- return
506  return

◆ initialize_column()

subroutine tablemodule::initialize_column ( class(tabletype this,
character(len=*), intent(in)  text,
integer(i4b), intent(in)  width,
integer(i4b), intent(in), optional  alignment 
)

Definition at line 198 of file Table.f90.

199 ! ******************************************************************************
200 ! initialize_column -- Initialize data for a column
201 ! ******************************************************************************
202 !
203 ! SPECIFICATIONS:
204 ! ------------------------------------------------------------------------------
205  ! -- modules
206  ! -- dummy
207  class(TableType) :: this
208  character(len=*), intent(in) :: text
209  integer(I4B), intent(in) :: width
210  integer(I4B), intent(in), optional :: alignment
211  ! -- local
212  integer(I4B) :: idx
213  integer(I4B) :: ialign
214 ! ------------------------------------------------------------------------------
215  !
216  ! -- process optional dummy variables
217  if (present(alignment)) then
218  ialign = alignment
219  else
220  ialign = tabcenter
221  end if
222  !
223  ! -- update index for tableterm
224  this%ientry = this%ientry + 1
225  idx = this%ientry
226  !
227  ! -- check that ientry is in bounds
228  if (this%ientry > this%ntableterm) then
229  write (errmsg, '(a,a,a,i0,a,1x,a,1x,a,a,a,1x,i0,1x,a)') &
230  'Trying to add column "', trim(adjustl(text)), '" (', &
231  this%ientry, ') in the', trim(adjustl(this%name)), 'table ("', &
232  trim(adjustl(this%title)), '") that only has', this%ntableterm, &
233  'columns.'
234  call store_error(errmsg, terminate=.true.)
235  end if
236  !
237  ! -- initialize table term
238  call this%tableterm(idx)%initialize(text, width, alignment=ialign)
239  !
240  ! -- create header when all terms have been specified
241  if (this%ientry == this%ntableterm) then
242  call this%set_header()
243  !
244  ! -- reset ientry
245  this%ientry = 0
246  end if
247  !
248  ! -- return
249  return
Here is the call graph for this function:

◆ line_to_columns()

subroutine tablemodule::line_to_columns ( class(tabletype this,
character(len=linelength), intent(in)  line 
)

Definition at line 560 of file Table.f90.

561 ! ******************************************************************************
562 ! line_to_columns -- convert a line to the correct number of columns
563 ! ******************************************************************************
564 !
565 ! SPECIFICATIONS:
566 ! ------------------------------------------------------------------------------
567  ! -- modules
568  ! -- dummy
569  class(TableType) :: this
570  character(len=LINELENGTH), intent(in) :: line
571  ! -- local
572  character(len=LINELENGTH), allocatable, dimension(:) :: words
573  integer(I4B) :: nwords
574  integer(I4B) :: icols
575  integer(I4B) :: i
576 ! ------------------------------------------------------------------------------
577  !
578  ! -- write header
579  if (this%icount == 0 .and. this%ientry == 0) then
580  call this%write_header()
581  end if
582  !
583  ! -- parse line into words
584  call parseline(line, nwords, words, 0)
585  !
586  ! -- calculate the number of entries in line but
587  ! limit it to the maximum number of columns if
588  ! the number of words exceeds ntableterm
589  icols = this%ntableterm
590  icols = min(nwords, icols)
591  !
592  ! -- add data (as strings) to line
593  do i = 1, icols
594  call this%add_term(words(i))
595  end do
596  !
597  ! -- add empty strings to complete the line
598  do i = icols + 1, this%ntableterm
599  call this%add_term(' ')
600  end do
601  !
602  ! -- clean up local allocatable array
603  deallocate (words)
604  !
605  ! -- Return
606  return
Here is the call graph for this function:

◆ print_list_entry()

subroutine tablemodule::print_list_entry ( class(tabletype this,
integer(i4b), intent(in)  i,
character(len=*), intent(in)  nodestr,
real(dp), intent(in)  q,
character(len=*), intent(in)  bname 
)

Definition at line 1018 of file Table.f90.

1019 ! ******************************************************************************
1020 ! print_list_entry -- write flow term table values
1021 ! ******************************************************************************
1022 !
1023 ! SPECIFICATIONS:
1024 ! ------------------------------------------------------------------------------
1025  ! -- modules
1026  ! -- dummy
1027  class(TableType) :: this
1028  integer(I4B), intent(in) :: i
1029  character(len=*), intent(in) :: nodestr
1030  real(DP), intent(in) :: q
1031  character(len=*), intent(in) :: bname
1032  ! -- local
1033 ! ------------------------------------------------------------------------------
1034  !
1035  ! -- fill table terms
1036  call this%add_term(i)
1037  call this%add_term(nodestr)
1038  call this%add_term(q)
1039  if (this%ntableterm > 3) then
1040  call this%add_term(bname)
1041  end if
1042  !
1043  ! -- return
1044  return

◆ print_separator()

subroutine tablemodule::print_separator ( class(tabletype this,
integer(i4b), optional  iextralines 
)

Definition at line 1047 of file Table.f90.

1048 ! ******************************************************************************
1049 ! print_separator -- print a line separator to the table
1050 ! ******************************************************************************
1051 !
1052 ! SPECIFICATIONS:
1053 ! ------------------------------------------------------------------------------
1054  ! -- modules
1055  ! -- dummy
1056  class(TableType) :: this
1057  integer(I4B), optional :: iextralines
1058  ! -- local
1059  integer(I4B) :: i
1060  integer(I4B) :: iextra
1061  integer(I4B) :: width
1062 ! ------------------------------------------------------------------------------
1063  !
1064  ! -- process optional variables
1065  if (present(iextralines)) then
1066  iextra = iextralines
1067  else
1068  iextra = 0
1069  end if
1070  !
1071  ! -- initialize local variables
1072  width = this%nlinewidth
1073  !
1074  ! -- print line separator
1075  if (this%add_linesep) then
1076  write (this%iout, '(1x,a)') this%linesep(1:width)
1077  do i = 1, iextra
1078  write (this%iout, '(/)')
1079  end do
1080  end if
1081  !
1082  ! -- return
1083  return

◆ reset()

subroutine tablemodule::reset ( class(tabletype this)

Definition at line 1086 of file Table.f90.

1087 ! ******************************************************************************
1088 ! reset -- Private method to reset table counters
1089 ! ******************************************************************************
1090 !
1091 ! SPECIFICATIONS:
1092 ! ------------------------------------------------------------------------------
1093  ! -- modules
1094  ! -- dummy
1095  class(TableType) :: this
1096  ! -- local
1097 ! ------------------------------------------------------------------------------
1098  !
1099  ! -- reset counters
1100  this%ientry = 0
1101  this%icount = 0
1102  this%first_entry = .true.
1103  !
1104  ! -- return
1105  return

◆ set_header()

subroutine tablemodule::set_header ( class(tabletype this)

Definition at line 252 of file Table.f90.

253 ! ******************************************************************************
254 ! set_header -- Set the table object header
255 ! ******************************************************************************
256 !
257 ! SPECIFICATIONS:
258 ! ------------------------------------------------------------------------------
259  ! -- modules
260  ! -- dummy
261  class(TableType) :: this
262  ! -- local
263  character(len=LINELENGTH) :: cval
264  integer(I4B) :: width
265  integer(I4B) :: alignment
266  integer(I4B) :: nlines
267  integer(I4B) :: iloc
268  integer(I4B) :: ival
269  real(DP) :: rval
270  integer(I4B) :: j
271  integer(I4B) :: n
272  integer(I4B) :: nn
273 ! ------------------------------------------------------------------------------
274  !
275  ! -- initialize variables
276  width = 0
277  nlines = 0
278  !
279  ! -- determine total width and maximum number of lines
280  do n = 1, this%ntableterm
281  width = width + this%tableterm(n)%get_width()
282  nlines = max(nlines, this%tableterm(n)%get_header_lines())
283  end do
284  !
285  ! -- add length of separators
286  width = width + this%ntableterm - 1
287  !
288  ! -- allocate the header and line separator
289  call this%allocate_strings(width, nlines)
290  !
291  ! -- build final header lines
292  do n = 1, this%ntableterm
293  call this%tableterm(n)%set_header(nlines)
294  end do
295  !
296  ! -- build header
297  do n = 1, nlines
298  iloc = 1
299  this%iloc = 1
300  if (this%add_linesep) then
301  nn = n + 1
302  else
303  nn = n
304  end if
305  do j = 1, this%ntableterm
306  width = this%tableterm(j)%get_width()
307  alignment = this%tableterm(j)%get_alignment()
308  call this%tableterm(j)%get_header(n, cval)
309  if (this%write_csv) then
310  if (j == 1) then
311  write (this%header(nn), '(a)') trim(adjustl(cval))
312  else
313  write (this%header(nn), '(a,",",G0)') &
314  trim(this%header(nn)), trim(adjustl(cval))
315  end if
316  else
317  if (j == this%ntableterm) then
318  call uwword(this%header(nn), iloc, width, tabucstring, &
319  cval(1:width), ival, rval, alignment=alignment)
320  else
321  call uwword(this%header(nn), iloc, width, tabucstring, &
322  cval(1:width), ival, rval, alignment=alignment, &
323  sep=this%sep)
324  end if
325  end if
326  end do
327  end do
328  !
329  ! -- return
330  return
Here is the call graph for this function:

◆ set_iout()

subroutine tablemodule::set_iout ( class(tabletype this,
integer(i4b), intent(in)  iout 
)

Definition at line 997 of file Table.f90.

998 ! ******************************************************************************
999 ! set_iout -- reset iout
1000 ! ******************************************************************************
1001 !
1002 ! SPECIFICATIONS:
1003 ! ------------------------------------------------------------------------------
1004  ! -- modules
1005  ! -- dummy
1006  class(TableType) :: this
1007  integer(I4B), intent(in) :: iout
1008  ! -- local
1009 ! ------------------------------------------------------------------------------
1010  !
1011  ! -- set iout
1012  this%iout = iout
1013  !
1014  ! -- return
1015  return

◆ set_kstpkper()

subroutine tablemodule::set_kstpkper ( class(tabletype this,
integer(i4b), intent(in)  kstp,
integer(i4b), intent(in)  kper 
)

Definition at line 953 of file Table.f90.

954 ! ******************************************************************************
955 ! set_kstpkper -- reset kstp and kper
956 ! ******************************************************************************
957 !
958 ! SPECIFICATIONS:
959 ! ------------------------------------------------------------------------------
960  ! -- modules
961  ! -- dummy
962  class(TableType) :: this
963  integer(I4B), intent(in) :: kstp
964  integer(I4B), intent(in) :: kper
965  ! -- local
966 ! ------------------------------------------------------------------------------
967  !
968  ! -- set maxbound
969  this%kstp = kstp
970  this%kper = kper
971  !
972  ! -- return
973  return

◆ set_maxbound()

subroutine tablemodule::set_maxbound ( class(tabletype this,
integer(i4b), intent(in)  maxbound 
)

Definition at line 929 of file Table.f90.

930 ! ******************************************************************************
931 ! set_maxbound -- reset maxbound
932 ! ******************************************************************************
933 !
934 ! SPECIFICATIONS:
935 ! ------------------------------------------------------------------------------
936  ! -- modules
937  ! -- dummy
938  class(TableType) :: this
939  integer(I4B), intent(in) :: maxbound
940  ! -- local
941 ! ------------------------------------------------------------------------------
942  !
943  ! -- set maxbound
944  this%maxbound = maxbound
945  !
946  ! -- reset counters
947  call this%reset()
948  !
949  ! -- return
950  return

◆ set_title()

subroutine tablemodule::set_title ( class(tabletype this,
character(len=*), intent(in)  title 
)

Definition at line 976 of file Table.f90.

977 ! ******************************************************************************
978 ! set_maxbound -- reset maxbound
979 ! ******************************************************************************
980 !
981 ! SPECIFICATIONS:
982 ! ------------------------------------------------------------------------------
983  ! -- modules
984  ! -- dummy
985  class(TableType) :: this
986  character(len=*), intent(in) :: title
987  ! -- local
988 ! ------------------------------------------------------------------------------
989  !
990  ! -- set maxbound
991  this%title = title
992  !
993  ! -- return
994  return

◆ table_cr()

subroutine, public tablemodule::table_cr ( type(tabletype), pointer  this,
character(len=*), intent(in)  name,
character(len=*), intent(in)  title 
)

Definition at line 84 of file Table.f90.

85 ! ******************************************************************************
86 ! table_cr -- Create a new table object
87 ! ******************************************************************************
88 !
89 ! SPECIFICATIONS:
90 ! ------------------------------------------------------------------------------
91  ! -- modules
92  ! -- dummy
93  type(TableType), pointer :: this
94  character(len=*), intent(in) :: name
95  character(len=*), intent(in) :: title
96  ! -- local
97 ! ------------------------------------------------------------------------------
98  !
99  ! -- check if table already associated and reset if necessary
100  if (associated(this)) then
101  call this%table_da()
102  deallocate (this)
103  nullify (this)
104  end if
105  !
106  ! -- Create the object
107  allocate (this)
108  !
109  ! -- initialize variables
110  this%name = name
111  this%title = title
112  !
113  ! -- Return
114  return
Here is the caller graph for this function:

◆ table_da()

subroutine tablemodule::table_da ( class(tabletype this)

Definition at line 509 of file Table.f90.

510 ! ******************************************************************************
511 ! table_da -- deallocate
512 ! ******************************************************************************
513 !
514 ! SPECIFICATIONS:
515 ! ------------------------------------------------------------------------------
516  ! -- modules
517  ! -- dummy
518  class(TableType) :: this
519  ! -- dummy
520  integer(I4B) :: i
521 ! ------------------------------------------------------------------------------
522  !
523  ! -- deallocate each table term
524  do i = 1, this%ntableterm
525  call this%tableterm(i)%da()
526  end do
527  !
528  ! -- deallocate space for tableterm
529  deallocate (this%tableterm)
530  !
531  ! -- deallocate character scalars and arrays
532  deallocate (this%linesep)
533  deallocate (this%dataline)
534  deallocate (this%header)
535  !
536  ! -- deallocate scalars
537  if (this%transient) then
538  deallocate (this%kstp)
539  deallocate (this%kper)
540  end if
541  deallocate (this%sep)
542  deallocate (this%write_csv)
543  deallocate (this%first_entry)
544  deallocate (this%transient)
545  deallocate (this%add_linesep)
546  deallocate (this%allow_finalization)
547  deallocate (this%iout)
548  deallocate (this%maxbound)
549  deallocate (this%nheaderlines)
550  deallocate (this%nlinewidth)
551  deallocate (this%ntableterm)
552  deallocate (this%ientry)
553  deallocate (this%iloc)
554  deallocate (this%icount)
555  !
556  ! -- Return
557  return

◆ table_df()

subroutine tablemodule::table_df ( class(tabletype this,
integer(i4b), intent(in)  maxbound,
integer(i4b), intent(in)  ntableterm,
integer(i4b), intent(in)  iout,
logical, intent(in), optional  transient,
logical, intent(in), optional  lineseparator,
character(len=1), intent(in), optional  separator,
logical, intent(in), optional  finalize 
)

Definition at line 117 of file Table.f90.

119 ! ******************************************************************************
120 ! table_df -- Define the new table object
121 ! ******************************************************************************
122 !
123 ! SPECIFICATIONS:
124 ! ------------------------------------------------------------------------------
125  ! -- modules
126  ! -- dummy
127  class(TableType) :: this
128  integer(I4B), intent(in) :: maxbound
129  integer(I4B), intent(in) :: ntableterm
130  integer(I4B), intent(in) :: iout
131  logical, intent(in), optional :: transient
132  logical, intent(in), optional :: lineseparator
133  character(len=1), intent(in), optional :: separator
134  logical, intent(in), optional :: finalize
135 ! ------------------------------------------------------------------------------
136  !
137  ! -- allocate scalars
138  allocate (this%sep)
139  allocate (this%write_csv)
140  allocate (this%first_entry)
141  allocate (this%transient)
142  allocate (this%add_linesep)
143  allocate (this%allow_finalization)
144  allocate (this%iout)
145  allocate (this%maxbound)
146  allocate (this%nheaderlines)
147  allocate (this%nlinewidth)
148  allocate (this%ntableterm)
149  allocate (this%ientry)
150  allocate (this%iloc)
151  allocate (this%icount)
152  !
153  ! -- allocate space for tableterm
154  allocate (this%tableterm(ntableterm))
155  !
156  ! -- initialize values based on optional dummy variables
157  if (present(transient)) then
158  this%transient = transient
159  allocate (this%kstp)
160  allocate (this%kper)
161  else
162  this%transient = .false.
163  end if
164  if (present(separator)) then
165  this%sep = separator
166  if (separator == ',') then
167  this%write_csv = .true.
168  else
169  this%write_csv = .false.
170  end if
171  else
172  this%sep = ' '
173  this%write_csv = .false.
174  end if
175  if (present(lineseparator)) then
176  this%add_linesep = lineseparator
177  else
178  this%add_linesep = .true.
179  end if
180  if (present(finalize)) then
181  this%allow_finalization = finalize
182  else
183  this%allow_finalization = .true.
184  end if
185  !
186  ! -- initialize variables
187  this%first_entry = .true.
188  this%iout = iout
189  this%maxbound = maxbound
190  this%ntableterm = ntableterm
191  this%ientry = 0
192  this%icount = 0
193  !
194  ! -- return
195  return

◆ write_header()

subroutine tablemodule::write_header ( class(tabletype this)

Definition at line 385 of file Table.f90.

386 ! ******************************************************************************
387 ! write_table -- Write the table header
388 ! ******************************************************************************
389 !
390 ! SPECIFICATIONS:
391 ! ------------------------------------------------------------------------------
392  ! -- modules
393  ! -- dummy
394  class(TableType) :: this
395  ! -- local
396  character(len=LINELENGTH) :: title
397  integer(I4B) :: width
398  integer(I4B) :: n
399 ! ------------------------------------------------------------------------------
400  !
401  ! -- initialize local variables
402  width = this%nlinewidth
403  !
404  ! -- write the table header
405  if (this%first_entry) then
406  ! -- write title
407  title = this%title
408  if (this%transient) then
409  write (title, '(a,a,i6)') trim(adjustl(title)), ' PERIOD ', this%kper
410  write (title, '(a,a,i8)') trim(adjustl(title)), ' STEP ', this%kstp
411  end if
412  if (len_trim(title) > 0) then
413  write (this%iout, '(/,1x,a)') trim(adjustl(title))
414  end if
415  !
416  ! -- write header
417  do n = 1, this%nheaderlines
418  write (this%iout, '(1x,a)') this%header(n) (1:width)
419  end do
420  end if
421  !
422  ! -- reinitialize variables
423  this%first_entry = .false.
424  this%ientry = 0
425  this%icount = 0
426  !
427  ! -- return
428  return

◆ write_line()

subroutine tablemodule::write_line ( class(tabletype this)

Definition at line 431 of file Table.f90.

432 ! ******************************************************************************
433 ! write_line -- Write the data line
434 ! ******************************************************************************
435 !
436 ! SPECIFICATIONS:
437 ! ------------------------------------------------------------------------------
438  ! -- modules
439  ! -- dummy
440  class(TableType) :: this
441  ! -- local
442  integer(I4B) :: width
443 ! ------------------------------------------------------------------------------
444  !
445  ! -- initialize local variables
446  width = this%nlinewidth
447  !
448  ! -- write the dataline
449  write (this%iout, '(1x,a)') this%dataline(1:width)
450  !
451  ! -- update column and line counters
452  this%ientry = 0
453  this%iloc = 1
454  this%icount = this%icount + 1
455  !
456  ! -- return
457  return