libsim Versione 8.0.0

◆ 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 608 del file stat_proc_engine.F90.

609! in next loop, we used initially steps instead of msteps (see comment
610! above), this gave much less combinations of time/timeranges with
611! possible empty output; we start from msteps instead of steps in
612! order to include partial initial intervals in case frac_valid<1;
613! however, as a gemeral rule, for aggregation of forecasts it's better
614! to use reference time
615 DO p1 = msteps, maxp1, msteps
616 CALL insert_unique(a_otimerange, vol7d_timerange_new(stat_proc, p1, steps))
617 ENDDO
618
619 ENDIF
620
621ELSE ! analysis mode
622 tmptime = lstart + step
623 DO WHILE(tmptime < lend) ! < since lend has been extended
624 CALL insert_unique(a_otime, tmptime)
625 tmptime = tmptime + step
626 ENDDO
627 CALL insert_unique(a_otimerange, vol7d_timerange_new(stat_proc, 0, steps))
628
629ENDIF
630
631CALL packarray(a_otime)
632CALL packarray(a_otimerange)
633otime => a_otime%array
634otimerange => a_otimerange%array
635CALL sort(otime)
636CALL sort(otimerange)
637! delete local objects keeping the contents
638CALL delete(a_otime, nodealloc=.true.)
639CALL delete(a_otimerange, nodealloc=.true.)

Generated with Doxygen.