libsim Versione 7.2.1
|
◆ vol7d_compute_stat_proc()
General-purpose method for computing a statistical processing on data in a vol7d object already processed with the same statistical processing, on a different time interval specified by step and start. This method tries to apply all the suitable specialized statistical processing methods according to the input and output statistical processing requested. The argument stat_proc_input determines which data will be processed, while the stat_proc argument determines the type of statistical process to be applied and which will be owned by output data. The possible combinations are:
processing is computed on longer intervals by aggregation, see the description of vol7d_compute_stat_proc_agg()
see the description of vol7d_decompute_stat_proc()
If a particular statistical processing cannot be performed on the input data, the program continues with a warning and, if requested, the input data is passed over to the volume specified by the other argument, in order to allow continuation of processing. All the other parameters are passed over to the specifical statistical processing methods and are documented there.
Definizione alla linea 294 del file vol7d_class_compute.F90. 296ENDIF
297that%ana = this%ana
298that%level = this%level
299that%network = this%network
300
301! compute the output time and timerange and all the required mappings
302CALL recompute_stat_proc_agg_common(this%time, this%timerange, stat_proc, tri, &
303 step, this%time_definition, that%time, that%timerange, map_ttr, dtratio, &
304 start, full_steps)
305CALL vol7d_alloc_vol(that)
306
307ALLOCATE(ttr_mask(SIZE(this%time), SIZE(this%timerange)))
308linshape = (/SIZE(ttr_mask)/)
309! finally perform computations
310IF (ASSOCIATED(this%voldatir)) THEN
311 DO j = 1, SIZE(that%timerange)
312 DO i = 1, SIZE(that%time)
313
314 DO i1 = 1, SIZE(this%ana)
315 DO i3 = 1, SIZE(this%level)
316 DO i6 = 1, SIZE(this%network)
317 DO i5 = 1, SIZE(this%dativar%r)
318
319 frac_m = 0.
320 DO n1 = SIZE(dtratio), 1, -1 ! precedence to longer periods
321 IF (dtratio(n1) <= 0) cycle ! safety check
322 ttr_mask = .false.
323 DO n = 1, map_ttr(i,j)%arraysize
324 IF (map_ttr(i,j)%array(n)%extra_info == dtratio(n1)) THEN
325 IF (c_e(this%voldatir(i1,map_ttr(i,j)%array(n)%it,i3, &
326 map_ttr(i,j)%array(n)%itr,i5,i6))) THEN
327 ttr_mask(map_ttr(i,j)%array(n)%it, &
328 map_ttr(i,j)%array(n)%itr) = .true.
329 ENDIF
330 ENDIF
331 ENDDO
332
333 ndtr = count(ttr_mask)
334 frac_c = real(ndtr)/real(dtratio(n1))
335
336 IF (ndtr > 0 .AND. frac_c >= max(lfrac_valid, frac_m)) THEN
337 frac_m = frac_c
338 SELECT CASE(stat_proc)
339 CASE (0, 200) ! average, vectorial mean
340 that%voldatir(i1,i,i3,j,i5,i6) = &
341 sum(this%voldatir(i1,:,i3,:,i5,i6), &
342 mask=ttr_mask)/ndtr
343 CASE (1, 4) ! accumulation, difference
344 that%voldatir(i1,i,i3,j,i5,i6) = &
345 sum(this%voldatir(i1,:,i3,:,i5,i6), &
346 mask=ttr_mask)
347 CASE (2) ! maximum
348 that%voldatir(i1,i,i3,j,i5,i6) = &
349 maxval(this%voldatir(i1,:,i3,:,i5,i6), &
350 mask=ttr_mask)
351 CASE (3) ! minimum
352 that%voldatir(i1,i,i3,j,i5,i6) = &
353 minval(this%voldatir(i1,:,i3,:,i5,i6), &
354 mask=ttr_mask)
355 CASE (6) ! stddev
356 that%voldatir(i1,i,i3,j,i5,i6) = &
357 stat_stddev( &
358 reshape(this%voldatir(i1,:,i3,:,i5,i6), shape=linshape), &
359 mask=reshape(ttr_mask, shape=linshape))
360 END SELECT
361 ENDIF
362
363 ENDDO ! dtratio
364 ENDDO ! var
365 ENDDO ! network
366 ENDDO ! level
367 ENDDO ! ana
368 CALL delete(map_ttr(i,j))
369 ENDDO ! otime
370 ENDDO ! otimerange
371ENDIF
372
373IF (ASSOCIATED(this%voldatid)) THEN
374 DO j = 1, SIZE(that%timerange)
375 DO i = 1, SIZE(that%time)
376
377 DO i1 = 1, SIZE(this%ana)
378 DO i3 = 1, SIZE(this%level)
379 DO i6 = 1, SIZE(this%network)
380 DO i5 = 1, SIZE(this%dativar%d)
381
382 frac_m = 0.
383 DO n1 = SIZE(dtratio), 1, -1 ! precedence to longer periods
384 IF (dtratio(n1) <= 0) cycle ! safety check
385 ttr_mask = .false.
|