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

Last change on this file since 5119 was 5117, checked in by abarral, 4 months ago

rename modules properly lmdz_*
move some unused files to obsolete/
(lint) uppercase fortran keywords

File size: 803 bytes
Line 
1SUBROUTINE 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))
32END SUBROUTINE minmaxqfi2
Note: See TracBrowser for help on using the repository browser.