[cdftools] 157/228: AL+JMM: fix problems in cdfnan and add test for huge values as well. ( +Infinity > huge ! )

Alastair McKinstry mckinstry at moszumanska.debian.org
Fri Jun 12 08:21:43 UTC 2015


This is an automated email from the git hooks/post-receive script.

mckinstry pushed a commit to branch master
in repository cdftools.

commit 58c24dd95e09189456972cc4247d53bf541747a2
Author: molines <molines at 1055176f-818a-41d9-83e1-73fbe5b947c5>
Date:   Tue Jun 5 09:15:32 2012 +0000

    AL+JMM: fix problems in cdfnan and add test for huge values as well. ( +Infinity > huge ! )
    
    
    git-svn-id: http://servforge.legi.grenoble-inp.fr/svn/CDFTOOLS/trunk@605 1055176f-818a-41d9-83e1-73fbe5b947c5
---
 cdfnan.f90 | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/cdfnan.f90 b/cdfnan.f90
index 33dbcb9..e9be2ee 100644
--- a/cdfnan.f90
+++ b/cdfnan.f90
@@ -49,6 +49,7 @@ PROGRAM cdfnan
      PRINT *,'     PURPOSE :'
      PRINT *,'       Detect NaN values in the input files, and change them to '
      PRINT *,'       either spval (missing_value) or the value given as option.'
+     PRINT *,'       Does the same for absolute values > huge(0.0)'
      PRINT *,'      '
      PRINT *,'     ARGUMENTS :'
      PRINT *,'       list of model output files. They must be of same type and have'
@@ -66,14 +67,13 @@ PROGRAM cdfnan
 
   ijarg=1
   DO WHILE ( ijarg <= narg )
-     CALL getarg(ijarg, cldum) ; ijarg = ijarg + 1
+     CALL getarg(ijarg, cldum) ;   ijarg = ijarg + 1
      SELECT CASE (cldum)
-     CASE ('-value' ) 
+     CASE ('-value' )
         CALL getarg( ijarg, cldum) ; ijarg = ijarg+1 ; 
         READ(cldum,*) replace ; l_replace=.true.
      CASE DEFAULT
-        CALL getarg( ijarg, cf_inout)
-        ijarg = ijarg + 1
+        cf_inout=TRIM(cldum)
      END SELECT
   END DO
   IF ( chkfile (cf_inout) )  STOP ! missing file
@@ -141,7 +141,9 @@ PROGRAM cdfnan
                     ! isnan function is not available on xlf90 compiler
                     ! we replace it by the following test that gives the same results
                     ! reference : http://www.unixguide.net/ibm/faq/faq3.03.shtml
-                    WHERE( tab(:,:) /= tab(:,:) ) tab(:,:) = zspval
+                    WHERE( tab(:,:) /=  tab(:,:) ) tab(:,:) = zspval
+                    WHERE( tab(:,:) < -huge(0.0) ) tab(:,:) = zspval
+                    WHERE( tab(:,:) >  huge(0.0) ) tab(:,:) = zspval
                     ierr = putvar(ncid, id_var(jvar), tab, jk, npiglo, npjglo, ktime=jt)
                  ENDDO
               END DO

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/cdftools.git



More information about the debian-science-commits mailing list