[cdftools] 45/228: JMM add support to 'levels' vertical dimension in cdfmoy and cdfmoy_weighted fix units in cdfsigtrp nc output

Alastair McKinstry mckinstry at moszumanska.debian.org
Fri Jun 12 08:21:27 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 29abebc2e0f30bbe52284947ab61caa8af789304
Author: molines <molines at 1055176f-818a-41d9-83e1-73fbe5b947c5>
Date:   Thu May 20 04:46:20 2010 +0000

    JMM add support to 'levels' vertical dimension in cdfmoy and cdfmoy_weighted
        fix units in cdfsigtrp nc output
    
    
    git-svn-id: http://servforge.legi.grenoble-inp.fr/svn/CDFTOOLS/trunk@321 1055176f-818a-41d9-83e1-73fbe5b947c5
---
 JOBS/monitor_prod_work.ksh | 15 ++++++++++++---
 cdfmoy.f90                 |  7 +++++--
 cdfmoy_weighted.f90        | 16 ++++++++++------
 cdfsigtrp.f90              |  4 ++--
 4 files changed, 29 insertions(+), 13 deletions(-)

diff --git a/JOBS/monitor_prod_work.ksh b/JOBS/monitor_prod_work.ksh
index 85f3564..1ecaf51 100755
--- a/JOBS/monitor_prod_work.ksh
+++ b/JOBS/monitor_prod_work.ksh
@@ -612,8 +612,8 @@ set -x
   # on a separate directory
   chkdirg ${CONFIG}/${CONFCASE}-TRPSIG/
   chkdirg ${CONFIG}/${CONFCASE}-TRPSIG/$YEAR/
-  chkdirg $DIAGS/$YEAR/
-  chkdirg $DIAGS/TRPSIG/
+  chkdirg $DIAGS/TXT/$YEAR/
+  chkdirg $DIAGS/TXT/TRPSIG/
 
   # also need temporary directories in the actual tmpdir:
   chkdir ${CONFIG}
@@ -639,6 +639,13 @@ set -x
     echo $tag > ${CONFCASE}_y${tag}_trpsig_monitor.lst
 
     cdfsigtrp $tfich $ufich $vfich 21 30 180 -bimg -print  >>  ${CONFCASE}_y${tag}_trpsig_monitor.lst
+    # save netcdf files
+    listfiles=$( ls | grep trpsig.nc  )
+
+    for file in $listfiles ; do
+        expatrie $file $DIAGS/NC ${CONFCASE}_${tag}_$file
+        mv $file ${CONFIG}/${CONFCASE}-TRPSIG/${CONFCASE}_${tag}_$file
+    done
 
     # save the monthly log file on gaya for an (improbable) eventual post processing ...
 #   expatrie ${CONFCASE}_y${tag}_trpsig_monitor.lst $TRPSIGY ${CONFCASE}_y${tag}_trpsig_monitor.lst
@@ -666,6 +673,8 @@ set -x
   # Launch post processing   ( by itself a complex script ...)
   # This script retrieve CONFIG name and CASE from the directory name where it runs...
   cd ${CONFIG}/${CONFCASE}-TRPSIG
+  # compute mean nc files
+  # ....
 
  .  $TMPDIR/trpsig_postproc.ksh
 
@@ -673,7 +682,7 @@ set -x
 
   # save results on gaya ( as many files as sections in dens_section.dat)
   for f in ${CONFCASE}_y*_trpsig.txt ; do
-    expatrie $f $DIAGS/TRPSIG/ $f
+    expatrie $f $DIAGS/TXT/TRPSIG/ $f
   done
 
    # return to tmpdir
diff --git a/cdfmoy.f90 b/cdfmoy.f90
index 1db61d2..efd0b22 100644
--- a/cdfmoy.f90
+++ b/cdfmoy.f90
@@ -73,8 +73,11 @@ PROGRAM cdfmoy
         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
+              npk = getdim (cfile,'levels',cdtrue=cdep,kstatus=istatus)
+              IF ( istatus /= 0 ) THEN 
+                PRINT *,' assume file with no depth'
+                npk=0
+              ENDIF
             ENDIF
         ENDIF
      ENDIF
diff --git a/cdfmoy_weighted.f90 b/cdfmoy_weighted.f90
index e8962a3..4b3f69c 100644
--- a/cdfmoy_weighted.f90
+++ b/cdfmoy_weighted.f90
@@ -65,15 +65,19 @@ PROGRAM cdfmoy_weighted
   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 
-! STOP 'depth dimension name not suported'
-         PRINT *,' assume file with no depth'
-         npk=0
+       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
+              npk = getdim (cfile,'levels',cdtrue=cdep,kstatus=istatus)
+              IF ( istatus /= 0 ) THEN
+                PRINT *,' assume file with no depth'
+                npk=0
+              ENDIF
+            ENDIF
         ENDIF
      ENDIF
   ENDIF
-  
 
   PRINT *, 'npiglo=', npiglo
   PRINT *, 'npjglo=', npjglo
diff --git a/cdfsigtrp.f90 b/cdfsigtrp.f90
index 940f717..d2f9722 100644
--- a/cdfsigtrp.f90
+++ b/cdfsigtrp.f90
@@ -399,7 +399,7 @@ PROGRAM cdfsigtrp
         ! (along section, depth ) 2D variables
         cdum=TRIM(csection(jsec))//'_trpdep.bimg'
         OPEN(numbimg,FILE=cdum,FORM='UNFORMATTED')
-        cdum=' 3 dimensions in this isopycnal file '
+        cdum=' 4 dimensions in this isopycnal file '
         WRITE(numbimg) cdum
         cdum=' 1: T ;  2: S ; 3: sigma ; 4: Velocity '
         WRITE(numbimg) cdum
@@ -480,7 +480,7 @@ PROGRAM cdfsigtrp
         ! netcdf output 
         DO jiso=1,nbins
            dummy1=sigma_lev(jiso)
-           dummy2=trpbin(jsec,jiso)
+           dummy2=trpbin(jsec,jiso)/1.e6
            ierr = putvar(ncout,id_varout(1), dummy1, jiso, kx, ky )
            ierr = putvar(ncout,id_varout(2), dummy2, jiso, kx, ky )
         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