Index: /branches/2014/dev_r4650_UKMO10_Tidally_Meaned_Diagnostics/NEMOGCM/NEMO/OPA_SRC/DIA/dia25h.F90
===================================================================
--- /branches/2014/dev_r4650_UKMO10_Tidally_Meaned_Diagnostics/NEMOGCM/NEMO/OPA_SRC/DIA/dia25h.F90	(revision 5432)
+++ /branches/2014/dev_r4650_UKMO10_Tidally_Meaned_Diagnostics/NEMOGCM/NEMO/OPA_SRC/DIA/dia25h.F90	(revision 5433)
@@ -8,5 +8,5 @@
    USE oce             ! ocean dynamics and tracers variables
    USE dom_oce         ! ocean space and time domain
-   USE diainsitutem, ONLY: insitu_t, theta2t
+   USE diainsitutem, ONLY: rinsitu_t, theta2t
    USE in_out_manager  ! I/O units
    USE iom             ! I/0 library
@@ -28,5 +28,5 @@
 
   !! * variables for calculating 25-hourly means
-   REAL(wp),SAVE, ALLOCATABLE,   DIMENSION(:,:,:) ::   tn_25h  , sn_25h, insitu_t_25h  
+   REAL(wp),SAVE, ALLOCATABLE,   DIMENSION(:,:,:) ::   tn_25h  , sn_25h, rinsitu_t_25h  
    REAL(wp),SAVE, ALLOCATABLE,   DIMENSION(:,:)   ::   sshn_25h 
    REAL(wp),SAVE, ALLOCATABLE,   DIMENSION(:,:,:) ::   un_25h  , vn_25h  , wn_25h
@@ -36,5 +36,5 @@
 #endif
 #if defined key_zdfgls 
-   REAL(wp),SAVE, ALLOCATABLE,   DIMENSION(:,:,:) ::   mxln_25h
+   REAL(wp),SAVE, ALLOCATABLE,   DIMENSION(:,:,:) ::   rmxln_25h
 #endif
    INTEGER, SAVE :: cnt_25h     ! Counter for 25 hour means
@@ -94,7 +94,7 @@
          CALL ctl_stop( 'dia_25h: unable to allocate sn_25h' )   ;   RETURN
       ENDIF
-      ALLOCATE( insitu_t_25h(jpi,jpj,jpk), STAT=ierror )
-      IF( ierror > 0 ) THEN
-         CALL ctl_stop( 'dia_25h: unable to allocate insitu_t_25h' )   ;   RETURN
+      ALLOCATE( rinsitu_t_25h(jpi,jpj,jpk), STAT=ierror )
+      IF( ierror > 0 ) THEN
+         CALL ctl_stop( 'dia_25h: unable to allocate rinsitu_t_25h' )   ;   RETURN
       ENDIF
       ALLOCATE( un_25h(jpi,jpj,jpk), STAT=ierror )
@@ -125,7 +125,7 @@
 #endif
 # if defined key_zdfgls 
-      ALLOCATE( mxln_25h(jpi,jpj,jpk), STAT=ierror )
-      IF( ierror > 0 ) THEN
-         CALL ctl_stop( 'dia_25h: unable to allocate mxln_25h' )   ;   RETURN
+      ALLOCATE( rmxln_25h(jpi,jpj,jpk), STAT=ierror )
+      IF( ierror > 0 ) THEN
+         CALL ctl_stop( 'dia_25h: unable to allocate rmxln_25h' )   ;   RETURN
       ENDIF
 #endif
@@ -141,5 +141,5 @@
       sn_25h(:,:,:) = tsb(:,:,:,jp_sal)
       CALL theta2t
-      insitu_t_25h(:,:,:) = insitu_t(:,:,:)
+      rinsitu_t_25h(:,:,:) = rinsitu_t(:,:,:)
       sshn_25h(:,:) = sshb(:,:)
       un_25h(:,:,:) = ub(:,:,:)
@@ -152,5 +152,5 @@
 #endif
 # if defined key_zdfgls
-         mxln_25h(:,:,:) = mxln(:,:,:)
+         rmxln_25h(:,:,:) = mxln(:,:,:)
 #endif
 #if defined key_lim3 || defined key_lim2
@@ -200,5 +200,5 @@
       REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zw3d                                  ! temporary workspace
       REAL(wp), DIMENSION(jpi,jpj,3)   ::   zwtmb                                 ! temporary workspace
-      INTEGER                          ::   nyear0, nmonth0,nday0                 ! start year,month,day
+      INTEGER                          ::   iyear0, nimonth0,iday0                ! start year,imonth,day
 
       !!----------------------------------------------------------------------
@@ -235,5 +235,5 @@
          sn_25h(:,:,:)        = sn_25h(:,:,:) + tsn(:,:,:,jp_sal)
          CALL theta2t
-         insitu_t_25h(:,:,:)  = insitu_t_25h(:,:,:) + insitu_t(:,:,:)
+         rinsitu_t_25h(:,:,:)  = rinsitu_t_25h(:,:,:) + rinsitu_t(:,:,:)
          sshn_25h(:,:)        = sshn_25h(:,:) + sshn (:,:)
          un_25h(:,:,:)        = un_25h(:,:,:) + un(:,:,:)
@@ -246,5 +246,5 @@
 #endif
 # if defined key_zdfgls
-         mxln_25h(:,:,:)      = mxln_25h(:,:,:) + mxln(:,:,:)
+         rmxln_25h(:,:,:)      = rmxln_25h(:,:,:) + mxln(:,:,:)
 #endif
          cnt_25h = cnt_25h + 1
@@ -266,5 +266,5 @@
             tn_25h(:,:,:)        = tn_25h(:,:,:) / 25.0_wp
             sn_25h(:,:,:)        = sn_25h(:,:,:) / 25.0_wp
-            insitu_t_25h(:,:,:)  = insitu_t_25h(:,:,:) / 25.0_wp
+            rinsitu_t_25h(:,:,:)  = rinsitu_t_25h(:,:,:) / 25.0_wp
             sshn_25h(:,:)        = sshn_25h(:,:) / 25.0_wp
             un_25h(:,:,:)        = un_25h(:,:,:) / 25.0_wp
@@ -277,5 +277,5 @@
 #endif
 # if defined key_zdfgls
-            mxln_25h(:,:,:)       = mxln_25h(:,:,:) / 25.0_wp
+            rmxln_25h(:,:,:)       = rmxln_25h(:,:,:) / 25.0_wp
 #endif
 
@@ -286,5 +286,5 @@
             CALL iom_put("temper25h", zw3d)   ! potential temperature
             CALL theta2t                                                                    ! calculate insitu temp
-            zw3d(:,:,:) = insitu_t_25h(:,:,:)*tmask(:,:,:) + zmdi*(1.0-tmask(:,:,:))
+            zw3d(:,:,:) = rinsitu_t_25h(:,:,:)*tmask(:,:,:) + zmdi*(1.0-tmask(:,:,:))
             CALL iom_put("tempis25h", zw3d)   ! in-situ temperature
             zw3d(:,:,:) = sn_25h(:,:,:)*tmask(:,:,:) + zmdi*(1.0-tmask(:,:,:))
@@ -311,5 +311,5 @@
 #endif
 #if defined key_zdfgls 
-            zw3d(:,:,:) = mxln_25h(:,:,:)*tmask(:,:,:) + zmdi*(1.0-tmask(:,:,:))
+            zw3d(:,:,:) = rmxln_25h(:,:,:)*tmask(:,:,:) + zmdi*(1.0-tmask(:,:,:))
             CALL iom_put( "mxln25h",zw3d)
 #endif
@@ -319,5 +319,5 @@
             sn_25h(:,:,:) = tsn(:,:,:,jp_sal)
             CALL theta2t
-            insitu_t_25h(:,:,:) = insitu_t(:,:,:)
+            rinsitu_t_25h(:,:,:) = rinsitu_t(:,:,:)
             sshn_25h(:,:) = sshn (:,:)
             un_25h(:,:,:) = un(:,:,:)
@@ -330,5 +330,5 @@
 #endif
 # if defined key_zdfgls
-            mxln_25h(:,:,:) = mxln(:,:,:)
+            rmxln_25h(:,:,:) = mxln(:,:,:)
 #endif
             cnt_25h = 1
Index: /branches/2014/dev_r4650_UKMO10_Tidally_Meaned_Diagnostics/NEMOGCM/NEMO/OPA_SRC/DIA/diainsitutem.F90
===================================================================
--- /branches/2014/dev_r4650_UKMO10_Tidally_Meaned_Diagnostics/NEMOGCM/NEMO/OPA_SRC/DIA/diainsitutem.F90	(revision 5432)
+++ /branches/2014/dev_r4650_UKMO10_Tidally_Meaned_Diagnostics/NEMOGCM/NEMO/OPA_SRC/DIA/diainsitutem.F90	(revision 5433)
@@ -22,5 +22,5 @@
   PUBLIC insitu_tem_alloc          ! routines called by step.F90
 
-  REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:,:) :: insitu_t
+  REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:,:) :: rinsitu_t
 
    !! * Substitutions
@@ -36,5 +36,5 @@
       ierr = 0
       !
-      ALLOCATE( insitu_t(jpi,jpj,jpk), STAT=ierr(1) )
+      ALLOCATE( rinsitu_t(jpi,jpj,jpk), STAT=ierr(1) )
          !
       insitu_tem_alloc = MAXVAL(ierr)
@@ -54,6 +54,6 @@
   SUBROUTINE theta2t()
 
-    INTEGER, PARAMETER :: num_steps=10                ! number of steps in integration
-    INTEGER            :: step                        ! iteration counter
+    INTEGER, PARAMETER :: inum_steps=10                ! number of steps in integration
+    INTEGER            :: jstep                        ! iteration counter
     INTEGER            :: ji, jj, jk                  ! loop indices
     REAL(wp), DIMENSION(jpi,jpj,jpk) :: zP            ! pressure (decibars)
@@ -76,5 +76,5 @@
            DO ji = 1, jpi
               ! These loops expanded for case where fsdept may be 1D
-              zDP(ji,jj,jk) = fsdept(ji,jj,jk) / real(num_steps)
+              zDP(ji,jj,jk) = fsdept(ji,jj,jk) / real(inum_steps)
            END DO
         END DO
@@ -91,5 +91,5 @@
      zTB(:,:,:) = zT(:,:,:)  - zLAPSE(:,:,:) * zDP(:,:,:)
 
-     interation: DO step=1, num_steps
+     interation: DO jstep=1, inum_steps
         ! Calculate lapse rate (dT/dP) and hence TA
         CALL ATG(zP, zT, zSS, zLAPSE)
@@ -102,6 +102,6 @@
      END DO interation
 
-     insitu_t(:,:,:) = zT(:,:,:) * tmask(:,:,:)
-     CALL lbc_lnk( insitu_t,  'T', 1.0)
+     rinsitu_t(:,:,:) = zT(:,:,:) * tmask(:,:,:)
+     CALL lbc_lnk( rinsitu_t,  'T', 1.0)
 
    END SUBROUTINE theta2t
Index: /branches/2014/dev_r4650_UKMO10_Tidally_Meaned_Diagnostics/NEMOGCM/NEMO/OPA_SRC/DIA/diatmb.F90
===================================================================
--- /branches/2014/dev_r4650_UKMO10_Tidally_Meaned_Diagnostics/NEMOGCM/NEMO/OPA_SRC/DIA/diatmb.F90	(revision 5432)
+++ /branches/2014/dev_r4650_UKMO10_Tidally_Meaned_Diagnostics/NEMOGCM/NEMO/OPA_SRC/DIA/diatmb.F90	(revision 5433)
@@ -62,5 +62,5 @@
    END SUBROUTINE dia_tmb_init
 
-   SUBROUTINE dia_calctmb( infield,outtmb )
+   SUBROUTINE dia_calctmb( pinfield,pouttmb )
       !!---------------------------------------------------------------------
       !!                  ***  ROUTINE dia_tmb  ***
@@ -81,6 +81,6 @@
 
       ! Routine arguments
-      REAL(wp), DIMENSION(jpi, jpj, jpk), INTENT(IN   ) :: infield    ! Input 3d field and mask
-      REAL(wp), DIMENSION(jpi, jpj, 3  ), INTENT(  OUT) :: outtmb     ! Output top, middle, bottom
+      REAL(wp), DIMENSION(jpi, jpj, jpk), INTENT(IN   ) :: pinfield    ! Input 3d field and mask
+      REAL(wp), DIMENSION(jpi, jpj, 3  ), INTENT(  OUT) :: pouttmb     ! Output top, middle, bottom
 
 
@@ -95,19 +95,19 @@
 
       ! Calculate top
-      outtmb(:,:,1) = infield(:,:,1)*tmask(:,:,1)  + zmdi*(1.0-tmask(:,:,1))
+      pouttmb(:,:,1) = pinfield(:,:,1)*tmask(:,:,1)  + zmdi*(1.0-tmask(:,:,1))
 
       ! Calculate middle
-      DO ji = 1,jpi
-         DO jj = 1,jpj
+      DO jj = 1,jpj
+         DO ji = 1,jpi
             jk              = max(1,mbathy(ji,jj)/2)
-            outtmb(ji,jj,2) = infield(ji,jj,jk)*tmask(ji,jj,jk)  + zmdi*(1.0-tmask(ji,jj,jk))
+            pouttmb(ji,jj,2) = pinfield(ji,jj,jk)*tmask(ji,jj,jk)  + zmdi*(1.0-tmask(ji,jj,jk))
          END DO
       END DO
 
       ! Calculate bottom
-      DO ji = 1,jpi
-         DO jj = 1,jpj
+      DO jj = 1,jpj
+         DO ji = 1,jpi
             jk              = max(1,mbathy(ji,jj) - 1)
-            outtmb(ji,jj,3) = infield(ji,jj,jk)*tmask(ji,jj,jk)  + zmdi*(1.0-tmask(ji,jj,jk))
+            pouttmb(ji,jj,3) = pinfield(ji,jj,jk)*tmask(ji,jj,jk)  + zmdi*(1.0-tmask(ji,jj,jk))
          END DO
       END DO
