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

Data Types

type  timeseriestype
 
type  timeseriesfiletype
 
type  timeseriescontainertype
 

Functions/Subroutines

subroutine, public constructtimeseriesfile (newTimeSeriesFile)
 Construct time series file. More...
 
type(timeseriesfiletype) function, pointer castastimeseriesfiletype (obj)
 Cast an unlimited polymorphic object as class(TimeSeriesFileType) More...
 
type(timeseriesfiletype) function, pointer, public castastimeseriesfileclass (obj)
 Cast an unlimited polymorphic object as class(TimeSeriesFileType) More...
 
subroutine, public addtimeseriesfiletolist (list, tsfile)
 Add time series file to list. More...
 
type(timeseriesfiletype) function, pointer, public gettimeseriesfilefromlist (list, idx)
 Get time series from list. More...
 
logical function, public sametimeseries (ts1, ts2)
 Compare two time series; if they are identical, return true. More...
 
real(dp) function getvalue (this, time0, time1, extendToEndOfSimulation)
 Get time series value. More...
 
subroutine initialize_time_series (this, tsfile, name, autoDeallocate)
 Initialize time series. More...
 
subroutine get_surrounding_records (this, time, tsrecEarlier, tsrecLater)
 Get surrounding records. More...
 
subroutine get_surrounding_nodes (this, time, nodeEarlier, nodeLater)
 Get surrounding nodes. More...
 
logical function read_next_record (this)
 Read next record. More...
 
real(dp) function get_value_at_time (this, time, extendToEndOfSimulation)
 Get value for a time. More...
 
real(dp) function get_integrated_value (this, time0, time1, extendToEndOfSimulation)
 Get integrated value. More...
 
real(dp) function get_average_value (this, time0, time1, extendToEndOfSimulation)
 Get average value. More...
 
subroutine get_latest_preceding_node (this, time, tslNode)
 Get latest preceding node. More...
 
subroutine ts_da (this)
 Deallocate. More...
 
subroutine addtimeseriesrecord (this, tsr)
 Add ts record. More...
 
type(timeseriesrecordtype) function, pointer getcurrenttimeseriesrecord (this)
 Get current ts record. More...
 
type(timeseriesrecordtype) function, pointer getprevioustimeseriesrecord (this)
 Get previous ts record. More...
 
type(timeseriesrecordtype) function, pointer getnexttimeseriesrecord (this)
 Get next ts record. More...
 
type(timeseriesrecordtype) function, pointer gettimeseriesrecord (this, time, epsi)
 Get ts record. More...
 
subroutine reset (this)
 Reset. More...
 
subroutine inserttsr (this, tsr)
 Insert a time series record. More...
 
double precision function findlatesttime (this, readToEnd)
 Find latest time. More...
 
subroutine clear (this, destroy)
 Clear the list of time series records. More...
 
integer(i4b) function count (this)
 Count number of time series. More...
 
type(timeseriestype) function, pointer gettimeseries (this, indx)
 Get time series. More...
 
subroutine initializetsfile (this, filename, iout, autoDeallocate)
 Open time-series tsfile file and read options and first record, which may contain data to define multiple time series. More...
 
logical function read_tsfile_line (this)
 Read time series file line. More...
 
subroutine tsf_da (this)
 Deallocate memory. More...
 

Function/Subroutine Documentation

◆ addtimeseriesfiletolist()

subroutine, public timeseriesmodule::addtimeseriesfiletolist ( type(listtype), intent(inout)  list,
class(timeseriesfiletype), intent(inout), pointer  tsfile 
)

Definition at line 147 of file TimeSeries.f90.

148  ! -- dummy
149  type(ListType), intent(inout) :: list
150  class(TimeSeriesFileType), pointer, intent(inout) :: tsfile
151  ! -- local
152  class(*), pointer :: obj => null()
153  !
154  obj => tsfile
155  call list%Add(obj)
156  !
157  ! -- Return
158  return
Here is the caller graph for this function:

◆ addtimeseriesrecord()

subroutine timeseriesmodule::addtimeseriesrecord ( class(timeseriestype this,
type(timeseriesrecordtype), intent(inout), pointer  tsr 
)
private

Definition at line 855 of file TimeSeries.f90.

856  ! -- dummy
857  class(TimeSeriesType) :: this
858  type(TimeSeriesRecordType), pointer, intent(inout) :: tsr
859  ! -- local
860  class(*), pointer :: obj => null()
861  !
862  obj => tsr
863  call this%list%Add(obj)
864  !
865  ! -- Return
866  return

◆ castastimeseriesfileclass()

type(timeseriesfiletype) function, pointer, public timeseriesmodule::castastimeseriesfileclass ( class(*), intent(inout), pointer  obj)

Definition at line 127 of file TimeSeries.f90.

128  ! -- dummy
129  class(*), pointer, intent(inout) :: obj
130  ! -- return
131  type(TimeSeriesFileType), pointer :: res
132  !
133  res => null()
134  if (.not. associated(obj)) return
135  !
136  select type (obj)
137  class is (timeseriesfiletype)
138  res => obj
139  end select
140  !
141  ! -- Return
142  return
Here is the caller graph for this function:

◆ castastimeseriesfiletype()

type(timeseriesfiletype) function, pointer timeseriesmodule::castastimeseriesfiletype ( class(*), intent(inout), pointer  obj)
private

Definition at line 107 of file TimeSeries.f90.

108  ! -- dummy
109  class(*), pointer, intent(inout) :: obj
110  ! -- return
111  type(TimeSeriesFileType), pointer :: res
112  !
113  res => null()
114  if (.not. associated(obj)) return
115  !
116  select type (obj)
117  type is (timeseriesfiletype)
118  res => obj
119  end select
120  !
121  ! -- Return
122  return
Here is the caller graph for this function:

◆ clear()

subroutine timeseriesmodule::clear ( class(timeseriestype), intent(inout)  this,
logical, intent(in), optional  destroy 
)
private

Definition at line 1089 of file TimeSeries.f90.

1090  ! -- dummy
1091  class(TimeSeriesType), intent(inout) :: this
1092  logical, optional, intent(in) :: destroy
1093  !
1094  call this%list%Clear(destroy)
1095  !
1096  ! -- Return
1097  return

◆ constructtimeseriesfile()

subroutine, public timeseriesmodule::constructtimeseriesfile ( type(timeseriesfiletype), intent(inout), pointer  newTimeSeriesFile)

Definition at line 94 of file TimeSeries.f90.

95  ! -- dummy
96  type(TimeSeriesFileType), pointer, intent(inout) :: newTimeSeriesFile
97  !
98  allocate (newtimeseriesfile)
99  allocate (newtimeseriesfile%parser)
100  !
101  ! -- Return
102  return
Here is the caller graph for this function:

◆ count()

integer(i4b) function timeseriesmodule::count ( class(timeseriesfiletype this)
private

Definition at line 1104 of file TimeSeries.f90.

1105  ! -- return
1106  integer(I4B) :: Count
1107  ! -- dummy
1108  class(TimeSeriesFileType) :: this
1109  !
1110  if (associated(this%timeSeries)) then
1111  count = size(this%timeSeries)
1112  else
1113  count = 0
1114  end if
1115  !
1116  ! -- Return
1117  return

◆ findlatesttime()

double precision function timeseriesmodule::findlatesttime ( class(timeseriestype), intent(inout)  this,
logical, intent(in), optional  readToEnd 
)
private

Definition at line 1059 of file TimeSeries.f90.

1060  ! -- dummy
1061  class(TimeSeriesType), intent(inout) :: this
1062  logical, intent(in), optional :: readToEnd
1063  ! -- local
1064  integer :: nrecords
1065  type(TimeSeriesRecordType), pointer :: tsr
1066  class(*), pointer :: obj => null()
1067  ! -- return
1068  double precision :: endtime
1069  !
1070  ! -- If the caller requested the very last time in the series (readToEnd is true), check that we have first read all records
1071  if (present(readtoend)) then
1072  if (readtoend) then
1073  do while (this%read_next_record())
1074  end do
1075  end if
1076  end if
1077  !
1078  nrecords = this%list%Count()
1079  obj => this%list%GetItem(nrecords)
1080  tsr => castastimeseriesrecordtype(obj)
1081  endtime = tsr%tsrTime
1082  !
1083  ! -- Return
1084  return
Here is the call graph for this function:

◆ get_average_value()

real(dp) function timeseriesmodule::get_average_value ( class(timeseriestype), intent(inout)  this,
real(dp), intent(in)  time0,
real(dp), intent(in)  time1,
logical, intent(in)  extendToEndOfSimulation 
)
private

Return a time-weighted average value for a specified time span. Units: (ts-value-unit)

Definition at line 735 of file TimeSeries.f90.

736  ! -- return
737  real(DP) :: get_average_value
738  ! -- dummy
739  class(TimeSeriesType), intent(inout) :: this
740  real(DP), intent(in) :: time0
741  real(DP), intent(in) :: time1
742  logical, intent(in) :: extendToEndOfSimulation
743  ! -- local
744  real(DP) :: timediff, value, valueIntegrated
745  !
746  timediff = time1 - time0
747  if (timediff > 0) then
748  valueintegrated = this%get_integrated_value(time0, time1, &
749  extendtoendofsimulation)
750  if (this%iMethod == linearend) then
751  value = valueintegrated
752  else
753  value = valueintegrated / timediff
754  end if
755  else
756  ! -- time0 and time1 are the same
757  value = this%get_value_at_time(time0, extendtoendofsimulation)
758  end if
759  get_average_value = value
760  !
761  ! -- Return
762  return

◆ get_integrated_value()

real(dp) function timeseriesmodule::get_integrated_value ( class(timeseriestype), intent(inout)  this,
real(dp), intent(in)  time0,
real(dp), intent(in)  time1,
logical, intent(in)  extendToEndOfSimulation 
)
private

Return an integrated value for a specified time span. Units: (ts-value-unit)*time

Definition at line 596 of file TimeSeries.f90.

597  ! -- return
598  real(DP) :: get_integrated_value
599  ! -- dummy
600  class(TimeSeriesType), intent(inout) :: this
601  real(DP), intent(in) :: time0
602  real(DP), intent(in) :: time1
603  logical, intent(in) :: extendToEndOfSimulation
604  ! -- local
605  real(DP) :: area, currTime, nextTime, ratio0, ratio1, t0, t01, t1, &
606  timediff, value, value0, value1, valuediff, currVal, nextVal
607  logical :: ldone, lprocess
608  type(ListNodeType), pointer :: tslNodePreceding => null()
609  type(ListNodeType), pointer :: currNode => null(), nextnode => null()
610  type(TimeSeriesRecordType), pointer :: currRecord => null()
611  type(TimeSeriesRecordType), pointer :: nextRecord => null()
612  class(*), pointer :: currObj => null(), nextobj => null()
613  ! -- formats
614 10 format('Error encountered while performing integration', &
615  ' for time series "', a, '" for time interval: ', g12.5, ' to ', g12.5)
616  !
617  value = dzero
618  ldone = .false.
619  t1 = -done
620  call this%get_latest_preceding_node(time0, tslnodepreceding)
621  if (associated(tslnodepreceding)) then
622  currnode => tslnodepreceding
623  do while (.not. ldone)
624  currobj => currnode%GetItem()
625  currrecord => castastimeseriesrecordtype(currobj)
626  currtime = currrecord%tsrTime
627  if (is_close(currtime, time1)) then
628  ! Current node time = time1 so should be ldone
629  ldone = .true.
630  elseif (currtime < time1) then
631  if (.not. associated(currnode%nextNode)) then
632  ! -- try to read the next record
633  if (.not. this%read_next_record()) then
634  if (.not. extendtoendofsimulation) then
635  write (errmsg, 10) trim(this%Name), time0, time1
636  call store_error(errmsg, terminate=.true.)
637  end if
638  end if
639  end if
640  !
641  currval = currrecord%tsrValue
642  lprocess = .false.
643  if (associated(currnode%nextNode)) then
644  nextnode => currnode%nextNode
645  nextobj => nextnode%GetItem()
646  nextrecord => castastimeseriesrecordtype(nextobj)
647  nexttime = nextrecord%tsrTime
648  nextval = nextrecord%tsrValue
649  lprocess = .true.
650  elseif (extendtoendofsimulation) then
651  ! -- Last time series value extends forever, so integrate the final value over all simulation time after the end of the series
652  nexttime = time1
653  nextval = currval
654  lprocess = .true.
655  end if
656  !
657  if (lprocess) then
658  ! -- determine lower and upper limits of time span of interest
659  ! within current interval
660  if (currtime > time0 .or. is_close(currtime, time0)) then
661  t0 = currtime
662  else
663  t0 = time0
664  end if
665  if (nexttime < time1 .or. is_close(nexttime, time1)) then
666  t1 = nexttime
667  else
668  t1 = time1
669  end if
670  ! -- find area of rectangle or trapezoid delimited by t0 and t1
671  t01 = t1 - t0
672  select case (this%iMethod)
673  case (stepwise)
674  ! -- compute area of a rectangle
675  value0 = currval
676  area = value0 * t01
677  case (linear, linearend)
678  ! -- compute area of a trapezoid
679  timediff = nexttime - currtime
680  ratio0 = (t0 - currtime) / timediff
681  ratio1 = (t1 - currtime) / timediff
682  valuediff = nextval - currval
683  value0 = currval + ratio0 * valuediff
684  value1 = currval + ratio1 * valuediff
685  if (this%iMethod == linear) then
686  area = 0.5d0 * t01 * (value0 + value1)
687  elseif (this%iMethod == linearend) then
688  area = dzero
689  value = value1
690  end if
691  end select
692  ! -- add area to integrated value
693  value = value + area
694  end if
695  end if
696  !
697  ! -- Are we done yet?
698  if (t1 > time1) then
699  ldone = .true.
700  elseif (is_close(t1, time1)) then
701  ldone = .true.
702  else
703  ! -- We are not done yet
704  if (.not. associated(currnode%nextNode)) then
705  ! -- Not done and no more data, so try to read the next record
706  if (.not. this%read_next_record()) then
707  write (errmsg, 10) trim(this%Name), time0, time1
708  call store_error(errmsg, terminate=.true.)
709  end if
710  elseif (associated(currnode%nextNode)) then
711  currnode => currnode%nextNode
712  end if
713  end if
714  end do
715  end if
716  !
717  get_integrated_value = value
718  if (this%autoDeallocate) then
719  if (associated(tslnodepreceding)) then
720  if (associated(tslnodepreceding%prevNode)) then
721  call this%list%DeallocateBackward(tslnodepreceding%prevNode)
722  end if
723  end if
724  end if
725  !
726  ! -- Return
727  return
Here is the call graph for this function:

◆ get_latest_preceding_node()

subroutine timeseriesmodule::get_latest_preceding_node ( class(timeseriestype), intent(inout)  this,
real(dp), intent(in)  time,
type(listnodetype), intent(inout), pointer  tslNode 
)
private

Return pointer to ListNodeType object for the node representing the latest preceding time in the time series

Definition at line 770 of file TimeSeries.f90.

771  ! -- dummy
772  class(TimeSeriesType), intent(inout) :: this
773  real(DP), intent(in) :: time
774  type(ListNodeType), pointer, intent(inout) :: tslNode
775  ! -- local
776  real(DP) :: time0
777  type(ListNodeType), pointer :: currNode => null()
778  type(ListNodeType), pointer :: tsNode0 => null()
779  type(TimeSeriesRecordType), pointer :: tsr => null()
780  type(TimeSeriesRecordType), pointer :: tsrec0 => null()
781  class(*), pointer :: obj => null()
782  !
783  tslnode => null()
784  if (associated(this%list%firstNode)) then
785  currnode => this%list%firstNode
786  else
787  call store_error('probable programming error in &
788  &get_latest_preceding_node', &
789  terminate=.true.)
790  end if
791  !
792  ! -- If the next node is earlier than time of interest, advance along
793  ! linked list until the next node is later than time of interest.
794  do
795  if (associated(currnode)) then
796  if (associated(currnode%nextNode)) then
797  obj => currnode%nextNode%GetItem()
798  tsr => castastimeseriesrecordtype(obj)
799  if (tsr%tsrTime < time .or. is_close(tsr%tsrTime, time)) then
800  currnode => currnode%nextNode
801  else
802  exit
803  end if
804  else
805  ! -- read another record
806  if (.not. this%read_next_record()) exit
807  end if
808  else
809  exit
810  end if
811  end do
812  !
813  if (associated(currnode)) then
814  !
815  ! -- find earlier record
816  tsnode0 => currnode
817  obj => tsnode0%GetItem()
818  tsrec0 => castastimeseriesrecordtype(obj)
819  time0 = tsrec0%tsrTime
820  do while (time0 > time)
821  if (associated(tsnode0%prevNode)) then
822  tsnode0 => tsnode0%prevNode
823  obj => tsnode0%GetItem()
824  tsrec0 => castastimeseriesrecordtype(obj)
825  time0 = tsrec0%tsrTime
826  else
827  exit
828  end if
829  end do
830  end if
831  !
832  if (time0 < time .or. is_close(time0, time)) tslnode => tsnode0
833  !
834  ! -- Return
835  return
Here is the call graph for this function:

◆ get_surrounding_nodes()

subroutine timeseriesmodule::get_surrounding_nodes ( class(timeseriestype), intent(inout)  this,
real(dp), intent(in)  time,
type(listnodetype), intent(inout), pointer  nodeEarlier,
type(listnodetype), intent(inout), pointer  nodeLater 
)
private

This subroutine is for working with time series already entirely stored in memory – it does not read data from a file.

Definition at line 388 of file TimeSeries.f90.

389  ! -- dummy
390  class(TimeSeriesType), intent(inout) :: this
391  real(DP), intent(in) :: time
392  type(ListNodeType), pointer, intent(inout) :: nodeEarlier
393  type(ListNodeType), pointer, intent(inout) :: nodeLater
394  ! -- local
395  real(DP) :: time0, time1
396  type(ListNodeType), pointer :: currNode => null()
397  type(ListNodeType), pointer :: tsNode0 => null()
398  type(ListNodeType), pointer :: tsNode1 => null()
399  type(TimeSeriesRecordType), pointer :: tsr => null(), tsrec0 => null()
400  type(TimeSeriesRecordType), pointer :: tsrec1 => null()
401  type(TimeSeriesRecordType), pointer :: tsrecEarlier
402  type(TimeSeriesRecordType), pointer :: tsrecLater
403  class(*), pointer :: obj => null()
404  !
405  tsrecearlier => null()
406  tsreclater => null()
407  nodeearlier => null()
408  nodelater => null()
409  !
410  if (associated(this%list%firstNode)) then
411  currnode => this%list%firstNode
412  end if
413  !
414  ! -- If the next node is earlier than time of interest, advance along
415  ! linked list until the next node is later than time of interest.
416  do
417  if (associated(currnode)) then
418  if (associated(currnode%nextNode)) then
419  obj => currnode%nextNode%GetItem()
420  tsr => castastimeseriesrecordtype(obj)
421  if (tsr%tsrTime < time .and. .not. is_close(tsr%tsrTime, time)) then
422  currnode => currnode%nextNode
423  else
424  exit
425  end if
426  else
427  exit
428  end if
429  else
430  exit
431  end if
432  end do
433  !
434  if (associated(currnode)) then
435  !
436  ! -- find earlier record
437  tsnode0 => currnode
438  obj => tsnode0%GetItem()
439  tsrec0 => castastimeseriesrecordtype(obj)
440  time0 = tsrec0%tsrTime
441  do while (time0 > time)
442  if (associated(tsnode0%prevNode)) then
443  tsnode0 => tsnode0%prevNode
444  obj => tsnode0%GetItem()
445  tsrec0 => castastimeseriesrecordtype(obj)
446  time0 = tsrec0%tsrTime
447  else
448  exit
449  end if
450  end do
451  !
452  ! -- find later record
453  tsnode1 => currnode
454  obj => tsnode1%GetItem()
455  tsrec1 => castastimeseriesrecordtype(obj)
456  time1 = tsrec1%tsrTime
457  do while (time1 < time .and. .not. is_close(time1, time))
458  if (associated(tsnode1%nextNode)) then
459  tsnode1 => tsnode1%nextNode
460  obj => tsnode1%GetItem()
461  tsrec1 => castastimeseriesrecordtype(obj)
462  time1 = tsrec1%tsrTime
463  else
464  exit
465  end if
466  end do
467  !
468  end if
469  !
470  if (time0 < time .or. is_close(time0, time)) then
471  tsrecearlier => tsrec0
472  nodeearlier => tsnode0
473  end if
474  if (time1 > time .or. is_close(time1, time)) then
475  tsreclater => tsrec1
476  nodelater => tsnode1
477  end if
478  !
479  ! -- Return
480  return
Here is the call graph for this function:

◆ get_surrounding_records()

subroutine timeseriesmodule::get_surrounding_records ( class(timeseriestype), intent(inout)  this,
real(dp), intent(in)  time,
type(timeseriesrecordtype), intent(inout), pointer  tsrecEarlier,
type(timeseriesrecordtype), intent(inout), pointer  tsrecLater 
)
private

Definition at line 293 of file TimeSeries.f90.

294  ! -- dummy
295  class(TimeSeriesType), intent(inout) :: this
296  real(DP), intent(in) :: time
297  type(TimeSeriesRecordType), pointer, intent(inout) :: tsrecEarlier
298  type(TimeSeriesRecordType), pointer, intent(inout) :: tsrecLater
299  ! -- local
300  real(DP) :: time0, time1
301  type(ListNodeType), pointer :: currNode => null()
302  type(ListNodeType), pointer :: tsNode0 => null()
303  type(ListNodeType), pointer :: tsNode1 => null()
304  type(TimeSeriesRecordType), pointer :: tsr => null(), tsrec0 => null()
305  type(TimeSeriesRecordType), pointer :: tsrec1 => null()
306  class(*), pointer :: obj => null()
307  !
308  tsrecearlier => null()
309  tsreclater => null()
310  !
311  if (associated(this%list%firstNode)) then
312  currnode => this%list%firstNode
313  end if
314  !
315  ! -- If the next node is earlier than time of interest, advance along
316  ! linked list until the next node is later than time of interest.
317  do
318  if (associated(currnode)) then
319  if (associated(currnode%nextNode)) then
320  obj => currnode%nextNode%GetItem()
321  tsr => castastimeseriesrecordtype(obj)
322  if (tsr%tsrTime < time .and. .not. is_close(tsr%tsrTime, time)) then
323  currnode => currnode%nextNode
324  else
325  exit
326  end if
327  else
328  ! -- read another record
329  if (.not. this%read_next_record()) exit
330  end if
331  else
332  exit
333  end if
334  end do
335  !
336  if (associated(currnode)) then
337  !
338  ! -- find earlier record
339  tsnode0 => currnode
340  obj => tsnode0%GetItem()
341  tsrec0 => castastimeseriesrecordtype(obj)
342  time0 = tsrec0%tsrTime
343  do while (time0 > time)
344  if (associated(tsnode0%prevNode)) then
345  tsnode0 => tsnode0%prevNode
346  obj => tsnode0%GetItem()
347  tsrec0 => castastimeseriesrecordtype(obj)
348  time0 = tsrec0%tsrTime
349  else
350  exit
351  end if
352  end do
353  !
354  ! -- find later record
355  tsnode1 => currnode
356  obj => tsnode1%GetItem()
357  tsrec1 => castastimeseriesrecordtype(obj)
358  time1 = tsrec1%tsrTime
359  do while (time1 < time .and. .not. is_close(time1, time))
360  if (associated(tsnode1%nextNode)) then
361  tsnode1 => tsnode1%nextNode
362  obj => tsnode1%GetItem()
363  tsrec1 => castastimeseriesrecordtype(obj)
364  time1 = tsrec1%tsrTime
365  else
366  ! -- get next record
367  if (.not. this%read_next_record()) then
368  ! -- end of file reached, so exit loop
369  exit
370  end if
371  end if
372  end do
373  !
374  end if
375  !
376  if (time0 < time .or. is_close(time0, time)) tsrecearlier => tsrec0
377  if (time1 > time .or. is_close(time1, time)) tsreclater => tsrec1
378  !
379  ! -- Return
380  return
Here is the call graph for this function:

◆ get_value_at_time()

real(dp) function timeseriesmodule::get_value_at_time ( class(timeseriestype), intent(inout)  this,
real(dp), intent(in)  time,
logical, intent(in)  extendToEndOfSimulation 
)
private

Return a value for a specified time, same units as time-series values

Definition at line 510 of file TimeSeries.f90.

511  ! -- return
512  real(DP) :: get_value_at_time
513  ! -- dummy
514  class(TimeSeriesType), intent(inout) :: this
515  real(DP), intent(in) :: time ! time of interest
516  logical, intent(in) :: extendToEndOfSimulation
517  ! -- local
518  integer(I4B) :: ierr
519  real(DP) :: ratio, time0, time1, timediff, timediffi, val0, val1, &
520  valdiff
521  type(TimeSeriesRecordType), pointer :: tsrEarlier => null()
522  type(TimeSeriesRecordType), pointer :: tsrLater => null()
523  ! -- formats
524 10 format('Error getting value at time ', g10.3, ' for time series "', a, '"')
525  !
526  ierr = 0
527  call this%get_surrounding_records(time, tsrearlier, tsrlater)
528  if (associated(tsrearlier)) then
529  if (associated(tsrlater)) then
530  ! -- values are available for both earlier and later times
531  if (this%iMethod == stepwise) then
532  get_value_at_time = tsrearlier%tsrValue
533  elseif (this%iMethod == linear .or. this%iMethod == linearend) then
534  ! -- For get_value_at_time, result is the same for either
535  ! linear method.
536  ! -- Perform linear interpolation.
537  time0 = tsrearlier%tsrTime
538  time1 = tsrlater%tsrtime
539  timediff = time1 - time0
540  timediffi = time - time0
541  if (timediff > 0) then
542  ratio = timediffi / timediff
543  else
544  ! -- should not happen if TS does not contain duplicate times
545  ratio = 0.5d0
546  end if
547  val0 = tsrearlier%tsrValue
548  val1 = tsrlater%tsrValue
549  valdiff = val1 - val0
550  get_value_at_time = val0 + (ratio * valdiff)
551  else
552  ierr = 1
553  end if
554  else
555  if (extendtoendofsimulation .or. is_close(tsrearlier%tsrTime, time)) then
556  get_value_at_time = tsrearlier%tsrValue
557  else
558  ! -- Only earlier time is available, and it is not time of interest;
559  ! however, if method is STEPWISE, use value for earlier time.
560  if (this%iMethod == stepwise) then
561  get_value_at_time = tsrearlier%tsrValue
562  else
563  ierr = 1
564  end if
565  end if
566  end if
567  else
568  if (associated(tsrlater)) then
569  if (is_close(tsrlater%tsrTime, time)) then
570  get_value_at_time = tsrlater%tsrValue
571  else
572  ! -- only later time is available, and it is not time of interest
573  ierr = 1
574  end if
575  else
576  ! -- Neither earlier nor later time is available.
577  ! This should never happen!
578  ierr = 1
579  end if
580  end if
581  !
582  if (ierr > 0) then
583  write (errmsg, 10) time, trim(this%Name)
584  call store_error(errmsg, terminate=.true.)
585  end if
586  !
587  ! -- Return
588  return
Here is the call graph for this function:

◆ getcurrenttimeseriesrecord()

type(timeseriesrecordtype) function, pointer timeseriesmodule::getcurrenttimeseriesrecord ( class(timeseriestype this)
private

Definition at line 871 of file TimeSeries.f90.

872  ! -- dummy
873  class(TimeSeriesType) :: this
874  ! -- result
875  type(TimeSeriesRecordType), pointer :: res
876  ! -- local
877  class(*), pointer :: obj => null()
878  !
879  obj => null()
880  res => null()
881  obj => this%list%GetItem()
882  if (associated(obj)) then
883  res => castastimeseriesrecordtype(obj)
884  end if
885  !
886  ! -- Return
887  return
Here is the call graph for this function:

◆ getnexttimeseriesrecord()

type(timeseriesrecordtype) function, pointer timeseriesmodule::getnexttimeseriesrecord ( class(timeseriestype this)
private

Definition at line 913 of file TimeSeries.f90.

914  ! -- dummy
915  class(TimeSeriesType) :: this
916  ! -- result
917  type(TimeSeriesRecordType), pointer :: res
918  ! -- local
919  class(*), pointer :: obj => null()
920  !
921  obj => null()
922  res => null()
923  obj => this%list%GetNextItem()
924  if (associated(obj)) then
925  res => castastimeseriesrecordtype(obj)
926  end if
927  !
928  ! -- Return
929  return
Here is the call graph for this function:

◆ getprevioustimeseriesrecord()

type(timeseriesrecordtype) function, pointer timeseriesmodule::getprevioustimeseriesrecord ( class(timeseriestype this)
private

Definition at line 892 of file TimeSeries.f90.

893  ! -- dummy
894  class(TimeSeriesType) :: this
895  ! -- result
896  type(TimeSeriesRecordType), pointer :: res
897  ! -- local
898  class(*), pointer :: obj => null()
899  !
900  obj => null()
901  res => null()
902  obj => this%list%GetPreviousItem()
903  if (associated(obj)) then
904  res => castastimeseriesrecordtype(obj)
905  end if
906  !
907  ! -- Return
908  return
Here is the call graph for this function:

◆ gettimeseries()

type(timeseriestype) function, pointer timeseriesmodule::gettimeseries ( class(timeseriesfiletype this,
integer(i4b), intent(in)  indx 
)
private

Definition at line 1122 of file TimeSeries.f90.

1123  ! -- dummy
1124  class(TimeSeriesFileType) :: this
1125  integer(I4B), intent(in) :: indx
1126  ! -- return
1127  type(TimeSeriesType), pointer :: res
1128  !
1129  res => null()
1130  if (indx > 0 .and. indx <= this%nTimeSeries) then
1131  res => this%timeSeries(indx)
1132  end if
1133  !
1134  ! -- Return
1135  return

◆ gettimeseriesfilefromlist()

type(timeseriesfiletype) function, pointer, public timeseriesmodule::gettimeseriesfilefromlist ( type(listtype), intent(inout)  list,
integer(i4b), intent(in)  idx 
)

Definition at line 163 of file TimeSeries.f90.

164  ! -- dummy
165  type(ListType), intent(inout) :: list
166  integer(I4B), intent(in) :: idx
167  ! -- return
168  type(TimeSeriesFileType), pointer :: res
169  ! -- local
170  class(*), pointer :: obj => null()
171  !
172  obj => list%GetItem(idx)
173  res => castastimeseriesfiletype(obj)
174  !
175  if (.not. associated(res)) then
176  res => castastimeseriesfileclass(obj)
177  end if
178  !
179  ! -- Return
180  return
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gettimeseriesrecord()

type(timeseriesrecordtype) function, pointer timeseriesmodule::gettimeseriesrecord ( class(timeseriestype this,
double precision, intent(in)  time,
double precision, intent(in)  epsi 
)
private

Definition at line 934 of file TimeSeries.f90.

935  ! -- dummy
936  class(TimeSeriesType) :: this
937  double precision, intent(in) :: time
938  double precision, intent(in) :: epsi
939  ! -- result
940  type(TimeSeriesRecordType), pointer :: res
941  ! -- local
942  type(TimeSeriesRecordType), pointer :: tsr
943  !
944  call this%list%Reset()
945  res => null()
946  do
947  tsr => this%GetNextTimeSeriesRecord()
948  if (associated(tsr)) then
949  if (is_close(tsr%tsrTime, time)) then
950  res => tsr
951  exit
952  end if
953  if (tsr%tsrTime > time) exit
954  else
955  exit
956  end if
957  end do
958  !
959  ! -- Return
960  return
Here is the call graph for this function:

◆ getvalue()

real(dp) function timeseriesmodule::getvalue ( class(timeseriestype), intent(inout)  this,
real(dp), intent(in)  time0,
real(dp), intent(in)  time1,
logical, intent(in), optional  extendToEndOfSimulation 
)
private

If iMethod is STEPWISE or LINEAR: Return a time-weighted average value for a specified time span. If iMethod is LINEAREND: Return value at time1. Time0 argument is ignored. Units: (ts-value-unit)

Definition at line 226 of file TimeSeries.f90.

227  ! -- return
228  real(DP) :: GetValue
229  ! -- dummy
230  class(TimeSeriesType), intent(inout) :: this
231  real(DP), intent(in) :: time0
232  real(DP), intent(in) :: time1
233  logical, intent(in), optional :: extendToEndOfSimulation
234  ! -- local
235  logical :: extend
236  !
237  if (present(extendtoendofsimulation)) then
238  extend = extendtoendofsimulation
239  else
240  extend = .false.
241  end if
242  !
243  select case (this%iMethod)
244  case (stepwise, linear)
245  getvalue = this%get_average_value(time0, time1, extend)
246  case (linearend)
247  getvalue = this%get_value_at_time(time1, extend)
248  end select
249  !
250  ! -- Return
251  return

◆ initialize_time_series()

subroutine timeseriesmodule::initialize_time_series ( class(timeseriestype), intent(inout)  this,
class(timeseriesfiletype), target  tsfile,
character(len=*), intent(in)  name,
logical, intent(in), optional  autoDeallocate 
)
private

Open time-series file and read options and first time-series record.

Definition at line 258 of file TimeSeries.f90.

259  ! -- dummy
260  class(TimeSeriesType), intent(inout) :: this
261  class(TimeSeriesFileType), target :: tsfile
262  character(len=*), intent(in) :: name
263  logical, intent(in), optional :: autoDeallocate
264  ! -- local
265  character(len=LENTIMESERIESNAME) :: tsNameTemp
266  !
267  ! -- Assign the time-series tsfile, name, and autoDeallocate
268  this%tsfile => tsfile
269  ! Store time-series name as all caps
270  tsnametemp = name
271  call upcase(tsnametemp)
272  this%Name = tsnametemp
273  !
274  this%iMethod = undefined
275  !
276  if (present(autodeallocate)) this%autoDeallocate = autodeallocate
277  !
278  ! -- allocate the list
279  allocate (this%list)
280  !
281  ! -- ensure that NAME has been specified
282  if (this%Name == '') then
283  errmsg = 'Name not specified for time series.'
284  call store_error(errmsg, terminate=.true.)
285  end if
286  !
287  ! -- Return
288  return
Here is the call graph for this function:

◆ initializetsfile()

subroutine timeseriesmodule::initializetsfile ( class(timeseriesfiletype), intent(inout), target  this,
character(len=*), intent(in)  filename,
integer(i4b), intent(in)  iout,
logical, intent(in), optional  autoDeallocate 
)
private

Definition at line 1141 of file TimeSeries.f90.

1142  ! -- dummy
1143  class(TimeSeriesFileType), target, intent(inout) :: this
1144  character(len=*), intent(in) :: filename
1145  integer(I4B), intent(in) :: iout
1146  logical, optional, intent(in) :: autoDeallocate
1147  ! -- local
1148  integer(I4B) :: iMethod, istatus, j, nwords
1149  integer(I4B) :: ierr, inunit
1150  logical :: autoDeallocateLocal = .true.
1151  logical :: continueread, found, endOfBlock
1152  logical :: methodWasSet
1153  real(DP) :: sfaclocal
1154  character(len=40) :: keyword, keyvalue
1155  character(len=:), allocatable :: line
1156  character(len=LENTIMESERIESNAME), allocatable, dimension(:) :: words
1157  !
1158  ! -- Initialize some variables
1159  if (present(autodeallocate)) autodeallocatelocal = autodeallocate
1160  imethod = undefined
1161  methodwasset = .false.
1162  !
1163  ! -- Assign members
1164  this%iout = iout
1165  this%datafile = filename
1166  !
1167  ! -- Open the time-series tsfile input file
1168  this%inunit = getunit()
1169  inunit = this%inunit
1170  call openfile(inunit, 0, filename, 'TS6')
1171  !
1172  ! -- Initialize block parser
1173  call this%parser%Initialize(this%inunit, this%iout)
1174  !
1175  ! -- Read the ATTRIBUTES block and count time series
1176  continueread = .false.
1177  ierr = 0
1178  !
1179  ! -- get BEGIN line of ATTRIBUTES block
1180  call this%parser%GetBlock('ATTRIBUTES', found, ierr, &
1181  supportopenclose=.true.)
1182  if (ierr /= 0) then
1183  ! end of file
1184  errmsg = 'End-of-file encountered while searching for'// &
1185  ' ATTRIBUTES in time-series '// &
1186  'input file "'//trim(this%datafile)//'"'
1187  call store_error(errmsg)
1188  call this%parser%StoreErrorUnit()
1189  elseif (.not. found) then
1190  errmsg = 'ATTRIBUTES block not found in time-series '// &
1191  'tsfile input file "'//trim(this%datafile)//'"'
1192  call store_error(errmsg)
1193  call this%parser%StoreErrorUnit()
1194  end if
1195  !
1196  ! -- parse ATTRIBUTES entries
1197  do
1198  ! -- read a line from input
1199  call this%parser%GetNextLine(endofblock)
1200  if (endofblock) exit
1201  !
1202  ! -- get the keyword
1203  call this%parser%GetStringCaps(keyword)
1204  !
1205  ! support either NAME or NAMES as equivalent keywords
1206  if (keyword == 'NAMES') keyword = 'NAME'
1207  !
1208  if (keyword /= 'NAME' .and. keyword /= 'METHODS' .and. &
1209  keyword /= 'SFACS') then
1210  ! -- get the word following the keyword (the key value)
1211  call this%parser%GetStringCaps(keyvalue)
1212  end if
1213  !
1214  select case (keyword)
1215  case ('NAME')
1216 ! line = line(istart:linelen)
1217  call this%parser%GetRemainingLine(line)
1218  call parseline(line, nwords, words, this%parser%iuactive)
1219  this%nTimeSeries = nwords
1220  ! -- Allocate the timeSeries array and initialize each
1221  ! time series.
1222  allocate (this%timeSeries(this%nTimeSeries))
1223  do j = 1, this%nTimeSeries
1224  call this%timeSeries(j)%initialize_time_series(this, words(j), &
1225  autodeallocatelocal)
1226  end do
1227  case ('METHOD')
1228  methodwasset = .true.
1229  if (this%nTimeSeries == 0) then
1230  errmsg = 'Error: NAME attribute not provided before METHOD in file: ' &
1231  //trim(filename)
1232  call store_error(errmsg)
1233  call this%parser%StoreErrorUnit()
1234  end if
1235  select case (keyvalue)
1236  case ('STEPWISE')
1237  imethod = stepwise
1238  case ('LINEAR')
1239  imethod = linear
1240  case ('LINEAREND')
1241  imethod = linearend
1242  case default
1243  errmsg = 'Unknown interpolation method: "'//trim(keyvalue)//'"'
1244  call store_error(errmsg)
1245  end select
1246  do j = 1, this%nTimeSeries
1247  this%timeSeries(j)%iMethod = imethod
1248  end do
1249  case ('METHODS')
1250  methodwasset = .true.
1251  if (this%nTimeSeries == 0) then
1252  errmsg = 'Error: NAME attribute not provided before METHODS in file: ' &
1253  //trim(filename)
1254  call store_error(errmsg)
1255  call this%parser%StoreErrorUnit()
1256  end if
1257  call this%parser%GetRemainingLine(line)
1258  call parseline(line, nwords, words, this%parser%iuactive)
1259  if (nwords < this%nTimeSeries) then
1260  errmsg = 'METHODS attribute does not list a method for'// &
1261  ' all time series.'
1262  call store_error(errmsg)
1263  call this%parser%StoreErrorUnit()
1264  end if
1265  do j = 1, this%nTimeSeries
1266  call upcase(words(j))
1267  select case (words(j))
1268  case ('STEPWISE')
1269  imethod = stepwise
1270  case ('LINEAR')
1271  imethod = linear
1272  case ('LINEAREND')
1273  imethod = linearend
1274  case default
1275  errmsg = 'Unknown interpolation method: "'//trim(words(j))//'"'
1276  call store_error(errmsg)
1277  end select
1278  this%timeSeries(j)%iMethod = imethod
1279  end do
1280  case ('SFAC')
1281  if (this%nTimeSeries == 0) then
1282  errmsg = 'NAME attribute not provided before SFAC in file: ' &
1283  //trim(filename)
1284  call store_error(errmsg)
1285  call this%parser%StoreErrorUnit()
1286  end if
1287  read (keyvalue, *, iostat=istatus) sfaclocal
1288  if (istatus /= 0) then
1289  errmsg = 'Error reading numeric value from: "'//trim(keyvalue)//'"'
1290  call store_error(errmsg)
1291  end if
1292  do j = 1, this%nTimeSeries
1293  this%timeSeries(j)%sfac = sfaclocal
1294  end do
1295  case ('SFACS')
1296  if (this%nTimeSeries == 0) then
1297  errmsg = 'NAME attribute not provided before SFACS in file: ' &
1298  //trim(filename)
1299  call store_error(errmsg)
1300  call this%parser%StoreErrorUnit()
1301  end if
1302  do j = 1, this%nTimeSeries
1303  sfaclocal = this%parser%GetDouble()
1304  this%timeSeries(j)%sfac = sfaclocal
1305  end do
1306  case ('AUTODEALLOCATE')
1307  do j = 1, this%nTimeSeries
1308  this%timeSeries(j)%autoDeallocate = (keyvalue == 'TRUE')
1309  end do
1310  case default
1311  errmsg = 'Unknown option found in ATTRIBUTES block: "'// &
1312  trim(keyword)//'"'
1313  call store_error(errmsg)
1314  call this%parser%StoreErrorUnit()
1315  end select
1316  end do
1317  !
1318  ! -- Get TIMESERIES block
1319  call this%parser%GetBlock('TIMESERIES', found, ierr, &
1320  supportopenclose=.true.)
1321  !
1322  ! -- Read the first line of time-series data
1323  if (.not. this%read_tsfile_line()) then
1324  errmsg = 'Error: No time-series data contained in file: '// &
1325  trim(this%datafile)
1326  call store_error(errmsg)
1327  end if
1328  !
1329  ! -- Ensure method was set
1330  if (.not. methodwasset) then
1331  errmsg = 'Interpolation method was not set. METHOD or METHODS &
1332  &must be specified in the ATTRIBUTES block for this time series file.'
1333  call store_error(errmsg)
1334  end if
1335  !
1336  ! -- Clean up and return
1337  if (allocated(words)) deallocate (words)
1338  !
1339  if (count_errors() > 0) then
1340  call this%parser%StoreErrorUnit()
1341  end if
1342  !
1343  ! -- Return
1344  return
Here is the call graph for this function:

◆ inserttsr()

subroutine timeseriesmodule::inserttsr ( class(timeseriestype), intent(inout)  this,
type(timeseriesrecordtype), intent(inout), pointer  tsr 
)
private

Definition at line 977 of file TimeSeries.f90.

978  ! -- dummy
979  class(TimeSeriesType), intent(inout) :: this
980  type(TimeSeriesRecordType), pointer, intent(inout) :: tsr
981  ! -- local
982  double precision :: badtime, time, time0, time1
983  type(TimeSeriesRecordType), pointer :: tsrEarlier, tsrLater
984  type(ListNodeType), pointer :: nodeEarlier, nodeLater
985  class(*), pointer :: obj => null()
986  !
987  badtime = -9.0d30
988  time0 = badtime
989  time1 = badtime
990  time = tsr%tsrTime
991  call this%get_surrounding_nodes(time, nodeearlier, nodelater)
992  !
993  if (associated(nodeearlier)) then
994  obj => nodeearlier%GetItem()
995  tsrearlier => castastimeseriesrecordtype(obj)
996  if (associated(tsrearlier)) then
997  time0 = tsrearlier%tsrTime
998  end if
999  end if
1000  !
1001  if (associated(nodelater)) then
1002  obj => nodelater%GetItem()
1003  tsrlater => castastimeseriesrecordtype(obj)
1004  if (associated(tsrlater)) then
1005  time1 = tsrlater%tsrTime
1006  end if
1007  end if
1008  !
1009  if (time0 > badtime) then
1010  ! Time0 is valid
1011  if (time1 > badtime) then
1012  ! Both time0 and time1 are valid
1013  if (time > time0 .and. time < time1) then
1014  ! Insert record between two list nodes
1015  obj => tsr
1016  call this%list%InsertBefore(obj, nodelater)
1017  else
1018  ! No need to insert a time series record, but if existing record
1019  ! for time of interest has NODATA as tsrValue, replace tsrValue
1020  if (time == time0 .and. tsrearlier%tsrValue == dnodata .and. &
1021  tsr%tsrValue /= dnodata) then
1022  tsrearlier%tsrValue = tsr%tsrValue
1023  elseif (time == time1 .and. tsrlater%tsrValue == dnodata .and. &
1024  tsr%tsrValue /= dnodata) then
1025  tsrlater%tsrValue = tsr%tsrValue
1026  end if
1027  end if
1028  else
1029  ! Time0 is valid and time1 is invalid. Just add tsr to the list.
1030  call this%AddTimeSeriesRecord(tsr)
1031  end if
1032  else
1033  ! Time0 is invalid, so time1 must be for first node in list
1034  if (time1 > badtime) then
1035  ! Time 1 is valid
1036  if (time < time1) then
1037  ! Insert tsr at beginning of list
1038  obj => tsr
1039  call this%list%InsertBefore(obj, nodelater)
1040  elseif (time == time1) then
1041  ! No need to insert a time series record, but if existing record
1042  ! for time of interest has NODATA as tsrValue, replace tsrValue
1043  if (tsrlater%tsrValue == dnodata .and. tsr%tsrValue /= dnodata) then
1044  tsrlater%tsrValue = tsr%tsrValue
1045  end if
1046  end if
1047  else
1048  ! Both time0 and time1 are invalid. Just add tsr to the list.
1049  call this%AddTimeSeriesRecord(tsr)
1050  end if
1051  end if
1052  !
1053  ! -- Return
1054  return
Here is the call graph for this function:

◆ read_next_record()

logical function timeseriesmodule::read_next_record ( class(timeseriestype), intent(inout)  this)
private

Read next time-series record from input file

Definition at line 487 of file TimeSeries.f90.

488  ! -- dummy
489  class(TimeSeriesType), intent(inout) :: this
490  !
491  ! -- If we have already encountered the end of the TIMESERIES block, do not try to read any further
492  if (this%tsfile%finishedReading) then
493  read_next_record = .false.
494  return
495  end if
496  !
497  read_next_record = this%tsfile%read_tsfile_line()
498  if (.not. read_next_record) then
499  this%tsfile%finishedReading = .true.
500  end if
501  !
502  ! -- Return
503  return

◆ read_tsfile_line()

logical function timeseriesmodule::read_tsfile_line ( class(timeseriesfiletype), intent(inout)  this)
private

Definition at line 1348 of file TimeSeries.f90.

1349  ! -- dummy
1350  class(TimeSeriesFileType), intent(inout) :: this
1351  ! -- local
1352  real(DP) :: tsrTime, tsrValue
1353  integer(I4B) :: i
1354  logical :: endOfBlock
1355  type(TimeSeriesRecordType), pointer :: tsRecord => null()
1356  !
1357  read_tsfile_line = .false.
1358  !
1359  ! -- Get an arbitrary length, non-comment, non-blank line
1360  ! from the input file.
1361  call this%parser%GetNextLine(endofblock)
1362  !
1363  ! -- Check if we've reached the end of the TIMESERIES block
1364  if (endofblock) then
1365  return
1366  end if
1367  !
1368  ! -- Get the time
1369  tsrtime = this%parser%GetDouble()
1370  !
1371  ! -- Construct a new record and append a new node to each time series
1372  tsloop: do i = 1, this%nTimeSeries
1373  tsrvalue = this%parser%GetDouble()
1374  if (tsrvalue == dnodata) cycle tsloop
1375  ! -- multiply value by sfac
1376  tsrvalue = tsrvalue * this%timeSeries(i)%sfac
1377  call constructtimeseriesrecord(tsrecord, tsrtime, tsrvalue)
1378  call addtimeseriesrecordtolist(this%timeSeries(i)%list, tsrecord)
1379  end do tsloop
1380  read_tsfile_line = .true.
1381  !
1382  ! -- Return
1383  return
Here is the call graph for this function:

◆ reset()

subroutine timeseriesmodule::reset ( class(timeseriestype this)
private

Definition at line 965 of file TimeSeries.f90.

966  ! -- dummy
967  class(TimeSeriesType) :: this
968  !
969  call this%list%Reset()
970  !
971  ! -- Return
972  return

◆ sametimeseries()

logical function, public timeseriesmodule::sametimeseries ( type(timeseriestype), intent(in)  ts1,
type(timeseriestype), intent(in)  ts2 
)

Definition at line 185 of file TimeSeries.f90.

186  ! -- dummy
187  type(TimeSeriesType), intent(in) :: ts1
188  type(TimeSeriesType), intent(in) :: ts2
189  ! -- return
190  logical :: same
191  ! -- local
192  integer :: i, n1, n2
193  type(TimeSeriesRecordType), pointer :: tsr1, tsr2
194  !
195  same = .false.
196  n1 = ts1%list%Count()
197  n2 = ts2%list%Count()
198  if (n1 /= n2) return
199  !
200  call ts1%Reset()
201  call ts2%Reset()
202  !
203  do i = 1, n1
204  tsr1 => ts1%GetNextTimeSeriesRecord()
205  tsr2 => ts2%GetNextTimeSeriesRecord()
206  if (tsr1%tsrTime /= tsr2%tsrTime) return
207  if (tsr1%tsrValue /= tsr2%tsrValue) return
208  end do
209  !
210  same = .true.
211  !
212  ! -- Return
213  return

◆ ts_da()

subroutine timeseriesmodule::ts_da ( class(timeseriestype), intent(inout)  this)
private

Definition at line 840 of file TimeSeries.f90.

841  ! -- dummy
842  class(TimeSeriesType), intent(inout) :: this
843  !
844  if (associated(this%list)) then
845  call this%list%Clear(.true.)
846  deallocate (this%list)
847  end if
848  !
849  ! -- Return
850  return

◆ tsf_da()

subroutine timeseriesmodule::tsf_da ( class(timeseriesfiletype), intent(inout)  this)
private

Definition at line 1388 of file TimeSeries.f90.

1389  ! -- dummy
1390  class(TimeSeriesFileType), intent(inout) :: this
1391  ! -- local
1392  integer :: i, n
1393  type(TimeSeriesType), pointer :: ts => null()
1394  !
1395  n = this%Count()
1396  do i = 1, n
1397  ts => this%GetTimeSeries(i)
1398  if (associated(ts)) then
1399  call ts%da()
1400 ! deallocate(ts)
1401  end if
1402  end do
1403  !
1404  deallocate (this%timeSeries)
1405  deallocate (this%parser)
1406  !
1407  ! -- Return
1408  return