libsim  Versione 7.1.6

◆ vol7d_compute_stat_proc_metamorph()

subroutine vol7d_class_compute::vol7d_compute_stat_proc_metamorph ( type(vol7d), intent(inout)  this,
type(vol7d), intent(out)  that,
integer, intent(in)  stat_proc_input,
integer, intent(in)  stat_proc 
)

Specialized method for statistically processing a set of data by integration/differentiation.

This method performs statistical processing by integrating (accumulating) in time values representing time-average rates or fluxes, (stat_proc_input=0 stat_proc=1) or by transforming a time-integrated (accumulated) value in a time-average rate or flux (stat_proc_input=1 stat_proc=0). Analysis/observation or forecast timeranges are processed. The only operation performed is respectively multiplying or dividing the values by the length of the time interval in seconds.

The output that vol7d object contains elements from the original volume this satisfying the conditions

Output data will have timerange of type stat_proc (1 or 0) and p1 and p2 equal to the corresponding input values. The supported statistical processing methods (parameter stat_proc) are:

  • 0 average
  • 1 cumulation

Input volume may have any value of thistime_definition, and that value will be conserved in the output volume.

Parametri
[in,out]thisvolume providing data to be recomputed, it is not modified by the method, apart from performing a vol7d_alloc_vol on it
[out]thatoutput volume which will contain the recomputed data
[in]stat_proc_inputtype of statistical processing of data that has to be processed (from grib2 table), only data having timerange of this type will be processed, the actual statistical processing performed and which will appear in the output volume, is however determined by stat_proc argument
[in]stat_proctype of statistical processing to be recomputed (from grib2 table), data in output volume that will have a timerange of this type

Definizione alla linea 1196 del file vol7d_class_compute.F90.

1197  DO i5 = 1, SIZE(this%dativar%d)
1198 
1199  frac_m = 0.
1200  DO n1 = SIZE(dtratio), 1, -1 ! precedence to longer periods
1201  IF (dtratio(n1) <= 0) cycle ! safety check
1202  ttr_mask = .false.
1203  DO n = 1, map_ttr(i,j)%arraysize
1204  IF (map_ttr(i,j)%array(n)%extra_info == dtratio(n1)) THEN
1205  IF (c_e(this%voldatid(i1,map_ttr(i,j)%array(n)%it,i3, &
1206  map_ttr(i,j)%array(n)%itr,i5,i6))) THEN
1207  ttr_mask(map_ttr(i,j)%array(n)%it, &
1208  map_ttr(i,j)%array(n)%itr) = .true.
1209  ENDIF
1210  ENDIF
1211  ENDDO
1212 
1213  ndtr = count(ttr_mask)
1214  frac_c = real(ndtr)/real(dtratio(n1))
1215 
1216  IF (ndtr > 0 .AND. frac_c >= max(lfrac_valid, frac_m)) THEN
1217  frac_m = frac_c
1218  SELECT CASE(stat_proc)
1219  CASE (0) ! average
1220  that%voldatid(i1,i,i3,j,i5,i6) = &
1221  sum(this%voldatid(i1,:,i3,:,i5,i6), &
1222  mask=ttr_mask)/ndtr
1223  CASE (1, 4) ! accumulation, difference
1224  that%voldatid(i1,i,i3,j,i5,i6) = &
1225  sum(this%voldatid(i1,:,i3,:,i5,i6), &
1226  mask=ttr_mask)
1227  CASE (2) ! maximum
1228  that%voldatid(i1,i,i3,j,i5,i6) = &
1229  maxval(this%voldatid(i1,:,i3,:,i5,i6), &
1230  mask=ttr_mask)
1231  CASE (3) ! minimum
1232  that%voldatid(i1,i,i3,j,i5,i6) = &
1233  minval(this%voldatid(i1,:,i3,:,i5,i6), &
1234  mask=ttr_mask)
1235  CASE (6) ! stddev
1236  that%voldatid(i1,i,i3,j,i5,i6) = &
1237  stat_stddev( &
1238  reshape(this%voldatid(i1,:,i3,:,i5,i6), shape=linshape), &
1239  mask=reshape(ttr_mask, shape=linshape))
1240  END SELECT
1241  ENDIF
1242 
1243  ENDDO ! dtratio
1244  ENDDO ! var
1245  ENDDO ! network
1246  ENDDO ! level
1247  ENDDO ! ana
1248  CALL delete(map_ttr(i,j))
1249  ENDDO ! otime
1250  ENDDO ! otimerange
1251 ENDIF
1252 
1253 DEALLOCATE(ttr_mask)
1254 
1255 END SUBROUTINE vol7d_recompute_stat_proc_agg_multiv
1256 

Generated with Doxygen.