|
Last change
on this file was
5718,
checked in by yann meurdesoif, 8 months ago
|
|
Manage isnan non standard fortran intrinsic function with wrapper that switch to ieee_is_nan when preprocessing key CPP_USE_IEEE_IS_NAN is set.
This is mandatory for nvdia compiler that is not accept the isnan function. Due to not well understood side effect with MPI initialization on irene, for now we offer the 2 possibility, and by default, CPP_USE_IEEE_IS_NAN is set only for nvidia compilers.
YM
|
|
File size:
842 bytes
|
| Line | |
|---|
| 1 | SUBROUTINE checknanqfi(zq,qmin,qmax,comment) |
|---|
| 2 | USE dimphy |
|---|
| 3 | USE lmdz_is_nan, ONLY : is_nan |
|---|
| 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 (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 | |
|---|
| 33 | END SUBROUTINE checknanqfi |
|---|
Note: See
TracBrowser
for help on using the repository browser.