MODFLOW 6  version 6.6.0.dev0
USGS Modular Hydrologic Model
printsavemanagermodule Module Reference

Print/save manager module.

Data Types

type  printsavemanagertype
 Print/save manager type. More...
 

Functions/Subroutines

type(printsavemanagertype) function, pointer, public create_psm ()
 Initialize or clear the print/save manager. More...
 
subroutine allocate (this)
 
subroutine deallocate (this)
 
subroutine init (this)
 
subroutine read (this, linein, iout)
 @ brief Read a line of input and prepare the manager. More...
 
logical function should_print (this, kstp, endofperiod)
 @ brief Determine if printing is enabled for this time step. More...
 
logical function should_save (this, kstp, endofperiod)
 @ brief Determine if saving is enabled for this time step. More...
 

Function/Subroutine Documentation

◆ allocate()

subroutine printsavemanagermodule::allocate ( class(printsavemanagertype this)
private

Definition at line 62 of file PrintSaveManager.f90.

63  class(PrintSaveManagerType) :: this
64  allocate (this%save_steps)
65  allocate (this%print_steps)
66  call this%save_steps%init()
67  call this%print_steps%init()

◆ create_psm()

type(printsavemanagertype) function, pointer, public printsavemanagermodule::create_psm
Returns
the print/save manager

Definition at line 56 of file PrintSaveManager.f90.

57  type(PrintSaveManagerType), pointer :: psm !< the print/save manager
58  allocate (psm)
59  call psm%allocate()
Here is the caller graph for this function:

◆ deallocate()

subroutine printsavemanagermodule::deallocate ( class(printsavemanagertype this)
private
Parameters
thisthis instance

Definition at line 70 of file PrintSaveManager.f90.

71  class(PrintSaveManagerType) :: this !< this instance
72  if (associated(this%save_steps)) deallocate (this%save_steps)
73  if (associated(this%print_steps)) deallocate (this%print_steps)

◆ init()

subroutine printsavemanagermodule::init ( class(printsavemanagertype this)
private

Definition at line 76 of file PrintSaveManager.f90.

77  class(PrintSaveManagerType) :: this
78  call this%deallocate()
79  call this%allocate()

◆ read()

subroutine printsavemanagermodule::read ( class(printsavemanagertype this,
character(len=*), intent(in)  linein,
integer(i4b), intent(in)  iout 
)
private
Parameters
thisthis instance
[in]lineininput line
[in]ioutoutput file unit

Definition at line 83 of file PrintSaveManager.f90.

84  ! dummy
85  class(PrintSaveManagerType) :: this !< this instance
86  character(len=*), intent(in) :: linein !< input line
87  integer(I4B), intent(in) :: iout !< output file unit
88  ! local
89  character(len=len(linein)) :: line
90  integer(I4B) :: lloc, istart, istop, ival
91  real(DP) :: rval
92 
93  line(:) = linein(:)
94  lloc = 1
95  call urword(line, lloc, istart, istop, 1, ival, rval, 0, 0)
96 
97  select case (line(istart:istop))
98  case ('PRINT')
99  call this%print_steps%read(line(istop + 2:))
100  if (iout > 0) &
101  call this%print_steps%log(iout, verb="PRINTED")
102  case ('SAVE')
103  call this%save_steps%read(line(istop + 2:))
104  if (iout > 0) &
105  call this%save_steps%log(iout, verb="SAVED")
106  case default
107  call store_error( &
108  'Looking for PRINT or SAVE. Found: '//trim(adjustl(line)), &
109  terminate=.true.)
110  end select
Here is the call graph for this function:

◆ should_print()

logical function printsavemanagermodule::should_print ( class(printsavemanagertype this,
integer(i4b), intent(in)  kstp,
logical(lgp), intent(in)  endofperiod 
)
private
Parameters
thisthis instance
[in]kstpcurrent time step
[in]endofperiodwhether last step of stress period

Definition at line 114 of file PrintSaveManager.f90.

115  class(PrintSaveManagerType) :: this !< this instance
116  integer(I4B), intent(in) :: kstp !< current time step
117  logical(LGP), intent(in) :: endofperiod !< whether last step of stress period
118 
119  should_print = this%print_steps%is_selected(kstp, endofperiod)

◆ should_save()

logical function printsavemanagermodule::should_save ( class(printsavemanagertype this,
integer(i4b), intent(in)  kstp,
logical(lgp), intent(in)  endofperiod 
)
private
Parameters
thisthis instance
[in]kstpcurrent time step
[in]endofperiodwhether last step of stress period

Definition at line 123 of file PrintSaveManager.f90.

124  class(PrintSaveManagerType) :: this !< this instance
125  integer(I4B), intent(in) :: kstp !< current time step
126  logical(LGP), intent(in) :: endofperiod !< whether last step of stress period
127 
128  should_save = this%save_steps%is_selected(kstp, endofperiod)