Index: /issm/trunk-jpl/test/MITgcm/build.sh
===================================================================
--- /issm/trunk-jpl/test/MITgcm/build.sh	(revision 23073)
+++ /issm/trunk-jpl/test/MITgcm/build.sh	(revision 23074)
@@ -6,30 +6,33 @@
 modelpath="$2"
 
-if [ -e ~/.bashrc ]; then
-	source ~/.bashrc
+#if [ -e ~/.bashrc ]; then
+#    source ~/.bashrc
+#fi
+
+# Get MITgcm code, if needed
+if [ ! -d "$modelpath/../MITgcm/install" ]; then
+    cd $modelpath/../MITgcm
+    source install.sh
+    cd $modelpath
 fi
 
-# Clean up build directory
+# Create build directory, if needed
 cd $modelpath
 if [ ! -d "build" ]; then mkdir build; fi
-rm -f build/*
+cd build
 
-# Get MITgcm code, if needed
-if [ ! -d "$SLR_DIR/components/mitgcm/install" ]; then
-   cd $modelpath/../MITgcm
-   source install.sh
-   cd $modelpath
+#create MITgcm makefile for this run, if needed
+if [ ! -f Makefile ]; then
+    if [ $hostname == "pleiades" ]; then 
+	$modelpath/../MITgcm/install/tools/genmake2 -of $SLR_DIR/models/ice-ocean/configs/linux_amd64_gfortran+mpi_ice_nas -mo ../code -rd $modelpath/../MITgcm/install
+    else
+	$modelpath/../MITgcm/install/tools/genmake2 -mpi -mo $modelpath/../MITgcm/code -rd $modelpath/../MITgcm/install
+    fi
 fi
 
-#create MITgcm makefile and code links for this run
-cd build
-if [ ! -f Makefile ]; then
-
-	if [ $hostname == "pleiades" ]; then 
-		$SLR_DIR/components/mitgcm/install/tools/genmake2 -of $SLR_DIR/models/ice-ocean/configs/linux_amd64_gfortran+mpi_ice_nas -mo ../code -rd $SLR_DIR/components/mitgcm/install
-	else
-		$modelpath/../MITgcm/install/tools/genmake2 -mpi -mo $modelpath/../MITgcm/code -rd $modelpath/../MITgcm/install
-	fi
+#create MITgcm code links for this run, if needed
+if [ ! -f BUILD_INFO.h ]; then
     make depend
 fi
+
 make -j 4
Index: sm/trunk-jpl/test/MITgcm/code/SIZE.h
===================================================================
--- /issm/trunk-jpl/test/MITgcm/code/SIZE.h	(revision 23073)
+++ 	(revision )
@@ -1,64 +1,0 @@
-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/NightlyRun/test4001.m
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/test4001.m	(revision 23073)
+++ /issm/trunk-jpl/test/NightlyRun/test4001.m	(revision 23074)
@@ -136,35 +136,37 @@
 
     %specify computational grid in SIZE.h
-    fidi=fopen('../MITgcm/code/SIZE.h.bak','r');
-    fido=fopen('../MITgcm/code/SIZE.h','w');
-    tline = fgetl(fidi);
-    fprintf(fido,'%s\n',tline);
-    while 1
+    if ~exist('../MITgcm/code/SIZE.h')
+        fidi=fopen('../MITgcm/code/SIZE.h.bak','r');
+        fido=fopen('../MITgcm/code/SIZE.h','w');
         tline = fgetl(fidi);
-        if ~ischar(tline), break, end
-        %do the change here: 
-        if strcmpi(tline,'     &           sNx =  20,'),
-            fprintf(fido,'%s%i%s\n','     &           sNx =  ',round(Nx/nPx),',');
-            continue;
+        fprintf(fido,'%s\n',tline);
+        while 1
+            tline = fgetl(fidi);
+            if ~ischar(tline), break, end
+            %do the change here: 
+            if strcmpi(tline,'     &           sNx =  20,'),
+                fprintf(fido,'%s%i%s\n','     &           sNx =  ',round(Nx/nPx),',');
+                continue;
+            end
+            if strcmpi(tline,'     &           sNy =  20,'),
+                fprintf(fido,'%s%i%s\n','     &           sNy =  ',round(Ny/nPy),',');
+                continue;
+            end
+            if strcmpi(tline,'     &           nPx =   1,'),
+                fprintf(fido,'%s%i%s\n','     &           nPx = ',nPx,',');
+                continue;
+            end
+            if strcmpi(tline,'     &           nPy =   2,'),
+                fprintf(fido,'%s%i%s\n','     &           nPy = ',nPy,',');
+                continue;
+            end
+            fprintf(fido,'%s\n',tline);
         end
-        if strcmpi(tline,'     &           sNy =  20,'),
-            fprintf(fido,'%s%i%s\n','     &           sNy =  ',round(Ny/nPy),',');
-            continue;
-        end
-        if strcmpi(tline,'     &           nPx =   1,'),
-            fprintf(fido,'%s%i%s\n','     &           nPx = ',nPx,',');
-            continue;
-        end
-        if strcmpi(tline,'     &           nPy =   2,'),
-            fprintf(fido,'%s%i%s\n','     &           nPy = ',nPy,',');
-            continue;
-        end
-        fprintf(fido,'%s\n',tline);
+        %close  files
+        fclose(fidi);
+        fclose(fido);
     end
-    %close  files
-    fclose(fidi);
-    fclose(fido);
-
-	 system(['../MITgcm/build.sh generic ' pwd '/../MITgcm']);
+
+    system(['../MITgcm/build.sh generic ' pwd '/../MITgcm']);
 end
 % }}}
Index: /issm/trunk-jpl/test/NightlyRun/test4002.m
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/test4002.m	(revision 23073)
+++ /issm/trunk-jpl/test/NightlyRun/test4002.m	(revision 23074)
@@ -4,4 +4,5 @@
 %Script control parameters
 steps=[1 2 3 4 5 6 7 8 9 10 11 12];
+steps=[1 2 3 4 5];
 final_time=1/365;
 
@@ -136,35 +137,37 @@
 
     %specify computational grid in SIZE.h
-    fidi=fopen('../MITgcm/code/SIZE.h.bak','r');
-    fido=fopen('../MITgcm/code/SIZE.h','w');
-    tline = fgetl(fidi);
-    fprintf(fido,'%s\n',tline);
-    while 1
+    if ~exist('../MITgcm/code/SIZE.h')
+        fidi=fopen('../MITgcm/code/SIZE.h.bak','r');
+        fido=fopen('../MITgcm/code/SIZE.h','w');
         tline = fgetl(fidi);
-        if ~ischar(tline), break, end
-        %do the change here: 
-        if strcmpi(tline,'     &           sNx =  20,'),
-            fprintf(fido,'%s%i%s\n','     &           sNx =  ',round(Nx/nPx),',');
-            continue;
-        end
-        if strcmpi(tline,'     &           sNy =  20,'),
-            fprintf(fido,'%s%i%s\n','     &           sNy =  ',round(Ny/nPy),',');
-            continue;
-        end
-        if strcmpi(tline,'     &           nPx =   1,'),
-            fprintf(fido,'%s%i%s\n','     &           nPx = ',nPx,',');
-            continue;
-        end
-        if strcmpi(tline,'     &           nPy =   2,'),
-            fprintf(fido,'%s%i%s\n','     &           nPy = ',nPy,',');
-            continue;
-        end
         fprintf(fido,'%s\n',tline);
+        while 1
+            tline = fgetl(fidi);
+            if ~ischar(tline), break, end
+            %do the change here: 
+            if strcmpi(tline,'     &           sNx =  20,'),
+                fprintf(fido,'%s%i%s\n','     &           sNx =  ',round(Nx/nPx),',');
+                continue;
+            end
+            if strcmpi(tline,'     &           sNy =  20,'),
+                fprintf(fido,'%s%i%s\n','     &           sNy =  ',round(Ny/nPy),',');
+                continue;
+            end
+            if strcmpi(tline,'     &           nPx =   1,'),
+                fprintf(fido,'%s%i%s\n','     &           nPx = ',nPx,',');
+                continue;
+            end
+            if strcmpi(tline,'     &           nPy =   2,'),
+                fprintf(fido,'%s%i%s\n','     &           nPy = ',nPy,',');
+                continue;
+            end
+            fprintf(fido,'%s\n',tline);
+        end
+        %close  files
+        fclose(fidi);
+        fclose(fido);
     end
-    %close  files
-    fclose(fidi);
-    fclose(fido);
-
-	 system(['../MITgcm/build.sh generic ' pwd '/../MITgcm']);
+
+    system(['../MITgcm/build.sh generic ' pwd '/../MITgcm']);
 end
 % }}}
