|
◆ 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, |
|
|
integer, intent(in), optional |
stat_proc_input |
|
) |
| |
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 |
[in] | stat_proc_input | to be used with care, type of statistical processing of data that has to be processed (from grib2 table), only data having timerange of this type will be recomputed, the actual statistical processing performed and which will appear in the output volume, is however determined by stat_proc argument |
Definizione alla linea 429 del file volgrid6d_class_compute.F90.
437 lclone = optio_log(clone) .OR. .NOT. ASSOCIATED(this%voldati)
441 nlevel= SIZE(this%level), nvar= SIZE(this%var), ini=.false.)
442 that%level = this%level
446 step, this%time_definition, that%time, that%timerange, map_ttr, &
447 start=start, full_steps=full_steps)
451 do_otimerange: DO j = 1, SIZE(that%timerange)
452 do_otime: DO i = 1, SIZE(that%time)
453 ninp = map_ttr(i,j)%arraysize
454 IF (ninp <= 0) cycle do_otime
456 IF (stat_proc == 4) THEN
457 IF (map_ttr(i,j)%array(1)%extra_info /= 1 .OR. &
458 map_ttr(i,j)%array(ninp)%extra_info /= 2) THEN
459 CALL delete(map_ttr(i,j))
465 IF (map_ttr(i,j)%array(n)%time - map_ttr(i,j)%array(n-1)%time >
467 CALL delete(map_ttr(i,j))
473 DO i6 = 1, SIZE(this%var)
474 DO i3 = 1, SIZE(this%level)
475 CALL volgrid_get_vol_2d(that, i3, i, j, i6, voldatiout)
477 IF (stat_proc == 4) THEN
479 CALL copy(this%gaid(i3, map_ttr(i,j)%array(1)%it,&
480 map_ttr(i,j)%array(1)%itr,i6), that%gaid(i3,i,j,i6))
482 that%gaid(i3,i,j,i6) = this%gaid(i3, map_ttr(i,j)%array(1)%it
483 map_ttr(i,j)%array(1)%itr,i6)
486 CALL volgrid_get_vol_2d(this, i3, map_ttr(i,j)%array(ninp)%it,
487 map_ttr(i,j)%array(ninp)%itr, i6, voldatiin)
488 voldatiout = voldatiin
489 CALL volgrid_get_vol_2d(this, i3, map_ttr(i,j)%array(1)%it, &
490 map_ttr(i,j)%array(1)%itr, i6, voldatiin)
492 WHERE(c_e(voldatiin(:,:)) .AND. c_e(voldatiout(:,:)))
493 voldatiout(:,:) = voldatiout(:,:) - voldatiin(:,:)
495 voldatiout(:,:) = rmiss
500 CALL volgrid_get_vol_2d(this, i3, map_ttr(i,j)%array(n)%it,
501 map_ttr(i,j)%array(n)%itr, i6, voldatiin)
504 voldatiout = voldatiin
506 CALL copy(this%gaid(i3, map_ttr(i,j)%array(n)%it,&
507 map_ttr(i,j)%array(n)%itr,i6), that%gaid(i3,i,j,i6))
509 that%gaid(i3,i,j,i6) = this%gaid(i3, map_ttr(i,j)%array(n
510 map_ttr(i,j)%array(n)%itr,i6)
514 SELECT CASE(stat_proc)
516 WHERE(c_e(voldatiin(:,:)) .AND. c_e(voldatiout(:,:)))
517 voldatiout(:,:) = voldatiout(:,:) + voldatiin(:,:)
519 voldatiout(:,:) = rmiss
522 WHERE(c_e(voldatiin(:,:)) .AND. c_e(voldatiout(:,:)))
523 voldatiout(:,:) = max(voldatiout(:,:), voldatiin(:,:))
525 voldatiout(:,:) = rmiss
528 WHERE(c_e(voldatiin(:,:)) .AND. c_e(voldatiout(:,:)))
529 voldatiout(:,:) = min(voldatiout(:,:), voldatiin(:,:))
531 voldatiout(:,:) = rmiss
537 IF (stat_proc == 0) THEN
538 WHERE(c_e(voldatiout(:,:)))
539 voldatiout(:,:) = voldatiout(:,:)/ninp
543 CALL volgrid_set_vol_2d(that, i3, i, j, i6, voldatiout)
546 CALL delete(map_ttr(i,j))
553 END SUBROUTINE volgrid6d_compute_stat_proc_agg
|