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

Last change on this file since 5133 was 5117, checked in by abarral, 5 months ago

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

File size: 803 bytes
RevLine 
[5104]1SUBROUTINE minmaxqfi2(zq, qmin, qmax, comment)
2  !
3  USE dimphy
4  USE infotrac
[5116]5  USE lmdz_libmath, ONLY: ismax, ismin
[5104]6  INCLUDE "dimensions.h"
[2630]7
[5104]8  ! character*20 comment
[5116]9  CHARACTER(LEN = *) :: comment
10  REAL :: qmin, qmax
11  REAL :: zq(klon, klev)
[2630]12
[5116]13  INTEGER :: ijmin, lmin, ijlmin
14  INTEGER :: ijmax, lmax, ijlmax
[2630]15
[5104]16  ijlmin = ismin(klon * klev, zq, 1)
17  lmin = (ijlmin - 1) / klon + 1
18  ijmin = ijlmin - (lmin - 1) * klon
19  zqmin = zq(ijmin, lmin)
[2630]20
[5104]21  ijlmax = ismax(klon * klev, zq, 1)
22  lmax = (ijlmax - 1) / klon + 1
23  ijmax = ijlmax - (lmax - 1) * klon
24  zqmax = zq(ijmax, lmax)
[2630]25
[5117]26  IF(zqmin<qmin.OR.zqmax>qmax) &
[5116]27          WRITE(*, 9999) comment, &
[5104]28                  ijmin, lmin, zqmin, ijmax, lmax, zqmax
29
[5116]30  RETURN
[5104]31  9999   format(a20, 2('  q(', i4, ',', i2, ')=', e12.5))
[5116]32END SUBROUTINE minmaxqfi2
Note: See TracBrowser for help on using the repository browser.