libsim  Versione 7.1.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 1272 del file vol7d_class_compute.F90.

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

Generated with Doxygen.