MODFLOW 6  version 6.5.0.dev2
MODFLOW 6 Code Documentation
ats.f90
Go to the documentation of this file.
1 ! Outstanding issues for future work:
2 ! CSUB state advance/restore
3 ! Add courant time step constraint and other stability controls for GWT model
5 
6  use kindmodule, only: dp, i4b, lgp
11  tabcenter
12 
13  implicit none
14  private
15  public :: isadaptiveperiod
16  public :: ats_set_delt
17  public :: ats_period_message
18  public :: ats_set_endofperiod
19  public :: ats_submit_delt
20  public :: ats_reset_delt
21  public :: ats_cr
22  public :: ats_da
23 
24  integer(I4B), pointer :: nper => null() !< set equal to nper
25  integer(I4B), pointer :: maxats => null() !< number of ats entries
26  real(dp), public, pointer :: dtstable => null() !< delt value required for stability
27  integer(I4B), dimension(:), pointer, contiguous :: kperats => null() !< array of stress period numbers to apply ats (size NPER)
28  integer(I4B), dimension(:), pointer, contiguous :: iperats => null() !< array of stress period numbers to apply ats (size MAXATS)
29  real(dp), dimension(:), pointer, contiguous :: dt0 => null() !< input array of initial time step sizes
30  real(dp), dimension(:), pointer, contiguous :: dtmin => null() !< input array of minimum time step sizes
31  real(dp), dimension(:), pointer, contiguous :: dtmax => null() !< input array of maximum time step sizes
32  real(dp), dimension(:), pointer, contiguous :: dtadj => null() !< input array of time step factors for shortening or increasing
33  real(dp), dimension(:), pointer, contiguous :: dtfailadj => null() !< input array of time step factors for shortening due to nonconvergence
34  type(blockparsertype) :: parser !< block parser for reading input file
35 
36 contains
37 
38  !> @ brief Determine if period is adaptive
39  !!
40  !! Check settings and determine if kper is an adaptive
41  !! stress period.
42  !!
43  !<
44  function isadaptiveperiod(kper) result(lv)
45  integer(I4B), intent(in) :: kper
46  logical(LGP) :: lv
47  lv = .false.
48  if (associated(kperats)) then
49  if (kperats(kper) > 0) then
50  lv = .true.
51  end if
52  end if
53  return
54  end function isadaptiveperiod
55 
56  !> @ brief Create ATS object
57  !!
58  !! Create a new ATS object, and read and check input.
59  !!
60  !<
61  subroutine ats_cr(inunit, nper_tdis)
62  ! -- modules
63  ! -- dummy
64  integer(I4B), intent(in) :: inunit
65  integer(I4B), intent(in) :: nper_tdis
66  ! -- local
67  ! -- formats
68  character(len=*), parameter :: fmtheader = &
69  "(1X,/1X,'ATS -- ADAPTIVE TIME STEP PACKAGE,', / &
70  &' VERSION 1 : 03/18/2021 - INPUT READ FROM UNIT ',I0)"
71  !
72  ! -- Allocate the scalar variables
74  !
75  ! -- Identify package
76  write (iout, fmtheader) inunit
77  !
78  ! -- Initialize block parser
79  call parser%initialize(inunit, iout)
80  !
81  ! -- Read options
82  call ats_read_options()
83  !
84  ! -- store tdis nper in nper
85  nper = nper_tdis
86  !
87  ! -- Read dimensions and then allocate arrays
88  call ats_read_dimensions()
89  call ats_allocate_arrays()
90  !
91  ! -- Read timing
92  call ats_read_timing()
93  !
94  ! -- Echo input data to table
95  call ats_input_table()
96  !
97  ! -- Check timing
98  call ats_check_timing()
99  !
100  ! -- Process input
101  call ats_process_input()
102  !
103  ! -- Close the file
104  call parser%Clear()
105  !
106  ! -- return
107  return
108  end subroutine ats_cr
109 
110  !> @ brief Allocate scalars
111  !!
112  !! Allocate and initialize scalars for the ATS package.
113  !!
114  !<
115  subroutine ats_allocate_scalars()
116  ! -- modules
118  !
119  ! -- memory manager variables
120  call mem_allocate(nper, 'NPER', 'ATS')
121  call mem_allocate(maxats, 'MAXATS', 'ATS')
122  call mem_allocate(dtstable, 'DTSTABLE', 'ATS')
123  !
124  ! -- Initialize variables
125  nper = 0
126  maxats = 0
127  dtstable = dnodata
128  !
129  ! -- return
130  return
131  end subroutine ats_allocate_scalars
132 
133  !> @ brief Allocate arrays
134  !!
135  !! Allocate and initialize arrays for the ATS package.
136  !!
137  !<
138  subroutine ats_allocate_arrays()
139  ! -- modules
141  ! -- local
142  integer(I4B) :: n
143  !
144  call mem_allocate(kperats, nper, 'KPERATS', 'ATS')
145  call mem_allocate(iperats, maxats, 'IPERATS', 'ATS')
146  call mem_allocate(dt0, maxats, 'DT0', 'ATS')
147  call mem_allocate(dtmin, maxats, 'DTMIN', 'ATS')
148  call mem_allocate(dtmax, maxats, 'DTMAX', 'ATS')
149  call mem_allocate(dtadj, maxats, 'DTADJ', 'ATS')
150  call mem_allocate(dtfailadj, maxats, 'DTFAILADJ', 'ATS')
151  !
152  ! -- initialize kperats
153  do n = 1, nper
154  kperats(n) = 0
155  end do
156  !
157  ! -- initialize
158  do n = 1, maxats
159  iperats(n) = 0
160  dt0(n) = dzero
161  dtmin(n) = dzero
162  dtmax(n) = dzero
163  dtadj(n) = dzero
164  dtfailadj(n) = dzero
165  end do
166  !
167  ! -- return
168  return
169  end subroutine ats_allocate_arrays
170 
171  !> @ brief Deallocate variables
172  !!
173  !! Deallocate all ATS variables.
174  !!
175  !<
176  subroutine ats_da()
178  !
179  ! -- Scalars
180  call mem_deallocate(nper)
181  call mem_deallocate(maxats)
183  !
184  ! -- Arrays
185  call mem_deallocate(kperats)
186  call mem_deallocate(iperats)
187  call mem_deallocate(dt0)
188  call mem_deallocate(dtmin)
189  call mem_deallocate(dtmax)
190  call mem_deallocate(dtadj)
192  !
193  ! -- Return
194  return
195  end subroutine ats_da
196 
197  !> @ brief Read options
198  !!
199  !! Read options from ATS input file.
200  !!
201  !<
202  subroutine ats_read_options()
203  ! -- dummy
204  ! -- local
205  character(len=LINELENGTH) :: keyword
206  integer(I4B) :: ierr
207  logical :: isfound, endOfBlock
208  ! -- formats
209  !
210  ! -- get options block
211  call parser%GetBlock('OPTIONS', isfound, ierr, &
212  supportopenclose=.true., blockrequired=.false.)
213  !
214  ! -- parse options block if detected
215  if (isfound) then
216  write (iout, '(1x,a)') 'PROCESSING ATS OPTIONS'
217  do
218  call parser%GetNextLine(endofblock)
219  if (endofblock) exit
220  call parser%GetStringCaps(keyword)
221  select case (keyword)
222  case default
223  write (errmsg, '(a,a)') 'Unknown ATS option: ', &
224  trim(keyword)
225  call store_error(errmsg)
226  call parser%StoreErrorUnit()
227  end select
228  end do
229  write (iout, '(1x,a)') 'END OF ATS OPTIONS'
230  end if
231  !
232  ! -- Return
233  return
234  end subroutine ats_read_options
235 
236  !> @ brief Read dimensions
237  !!
238  !! Read dimensions from ATS input file.
239  !!
240  !<
241  subroutine ats_read_dimensions()
242  ! -- dummy
243  ! -- local
244  character(len=LINELENGTH) :: keyword
245  integer(I4B) :: ierr
246  logical :: isfound, endOfBlock
247  ! -- formats
248  character(len=*), parameter :: fmtmaxats = &
249  &"(1X,I0,' ADAPTIVE TIME STEP RECORDS(S) WILL FOLLOW IN PERIODDATA')"
250  !
251  ! -- get DIMENSIONS block
252  call parser%GetBlock('DIMENSIONS', isfound, ierr, &
253  supportopenclose=.true.)
254  !
255  ! -- parse block if detected
256  if (isfound) then
257  write (iout, '(1x,a)') 'PROCESSING ATS DIMENSIONS'
258  do
259  call parser%GetNextLine(endofblock)
260  if (endofblock) exit
261  call parser%GetStringCaps(keyword)
262  select case (keyword)
263  case ('MAXATS')
264  maxats = parser%GetInteger()
265  write (iout, fmtmaxats) maxats
266  case default
267  write (errmsg, '(a,a)') 'Unknown ATS dimension: ', &
268  trim(keyword)
269  call store_error(errmsg)
270  call parser%StoreErrorUnit()
271  end select
272  end do
273  write (iout, '(1x,a)') 'END OF ATS DIMENSIONS'
274  else
275  write (errmsg, '(a)') 'Required DIMENSIONS block not found.'
276  call store_error(errmsg)
277  call parser%StoreErrorUnit()
278  end if
279  !
280  ! -- Return
281  return
282  end subroutine ats_read_dimensions
283 
284  !> @ brief Read timing
285  !!
286  !! Read timing information from ATS input file.
287  !!
288  !<
289  subroutine ats_read_timing()
290  ! -- modules
291  ! -- dummy
292  ! -- local
293  integer(I4B) :: ierr
294  integer(I4B) :: n
295  logical :: isfound, endOfBlock
296  ! -- formats
297  !
298  ! -- get PERIODDATA block
299  call parser%GetBlock('PERIODDATA', isfound, ierr, &
300  supportopenclose=.true.)
301  !
302  ! -- parse block if detected
303  if (isfound) then
304  write (iout, '(1x,a)') 'READING ATS PERIODDATA'
305  do n = 1, maxats
306  call parser%GetNextLine(endofblock)
307  if (endofblock) exit
308  !
309  ! -- fill the ats data arrays
310  iperats(n) = parser%GetInteger()
311  dt0(n) = parser%GetDouble()
312  dtmin(n) = parser%GetDouble()
313  dtmax(n) = parser%GetDouble()
314  dtadj(n) = parser%GetDouble()
315  dtfailadj(n) = parser%GetDouble()
316  end do
317  !
318  ! -- Close the block
319  call parser%terminateblock()
320  !
321  ! -- Check for errors
322  if (count_errors() > 0) then
323  call parser%StoreErrorUnit()
324  end if
325  write (iout, '(1x,a)') 'END READING ATS PERIODDATA'
326  else
327  write (errmsg, '(a)') 'Required PERIODDATA block not found.'
328  call store_error(errmsg)
329  call parser%StoreErrorUnit()
330  end if
331  !
332  ! -- Return
333  return
334  end subroutine ats_read_timing
335 
336  !> @ brief Process input
337  !!
338  !! Process ATS input by filling the kperats array.
339  !!
340  !<
341  subroutine ats_process_input()
342  integer(I4B) :: kkper
343  integer(I4B) :: n
344  !
345  ! -- fill kperats for valid iperats values
346  do n = 1, maxats
347  kkper = iperats(n)
348  if (kkper > 0 .and. kkper <= nper) then
349  kperats(kkper) = n
350  end if
351  end do
352  end subroutine ats_process_input
353 
354  !> @ brief Write input table
355  !!
356  !! Write a table showing the ATS input read from the perioddata block.
357  !!
358  !<
359  subroutine ats_input_table()
360  use tablemodule, only: tabletype, table_cr
361  integer(I4B) :: n
362  character(len=LINELENGTH) :: tag
363  type(tabletype), pointer :: inputtab => null()
364  !
365  ! -- setup table
366  call table_cr(inputtab, 'ATS', 'ATS PERIOD DATA')
367  call inputtab%table_df(maxats, 7, iout)
368  !
369  ! add columns
370  tag = 'RECORD'
371  call inputtab%initialize_column(tag, 10, alignment=tableft)
372  tag = 'IPERATS'
373  call inputtab%initialize_column(tag, 10, alignment=tableft)
374  tag = 'DT0'
375  call inputtab%initialize_column(tag, 10, alignment=tabcenter)
376  tag = 'DTMIN'
377  call inputtab%initialize_column(tag, 10, alignment=tabcenter)
378  tag = 'DTMAX'
379  call inputtab%initialize_column(tag, 10, alignment=tabcenter)
380  tag = 'DTADJ'
381  call inputtab%initialize_column(tag, 10, alignment=tabcenter)
382  tag = 'DTFAILADJ'
383  call inputtab%initialize_column(tag, 10, alignment=tabcenter)
384  !
385  ! -- write the data
386  do n = 1, maxats
387  call inputtab%add_term(n)
388  call inputtab%add_term(iperats(n))
389  call inputtab%add_term(dt0(n))
390  call inputtab%add_term(dtmin(n))
391  call inputtab%add_term(dtmax(n))
392  call inputtab%add_term(dtadj(n))
393  call inputtab%add_term(dtfailadj(n))
394  end do
395  !
396  ! -- deallocate the table
397  call inputtab%table_da()
398  deallocate (inputtab)
399  nullify (inputtab)
400  return
401  end subroutine ats_input_table
402 
403  !> @ brief Check timing
404  !!
405  !! Perform a check on the input data to make sure values are within
406  !! required ranges.
407  !!
408  !<
409  subroutine ats_check_timing()
410  integer(I4B) :: n
411  write (iout, '(1x,a)') 'PROCESSING ATS INPUT'
412  do n = 1, maxats
413  !
414  ! -- check iperats
415  if (iperats(n) < 1) then
416  write (errmsg, '(a, i0, a, i0)') &
417  'IPERATS must be greater than zero. Found ', iperats(n), &
418  ' for ATS PERIODDATA record ', n
419  call store_error(errmsg)
420  end if
421  if (iperats(n) > nper) then
422  write (warnmsg, '(a, i0, a, i0)') &
423  'IPERATS greater than NPER. Found ', iperats(n), &
424  ' for ATS PERIODDATA record ', n
425  call store_warning(warnmsg)
426  end if
427  !
428  ! -- check dt0
429  if (dt0(n) < dzero) then
430  write (errmsg, '(a, g15.7, a, i0)') &
431  'DT0 must be >= zero. Found ', dt0(n), &
432  ' for ATS PERIODDATA record ', n
433  call store_error(errmsg)
434  end if
435  !
436  ! -- check dtmin
437  if (dtmin(n) <= dzero) then
438  write (errmsg, '(a, g15.7, a, i0)') &
439  'DTMIN must be > zero. Found ', dtmin(n), &
440  ' for ATS PERIODDATA record ', n
441  call store_error(errmsg)
442  end if
443  !
444  ! -- check dtmax
445  if (dtmax(n) <= dzero) then
446  write (errmsg, '(a, g15.7, a, i0)') &
447  'DTMAX must be > zero. Found ', dtmax(n), &
448  ' for ATS PERIODDATA record ', n
449  call store_error(errmsg)
450  end if
451  !
452  ! -- check dtmin <= dtmax
453  if (dtmin(n) > dtmax(n)) then
454  write (errmsg, '(a, 2g15.7, a, i0)') &
455  'DTMIN must be < dtmax. Found ', dtmin(n), dtmax(n), &
456  ' for ATS PERIODDATA record ', n
457  call store_error(errmsg)
458  end if
459  !
460  ! -- check dtadj
461  if (dtadj(n) .ne. dzero .and. dtadj(n) < done) then
462  write (errmsg, '(a, g15.7, a, i0)') &
463  'DTADJ must be 0 or >= 1.0. Found ', dtadj(n), &
464  ' for ATS PERIODDATA record ', n
465  call store_error(errmsg)
466  end if
467  !
468  ! -- check dtfailadj
469  if (dtfailadj(n) .ne. dzero .and. dtfailadj(n) < done) then
470  write (errmsg, '(a, g15.7, a, i0)') &
471  'DTFAILADJ must be 0 or >= 1.0. Found ', dtfailadj(n), &
472  ' for ATS PERIODDATA record ', n
473  call store_error(errmsg)
474  end if
475 
476  end do
477  !
478  ! -- Check for errors
479  if (count_errors() > 0) then
480  call parser%StoreErrorUnit()
481  end if
482  write (iout, '(1x,a)') 'DONE PROCESSING ATS INPUT'
483  end subroutine ats_check_timing
484 
485  !> @ brief Write period message
486  !!
487  !! Write message to mfsim.lst file with information on ATS settings
488  !! for this period.
489  !!
490  !<
491  subroutine ats_period_message(kper)
492  ! -- dummy
493  integer(I4B), intent(in) :: kper
494  ! -- local
495  integer(I4B) :: n
496  character(len=*), parameter :: fmtspts = &
497  "(28X,'ATS IS OVERRIDING TIME STEPPING FOR THIS PERIOD',/ &
498  &28X,'INITIAL TIME STEP SIZE (DT0) = ',G15.7,/ &
499  &28X,'MINIMUM TIME STEP SIZE (DTMIN) = ',G15.7,/ &
500  &28X,'MAXIMUM TIME STEP SIZE (DTMAX) = ',G15.7,/ &
501  &28X,'MULTIPLIER/DIVIDER FOR TIME STEP (DTADJ) = ',G15.7,/ &
502  &28X,'DIVIDER FOR FAILED TIME STEP (DTFAILADJ) = ',G15.7,/ &
503  &)"
504  n = kperats(kper)
505  write (iout, fmtspts) dt0(n), dtmin(n), dtmax(n), dtadj(n), dtfailadj(n)
506  return
507  end subroutine ats_period_message
508 
509  !> @ brief Allow and external caller to submit preferred time step
510  !!
511  !! Submit a preferred time step length. Alternatively, if idir is
512  !! is passed, then either increase or decrease the submitted time
513  !! step by the dtadj input variable.
514  !!
515  !<
516  subroutine ats_submit_delt(kstp, kper, dt, sloc, idir)
517  integer(I4B), intent(in) :: kstp
518  integer(I4B), intent(in) :: kper
519  real(dp), intent(in) :: dt
520  character(len=*), intent(in) :: sloc
521  integer(I4B), intent(in), optional :: idir
522  ! -- local
523  integer(I4B) :: n
524  real(dp) :: tsfact
525  real(dp) :: dt_temp
526  character(len=*), parameter :: fmtdtsubmit = &
527  &"(1x, 'ATS: ', A,' submitted a preferred time step size of ', G15.7)"
528 
529  if (isadaptiveperiod(kper)) then
530  n = kperats(kper)
531  tsfact = dtadj(n)
532  if (tsfact > done) then
533  !
534  ! -- if idir is present, then dt is a length that should be adjusted
535  ! (divided by or multiplied by) by dtadj. If idir is not present
536  ! then dt is the submitted time step.
537  if (present(idir)) then
538  dt_temp = dzero
539  if (idir == -1) then
540  dt_temp = dt / tsfact
541  else if (idir == 1) then
542  dt_temp = dt * tsfact
543  end if
544  else
545  dt_temp = dt
546  end if
547  if (kstp > 1 .and. dt_temp > dzero) then
548  write (iout, fmtdtsubmit) trim(adjustl(sloc)), dt_temp
549  end if
550  if (dt_temp > dzero .and. dt_temp < dtstable) then
551  ! -- Reset dtstable to a smaller value
552  dtstable = dt_temp
553  end if
554  end if
555  end if
556  return
557  end subroutine ats_submit_delt
558 
559  !> @ brief Set time step
560  !!
561  !! Set the time step length (delt) for this time step using the ATS
562  !! controls.
563  !!
564  !<
565  subroutine ats_set_delt(kstp, kper, pertim, perlencurrent, delt)
566  ! -- modules
567  ! -- dummy
568  integer(I4B), intent(in) :: kstp
569  integer(I4B), intent(in) :: kper
570  real(dp), intent(inout) :: pertim
571  real(dp), intent(in) :: perlencurrent
572  real(dp), intent(inout) :: delt
573  ! -- local
574  integer(I4B) :: n
575  real(dp) :: tstart
576  ! -- formats
577  character(len=*), parameter :: fmtdt = &
578  "(1x, 'ATS: time step set to ', G15.7, ' for step ', i0, &
579  &' and period ', i0)"
580  !
581  ! -- initialize the record position (n) for this stress period
582  n = kperats(kper)
583  !
584  ! -- set tstart to the end of the last time step.
585  tstart = pertim
586  !
587  ! -- Calculate delt
588  !
589  ! -- Setup new stress period if kstp is 1
590  if (kstp == 1) then
591  !
592  ! -- Assign first value of delt for this stress period
593  if (dt0(n) /= dzero) then
594  delt = dt0(n)
595  else
596  ! leave delt the way it was
597  end if
598  else
599  !
600  ! -- Assign delt based on stability
601  if (dtstable /= dnodata) then
602  delt = dtstable
603  dtstable = dnodata
604  end if
605  end if
606  !
607  ! -- Ensure tsmin < delt < tsmax
608  if (delt < dtmin(n)) then
609  delt = dtmin(n)
610  end if
611  if (delt > dtmax(n)) then
612  delt = dtmax(n)
613  end if
614  !
615  ! -- Cut timestep down to meet end of period
616  if (tstart + delt > perlencurrent - dtmin(n)) then
617  delt = perlencurrent - tstart
618  end if
619  !
620  ! -- Write time step size information
621  write (iout, fmtdt) delt, kstp, kper
622  !
623  return
624  end subroutine ats_set_delt
625 
626  !> @ brief Reset time step because failure has occurred
627  !!
628  !! Reset the time step using dtfailadj because the time step
629  !! did not converge.
630  !!
631  !<
632  subroutine ats_reset_delt(kstp, kper, lastStepFailed, delt, finishedTrying)
633  ! -- modules
634  ! -- dummy
635  integer(I4B), intent(in) :: kstp
636  integer(I4B), intent(in) :: kper
637  integer(I4B), intent(in) :: laststepfailed
638  real(dp), intent(inout) :: delt
639  logical, intent(inout) :: finishedtrying
640  ! -- local
641  integer(I4B) :: n
642  real(dp) :: delt_temp
643  real(dp) :: tsfact
644  ! -- formats
645  character(len=*), parameter :: fmttsi = &
646  "(1X, 'Failed solution for step ', i0, ' and period ', i0, &
647  &' will be retried using time step of ', G15.7)"
648  if (isadaptiveperiod(kper)) then
649  if (laststepfailed /= 0) then
650  delt_temp = delt
651  n = kperats(kper)
652  tsfact = dtfailadj(n)
653  if (tsfact > done) then
654  delt_temp = delt / tsfact
655  if (delt_temp >= dtmin(n)) then
656  finishedtrying = .false.
657  delt = delt_temp
658  write (iout, fmttsi) kstp, kper, delt
659  end if
660  end if
661 
662  end if
663  end if
664  return
665  end subroutine ats_reset_delt
666 
667  !> @ brief Set end of period indicator
668  !!
669  !! Determine if it is the end of the stress period and set the endofperiod
670  !! logical variable if so.
671  !!
672  !<
673  subroutine ats_set_endofperiod(kper, pertim, perlencurrent, endofperiod)
674  integer(I4B), intent(in) :: kper
675  real(dp), intent(inout) :: pertim
676  real(dp), intent(in) :: perlencurrent
677  logical(LGP), intent(inout) :: endofperiod
678  ! -- local
679  integer(I4B) :: n
680  !
681  ! -- End of stress period and/or simulation?
682  n = kperats(kper)
683  if (abs(pertim - perlencurrent) < dtmin(n)) then
684  endofperiod = .true.
685  end if
686  return
687  end subroutine ats_set_endofperiod
688 
689 end module adaptivetimestepmodule
subroutine ats_read_timing()
@ brief Read timing
Definition: ats.f90:290
subroutine, public ats_set_delt(kstp, kper, pertim, perlencurrent, delt)
@ brief Set time step
Definition: ats.f90:566
subroutine ats_allocate_arrays()
@ brief Allocate arrays
Definition: ats.f90:139
subroutine, public ats_cr(inunit, nper_tdis)
@ brief Create ATS object
Definition: ats.f90:62
subroutine, public ats_set_endofperiod(kper, pertim, perlencurrent, endofperiod)
@ brief Set end of period indicator
Definition: ats.f90:674
real(dp), dimension(:), pointer, contiguous dtfailadj
input array of time step factors for shortening due to nonconvergence
Definition: ats.f90:33
real(dp), dimension(:), pointer, contiguous dtmin
input array of minimum time step sizes
Definition: ats.f90:30
subroutine ats_input_table()
@ brief Write input table
Definition: ats.f90:360
real(dp), dimension(:), pointer, contiguous dtmax
input array of maximum time step sizes
Definition: ats.f90:31
subroutine ats_check_timing()
@ brief Check timing
Definition: ats.f90:410
integer(i4b), pointer nper
set equal to nper
Definition: ats.f90:24
logical(lgp) function, public isadaptiveperiod(kper)
@ brief Determine if period is adaptive
Definition: ats.f90:45
real(dp), pointer, public dtstable
delt value required for stability
Definition: ats.f90:26
integer(i4b), dimension(:), pointer, contiguous kperats
array of stress period numbers to apply ats (size NPER)
Definition: ats.f90:27
integer(i4b), pointer maxats
number of ats entries
Definition: ats.f90:25
subroutine, public ats_da()
@ brief Deallocate variables
Definition: ats.f90:177
subroutine, public ats_reset_delt(kstp, kper, lastStepFailed, delt, finishedTrying)
@ brief Reset time step because failure has occurred
Definition: ats.f90:633
subroutine ats_read_dimensions()
@ brief Read dimensions
Definition: ats.f90:242
subroutine ats_process_input()
@ brief Process input
Definition: ats.f90:342
subroutine, public ats_submit_delt(kstp, kper, dt, sloc, idir)
@ brief Allow and external caller to submit preferred time step
Definition: ats.f90:517
real(dp), dimension(:), pointer, contiguous dt0
input array of initial time step sizes
Definition: ats.f90:29
subroutine ats_allocate_scalars()
@ brief Allocate scalars
Definition: ats.f90:116
subroutine, public ats_period_message(kper)
@ brief Write period message
Definition: ats.f90:492
real(dp), dimension(:), pointer, contiguous dtadj
input array of time step factors for shortening or increasing
Definition: ats.f90:32
subroutine ats_read_options()
@ brief Read options
Definition: ats.f90:203
integer(i4b), dimension(:), pointer, contiguous iperats
array of stress period numbers to apply ats (size MAXATS)
Definition: ats.f90:28
type(blockparsertype) parser
block parser for reading input file
Definition: ats.f90:34
This module contains block parser methods.
Definition: BlockParser.f90:7
This module contains simulation constants.
Definition: Constants.f90:9
integer(i4b), parameter linelength
maximum length of a standard line
Definition: Constants.f90:44
@ tabcenter
centered table column
Definition: Constants.f90:171
@ tableft
left justified table column
Definition: Constants.f90:170
real(dp), parameter dnodata
real no data constant
Definition: Constants.f90:94
real(dp), parameter dzero
real constant zero
Definition: Constants.f90:64
real(dp), parameter done
real constant 1
Definition: Constants.f90:75
This module defines variable data types.
Definition: kind.f90:8
This module contains simulation methods.
Definition: Sim.f90:10
subroutine, public store_warning(msg, substring)
Store warning message.
Definition: Sim.f90:236
subroutine, public store_error(msg, terminate)
Store an error message.
Definition: Sim.f90:92
integer(i4b) function, public count_errors()
Return number of errors.
Definition: Sim.f90:59
This module contains simulation variables.
Definition: SimVariables.f90:9
character(len=maxcharlen) errmsg
error message string
character(len=maxcharlen) warnmsg
warning message string
integer(i4b) iout
file unit number for simulation output
subroutine, public table_cr(this, name, title)
Definition: Table.f90:85