1 | SUBROUTINE minmaxqfi2(zq, qmin, qmax, comment) |
---|
2 | ! |
---|
3 | USE dimphy |
---|
4 | USE infotrac |
---|
5 | USE lmdz_libmath, ONLY: ismax, ismin |
---|
6 | INCLUDE "dimensions.h" |
---|
7 | |
---|
8 | ! character*20 comment |
---|
9 | CHARACTER(LEN = *) :: comment |
---|
10 | REAL :: qmin, qmax |
---|
11 | REAL :: zq(klon, klev) |
---|
12 | |
---|
13 | INTEGER :: ijmin, lmin, ijlmin |
---|
14 | INTEGER :: ijmax, lmax, ijlmax |
---|
15 | |
---|
16 | ijlmin = ismin(klon * klev, zq, 1) |
---|
17 | lmin = (ijlmin - 1) / klon + 1 |
---|
18 | ijmin = ijlmin - (lmin - 1) * klon |
---|
19 | zqmin = zq(ijmin, lmin) |
---|
20 | |
---|
21 | ijlmax = ismax(klon * klev, zq, 1) |
---|
22 | lmax = (ijlmax - 1) / klon + 1 |
---|
23 | ijmax = ijlmax - (lmax - 1) * klon |
---|
24 | zqmax = zq(ijmax, lmax) |
---|
25 | |
---|
26 | IF(zqmin<qmin.OR.zqmax>qmax) & |
---|
27 | WRITE(*, 9999) comment, & |
---|
28 | ijmin, lmin, zqmin, ijmax, lmax, zqmax |
---|
29 | |
---|
30 | RETURN |
---|
31 | 9999 format(a20, 2(' q(', i4, ',', i2, ')=', e12.5)) |
---|
32 | END SUBROUTINE minmaxqfi2 |
---|