libsim Versione 7.2.1
|
◆ volgrid6d_compute_stat_proc()
General-purpose method for computing a statistical processing on data in a volgrid6d 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:
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 290 del file volgrid6d_class_compute.F90. 292 CALL volgrid_get_vol_2d(that, i3, i, j, i6, voldatiout)
293 ndtr = 0
294 DO n = 1, map_ttr(i,j)%arraysize
295 IF (map_ttr(i,j)%array(n)%extra_info == dtratio(n1)) THEN
296 ndtr = ndtr + 1
297 CALL volgrid_get_vol_2d(this, i3, map_ttr(i,j)%array(n)%it, &
298 map_ttr(i,j)%array(n)%itr, i6, voldatiin)
299
300 IF (ndtr == 1) THEN
301 voldatiout = voldatiin
302 IF (lclone) THEN
303 CALL copy(this%gaid(i3, map_ttr(i,j)%array(n)%it,&
304 map_ttr(i,j)%array(n)%itr,i6), that%gaid(i3,i,j,i6))
305 ELSE
306 that%gaid(i3,i,j,i6) = this%gaid(i3, map_ttr(i,j)%array(n)%it, &
307 map_ttr(i,j)%array(n)%itr,i6)
308 ENDIF
309
310 ELSE ! second or more time
311 SELECT CASE(stat_proc)
312 CASE (0, 200, 1, 4) ! average, vectorial mean, accumulation, difference
313 WHERE(c_e(voldatiin(:,:)) .AND. c_e(voldatiout(:,:)))
314 voldatiout(:,:) = voldatiout(:,:) + voldatiin(:,:)
315 ELSEWHERE
316 voldatiout(:,:) = rmiss
317 END WHERE
318 CASE(2) ! maximum
319 WHERE(c_e(voldatiin(:,:)) .AND. c_e(voldatiout(:,:)))
320 voldatiout(:,:) = max(voldatiout(:,:), voldatiin(:,:))
321 ELSEWHERE
322 voldatiout(:,:) = rmiss
323 END WHERE
324 CASE(3) ! minimum
325 WHERE(c_e(voldatiin(:,:)) .AND. c_e(voldatiout(:,:)))
326 voldatiout(:,:) = min(voldatiout(:,:), voldatiin(:,:))
327 ELSEWHERE
328 voldatiout(:,:) = rmiss
329 END WHERE
330 END SELECT
331
332 ENDIF ! first time
333 ENDIF ! dtratio(n1)
334 ENDDO ! ttr
335
336#ifdef DEBUG
337 CALL l4f_log(l4f_debug, &
338 'compute_stat_proc_agg, ndtr/dtratio/frac_valid: '// &
339 t2c(ndtr)//'/'//t2c(dtratio(n1))//'/'//t2c(lfrac_valid))
340#endif
341 IF (ndtr > 0) THEN ! why this condition was not here before?
342 IF (real(ndtr)/real(dtratio(n1)) >= lfrac_valid) THEN ! success
343 IF (stat_proc == 0) THEN ! average
344 WHERE(c_e(voldatiout(:,:)))
345 voldatiout(:,:) = voldatiout(:,:)/ndtr
346 END WHERE
347 ENDIF
348 CALL volgrid_set_vol_2d(that, i3, i, j, i6, voldatiout)
349#ifdef DEBUG
350 CALL l4f_log(l4f_debug, &
351 'compute_stat_proc_agg, coding lev/t/tr/var: '// &
352 t2c(i3)//'/'//t2c(i)//'/'//t2c(j)//'/'//t2c(i6))
353#endif
354 ELSE
355! must nullify the output gaid here, otherwise an incomplete field will be output
356 IF (lclone) THEN
357 CALL delete(that%gaid(i3,i,j,i6))
358 ELSE
359 CALL init(that%gaid(i3,i,j,i6)) ! grid_id lacks a nullify method
360 ENDIF
361#ifdef DEBUG
362 CALL l4f_log(l4f_debug, &
363 'compute_stat_proc_agg, skipping lev/t/tr/var: '// &
364 t2c(i3)//'/'//t2c(i)//'/'//t2c(j)//'/'//t2c(i6))
365#endif
366 ENDIF
367 ENDIF ! ndtr > 0
368
369 ENDDO ! level
370 ENDDO ! var
371 ENDDO ! dtratio
372 CALL delete(map_ttr(i,j))
373 ENDDO do_otime
|