libsim  Versione 7.2.6

◆ vol7d_recompute_stat_proc_agg_multiv()

subroutine vol7d_class_compute::vol7d_recompute_stat_proc_agg_multiv ( type(vol7d), intent(inout)  this,
type(vol7d), intent(out)  that,
type(timedelta), intent(in)  step,
type(datetime), intent(in), optional  start,
real, intent(in), optional  frac_valid,
integer, intent(in)  multiv_proc 
)
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]steplength of the step over which the statistical processing is performed
[in]startstart of statistical processing interval
[in]frac_validminimum fraction of valid data required for considering acceptable a recomputed value, default=1.
[in]multiv_procindex of multivariate specific operation

Definizione alla linea 1278 del file vol7d_class_compute.F90.

1280 TYPE(datetime),INTENT(in),OPTIONAL :: stopp
1281 TYPE(cyclicdatetime),INTENT(in),OPTIONAL :: cyclicdt
1282 
1283 TYPE(cyclicdatetime) :: lcyclicdt
1284 TYPE(datetime) :: counter, lstart, lstop
1285 INTEGER :: i, naddtime
1286 
1287 CALL safe_start_stop(this, lstart, lstop, start, stopp)
1288 IF (.NOT. c_e(lstart) .OR. .NOT. c_e(lstop) .OR. .NOT. c_e(step)) RETURN
1289 
1290 lcyclicdt=cyclicdatetime_miss
1291 if (present(cyclicdt)) then
1292  if(c_e(cyclicdt)) lcyclicdt=cyclicdt
1293 end if
1294 
1295 CALL l4f_log(l4f_info, 'vol7d_fill_time: time interval '//trim(to_char(lstart))// &
1296  ' '//trim(to_char(lstop)))
1297 
1298 ! Count the number of time levels required for completing the series
1299 ! valid also in the case (SIZE(this%time) == 0)
1300 naddtime = 0
1301 counter = lstart
1302 i = 1
1303 naddcount: DO WHILE(counter <= lstop)
1304  DO WHILE(i <= SIZE(this%time)) ! this%time(i) chases counter
1305  IF (counter < this%time(i)) THEN ! this%time(i) overtook counter
1306  i = max(i-1,1) ! go back if possible
1307  EXIT
1308  ELSE IF (counter == this%time(i) .OR. .NOT. counter == lcyclicdt) THEN ! found matching time
1309  counter = counter + step
1310  cycle naddcount
1311  ENDIF
1312  i = i + 1
1313  ENDDO
1314  naddtime = naddtime + 1
1315  counter = counter + step
1316 ENDDO naddcount
1317 
1318 ! old universal algorithm, not optimized, check that the new one is equivalent
1319 !naddtime = 0
1320 !counter = lstart
1321 !DO WHILE(counter <= lstop)
1322 ! IF (.NOT.ANY(counter == this%time(:))) THEN
1323 ! naddtime = naddtime + 1
1324 ! ENDIF
1325 ! counter = counter + step
1326 !ENDDO
1327 
1328 IF (naddtime > 0) THEN
1329 
1330  CALL init(that)
1331  CALL vol7d_alloc(that, ntime=naddtime)
1332  CALL vol7d_alloc_vol(that)
1333 
1334  ! Repeat the count loop setting the time levels to be added
1335  naddtime = 0
1336  counter = lstart
1337  i = 1
1338  naddadd: DO WHILE(counter <= lstop)
1339  DO WHILE(i <= SIZE(this%time)) ! this%time(i) chases counter
1340  IF (counter < this%time(i)) THEN ! this%time(i) overtook counter
1341  i = max(i-1,1) ! go back if possible
1342  EXIT
1343  ELSE IF (counter == this%time(i) .OR. .NOT. counter == lcyclicdt) THEN ! found matching time
1344  counter = counter + step
1345  cycle naddadd
1346  ENDIF
1347  i = i + 1
1348  ENDDO
1349  naddtime = naddtime + 1
1350  that%time(naddtime) = counter ! only difference
1351  counter = counter + step
1352  ENDDO naddadd
1353 
1354  CALL vol7d_append(that, this, sort=.true.)
1355 
1356 ELSE
1357 !! ? why sort all dimension ?
1358 !! CALL vol7d_copy(this, that, lsort_time=.TRUE.)
1359  CALL vol7d_copy(this, that, sort=.true.)
1360 ENDIF
1361 
1362 
1363 END SUBROUTINE vol7d_fill_time
1364 
1365 
1377 SUBROUTINE vol7d_filter_time(this, that, step, start, stopp, cyclicdt)
1378 TYPE(vol7d),INTENT(inout) :: this
1379 TYPE(vol7d),INTENT(inout) :: that
1380 TYPE(timedelta),INTENT(in),optional :: step
1381 TYPE(datetime),INTENT(in),OPTIONAL :: start
1382 TYPE(datetime),INTENT(in),OPTIONAL :: stopp
1383 TYPE(cyclicdatetime),INTENT(in),OPTIONAL :: cyclicdt
1384 
1385 TYPE(datetime) :: lstart, lstop
1386 LOGICAL, ALLOCATABLE :: time_mask(:)
1387 
1388 CALL safe_start_stop(this, lstart, lstop, start, stopp)
1389 IF (.NOT. c_e(lstart) .OR. .NOT. c_e(lstop)) RETURN
1390 
1391 CALL l4f_log(l4f_info, 'vol7d_filter_time: time interval '//trim(to_char(lstart))// &
1392  ' '//trim(to_char(lstop)))
1393 
1394 ALLOCATE(time_mask(SIZE(this%time)))
1395 
1396 time_mask = this%time >= lstart .AND. this%time <= lstop
1397 
1398 IF (PRESENT(cyclicdt)) THEN
1399  IF (c_e(cyclicdt)) THEN
1400  time_mask = time_mask .AND. this%time == cyclicdt
1401  ENDIF
1402 ENDIF
1403 
1404 IF (PRESENT(step)) THEN
1405  IF (c_e(step)) THEN
1406  time_mask = time_mask .AND. mod(this%time - lstart, step) == timedelta_0
1407  ENDIF
1408 ENDIF
1409 
1410 CALL vol7d_copy(this,that, ltime=time_mask)
1411 
1412 DEALLOCATE(time_mask)
1413 
1414 END SUBROUTINE vol7d_filter_time
1415 
1416 
1420 SUBROUTINE vol7d_fill_data(this, step, start, stopp, tolerance)
1421 TYPE(vol7d),INTENT(inout) :: this
1422 TYPE(timedelta),INTENT(in) :: step
1423 TYPE(datetime),INTENT(in),OPTIONAL :: start
1424 TYPE(datetime),INTENT(in),OPTIONAL :: stopp
1425 TYPE(timedelta),INTENT(in),optional :: tolerance
1426 
1427 TYPE(datetime) :: lstart, lstop
1428 integer :: indana , indtime ,indlevel ,indtimerange ,inddativarr, indnetwork, iindtime
1429 type(timedelta) :: deltato,deltat, ltolerance
1430 
1431 CALL safe_start_stop(this, lstart, lstop, start, stopp)
1432 IF (.NOT. c_e(lstart) .OR. .NOT. c_e(lstop)) RETURN
1433 
1434 CALL l4f_log(l4f_info, 'vol7d_fill_data: time interval '//trim(to_char(lstart))// &
1435  ' '//trim(to_char(lstop)))
1436 
1437 
1438 ltolerance=step/2
1439 
1440 if (present(tolerance))then
1441  if (c_e(tolerance)) ltolerance=tolerance
1442 end if
1443 
1444 
1445 do indtime=1,size(this%time)
1446 
1447  IF (this%time(indtime) < lstart .OR. this%time(indtime) > lstop .OR. &
1448  mod(this%time(indtime) - lstart, step) /= timedelta_0) cycle
1449  do indtimerange=1,size(this%timerange)
1450  if (this%timerange(indtimerange)%timerange /= 254) cycle
1451  do indnetwork=1,size(this%network)
1452  do inddativarr=1,size(this%dativar%r)
1453  do indlevel=1,size(this%level)
1454  do indana=1,size(this%ana)

Generated with Doxygen.