[cdftools] 20/228: JMM allow z dim name in cdfbottom

Alastair McKinstry mckinstry at moszumanska.debian.org
Fri Jun 12 08:21:24 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 abf5b47950d5e7a8bcf558bc454ba8da68613f80
Author: molines <molines at 1055176f-818a-41d9-83e1-73fbe5b947c5>
Date:   Mon Mar 22 17:22:21 2010 +0000

    JMM allow z dim name in cdfbottom
    
    
    git-svn-id: http://servforge.legi.grenoble-inp.fr/svn/CDFTOOLS/trunk@296 1055176f-818a-41d9-83e1-73fbe5b947c5
---
 cdfbottom.f90 | 22 +++++++++++++++++++---
 1 file changed, 19 insertions(+), 3 deletions(-)

diff --git a/cdfbottom.f90 b/cdfbottom.f90
index a8df28f..c8fc7b1 100644
--- a/cdfbottom.f90
+++ b/cdfbottom.f90
@@ -30,7 +30,7 @@ PROGRAM cdfbottom
   INTEGER   :: nvars                               !: number of variables in the input file
   INTEGER, DIMENSION(:), ALLOCATABLE :: ipk,ipko,& !: outptut variables : number of levels,
        &               id_var,     id_varout       !: ncdf varid's
-  real(KIND=4) , DIMENSION (:,:), ALLOCATABLE :: zfield ,&   !: Array to read a layer of data
+  REAL(KIND=4) , DIMENSION (:,:), ALLOCATABLE :: zfield ,&   !: Array to read a layer of data
        &                                         zbot , &    !: array to store the bottom value
        &                                         zmask       !: 2D mask at current level
   REAL(KIND=4),DIMENSION(1)                   ::  tim
@@ -39,6 +39,7 @@ PROGRAM cdfbottom
   CHARACTER(LEN=1) :: ctype=' '
   CHARACTER(LEN=5) :: cvmask=' '                                   !: name of the mask variable
   CHARACTER(LEN=256) ,DIMENSION(:), ALLOCATABLE   :: cvarname       !: array of var name
+  CHARACTER(LEN=256) :: cdep
   
   TYPE (variable), DIMENSION(:), ALLOCATABLE :: typvar             !: structure for variable attribute
 
@@ -59,7 +60,22 @@ PROGRAM cdfbottom
   CALL getarg (1, cfile)
   npiglo= getdim (cfile,'x')
   npjglo= getdim (cfile,'y')
-  npk   = getdim (cfile,'depth')
+  npk   = getdim (cfile,'depth',cdtrue=cdep,kstatus=istatus)
+
+  IF (istatus /= 0 ) THEN
+     npk   = getdim (cfile,'z',cdtrue=cdep,kstatus=istatus)
+     IF (istatus /= 0 ) THEN
+       npk   = getdim (cfile,'sigma',cdtrue=cdep,kstatus=istatus)
+        IF ( istatus /= 0 ) THEN
+          npk = getdim (cfile,'nav_lev',cdtrue=cdep,kstatus=istatus)
+            IF ( istatus /= 0 ) THEN
+              PRINT *,' assume file with no depth'
+              npk=0
+            ENDIF
+        ENDIF
+     ENDIF
+  ENDIF
+
 
   ALLOCATE (zfield(npiglo,npjglo), zbot(npiglo,npjglo),zmask(npiglo,npjglo))
 
@@ -94,7 +110,7 @@ PROGRAM cdfbottom
 
   id_var(:)  = (/(jv, jv=1,nvars)/)
   ! ipk gives the number of level or 0 if not a T[Z]YX  variable
-  ipk(:)     = getipk (cfile,nvars)
+  ipk(:)     = getipk (cfile,nvars,cdep=cdep)
   ipko(:)= 1  ! all variables output are 2D
 
   WHERE( ipk <= 1 ) cvarname='none'

-- 
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