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