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