[cdftools] 05/228: JMM add raz_below option to cdfbathy

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

    JMM add raz_below option to cdfbathy
    
    
    git-svn-id: http://servforge.legi.grenoble-inp.fr/svn/CDFTOOLS/trunk@281 1055176f-818a-41d9-83e1-73fbe5b947c5
---
 cdfbathy.f90 | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/cdfbathy.f90 b/cdfbathy.f90
index 6d94630..30379c2 100644
--- a/cdfbathy.f90
+++ b/cdfbathy.f90
@@ -30,7 +30,7 @@ PROGRAM cdfbathy
   INTEGER, DIMENSION(:), ALLOCATABLE :: level
   INTEGER, DIMENSION (:,:), ALLOCATABLE :: mbathy, mask
   ! REAL(KIND=4) :: e3zps_min=25, e3zps_rat=0.2
-  REAL(KIND=4) :: e3zps_min=1000, e3zps_rat=1, depmin=600.
+  REAL(KIND=4) :: e3zps_min=1000, e3zps_rat=1, depmin=600., depfill=0.
   REAL(KIND=4), DIMENSION(:), ALLOCATABLE :: gdept, gdepw, e3t, e3w
   !
   REAL(KIND=4), DIMENSION(:), ALLOCATABLE     :: h, rtime
@@ -41,6 +41,7 @@ PROGRAM cdfbathy
 
   LOGICAL :: lexist=.TRUE., lfill=.FALSE., lfullstep=.FALSE., lappend=.FALSE., lreplace=.FALSE.
   LOGICAL :: ldump = .FALSE., lmodif=.FALSE., loverwrite=.false., lraz=.false., ldumpn=.false.
+  LOGICAL :: lrazb=.false.
   INTEGER :: iversion=1, iostat, ipos
   !!
   !! 1. Initializations:
@@ -58,6 +59,7 @@ PROGRAM cdfbathy
      PRINT 9999, '   -zoom (or -z ) : sub area of the bathy file to work with (imin imax jmin jmax)'
      PRINT 9999, '   -fillzone (or -fz ) : sub area will be filled with 0 up to the first coast line '
      PRINT 9999, '   -raz_zone (or -raz ) : sub area will be filled with 0 up '
+     PRINT 9999, '   -raz_below depmin (or -rb depmin ) : any depth less than depmin in subarea will be replaced by 0 '
      PRINT 9999, '   -fullstep (or -fs ) : sub area will be reshaped as full-step, below depmin'
      PRINT 9999, '               requires the presence of the file zgr_bat.txt (from ocean.output, eg )'
      PRINT 9999, '   -dumpzone (or -d ): sub area will be output to an ascii file, which can be used by -replace'
@@ -93,6 +95,10 @@ PROGRAM cdfbathy
         lfill=.TRUE. ; lmodif=.TRUE.
      ELSE IF (cline1 == '-raz_zone' .OR. cline1 == '-raz' ) THEN
         lraz=.TRUE. ; lmodif=.TRUE.
+     ELSE IF (cline1 == '-raz_below' .OR. cline1 == '-rb' ) THEN
+        CALL getarg(jarg,cline2) ; jarg = jarg + 1
+        READ(cline2,*) depfill
+        lrazb=.TRUE. ; lmodif=.TRUE.
      ELSE IF (cline1 == '-fullstep' .OR. cline1 == '-fs' ) THEN
         lfullstep=.TRUE. ; lmodif=.TRUE.
         CALL getarg(jarg,cline2) ; jarg = jarg + 1
@@ -158,6 +164,7 @@ PROGRAM cdfbathy
   ENDIF
   IF (lfill ) CALL fillzone( imin, imax, jmin, jmax)
   IF (lraz )  CALL raz_zone( imin, imax, jmin, jmax)
+  IF (lrazb )  CALL raz_below( imin, imax, jmin, jmax, depfill)
   IF (ldump)    CALL dumpzone(cdump,imin, imax, jmin, jmax)
   IF (ldumpn)    CALL nicedumpzone(cdump,imin, imax, jmin, jmax)
   IF (lreplace) CALL replacezone(creplace)
@@ -299,6 +306,13 @@ CONTAINS
     bathy(kimin:kimax, kjmin:kjmax) = 0.
   END SUBROUTINE raz_zone
 
+  SUBROUTINE raz_below(kimin,kimax,kjmin,kjmax,pdepmin)
+    ! * Fill subzone of the bathy file
+    INTEGER,      INTENT(in) :: kimin, kimax, kjmin,kjmax
+    REAL(KIND=4), INTENT(in) :: pdepmin
+   WHERE ( bathy(kimin:kimax, kjmin:kjmax) <= pdepmin)  bathy(kimin:kimax, kjmin:kjmax) = 0.
+  END SUBROUTINE raz_below
+
 
   SUBROUTINE dumpzone(cdumpf,kimin,kimax,kjmin,kjmax)
     CHARACTER(LEN=*), INTENT(in) :: cdumpf

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