[cdftools] 25/228: JMM+CD modification of cdfmocsig.f90 for EIV
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 24bce16a59a7058ae2b6bdb5a1d6a93d112a51aa
Author: molines <molines at 1055176f-818a-41d9-83e1-73fbe5b947c5>
Date: Mon Apr 19 15:24:48 2010 +0000
JMM+CD modification of cdfmocsig.f90 for EIV
git-svn-id: http://servforge.legi.grenoble-inp.fr/svn/CDFTOOLS/trunk@301 1055176f-818a-41d9-83e1-73fbe5b947c5
---
cdfmean.f90 | 4 ++--
cdfmocsig.f90 | 26 ++++++++++++++++++++++----
cdfsum.f90 | 3 ++-
3 files changed, 26 insertions(+), 7 deletions(-)
diff --git a/cdfmean.f90 b/cdfmean.f90
index 3571c7c..2023372 100644
--- a/cdfmean.f90
+++ b/cdfmean.f90
@@ -230,8 +230,8 @@ PROGRAM cdfmean
DO jk = 1,nvpk
ik = jk+kmin-1
! Get velocities v at ik
- zv(:,:)= getvar(cfilev, cvar, ik ,npiglo,npjglo,kimin=imin,kjmin=jmin)
- ! zv(:,:)= getvar(cfilev, cvar, jt ,npiglo,npjglo,kimin=imin,kjmin=jmin,ktime=jt)
+! zv(:,:)= getvar(cfilev, cvar, ik ,npiglo,npjglo,kimin=imin,kjmin=jmin)
+ zv(:,:)= getvar(cfilev, cvar, ik ,npiglo,npjglo,kimin=imin,kjmin=jmin,ktime=jt)
zmask(:,:)=getvar(cmask,cvmask,ik,npiglo,npjglo,kimin=imin,kjmin=jmin)
! zmask(:,npjglo)=0.
! get e3 at level ik ( ps...)
diff --git a/cdfmocsig.f90 b/cdfmocsig.f90
index d056a6a..69a926f 100644
--- a/cdfmocsig.f90
+++ b/cdfmocsig.f90
@@ -40,7 +40,7 @@ PROGRAM cdfmocsig
INTEGER :: jpbasins
INTEGER :: jbasin, jj, jk ,ji, jkk !: dummy loop index
INTEGER :: ierr !: working integer
- INTEGER :: narg, iargc !: command line
+ INTEGER :: narg, iargc, iarg !: command line
INTEGER :: npiglo,npjglo, npk !: size of the domain
INTEGER :: ncout, np
INTEGER :: numout=10
@@ -48,7 +48,7 @@ PROGRAM cdfmocsig
INTEGER, DIMENSION(2) :: iloc
REAL(KIND=4), DIMENSION (:,:), ALLOCATABLE :: e1v, gphiv !: metrics, velocity
- REAL(KIND=4), DIMENSION (:,:), ALLOCATABLE :: zt,zs, zv, e3v !: metrics, velocity
+ REAL(KIND=4), DIMENSION (:,:), ALLOCATABLE :: zt, zs, zv, zveiv, e3v !: metrics, velocity
INTEGER, DIMENSION (:,:), ALLOCATABLE :: ibin !: integer value corresponding to the density for binning
REAL(KIND=4), DIMENSION (:,:), ALLOCATABLE :: dumlon !: dummy longitude = 0.
REAL(KIND=4), DIMENSION (:,:), ALLOCATABLE :: dumlat !: latitude for i = north pole
@@ -73,16 +73,19 @@ PROGRAM cdfmocsig
INTEGER :: istatus
LOGICAL :: lprint = .false.
+ LOGICAL :: leiv = .false.
! constants
lprint = .false.
!! Read command line and output usage message if not compliant.
narg= iargc()
IF ( narg == 0 ) THEN
- PRINT *,' Usage : cdfmocsig V_file T_file depth_ref'
+ PRINT *,' Usage : cdfmocsig V_file T_file depth_ref [-eiv]'
PRINT *,' Computes the MOC for oceanic basins as described in new_maskglo.nc'
PRINT *,' Last arguments is the reference depth for potential density, in m'
PRINT *,' actually only 0 1000 or 2000 are allowed'
+ PRINT *,' Option -eiv : takes into account VEIV Meridional eddy induced velocity'
+ PRINT *,' -> To be used only if Gent and McWilliams parameterization has been used '
PRINT *,' PARTIAL CELLS VERSION'
PRINT *,' Files mesh_hgr.nc, mesh_zgr.nc ,new_maskglo.nc ,mask.nc '
PRINT *,' must be in the current directory'
@@ -103,6 +106,11 @@ PROGRAM cdfmocsig
CALL getarg (2, cfilet)
CALL getarg (3, cdref)
READ(cdref,*) pref
+ IF (narg > 3 ) THEN
+ iarg=4
+ leiv=.TRUE.
+ ENDIF
+
npiglo= getdim (cfilev,'x')
npjglo= getdim (cfilev,'y')
npk = getdim (cfilev,'depth')
@@ -192,6 +200,9 @@ PROGRAM cdfmocsig
! Allocate arrays
ALLOCATE ( zmask(jpbasins,npiglo,npjglo) )
ALLOCATE ( zv (npiglo,npjglo), zt(npiglo,npjglo), zs(npiglo,npjglo))
+ IF ( leiv ) THEN
+ ALLOCATE ( zveiv (npiglo,npjglo))
+ END IF
ALLOCATE ( e3v(npiglo,npjglo) )
ALLOCATE ( ibin(npiglo, npjglo) )
ALLOCATE ( e1v(npiglo,npjglo), gphiv(npiglo,npjglo) ,gdepw(npk) )
@@ -247,6 +258,9 @@ PROGRAM cdfmocsig
IF (lprint) PRINT *,' working at depth ',jk
! Get velocities v at jj
zv(:,:)= getvar(cfilev, 'vomecrty', jk,npiglo,npjglo)
+ IF ( leiv ) THEN
+ zveiv(:,:)= getvar(cfilev, 'vomeeivv', jk,npiglo,npjglo)
+ END IF
zt(:,:)= getvar(cfilet, 'votemper', jk,npiglo,npjglo)
zs(:,:)= getvar(cfilet, 'vosaline', jk,npiglo,npjglo)
! get e3v at latitude jj
@@ -266,7 +280,11 @@ PROGRAM cdfmocsig
! converts transport in "k" to transport in "sigma"
! indirect adresssing - do it once and not for each basin!
DO ji=2,npiglo-1
- ztrans = e1v(ji,jj)*e3v(ji,jj)*zv(ji,jj)
+ IF ( leiv ) THEN
+ ztrans = e1v(ji,jj)*e3v(ji,jj)*(zv(ji,jj)+zveiv(ji,jj))
+ ELSE
+ ztrans = e1v(ji,jj)*e3v(ji,jj)*zv(ji,jj)
+ END IF
zomsftmp(ibin(ji,jj),ji)=zomsftmp(ibin(ji,jj),ji) - ztrans
END DO
! integrates 'zonally' (along i-coordinate)
diff --git a/cdfsum.f90 b/cdfsum.f90
index 227b539..35f5da5 100644
--- a/cdfsum.f90
+++ b/cdfsum.f90
@@ -98,7 +98,8 @@ PROGRAM cdfsum
PRINT *, 'nt =',nt
lforcing=.FALSE.
- IF ((npk .EQ. 0) .AND. (nt .GT. 1)) THEN
+! IF ((npk .EQ. 0) .AND. (nt .GT. 1)) THEN
+ IF ((npk .EQ. 0) ) THEN
lforcing=.TRUE.
npk=1
PRINT *, 'W A R N I N G : you used a forcing field'
--
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