libsim  Versione 7.1.6

◆ arrayof_ttr_mapper_insert_sorted()

integer function, private stat_proc_engine::arrayof_ttr_mapper_insert_sorted ( type(arrayof_ttr_mapper this,
type(ttr_mapper), intent(in)  content,
logical, intent(in)  incr,
logical, intent(in)  back 
)
private

Method for inserting an element of the array in a sorted manner.

If necessary, the array is reallocated to accomodate the new element. It works under the assumption that the current content of the array is already sorted in the desired order.

Parametri
thisarray object to extend
[in]contentobject of TYPE TYPE(ttr_mapper) to insert
[in]incrinsert in increasing order
[in]backsearch position starting from end of array (optimization)

Definizione alla linea 608 del file stat_proc_engine.F90.

609  do_itimerange1: DO l = 1, SIZE(itimerange)
610  IF (.NOT.mask_timerange(l)) cycle do_itimerange1
611  do_itime1: DO k = 1, SIZE(itime)
612  CALL time_timerange_get_period(itime(k), itimerange(l), &
613  time_definition, pstart1, pend1, reftime1)
614  do_otimerange1: DO j = 1, SIZE(otimerange)
615  do_otime1: DO i = 1, SIZE(otime)
616  CALL time_timerange_get_period_pop(otime(i), otimerange(j), step, &
617  time_definition, pstart2, pend2, reftime2)
618  IF (lforecast) THEN
619  IF (reftime1 /= reftime2) cycle do_otime1
620  ENDIF
621 
622  IF (pstart1 >= pstart2 .AND. pend1 <= pend2 .AND. &
623  mod(pstart1-pstart2, pend1-pstart1) == timedelta_0) THEN ! useful
624  lmapper%it = k
625  lmapper%itr = l
626  lmapper%extra_info = steps/itimerange(l)%p2 ! dtratio, guaranteed to be integer
627  n = append(map_ttr(i,j), lmapper)
628  cycle do_itime1 ! can contribute only to a single interval
629  ENDIF
630  ENDDO do_otime1
631  ENDDO do_otimerange1
632  ENDDO do_itime1
633  ENDDO do_itimerange1
634 
635 ELSE
636 
637  ALLOCATE(map_ttr(SIZE(otime),SIZE(otimerange)))
638  do_itimerange2: DO l = 1, SIZE(itimerange)
639  IF (.NOT.mask_timerange(l)) cycle do_itimerange2

Generated with Doxygen.