- Timestamp:
- May 14, 2018, 11:52:50 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/module_scientific.f90
r1782 r1913 21 21 ! look_clockwise_borders: Subroutine to look clock-wise for a next point within a collection of borders 22 22 ! (limits of a region) 23 ! NcountR: Subroutine to count real values 23 24 ! paths_border: Subroutine to search the paths of a border field. 24 25 ! path_properties: Subroutine to determine the properties of a path … … 3572 3573 END SUBROUTINE StatsR_k 3573 3574 3575 SUBROUTINE NcountR(values, d1, Ndiffvals, counts) 3576 ! Subroutine to count real values 3577 3578 IMPLICIT NONE 3579 3580 INTEGER, INTENT(in) :: d1 3581 REAL(r_k), DIMENSION(d1), INTENT(in) :: values 3582 INTEGER, INTENT(out) :: Ndiffvals 3583 REAL(r_k), DIMENSION(d1,2), INTENT(out) :: counts 3584 ! Local 3585 INTEGER :: i, ival 3586 REAL(r_k), DIMENSION(d1) :: diffv 3587 3588 !!!!!!! Variables 3589 ! values: values to count 3590 ! counts: counts of time for each value 3591 3592 fname = 'NcountR' 3593 3594 counts = -1. 3595 3596 counts(1,1) = values(1) 3597 counts(1,2) = 1 3598 Ndiffvals = 1 3599 DO i=2,d1 3600 diffv(1:Ndiffvals) = counts(1:Ndiffvals,1) - values(i) 3601 IF (ANY(diffv(1:Ndiffvals) == 0)) THEN 3602 ival = Index1DArrayR(counts(1:Ndiffvals,1), Ndiffvals, values(i)) 3603 counts(ival,2) = counts(ival,2) + 1 3604 ELSE 3605 Ndiffvals = Ndiffvals + 1 3606 counts(Ndiffvals,1) = values(i) 3607 counts(Ndiffvals,2) = 1 3608 END IF 3609 END DO 3610 3611 END SUBROUTINE NcountR 3612 3574 3613 END MODULE module_scientific
Note: See TracChangeset
for help on using the changeset viewer.