source: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/minmaxqfi2.f90

Last change on this file was 5182, checked in by abarral, 2 months ago

(WIP) Replace REPROBUS CPP KEY by logical
properly name modules

File size: 836 bytes
Line 
1SUBROUTINE minmaxqfi2(zq, qmin, qmax, comment)
2
3  USE dimphy
4  USE lmdz_infotrac
5  USE lmdz_libmath, ONLY: ismax, ismin
6
7USE 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, klev)
17
18  INTEGER :: ijmin, lmin, ijlmin
19  INTEGER :: ijmax, lmax, ijlmax
20
21  ijlmin = ismin(klon * klev, zq, 1)
22  lmin = (ijlmin - 1) / klon + 1
23  ijmin = ijlmin - (lmin - 1) * klon
24  zqmin = zq(ijmin, lmin)
25
26  ijlmax = ismax(klon * klev, 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))
35END SUBROUTINE minmaxqfi2
Note: See TracBrowser for help on using the repository browser.