Index: /issm/trunk-jpl/test/MITgcm/code/SIZE.h
===================================================================
--- /issm/trunk-jpl/test/MITgcm/code/SIZE.h	(revision 18535)
+++ /issm/trunk-jpl/test/MITgcm/code/SIZE.h	(revision 18535)
@@ -0,0 +1,64 @@
+C $Header: /u/gcmpack/MITgcm/model/inc/SIZE.h,v 1.28 2009/05/17 21:15:07 jmc Exp $
+C $Name:  $
+C
+CBOP
+C    !ROUTINE: SIZE.h
+C    !INTERFACE:
+C    include SIZE.h
+C    !DESCRIPTION: \bv
+C     *==========================================================*
+C     | SIZE.h Declare size of underlying computational grid.     
+C     *==========================================================*
+C     | The design here support a three-dimensional model grid    
+C     | with indices I,J and K. The three-dimensional domain      
+C     | is comprised of nPx*nSx blocks of size sNx along one axis 
+C     | nPy*nSy blocks of size sNy along another axis and one     
+C     | block of size Nz along the final axis.                    
+C     | Blocks have overlap regions of size OLx and OLy along the 
+C     | dimensions that are subdivided.                           
+C     *==========================================================*
+C     \ev
+CEOP
+C     Voodoo numbers controlling data layout.
+C     sNx :: No. X points in sub-grid.
+C     sNy :: No. Y points in sub-grid.
+C     OLx :: Overlap extent in X.
+C     OLy :: Overlat extent in Y.
+C     nSx :: No. sub-grids in X.
+C     nSy :: No. sub-grids in Y.
+C     nPx :: No. of processes to use in X.
+C     nPy :: No. of processes to use in Y.
+C     Nx  :: No. points in X for the total domain.
+C     Ny  :: No. points in Y for the total domain.
+C     Nr  :: No. points in Z for full process domain.
+      INTEGER sNx
+      INTEGER sNy
+      INTEGER OLx
+      INTEGER OLy
+      INTEGER nSx
+      INTEGER nSy
+      INTEGER nPx
+      INTEGER nPy
+      INTEGER Nx
+      INTEGER Ny
+      INTEGER Nr
+      PARAMETER (
+     &           sNx =  10,
+     &           sNy =  10,
+     &           OLx =   3,
+     &           OLy =   3,
+     &           nSx =   1,
+     &           nSy =   1,
+     &           nPx = 2,
+     &           nPy = 4,
+     &           Nx  = sNx*nSx*nPx,
+     &           Ny  = sNy*nSy*nPy,
+     &           Nr  =  30)
+
+C     MAX_OLX :: Set to the maximum overlap region size of any array
+C     MAX_OLY    that will be exchanged. Controls the sizing of exch
+C                routine buffers.
+      INTEGER MAX_OLX
+      INTEGER MAX_OLY
+      PARAMETER ( MAX_OLX = OLx,
+     &            MAX_OLY = OLy )
Index: /issm/trunk-jpl/test/MITgcm/code/SIZE.h.bak
===================================================================
--- /issm/trunk-jpl/test/MITgcm/code/SIZE.h.bak	(revision 18535)
+++ /issm/trunk-jpl/test/MITgcm/code/SIZE.h.bak	(revision 18535)
@@ -0,0 +1,64 @@
+C $Header: /u/gcmpack/MITgcm/model/inc/SIZE.h,v 1.28 2009/05/17 21:15:07 jmc Exp $
+C $Name:  $
+C
+CBOP
+C    !ROUTINE: SIZE.h
+C    !INTERFACE:
+C    include SIZE.h
+C    !DESCRIPTION: \bv
+C     *==========================================================*
+C     | SIZE.h Declare size of underlying computational grid.     
+C     *==========================================================*
+C     | The design here support a three-dimensional model grid    
+C     | with indices I,J and K. The three-dimensional domain      
+C     | is comprised of nPx*nSx blocks of size sNx along one axis 
+C     | nPy*nSy blocks of size sNy along another axis and one     
+C     | block of size Nz along the final axis.                    
+C     | Blocks have overlap regions of size OLx and OLy along the 
+C     | dimensions that are subdivided.                           
+C     *==========================================================*
+C     \ev
+CEOP
+C     Voodoo numbers controlling data layout.
+C     sNx :: No. X points in sub-grid.
+C     sNy :: No. Y points in sub-grid.
+C     OLx :: Overlap extent in X.
+C     OLy :: Overlat extent in Y.
+C     nSx :: No. sub-grids in X.
+C     nSy :: No. sub-grids in Y.
+C     nPx :: No. of processes to use in X.
+C     nPy :: No. of processes to use in Y.
+C     Nx  :: No. points in X for the total domain.
+C     Ny  :: No. points in Y for the total domain.
+C     Nr  :: No. points in Z for full process domain.
+      INTEGER sNx
+      INTEGER sNy
+      INTEGER OLx
+      INTEGER OLy
+      INTEGER nSx
+      INTEGER nSy
+      INTEGER nPx
+      INTEGER nPy
+      INTEGER Nx
+      INTEGER Ny
+      INTEGER Nr
+      PARAMETER (
+     &           sNx =  20,
+     &           sNy =  20,
+     &           OLx =   3,
+     &           OLy =   3,
+     &           nSx =   1,
+     &           nSy =   1,
+     &           nPx =   1,
+     &           nPy =   2,
+     &           Nx  = sNx*nSx*nPx,
+     &           Ny  = sNy*nSy*nPy,
+     &           Nr  =  30)
+
+C     MAX_OLX :: Set to the maximum overlap region size of any array
+C     MAX_OLY    that will be exchanged. Controls the sizing of exch
+C                routine buffers.
+      INTEGER MAX_OLX
+      INTEGER MAX_OLY
+      PARAMETER ( MAX_OLX = OLx,
+     &            MAX_OLY = OLy )
Index: /issm/trunk-jpl/test/MITgcm/get_mitgcm.sh
===================================================================
--- /issm/trunk-jpl/test/MITgcm/get_mitgcm.sh	(revision 18535)
+++ /issm/trunk-jpl/test/MITgcm/get_mitgcm.sh	(revision 18535)
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+if [ -e ~/.bashrc ]; then 
+	source ~/.bashrc
+fi
+
+# Download fresh copy of MITgcm
+cd ../MITgcm/
+source install.sh
Index: /issm/trunk-jpl/test/MITgcm/input/data
===================================================================
--- /issm/trunk-jpl/test/MITgcm/input/data	(revision 18535)
+++ /issm/trunk-jpl/test/MITgcm/input/data	(revision 18535)
@@ -0,0 +1,74 @@
+# ====================
+# | Model parameters |
+# ====================
+#
+# Continuous equation parameters
+ &PARM01
+ Tref = 30*-1.9,
+ Sref = 30*34.4,
+ viscAz=1.E-3,
+ viscAh=600.0,
+ no_slip_sides=.FALSE.,
+ no_slip_bottom=.FALSE.,
+ diffKhT=100.0,
+ diffKzT=5.E-5,
+ diffKhS=100.0,
+ diffKzS=5.E-5,
+ bottomDragQuadratic=2.5E-3,
+ eosType='JMD95Z', 
+ HeatCapacity_cp = 3974.0,
+ rhoConst=1030.,
+ rhoNil=1030.,
+ gravity=9.81,
+ convertFW2Salt = 33.4,
+ rigidLid=.FALSE.,
+ implicitFreeSurface=.TRUE.,
+ exactConserv=.TRUE.,
+ hFacMin=0.05,
+ nonHydrostatic=.FALSE.,
+ globalfiles = .TRUE.,
+ useSingleCpuIO = .TRUE.,
+ &
+
+# Elliptic solver parameters
+ &PARM02
+ cg2dMaxIters=1000,
+ cg2dTargetResidual=1.E-13,
+ cg3dMaxIters=400,
+ cg3dTargetResidual=1.E-13,
+ &
+
+# Time stepping parameters
+ &PARM03
+ startTime=0.,
+ endTime=2592000.,
+ deltaT=1200.0,
+ abEps=0.1,
+ cAdjFreq = 1.,
+ pChkptFreq=2592000.,
+ chkptFreq=0.,
+ dumpFreq=0.,
+ taveFreq=2592000.,
+ monitorFreq=86400.,
+ monitorSelect=2,
+ &
+
+# Gridding parameters
+ &PARM04
+ usingSphericalPolarGrid=.TRUE.,
+ xgOrigin = 0.0,
+ ygOrigin = -80.0,
+ delX = 20*0.25,
+ delY = 40*0.05,
+ delZ = 30*30.0,
+ &
+
+# Input datasets
+ &PARM05
+ bathyFile       = 'bathymetry.bin',
+ hydrogSaltFile  = 'Salt.bin',
+ hydrogThetaFile = 'Theta.bin',
+ uVelInitFile    = 'Uvel.bin',
+ vVelInitFile    = 'Vvel.bin',
+ pSurfInitFile   = 'Etan.bin',
+ &
Index: /issm/trunk-jpl/test/MITgcm/input/data.obcs
===================================================================
--- /issm/trunk-jpl/test/MITgcm/input/data.obcs	(revision 18535)
+++ /issm/trunk-jpl/test/MITgcm/input/data.obcs	(revision 18535)
@@ -0,0 +1,18 @@
+# ***************
+# Open boundaries
+# ***************
+ &OBCS_PARM01
+ OB_Iwest = 40*1,
+ OB_Ieast = 40*-1,
+#
+ useOBCSprescribe = .TRUE.,
+#
+ OBWsFile = 'OBs.bin',
+ OBWtFile = 'OBt.bin',
+ OBWuFile = 'OBu.bin',
+ OBWvFile = 'zeros.bin',
+ OBEsFile = 'OBs.bin',
+ OBEtFile = 'OBt.bin',
+ OBEuFile = 'OBu.bin',
+ OBEvFile = 'zeros.bin',
+ &
Index: /issm/trunk-jpl/test/MITgcm/input/data.pkg
===================================================================
--- /issm/trunk-jpl/test/MITgcm/input/data.pkg	(revision 18535)
+++ /issm/trunk-jpl/test/MITgcm/input/data.pkg	(revision 18535)
@@ -0,0 +1,5 @@
+# Packages
+ &PACKAGES
+ useShelfIce = .TRUE.,
+ useOBCS     = .TRUE.,
+ &
Index: /issm/trunk-jpl/test/MITgcm/input/data.shelfice
===================================================================
--- /issm/trunk-jpl/test/MITgcm/input/data.shelfice	(revision 18535)
+++ /issm/trunk-jpl/test/MITgcm/input/data.shelfice	(revision 18535)
@@ -0,0 +1,9 @@
+# ===================================
+# | Parameters for SHELFICE package |
+# ===================================
+ &SHELFICE_PARM01
+ SHELFICEconserve = .TRUE.,
+ SHELFICEboundaryLayer = .TRUE.,
+ SHELFICEtopoFile='icetopo.bin',
+ SHELFICEwriteState = .TRUE.,
+ &
Index: /issm/trunk-jpl/test/MITgcm/input/eedata
===================================================================
--- /issm/trunk-jpl/test/MITgcm/input/eedata	(revision 18535)
+++ /issm/trunk-jpl/test/MITgcm/input/eedata	(revision 18535)
@@ -0,0 +1,9 @@
+# Example "eedata" file
+# Lines beginning "#" are comments
+# nTx - No. threads per process in X
+# nTy - No. threads per process in Y
+ &EEPARMS
+ &
+# Note: Some systems use & as the
+# namelist terminator. Other systems
+# use a / character (as shown here).
Index: /issm/trunk-jpl/test/MITgcm/install.sh
===================================================================
--- /issm/trunk-jpl/test/MITgcm/install.sh	(revision 18535)
+++ /issm/trunk-jpl/test/MITgcm/install.sh	(revision 18535)
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+#Some cleanup
+\rm -rf install
+
+#Add cvs repository
+export CVSROOT=':pserver:cvsanon@mitgcm.org:/u/gcmpack'
+
+#Download code from server
+echo loging into MITgcm CVS server
+echo enter MITgcm CVS password: cvsanon
+#Login only the first time
+#cvs login
+cvs co -P MITgcm_code
+
+#Move
+mv MITgcm install
Index: /issm/trunk-jpl/test/MITgcm/tools/myint2str.m
===================================================================
--- /issm/trunk-jpl/test/MITgcm/tools/myint2str.m	(revision 18535)
+++ /issm/trunk-jpl/test/MITgcm/tools/myint2str.m	(revision 18535)
@@ -0,0 +1,12 @@
+function s=myint2str(x,n);
+%MYIN2STR(X,N)   convert integer to string with leading zeros
+%                padds integer X with zeros to N locations
+
+if nargin < 2, n=2;  end
+if nargin < 1, help myint2str, return, end
+
+s=int2str(x);
+n=n-length(s);
+for i=1:n
+  s=['0' s];
+end
Index: /issm/trunk-jpl/test/MITgcm/tools/readbin.m
===================================================================
--- /issm/trunk-jpl/test/MITgcm/tools/readbin.m	(revision 18535)
+++ /issm/trunk-jpl/test/MITgcm/tools/readbin.m	(revision 18535)
@@ -0,0 +1,68 @@
+function fld=readbin(fnam,siz,typ,prec,skip,mform)
+
+% Function fld=readbin(fnam,siz,typ,prec,skip,mform)
+% read in N-D binary field
+%
+% INPUTS
+% fnam  input path and file name
+% siz   grid dimension (default [360 224 46])
+% typ   0: sequential FORTRAN;  1: plain binary (the default)
+% prec  numeric precision (see fread; default: 'real*4')
+% skip  records to skip before reading (default 0)
+% mform machine format (see fopen; default: 'ieee-be')
+%
+% OUTPUTS
+% fld    output array of dimension siz
+%
+% SEE ALSO
+% read_ijk read_ijkt writebin
+
+if nargin < 6, mform='ieee-be'; end
+if nargin < 5, skip=0; end
+if nargin < 4, prec='real*4'; end
+if nargin < 3, typ=1; end
+if nargin < 2, siz=[360 224 46]; end
+if nargin < 1, error('please specify input file name'); end
+
+fid=fopen(fnam,'r',mform);
+
+if skip>0
+  if typ==0
+    for n=1:skip
+      tmp=read_record(fid,prec);
+    end
+  else
+    switch prec
+      case {'int8','integer*1'}
+        reclength=prod(siz);
+      case {'int16','integer*2','uint16','integer*2'}
+        reclength=2*prod(siz);
+      case {'int32','integer*4','uint32','single','real*4','float32'}
+        reclength=4*prod(siz);
+      case {'int64','integer*8','uint64','double','real*8','float64'}
+        reclength=8*prod(siz);
+    end
+    if(fseek(fid,skip*reclength,'bof')<0), error('past end of file'); end
+  end
+end
+
+switch typ
+  case 0
+    tmp=read_record(fid,prec);
+  case 1
+    tmp=fread(fid,[siz(1),prod(siz(2:length(siz)))],prec);
+end
+fid=fclose(fid);
+
+switch length(siz)
+  case 2
+    fld=reshape(tmp,siz(1),siz(2));
+  case 3
+    fld=reshape(tmp,siz(1),siz(2),siz(3));
+  case 4
+    fld=reshape(tmp,siz(1),siz(2),siz(3),siz(4));
+  case 5
+    fld=reshape(tmp,siz(1),siz(2),siz(3),siz(4),siz(5));
+  otherwise
+    fld=tmp;
+end
