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

Last change on this file since 5158 was 5158, checked in by abarral, 3 months ago

Add missing klon on strataer_emiss_mod.F90
Correct various missing explicit declarations
Replace tabs by spaces (tabs are not part of the fortran charset)
Continue cleaning modules
Removed unused arguments and variables

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