libsim Versione 7.2.1

◆ arrayof_ttr_mapper_insert_sorted()

integer function, private 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 602 del file stat_proc_engine.F90.

603#ifdef DEBUG
604 CALL l4f_log(l4f_debug, &
605 'recompute_stat_proc_agg, found '//t2c(size(dtratio))// &
606 ' possible aggregation ratios, from '// &
607 t2c(dtratio(1))//' to '//t2c(dtratio(SIZE(dtratio))))
608#endif
609
610 ALLOCATE(map_ttr(SIZE(otime),SIZE(otimerange)))
611 do_itimerange1: DO l = 1, SIZE(itimerange)
612 IF (.NOT.mask_timerange(l)) cycle do_itimerange1
613 do_itime1: DO k = 1, SIZE(itime)
614 CALL time_timerange_get_period(itime(k), itimerange(l), &
615 time_definition, pstart1, pend1, reftime1)
616 do_otimerange1: DO j = 1, SIZE(otimerange)
617 do_otime1: DO i = 1, SIZE(otime)
618 CALL time_timerange_get_period_pop(otime(i), otimerange(j), step, &
619 time_definition, pstart2, pend2, reftime2)
620 IF (lforecast) THEN
621 IF (reftime1 /= reftime2) cycle do_otime1
622 ENDIF
623
624 IF (pstart1 >= pstart2 .AND. pend1 <= pend2 .AND. &
625 mod(pstart1-pstart2, pend1-pstart1) == timedelta_0) THEN ! useful
626 lmapper%it = k
627 lmapper%itr = l
628 lmapper%extra_info = steps/itimerange(l)%p2 ! dtratio, guaranteed to be integer
629 n = append(map_ttr(i,j), lmapper)
630 cycle do_itime1 ! can contribute only to a single interval
631 ENDIF
632 ENDDO do_otime1
633 ENDDO do_otimerange1

Generated with Doxygen.