source: LMDZ6/branches/contrails/libf/phylmd/Dust/checknanqfi.f90 @ 5445

Last change on this file since 5445 was 5354, checked in by yann meurdesoif, 3 weeks ago

function isnan() is a non-standard gnu extension and it is not compiling with nvidia compiler.
It has been standardize in fortran 2003 by using intrinsic module function ieee_is_nan()
YM

File size: 850 bytes
Line 
1SUBROUTINE checknanqfi(zq,qmin,qmax,comment)
2  USE dimphy
3  USE, intrinsic :: ieee_arithmetic
4  IMPLICIT NONE
5
6! Entrees
7  REAL,DIMENSION(klon,klev), INTENT(IN)   :: zq
8  REAL,INTENT(IN)                         :: qmin,qmax
9  CHARACTER(LEN=*),INTENT(IN)             :: comment
10
11! Local 
12  INTEGER,DIMENSION(klon)     :: jadrs
13  INTEGER                     :: i, jbad, k
14 
15  DO k = 1, klev
16     jbad = 0
17     DO i = 1, klon
18!        IF (zq(i,k).GT.qmax .OR. zq(i,k).LT.qmin) THEN
19        IF (ieee_is_nan(zq(i,k))) THEN
20           jbad = jbad + 1
21           jadrs(jbad) = i
22        ENDIF
23     ENDDO
24     IF (jbad.GT.0) THEN
25        WRITE(*,*)comment
26        DO i = 1, jbad
27           WRITE(*,*) "i,k,q=", jadrs(i),k,zq(jadrs(i),k)
28           CALL abort_physic(comment, 'NaN founded',1)
29        ENDDO
30     ENDIF
31  ENDDO
32 
33END SUBROUTINE checknanqfi
Note: See TracBrowser for help on using the repository browser.