|
◆ volgrid6d_compute_stat_proc_agg()
subroutine volgrid6d_class_compute::volgrid6d_compute_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, |
|
|
logical, intent(in), optional |
full_steps, |
|
|
type(timedelta), intent(in), optional |
max_step, |
|
|
logical, intent(in), optional |
clone |
|
) |
| |
Method for statistically processing a set of instantaneous data.
This method performs statistical processing by aggregation of instantaneous data.
The output that volgrid6d object contains elements from the original volume this satisfying the conditions
Output data will have timerange of type stat_proc, and p2 = step. The supported statistical processing methods (parameter stat_proc) are:
- 0 average
- 2 maximum
- 3 minimum
- 4 difference
A maximum distance in time for input valid data can be assigned with the optional argument max_step, in order to filter datasets with too long "holes". - Parametri
-
[in,out] | this | volume providing data to be recomputed, it is not modified by the method, apart from performing a volgrid6d_alloc_vol on it |
[out] | that | output volume which will contain the recomputed data |
[in] | stat_proc | type 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] | step | length of the step over which the statistical processing is performed |
[in] | start | start of statistical processing interval |
[in] | full_steps | if .TRUE. and start is not provided, apply processing only on intervals starting at a forecast time or a reference time modulo step |
[in] | max_step | maximum allowed distance in time between two contiguougs valid data within an interval, for the interval to be eligible for statistical processing |
[in] | clone | if provided and .TRUE. , clone the gaid's from this to that |
Definizione alla linea 588 del file volgrid6d_class_compute.F90.
590 lclone = optio_log(clone) .OR. .NOT. ASSOCIATED(this%voldati)
592 CALL init(that, griddim=this%griddim, time_definition=this%time_definition)
593 CALL volgrid6d_alloc(that, dim=this%griddim%dim, &
594 nlevel= SIZE(this%level), nvar= SIZE(this%var), ini=.false.)
595 that%level = this%level
599 CALL getval(step, asec=steps)
603 CALL recompute_stat_proc_diff_common(this%time, this%timerange, stat_proc, step, &
604 that%time, that%timerange, map_tr, f, keep_tr, &
605 this%time_definition, full_steps, start)
609 CALL volgrid6d_alloc_vol(that, decode= ASSOCIATED(this%voldati))
611 IF (.NOT. ASSOCIATED(that%voldati)) THEN
612 ALLOCATE(voldatiin1(this%griddim%dim%nx, this%griddim%dim%ny), &
613 voldatiin2(this%griddim%dim%nx, this%griddim%dim%ny), &
614 voldatiout(this%griddim%dim%nx, this%griddim%dim%ny))
618 DO i4 = 1, SIZE(this%time)
620 IF (c_e(keep_tr(i, i4, 2))) THEN
621 l = keep_tr(i, i4, 1)
622 k = keep_tr(i, i4, 2)
624 CALL l4f_category_log(this%category, l4f_debug, &
625 'volgrid6d_recompute_stat_proc_diff, good timerange: '//t2c(f(i))// &
628 DO i6 = 1, SIZE(this%var)
629 DO i3 = 1, SIZE(this%level)
630 IF (c_e(this%gaid(i3,i4,f(i),i6))) THEN
632 CALL copy(this%gaid(i3,i4,f(i),i6), that%gaid(i3,l,k,i6))
634 that%gaid(i3,l,k,i6) = this%gaid(i3,i4,f(i),i6)
636 IF ( ASSOCIATED(that%voldati)) THEN
637 that%voldati(:,:,i3,l,k,i6) = this%voldati(:,:,i3,i4,f(i),i6)
639 CALL volgrid_get_vol_2d(this, i3, i4, f(i), i6, voldatiout)
640 CALL volgrid_set_vol_2d(that, i3, l, k, i6, voldatiout)
650 ALLOCATE(varbufr( SIZE(this%var)))
651 DO i6 = 1, SIZE(this%var)
652 varbufr(i6) = convert(this%var(i6))
655 DO l = 1, SIZE(this%time)
657 DO j = 1, SIZE(this%time)
659 IF (c_e(map_tr(i,j,k,l,1))) THEN
660 DO i6 = 1, SIZE(this%var)
661 DO i3 = 1, SIZE(this%level)
663 IF (c_e(this%gaid(i3,j,f(i),i6)) .AND. &
664 c_e(this%gaid(i3,l,f(k),i6))) THEN
668 CALL copy(this%gaid(i3,l,f(k),i6), &
669 that%gaid(i3,map_tr(i,j,k,l,1),map_tr(i,j,k,l,2),i6))
671 that%gaid(i3,map_tr(i,j,k,l,1),map_tr(i,j,k,l,2),i6) = &
672 this%gaid(i3,l,f(k),i6)
676 CALL volgrid_get_vol_2d(this, i3, l, f(k), i6, voldatiin1)
677 CALL volgrid_get_vol_2d(this, i3, j, f(i), i6, voldatiin2)
678 IF ( ASSOCIATED(that%voldati)) &
679 CALL volgrid_get_vol_2d(that, i3, &
680 map_tr(i,j,k,l,1), map_tr(i,j,k,l,2), i6, voldatiout)
682 IF (stat_proc == 0) THEN
683 WHERE(c_e(voldatiin1(:,:)) .AND. c_e(voldatiin2(:,:)))
685 (voldatiin1(:,:)*this%timerange(f(k))%p2 - &
686 voldatiin2(:,:)*this%timerange(f(i))%p2)/ &
689 voldatiout(:,:) = rmiss
691 ELSE IF (stat_proc == 1 .OR. stat_proc == 4) THEN
692 WHERE(c_e(voldatiin1(:,:)) .AND. c_e(voldatiin2(:,:)))
693 voldatiout(:,:) = voldatiin1(:,:) - voldatiin2(:,:)
695 voldatiout(:,:) = rmiss
697 IF (stat_proc == 1) THEN
698 CALL vol7d_var_features_posdef_apply(varbufr(i6), voldatiout)
702 CALL volgrid_set_vol_2d(that, i3, &
703 map_tr(i,j,k,l,1), map_tr(i,j,k,l,2), i6, voldatiout)
714 IF (.NOT. ASSOCIATED(that%voldati)) THEN
715 DEALLOCATE(voldatiin1, voldatiin2, voldatiout)
718 END SUBROUTINE volgrid6d_recompute_stat_proc_diff
|