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

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

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

File size: 836 bytes
RevLine 
[5104]1SUBROUTINE 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]7USE 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]35END SUBROUTINE minmaxqfi2
Note: See TracBrowser for help on using the repository browser.