libsim  Versione6.3.0

◆ volgrid6d_recompute_stat_proc_agg()

subroutine volgrid6d_class_compute::volgrid6d_recompute_stat_proc_agg ( type(volgrid6d), intent(inout)  this,
type(volgrid6d), intent(out)  that,
integer, intent(in)  stat_proc,
type(timedelta), intent(in)  step,
type(datetime), intent(in), optional  start,
real, intent(in), optional  frac_valid,
logical, intent(in), optional  clone 
)

Specialized method for statistically processing a set of data already processed with the same statistical processing, on a different time interval.

This method performs statistical processing by aggregation of shorter intervals.

The output that volgrid6d object contains elements from the original volume this satisfying the conditions

  • timerange (vol7d_timerange_class::vol7d_timerange::timerange) of type stat_proc (or stat_proc_input if provided)
  • any p1 (analysis/observation or forecast)
  • p2 > 0 (processing interval non null, non instantaneous data) and equal to a multiplier of step

Output data will have timerange of type stat_proc and p2 = step. The supported statistical processing methods (parameter stat_proc) are:

  • 0 average
  • 1 accumulation
  • 2 maximum
  • 3 minimum
  • 4 difference

The start of processing period can be computed automatically from the input intervals as the first possible interval modulo step, or, for a better control, it can be specified explicitely by the optional argument start. Be warned that, in the final volume, the first reference time will actually be start + step, since start indicates the beginning of first processing interval, while reference time (for analysis/oservation) is the end of the interval.

The purpose of the optional argument stat_proc_input is to allow processing with a certain statistical processing operator a dataset already processed with a different operator, by specifying the latter as stat_proc_input; this is useful, for example, if one wants to compute the monthly average of daily maximum temperatures; however this has to be used with care since the resulting data volume will not carry all the information about the processing which has been done, in the previous case, for example, the temperatures will simply look like monthly average temperatures.

Parametri
[in,out]thisvolume providing data to be recomputed, it is not modified by the method, apart from performing a volgrid6d_alloc_vol on it
[out]thatoutput volume which will contain the recomputed data
[in]stat_proctype of statistical processing to be recomputed (from grib2 table), only data having timerange of this type will be recomputed and will appear in the output volume
[in]steplength of the step over which the statistical processing is performed
[in]startstart of statistical processing interval
[in]frac_validminimum fraction of valid data required for considering acceptable a recomputed value, default=1.
[in]cloneif provided and .TRUE. , clone the gaid's from this to that

Definizione alla linea 438 del file volgrid6d_class_compute.F90.

438  CALL copy(this%gaid(i3, map_ttr(i,j)%array(1)%it,&
439  map_ttr(i,j)%array(1)%itr,i6), that%gaid(i3,i,j,i6))
440  ELSE
441  that%gaid(i3,i,j,i6) = this%gaid(i3, map_ttr(i,j)%array(1)%it, &
442  map_ttr(i,j)%array(1)%itr,i6)
443  ENDIF
444 ! improve the next workflow?
445  CALL volgrid_get_vol_2d(this, i3, map_ttr(i,j)%array(ninp)%it, &
446  map_ttr(i,j)%array(ninp)%itr, i6, voldatiin)
447  voldatiout = voldatiin
448  CALL volgrid_get_vol_2d(this, i3, map_ttr(i,j)%array(1)%it, &
449  map_ttr(i,j)%array(1)%itr, i6, voldatiin)
450 
451  WHERE(c_e(voldatiin(:,:)) .AND. c_e(voldatiout(:,:)))
452  voldatiout(:,:) = voldatiout(:,:) - voldatiin(:,:)
453  ELSEWHERE
454  voldatiout(:,:) = rmiss
455  END WHERE
456 
457  ELSE ! other stat_proc
458  DO n = 1, ninp
459  CALL volgrid_get_vol_2d(this, i3, map_ttr(i,j)%array(n)%it, &
460  map_ttr(i,j)%array(n)%itr, i6, voldatiin)
461 
462  IF (n == 1) THEN
463  voldatiout = voldatiin
464  IF (lclone) THEN
465  CALL copy(this%gaid(i3, map_ttr(i,j)%array(n)%it,&
466  map_ttr(i,j)%array(n)%itr,i6), that%gaid(i3,i,j,i6))
467  ELSE
468  that%gaid(i3,i,j,i6) = this%gaid(i3, map_ttr(i,j)%array(n)%it, &
469  map_ttr(i,j)%array(n)%itr,i6)
470  ENDIF
471 
472  ELSE ! second or more time
473  SELECT CASE(stat_proc)
474  CASE (0, 1) ! average, accumulation
475  WHERE(c_e(voldatiin(:,:)) .AND. c_e(voldatiout(:,:)))
476  voldatiout(:,:) = voldatiout(:,:) + voldatiin(:,:)
477  ELSEWHERE
478  voldatiout(:,:) = rmiss
479  END WHERE
480  CASE(2) ! maximum
481  WHERE(c_e(voldatiin(:,:)) .AND. c_e(voldatiout(:,:)))
482  voldatiout(:,:) = max(voldatiout(:,:), voldatiin(:,:))
483  ELSEWHERE
484  voldatiout(:,:) = rmiss
485  END WHERE
486  CASE(3) ! minimum
487  WHERE(c_e(voldatiin(:,:)) .AND. c_e(voldatiout(:,:)))
488  voldatiout(:,:) = min(voldatiout(:,:), voldatiin(:,:))
489  ELSEWHERE
490  voldatiout(:,:) = rmiss
491  END WHERE
492  END SELECT
493 
494  ENDIF ! first time
495  ENDDO
496  IF (stat_proc == 0) THEN ! average
497  WHERE(c_e(voldatiout(:,:)))
498  voldatiout(:,:) = voldatiout(:,:)/ninp
499  END WHERE
500  ENDIF
501  ENDIF
502  CALL volgrid_set_vol_2d(that, i3, i, j, i6, voldatiout)
503  ENDDO ! level
504  ENDDO ! var
505  CALL delete(map_ttr(i,j))
506  ENDDO do_otime
507 ENDDO do_otimerange
508 
509 DEALLOCATE(map_ttr)
510 
511 
512 END SUBROUTINE volgrid6d_compute_stat_proc_agg
513 
514 
539 SUBROUTINE volgrid6d_recompute_stat_proc_diff(this, that, stat_proc, step, full_steps, start, clone)
540 TYPE(volgrid6d),INTENT(inout) :: this
541 TYPE(volgrid6d),INTENT(out) :: that
542 INTEGER,INTENT(in) :: stat_proc
543 TYPE(timedelta),INTENT(in) :: step
544 LOGICAL,INTENT(in),OPTIONAL :: full_steps
545 TYPE(datetime),INTENT(in),OPTIONAL :: start
546 LOGICAL,INTENT(in),OPTIONAL :: clone
547 INTEGER :: i3, i4, i6, i, j, k, l, nitr, steps
548 INTEGER,POINTER :: map_tr(:,:,:,:,:), f(:)
549 REAL,POINTER :: voldatiin1(:,:), voldatiin2(:,:), voldatiout(:,:)
550 LOGICAL,POINTER :: mask_timerange(:)
551 LOGICAL :: lclone
552 
Distruttori per le 2 classi.

Generated with Doxygen.