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