[cdftools] 81/228: RD: add improvement for ORCA2

Alastair McKinstry mckinstry at moszumanska.debian.org
Fri Jun 12 08:21:31 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 a2212a8fec903b128d3ddb9d8e1fe3537417c47a
Author: dussin <dussin at 1055176f-818a-41d9-83e1-73fbe5b947c5>
Date:   Fri Jan 21 14:31:34 2011 +0000

    RD: add improvement for ORCA2
    
    
    git-svn-id: http://servforge.legi.grenoble-inp.fr/svn/CDFTOOLS/trunk@406 1055176f-818a-41d9-83e1-73fbe5b947c5
---
 cdf2matlab.f90 | 31 ++++++++++++++++++++++++++++++-
 1 file changed, 30 insertions(+), 1 deletion(-)

diff --git a/cdf2matlab.f90 b/cdf2matlab.f90
index 5550d85..ee400dd 100755
--- a/cdf2matlab.f90
+++ b/cdf2matlab.f90
@@ -19,13 +19,14 @@ PROGRAM cdf2matlab
 
   !! * Local variables
   IMPLICIT NONE
-  INTEGER   :: jj
+  INTEGER   :: ji, jj
   INTEGER   :: narg, iargc                           !: 
   INTEGER   :: npiglo, npjglo, npk, npiglox2         !: size of the domain
   INTEGER   :: zlev , zindex, ztmp
   INTEGER, DIMENSION(3) :: ipk, id_varout
   REAL(KIND=4) , DIMENSION(:,:), ALLOCATABLE :: zlon, zlat, zvar          ! input arrays
   REAL(KIND=4) , DIMENSION(:,:), ALLOCATABLE :: zlonout, zlatout, zvarout ! output arrays
+  REAL(KIND=4) , DIMENSION(:,:), ALLOCATABLE :: zlonwork, zlatwork, zvarwork ! working arrays arrays
   REAL(KIND=4) , DIMENSION(1)                :: timean
 
   CHARACTER(LEN=256) :: cfile, cvarin, cdum, cfileout='output.nc'        !: file name
@@ -115,6 +116,34 @@ PROGRAM cdf2matlab
 
   END DO
 
+  ! Special treatement for ORCA2
+
+  IF ( ( npiglo .EQ. 182 ) .AND. ( npjglo .EQ. 149 ) ) THEN
+     PRINT *, 'Assuming that config is ORCA2'
+
+     ALLOCATE( zvarwork(npiglox2,npjglo),zlonwork(npiglox2,npjglo),zlatwork(npiglox2,npjglo) )
+
+     !! init the arryas
+     zlonwork(:,:) = zlonout(:,:)
+     zlatwork(:,:) = zlatout(:,:)
+     zvarwork(:,:) = zvarout(:,:)
+
+     !! swap values to keep lon increasing 
+     zlonwork(131,:) = zlonout(130,:) ; zlonwork(npiglo+131,:) = zlonout(npiglo+130,:)
+     zlatwork(131,:) = zlatout(130,:) ; zlatwork(npiglo+131,:) = zlatout(npiglo+130,:)
+     zvarwork(131,:) = zvarout(130,:) ; zvarwork(npiglo+131,:) = zvarout(npiglo+130,:)
+
+     zlonwork(130,:) = zlonout(131,:) ; zlonwork(npiglo+130,:) = zlonout(npiglo+131,:)
+     zlatwork(130,:) = zlatout(131,:) ; zlatwork(npiglo+130,:) = zlatout(npiglo+131,:)
+     zvarwork(130,:) = zvarout(131,:) ; zvarwork(npiglo+130,:) = zvarout(npiglo+131,:)
+
+   !! swapping the arrays
+   zlonout(:,:) = zlonwork(:,:)
+   zlatout(:,:) = zlatwork(:,:)
+   zvarout(:,:) = zvarwork(:,:)
+
+   ENDIF
+
   ierr=putvar(ncout,id_varout(1), zlonout, 1, npiglox2, npjglo)
   ierr=putvar(ncout,id_varout(2), zlatout, 1, npiglox2, npjglo)
   ierr=putvar(ncout,id_varout(3), zvarout, 1, npiglox2, npjglo)

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