|
◆ 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, |
|
|
logical, intent(in), optional |
full_steps, |
|
|
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
- 200 vectorial mean
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] | 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] | frac_valid | minimum fraction of valid data required for considering acceptable a recomputed value, default=1. |
[in] | clone | if provided and .TRUE. , clone the gaid's from this to that |
Definizione alla linea 420 del file volgrid6d_class_compute.F90.
427 lclone = optio_log(clone) .OR. .NOT. ASSOCIATED(this%voldati)
431 nlevel= SIZE(this%level), nvar= SIZE(this%var), ini=.false.)
432 that%level = this%level
436 step, this%time_definition, that%time, that%timerange, map_ttr, &
437 start=start, full_steps=full_steps)
441 do_otimerange: DO j = 1, SIZE(that%timerange)
442 do_otime: DO i = 1, SIZE(that%time)
443 ninp = map_ttr(i,j)%arraysize
444 IF (ninp <= 0) cycle do_otime
446 IF (stat_proc == 4) THEN
447 IF (map_ttr(i,j)%array(1)%extra_info /= 1 .OR. &
448 map_ttr(i,j)%array(ninp)%extra_info /= 2) THEN
449 CALL delete(map_ttr(i,j))
455 IF (map_ttr(i,j)%array(n)%time - map_ttr(i,j)%array(n-1)%time >
457 CALL delete(map_ttr(i,j))
463 DO i6 = 1, SIZE(this%var)
464 DO i3 = 1, SIZE(this%level)
465 CALL volgrid_get_vol_2d(that, i3, i, j, i6, voldatiout)
467 IF (stat_proc == 4) THEN
469 CALL copy(this%gaid(i3, map_ttr(i,j)%array(1)%it,&
470 map_ttr(i,j)%array(1)%itr,i6), that%gaid(i3,i,j,i6))
472 that%gaid(i3,i,j,i6) = this%gaid(i3, map_ttr(i,j)%array(1)%it
473 map_ttr(i,j)%array(1)%itr,i6)
476 CALL volgrid_get_vol_2d(this, i3, map_ttr(i,j)%array(ninp)%it,
477 map_ttr(i,j)%array(ninp)%itr, i6, voldatiin)
478 voldatiout = voldatiin
479 CALL volgrid_get_vol_2d(this, i3, map_ttr(i,j)%array(1)%it, &
480 map_ttr(i,j)%array(1)%itr, i6, voldatiin)
482 WHERE(c_e(voldatiin(:,:)) .AND. c_e(voldatiout(:,:)))
483 voldatiout(:,:) = voldatiout(:,:) - voldatiin(:,:)
485 voldatiout(:,:) = rmiss
490 CALL volgrid_get_vol_2d(this, i3, map_ttr(i,j)%array(n)%it,
491 map_ttr(i,j)%array(n)%itr, i6, voldatiin)
494 voldatiout = voldatiin
496 CALL copy(this%gaid(i3, map_ttr(i,j)%array(n)%it,&
497 map_ttr(i,j)%array(n)%itr,i6), that%gaid(i3,i,j,i6))
499 that%gaid(i3,i,j,i6) = this%gaid(i3, map_ttr(i,j)%array(n
500 map_ttr(i,j)%array(n)%itr,i6)
504 SELECT CASE(stat_proc)
506 WHERE(c_e(voldatiin(:,:)) .AND. c_e(voldatiout(:,:)))
507 voldatiout(:,:) = voldatiout(:,:) + voldatiin(:,:)
509 voldatiout(:,:) = rmiss
512 WHERE(c_e(voldatiin(:,:)) .AND. c_e(voldatiout(:,:)))
513 voldatiout(:,:) = max(voldatiout(:,:), voldatiin(:,:))
515 voldatiout(:,:) = rmiss
518 WHERE(c_e(voldatiin(:,:)) .AND. c_e(voldatiout(:,:)))
519 voldatiout(:,:) = min(voldatiout(:,:), voldatiin(:,:))
521 voldatiout(:,:) = rmiss
527 IF (stat_proc == 0) THEN
528 WHERE(c_e(voldatiout(:,:)))
529 voldatiout(:,:) = voldatiout(:,:)/ninp
533 CALL volgrid_set_vol_2d(that, i3, i, j, i6, voldatiout)
536 CALL delete(map_ttr(i,j))
543 END SUBROUTINE volgrid6d_compute_stat_proc_agg
|