|
◆ vol7d_recompute_stat_proc_diff()
subroutine vol7d_class_compute::vol7d_recompute_stat_proc_diff |
( |
type(vol7d), intent(inout) |
this, |
|
|
type(vol7d), intent(out) |
that, |
|
|
integer, intent(in) |
stat_proc, |
|
|
type(timedelta), intent(in) |
step, |
|
|
logical, intent(in), optional |
full_steps, |
|
|
type(vol7d), intent(out), optional |
other |
|
) |
| |
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 difference of different intervals. Only floating point single or double precision data with analysis/observation or forecast timerange are processed.
The output that vol7d object contains elements from the original volume this satisfying the conditions
- real single or double precision variables
- timerange (vol7d_timerange_class::vol7d_timerange::timerange) of type stat_proc
- any p1 (analysis/observation or forecast)
- p2 > 0 (processing interval non null, non instantaneous data) and equal to a multiplier of step if full_steps is
.TRUE.
Output data will have timerange of type stat_proc and p2 = step. The supported statistical processing methods (parameter stat_proc) are:
- 0 average
- 1 cumulation
- 4 difference
Input volume may have any value of thistime_definition, and that value will be conserved in the output volume. - Parametri
-
[in,out] | this | volume providing data to be recomputed, it is not modified by the method, apart from performing a vol7d_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] | full_steps | if provided and .TRUE., process only data having processing interval (p2) equal to a multiplier of step |
[out] | other | optional volume that, on exit, is going to contain the data that did not contribute to the statistical processing |
Definizione alla linea 1015 del file vol7d_class_compute.F90.
1016 CALL l4f_log(l4f_warn, &
1017 'compute_stat_proc_metamorph, can only be applied to average->accumulated timerange and viceversa')
1020 CALL vol7d_alloc_vol(that)
1025 CALL vol7d_alloc_vol(this)
1028 tr_mask = this%timerange(:)%timerange == stat_proc_input .AND. this%timerange(:)%p2 /= imiss &
1029 .AND. this%timerange(:)%p2 /= 0
1032 IF (count(tr_mask) == 0) THEN
1033 CALL l4f_log(l4f_warn, &
1034 'vol7d_compute, no timeranges suitable for statistical processing by metamorphosis')
1041 CALL vol7d_copy(this, that, ltimerange=tr_mask)
1042 that%timerange(:)%timerange = stat_proc
1044 ALLOCATE(int_ratio( SIZE(that%timerange)), int_ratiod( SIZE(that%timerange)))
1046 IF (stat_proc == 0) THEN
1047 int_ratio = 1./real(that%timerange(:)%p2)
1048 int_ratiod = 1./dble(that%timerange(:)%p2)
1050 int_ratio = real(that%timerange(:)%p2)
1051 int_ratiod = dble(that%timerange(:)%p2)
1054 IF ( ASSOCIATED(that%voldatir)) THEN
1055 DO j = 1, SIZE(that%timerange)
1056 WHERE(c_e(that%voldatir(:,:,:,j,:,:)))
1057 that%voldatir(:,:,:,j,:,:) = that%voldatir(:,:,:,j,:,:)*int_ratio(j)
1059 that%voldatir(:,:,:,j,:,:) = rmiss
1064 IF ( ASSOCIATED(that%voldatid)) THEN
1065 DO j = 1, SIZE(that%timerange)
1066 WHERE(c_e(that%voldatid(:,:,:,j,:,:)))
1067 that%voldatid(:,:,:,j,:,:) = that%voldatid(:,:,:,j,:,:)*int_ratiod(j)
1069 that%voldatid(:,:,:,j,:,:) = rmiss
1075 END SUBROUTINE vol7d_compute_stat_proc_metamorph
1078 SUBROUTINE vol7d_recompute_stat_proc_agg_multiv(this, that, &
1079 step, start, frac_valid, multiv_proc)
1080 TYPE(vol7d), INTENT(inout) :: this
1081 TYPE(vol7d), INTENT(out) :: that
1083 TYPE(timedelta), INTENT(in) :: step
1084 TYPE(datetime), INTENT(in), OPTIONAL :: start
1085 REAL, INTENT(in), OPTIONAL :: frac_valid
1088 INTEGER, INTENT(in) :: multiv_proc
1091 INTEGER :: i, j, n, n1, ndtr, i1, i3, i5, i6
1092 INTEGER :: linshape(1)
1093 REAL :: lfrac_valid, frac_c, frac_m
1094 LOGICAL, ALLOCATABLE :: ttr_mask(:,:)
1095 TYPE(arrayof_ttr_mapper), POINTER :: map_ttr(:,:)
1096 INTEGER, POINTER :: dtratio(:)
1097 INTEGER :: stat_proc_input, stat_proc
1099 SELECT CASE(multiv_proc)
1101 stat_proc_input = 205
1105 tri = stat_proc_input
1106 IF ( PRESENT(frac_valid)) THEN
1107 lfrac_valid = frac_valid
1113 CALL vol7d_alloc_vol(this)
1117 CALL vol7d_smart_sort(this, lsort_time=.true.)
1118 CALL vol7d_reform(this, miss=.false., sort=.false., unique=.true.)
1120 CALL init(that, time_definition=this%time_definition)
1121 CALL vol7d_alloc(that, nana= SIZE(this%ana), nlevel= SIZE(this%level), &
1122 nnetwork= SIZE(this%network))
1123 IF ( ASSOCIATED(this%dativar%r)) THEN
1124 CALL vol7d_alloc(that, ndativarr= SIZE(this%dativar%r))
1125 that%dativar%r = this%dativar%r
1127 IF ( ASSOCIATED(this%dativar%d)) THEN
1128 CALL vol7d_alloc(that, ndativard= SIZE(this%dativar%d))
1129 that%dativar%d = this%dativar%d
1132 that%level = this%level
1133 that%network = this%network
1136 CALL recompute_stat_proc_agg_common(this%time, this%timerange, stat_proc, tri, &
1137 step, this%time_definition, that%time, that%timerange, map_ttr, &
1138 dtratio=dtratio, start=start)
1139 CALL vol7d_alloc_vol(that)
1141 ALLOCATE(ttr_mask( SIZE(this%time), SIZE(this%timerange)))
1142 linshape = (/ SIZE(ttr_mask)/)
1144 IF ( ASSOCIATED(this%voldatir)) THEN
1145 DO j = 1, SIZE(that%timerange)
1146 DO i = 1, SIZE(that%time)
1148 DO i1 = 1, SIZE(this%ana)
1149 DO i3 = 1, SIZE(this%level)
1150 DO i6 = 1, SIZE(this%network)
1151 DO i5 = 1, SIZE(this%dativar%r)
1154 DO n1 = SIZE(dtratio), 1, -1
1155 IF (dtratio(n1) <= 0) cycle
1157 DO n = 1, map_ttr(i,j)%arraysize
1158 IF (map_ttr(i,j)%array(n)%extra_info == dtratio(n1)) THEN
1159 IF (c_e(this%voldatir(i1,map_ttr(i,j)%array(n)%it,i3, &
1160 map_ttr(i,j)%array(n)%itr,i5,i6))) THEN
1161 ttr_mask(map_ttr(i,j)%array(n)%it, &
1162 map_ttr(i,j)%array(n)%itr) = .true.
|