|
◆ 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(datetime), intent(in), optional |
start, |
|
|
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 |
[in] | start | start of statistical processing interval |
[out] | other | optional volume that, on exit, is going to contain the data that did not contribute to the statistical processing |
Definizione alla linea 1021 del file vol7d_class_compute.F90.
1022 CALL vol7d_alloc_vol(that) 1027 CALL vol7d_alloc_vol(this) 1030 tr_mask = this%timerange(:)%timerange == stat_proc_input .AND. this%timerange(:)%p2 /= imiss & 1031 .AND. this%timerange(:)%p2 /= 0 1034 IF (count(tr_mask) == 0) THEN 1035 CALL l4f_log(l4f_warn, & 1036 'vol7d_compute, no timeranges suitable for statistical processing by metamorphosis') 1043 CALL vol7d_copy(this, that, ltimerange=tr_mask) 1044 that%timerange(:)%timerange = stat_proc 1046 ALLOCATE(int_ratio( SIZE(that%timerange)), int_ratiod( SIZE(that%timerange))) 1048 IF (stat_proc == 0) THEN 1049 int_ratio = 1./ REAL(that%timerange(:)%p2) 1050 int_ratiod = 1./dble(that%timerange(:)%p2) 1052 int_ratio = REAL(that%timerange(:)%p2) 1053 int_ratiod = dble(that%timerange(:)%p2) 1056 IF ( ASSOCIATED(that%voldatir)) THEN 1057 DO j = 1, SIZE(that%timerange) 1058 WHERE(c_e(that%voldatir(:,:,:,j,:,:))) 1059 that%voldatir(:,:,:,j,:,:) = that%voldatir(:,:,:,j,:,:)*int_ratio(j) 1061 that%voldatir(:,:,:,j,:,:) = rmiss 1066 IF ( ASSOCIATED(that%voldatid)) THEN 1067 DO j = 1, SIZE(that%timerange) 1068 WHERE(c_e(that%voldatid(:,:,:,j,:,:))) 1069 that%voldatid(:,:,:,j,:,:) = that%voldatid(:,:,:,j,:,:)*int_ratiod(j) 1071 that%voldatid(:,:,:,j,:,:) = rmiss 1077 END SUBROUTINE vol7d_compute_stat_proc_metamorph 1080 SUBROUTINE vol7d_recompute_stat_proc_agg_multiv(this, that, & 1081 step, start, frac_valid, multiv_proc) 1082 TYPE(vol7d), INTENT(inout) :: this 1083 TYPE(vol7d), INTENT(out) :: that 1085 TYPE(timedelta), INTENT(in) :: step 1086 TYPE(datetime), INTENT(in), OPTIONAL :: start 1087 REAL, INTENT(in), OPTIONAL :: frac_valid 1090 INTEGER, INTENT(in) :: multiv_proc 1093 INTEGER :: i, j, n, n1, ndtr, i1, i3, i5, i6 1094 INTEGER :: linshape(1) 1095 REAL :: lfrac_valid, frac_c, frac_m 1096 LOGICAL, ALLOCATABLE :: ttr_mask(:,:) 1097 TYPE(arrayof_ttr_mapper), POINTER :: map_ttr(:,:) 1098 INTEGER, POINTER :: dtratio(:) 1099 INTEGER :: stat_proc_input, stat_proc 1101 SELECT CASE(multiv_proc) 1103 stat_proc_input = 205 1107 tri = stat_proc_input 1108 IF ( PRESENT(frac_valid)) THEN 1109 lfrac_valid = frac_valid 1115 CALL vol7d_alloc_vol(this) 1119 CALL vol7d_smart_sort(this, lsort_time=.true.) 1120 CALL vol7d_reform(this, miss=.false., sort=.false., unique=.true.) 1122 CALL init(that, time_definition=this%time_definition) 1123 CALL vol7d_alloc(that, nana= SIZE(this%ana), nlevel= SIZE(this%level), & 1124 nnetwork= SIZE(this%network)) 1125 IF ( ASSOCIATED(this%dativar%r)) THEN 1126 CALL vol7d_alloc(that, ndativarr= SIZE(this%dativar%r)) 1127 that%dativar%r = this%dativar%r 1129 IF ( ASSOCIATED(this%dativar%d)) THEN 1130 CALL vol7d_alloc(that, ndativard= SIZE(this%dativar%d)) 1131 that%dativar%d = this%dativar%d 1134 that%level = this%level 1135 that%network = this%network 1138 CALL recompute_stat_proc_agg_common(this%time, this%timerange, stat_proc, tri, & 1139 step, this%time_definition, that%time, that%timerange, map_ttr, & 1140 dtratio=dtratio, start=start) 1141 CALL vol7d_alloc_vol(that) 1143 ALLOCATE(ttr_mask( SIZE(this%time), SIZE(this%timerange))) 1144 linshape = (/ SIZE(ttr_mask)/) 1146 IF ( ASSOCIATED(this%voldatir)) THEN 1147 DO j = 1, SIZE(that%timerange) 1148 DO i = 1, SIZE(that%time) 1150 DO i1 = 1, SIZE(this%ana) 1151 DO i3 = 1, SIZE(this%level) 1152 DO i6 = 1, SIZE(this%network) 1153 DO i5 = 1, SIZE(this%dativar%r) 1156 DO n1 = SIZE(dtratio), 1, -1 1157 IF (dtratio(n1) <= 0) cycle 1159 DO n = 1, map_ttr(i,j)%arraysize 1160 IF (map_ttr(i,j)%array(n)%extra_info == dtratio(n1)) THEN 1161 IF (c_e(this%voldatir(i1,map_ttr(i,j)%array(n)%it,i3, & 1162 map_ttr(i,j)%array(n)%itr,i5,i6))) THEN 1163 ttr_mask(map_ttr(i,j)%array(n)%it, & 1164 map_ttr(i,j)%array(n)%itr) = .true. 1169 ndtr = count(ttr_mask) 1170 frac_c = REAL(ndtr)/ REAL(dtratio(n1))
|