-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmaxmin.src
More file actions
51 lines (51 loc) · 1.56 KB
/
Copy pathmaxmin.src
File metadata and controls
51 lines (51 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include "zeus2d.def"
c=======================================================================
c////////////////////////// SUBROUTINE MAXMIN \\\\\\\\\\\\\\\\\\\\\\\\
c
subroutine maxmin(qin,q1,q2,ii,io,js,je,qmin,qmax)
c
c PURPOSE: This subroutine returns the minimum and maximum of the
c 2-D zone centered array qin over all active grid zones. Uneven
c boundaries, eg steps and jumps, can be accounted for.
c
c INPUT ARGUMENTS:
c qin = the 2-D array to be searched
c q1,q2 = 1-D worker arrays with dimensions of the trailin index of q
c ii,io = vectors of starting and ending indices in the 1-direction
c (permits using uneven boundaries, eg steps and jumps)
c js,je = scalars of smallest starting index and largest ending index
c in 2-direction
c
c OUTPUT ARGUMENTS:
c qmin = minimum value
c qmax = maximum value
c
c LOCALS:
c----------------------------------------------------------------------
implicit NONE
#include "param.h"
REAL qin(in,jn),q1(jn),q2(jn),qmin,qmax
integer ii(jn),io(jn),js,je
c
integer i,j
c\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\///////////////////////////////////
c=======================================================================
c
do 20 j=js,je
q1(j)= qin(ii(j),j)
q2(j)= qin(ii(j),j)
do 10 i=ii(j),io(j)
q1(j) = max(q1(j), qin(i,j))
q2(j) = min(q2(j), qin(i,j))
10 continue
20 continue
c
qmax = q1(js)
qmin = q2(js)
do 30 j=js,je
qmax = max(qmax, q1(j))
qmin = min(qmin, q2(j))
30 continue
c
return
end