Debian Codegraph @

packages/seacas/applications/blot/cfvmax.f

raw
1 C Copyright(C) 1999-2020 National Technology & Engineering Solutions
2 C of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with
3 C NTESS, the U.S. Government retains certain rights in this software.
4 C
5 C See packages/seacas/LICENSE for details
6
7 C=======================================================================
8 SUBROUTINE CFVMAX (NUMFAC, VARFAC, NMIN, NMAX, FMIN, FMAX)
9 C=======================================================================
10
11 C --*** CFVMAX *** (DETOUR) Calculate face variable min/max and count number
12 C -- Written by Amy Gilkey - revised 03/09/88
13 C --
14 C --CFVMAX calculates the minimum and maximum value of a face variable
15 C --and counts the number of occurrences of the minimum and maximum.
16 C --
17 C --Parameters:
18 C -- NUMFAC - IN - the number of surface faces
19 C -- VARFAC - IN - the face variable values
20 C -- NMIN, NMAX - OUT - the number of variables values matching the
21 C -- minimum and the maximum
22 C -- FMIN, FMAX - OUT - the face variable minimums and maximums
23
24 REAL VARFAC(*)
25
26 LOGICAL INIT
27
28 NMIN = 0
29 NMAX = 0
30 FMIN = 0.0
31 FMAX = 0.0
32 INIT = .TRUE.
33 DO 100 IFAC = 1, NUMFAC
34 IF (INIT) THEN
35 FMIN = VARFAC(IFAC)
36 NMIN = 1
37 FMAX = VARFAC(IFAC)
38 NMAX = 1
39 INIT = .FALSE.
40 ELSE
41 IF (FMIN .GE. VARFAC(IFAC)) THEN
42 IF (FMIN .EQ. VARFAC(IFAC)) THEN
43 NMIN = NMIN + 1
44 ELSE
45 FMIN = VARFAC(IFAC)
46 NMIN = 1
47 END IF
48 END IF
49 IF (FMAX .LE. VARFAC(IFAC)) THEN
50 IF (FMAX .EQ. VARFAC(IFAC)) THEN
51 NMAX = NMAX + 1
52 ELSE
53 FMAX = VARFAC(IFAC)
54 NMAX = 1
55 END IF
56 END IF
57 END IF
58 100 CONTINUE
59
60 RETURN
61 END