1 | subroutine minmaxsource(zq,qmin,qmax,comment) |
---|
2 | |
---|
3 | USE dimphy |
---|
4 | USE infotrac_phy, ONLY: nbtr |
---|
5 | |
---|
6 | ! character*20 comment |
---|
7 | character(len=*) :: comment |
---|
8 | real :: qmin,qmax,zqmin,zqmax |
---|
9 | real :: zq(klon,nbtr) |
---|
10 | |
---|
11 | integer :: ijmin, lmin, ijlmin |
---|
12 | integer :: ijmax, lmax, ijlmax |
---|
13 | integer :: ismin,ismax |
---|
14 | |
---|
15 | ijlmin=ismin(klon*nbtr,zq,1) |
---|
16 | lmin=(ijlmin-1)/klon+1 |
---|
17 | ijmin=ijlmin-(lmin-1)*klon |
---|
18 | zqmin=zq(ijmin,lmin) |
---|
19 | |
---|
20 | ijlmax=ismax(klon*nbtr,zq,1) |
---|
21 | lmax=(ijlmax-1)/klon+1 |
---|
22 | ijmax=ijlmax-(lmax-1)*klon |
---|
23 | zqmax=zq(ijmax,lmax) |
---|
24 | |
---|
25 | if(zqmin.lt.qmin.or.zqmax.gt.qmax) & |
---|
26 | write(*,9999) comment, & |
---|
27 | ijmin,lmin,zqmin,ijmax,lmax,zqmax |
---|
28 | |
---|
29 | return |
---|
30 | 9999 format(a20,2(' q(',i4,',',i2,')=',e12.5)) |
---|
31 | end subroutine minmaxsource |
---|