libsim  Versione 7.2.6

◆ arrayof_ttr_mapper_delete()

subroutine arrayof_ttr_mapper_delete ( type(arrayof_ttr_mapper this,
logical, intent(in), optional  nodealloc 
)

Destructor for finalizing an array object.

If defined, calls the destructor for every element of the array object; finally it deallocates all the space occupied.

Parametri
thisarray object to be destroyed
[in]nodeallocif provided and .TRUE. , the space reserved for the array is not deallocated, thus the values are retained, while the array pointer is nullified, this means that the caller must have previously assigned the pointer contents thisarray to another pointer to prevent memory leaks

Definizione alla linea 704 del file stat_proc_engine.F90.

709  max_step, weights)
710 TYPE(datetime),INTENT(in) :: vertime(:)
711 TYPE(datetime),INTENT(in) :: pstart
712 TYPE(datetime),INTENT(in) :: pend
713 LOGICAL,INTENT(in) :: time_mask(:)
714 TYPE(timedelta),OPTIONAL,INTENT(out) :: max_step
715 DOUBLE PRECISION,OPTIONAL,INTENT(out) :: weights(:)
716 
717 INTEGER :: i, nt
718 TYPE(datetime),ALLOCATABLE :: lvertime(:)
719 TYPE(datetime) :: half, nexthalf
720 INTEGER(kind=int_ll) :: dt, tdt
721 
722 nt = count(time_mask)
723 ALLOCATE(lvertime(nt))
724 lvertime = pack(vertime, mask=time_mask)
725 
726 IF (PRESENT(max_step)) THEN
727 ! new way
728 ! max_step = timedelta_0
729 ! DO i = 1, nt - 1
730 ! IF (lvertime(i+1) - lvertime(i) > max_step) &
731 ! max_step = lvertime(i+1) - lvertime(i)
732 ! ENDDO
733 ! IF (lvertime(1) - pstart > max_step) max_step = lvertime(1) - pstart
734 ! IF (pend - lvertime(nt) > max_step) max_step = pend - lvertime(nt)
735 ! old way
736  IF (nt == 1) THEN
737  max_step = pend - pstart
738  ELSE
739  half = lvertime(1) + (lvertime(2) - lvertime(1))/2
740  max_step = half - pstart
741  DO i = 2, nt - 1
742  nexthalf = lvertime(i) + (lvertime(i+1) - lvertime(i))/2
743  IF (nexthalf - half > max_step) max_step = nexthalf - half
744  half = nexthalf
745  ENDDO
746  IF (pend - half > max_step) max_step = pend - half
747  ENDIF
748 
749 ENDIF
750 

Generated with Doxygen.