Debian Codegraph @

packages/seacas/applications/blot/cnvmax.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 CNVMAX (NUMNPF, VARNP, IN2ELB, NMIN, NMAX, FMIN, FMAX)
9 C=======================================================================
10
11 C --*** CNVMAX *** (DETOUR) Calculate nodal variable min/max and count number
12 C -- Written by Amy Gilkey - revised 03/09/88
13 C --
14 C --CNVMAX calculates the minimum and maximum value of a nodal variable
15 C --and counts the number of occurrences of the minimum and maximum.
16 C --
17 C --Parameters:
18 C -- NUMNPF - IN - the number of nodes
19 C -- VARNP - IN - the nodal variable values
20 C -- IN2ELB - IN - the element block for each node;
21 C -- <0 if not in any selected element block
22 C -- =0 if in more than one selected element block
23 C -- NMIN, NMAX - OUT - the number of variables values matching the
24 C -- minimum and the maximum
25 C -- FMIN, FMAX - OUT - the nodal variable minimums and maximums
26
27 REAL VARNP(*)
28 INTEGER IN2ELB(*)
29
30 LOGICAL INIT
31
32 NMIN = 0
33 NMAX = 0
34 FMIN = 0.0
35 FMAX = 0.0
36 INIT = .TRUE.
37 DO 100 INP = 1, NUMNPF
38 IF (IN2ELB(INP) .GE. 0) THEN
39 IF (INIT) THEN
40 FMIN = VARNP(INP)
41 NMIN = 1
42 FMAX = VARNP(INP)
43 NMAX = 1
44 INIT = .FALSE.
45 ELSE
46 IF (FMIN .GE. VARNP(INP)) THEN
47 IF (FMIN .EQ. VARNP(INP)) THEN
48 NMIN = NMIN + 1
49 ELSE
50 FMIN = VARNP(INP)
51 NMIN = 1
52 END IF
53 END IF
54 IF (FMAX .LE. VARNP(INP)) THEN
55 IF (FMAX .EQ. VARNP(INP)) THEN
56 NMAX = NMAX + 1
57 ELSE
58 FMAX = VARNP(INP)
59 NMAX = 1
60 END IF
61 END IF
62 END IF
63 END IF
64 100 CONTINUE
65
66 RETURN
67 END