SUBROUTINE minmaxsource(zq, qmin, qmax, comment) USE dimphy USE lmdz_infotrac USE lmdz_libmath, ONLY: ismax, ismin USE lmdz_dimensions, ONLY: iim, jjm, llm, ndm IMPLICIT NONE ! CHARACTER*20 comment CHARACTER(LEN = *) :: comment REAL :: qmin, qmax REAL :: zqmin, zqmax REAL :: zq(klon, nbtr) INTEGER :: ijmin, lmin, ijlmin INTEGER :: ijmax, lmax, ijlmax ijlmin = ismin(klon * nbtr, zq, 1) lmin = (ijlmin - 1) / klon + 1 ijmin = ijlmin - (lmin - 1) * klon zqmin = zq(ijmin, lmin) ijlmax = ismax(klon * nbtr, zq, 1) lmax = (ijlmax - 1) / klon + 1 ijmax = ijlmax - (lmax - 1) * klon zqmax = zq(ijmax, lmax) IF(zqminqmax) WRITE(*, 9999) comment, ijmin, lmin, zqmin, ijmax, lmax, zqmax RETURN 9999 format(a20, 2(' q(', i4, ',', i2, ')=', e12.5)) END SUBROUTINE minmaxsource