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 6031)
+++ /branches/2014/dev_r4650_UKMO10_Tidally_Meaned_Diagnostics/NEMOGCM/NEMO/OPA_SRC/DIA/dia25h.F90	(revision 6032)
@@ -8,5 +8,4 @@
    USE oce             ! ocean dynamics and tracers variables
    USE dom_oce         ! ocean space and time domain
-   USE diainsitutem, ONLY: rinsitu_t, theta2t
    USE in_out_manager  ! I/O units
    USE iom             ! I/0 library
@@ -29,5 +28,5 @@
 
   !! * variables for calculating 25-hourly means
-   REAL(wp),SAVE, ALLOCATABLE,   DIMENSION(:,:,:) ::   tn_25h  , sn_25h, rinsitu_t_25h  
+   REAL(wp),SAVE, ALLOCATABLE,   DIMENSION(:,:,:) ::   tn_25h  , sn_25h
    REAL(wp),SAVE, ALLOCATABLE,   DIMENSION(:,:)   ::   sshn_25h 
    REAL(wp),SAVE, ALLOCATABLE,   DIMENSION(:,:,:) ::   un_25h  , vn_25h  , wn_25h
@@ -95,8 +94,4 @@
          CALL ctl_stop( 'dia_25h: unable to allocate sn_25h' )   ;   RETURN
       ENDIF
-      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 )
       IF( ierror > 0 ) THEN
@@ -142,5 +137,4 @@
       sn_25h(:,:,:) = tsb(:,:,:,jp_sal)
       CALL theta2t
-      rinsitu_t_25h(:,:,:) = rinsitu_t(:,:,:)
       sshn_25h(:,:) = sshb(:,:)
       un_25h(:,:,:) = ub(:,:,:)
@@ -235,6 +229,4 @@
          tn_25h(:,:,:)        = tn_25h(:,:,:) + tsn(:,:,:,jp_tem)
          sn_25h(:,:,:)        = sn_25h(:,:,:) + tsn(:,:,:,jp_sal)
-         CALL theta2t
-         rinsitu_t_25h(:,:,:)  = rinsitu_t_25h(:,:,:) + rinsitu_t(:,:,:)
          sshn_25h(:,:)        = sshn_25h(:,:) + sshn (:,:)
          un_25h(:,:,:)        = un_25h(:,:,:) + un(:,:,:)
@@ -267,5 +259,4 @@
             tn_25h(:,:,:)        = tn_25h(:,:,:) / 25.0_wp
             sn_25h(:,:,:)        = sn_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
@@ -286,7 +277,4 @@
             zw3d(:,:,:) = tn_25h(:,:,:)*tmask(:,:,:) + zmdi*(1.0-tmask(:,:,:))
             CALL iom_put("temper25h", zw3d)   ! potential temperature
-            CALL theta2t                                                                    ! calculate insitu temp
-            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(:,:,:))
             CALL iom_put( "salin25h", zw3d  )   ! salinity
@@ -319,6 +307,4 @@
             tn_25h(:,:,:) = tsn(:,:,:,jp_tem)
             sn_25h(:,:,:) = tsn(:,:,:,jp_sal)
-            CALL theta2t
-            rinsitu_t_25h(:,:,:) = rinsitu_t(:,:,:)
             sshn_25h(:,:) = sshn (:,:)
             un_25h(:,:,:) = un(:,:,:)
Index: anches/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 6031)
+++ 	(revision )
@@ -1,124 +1,0 @@
-MODULE diainsitutem
-   !!======================================================================
-   !!                       ***  MODULE  diaharm  ***
-   !! Harmonic analysis of tidal constituents
-   !!======================================================================
-   !! Initial version: D. Acreman June 2006 Original Code
-   !! History :  3.6  !  2014  (E O'Dea) for 3.6 25hour mean output
-   !!----------------------------------------------------------------------
-
-  USE dom_oce  ! ocean space and time domain
-  USE oce,            ONLY: tsn
-  USE par_oce,        ONLY: jpi, jpj, jpk, jpkm1
-  USE lbclnk,         ONLY: lbc_lnk
-  USE lib_mpp         ! MPP library
-
-  IMPLICIT NONE
-  PRIVATE
-
-  PUBLIC theta2t
-
-  !! * Accessibility
-  PUBLIC insitu_tem_alloc          ! routines called by step.F90
-
-  REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:,:) :: rinsitu_t
-
-   !! * Substitutions
-#  include "domzgr_substitute.h90"
-
-CONTAINS
-
-   REAL FUNCTION insitu_tem_alloc()
-      !!----------------------------------------------------------------------
-      INTEGER, DIMENSION(2) :: ierr
-      !!----------------------------------------------------------------------
-      !
-      ierr = 0
-      !
-      ALLOCATE( rinsitu_t(jpi,jpj,jpk), STAT=ierr(1) )
-         !
-      insitu_tem_alloc = MAXVAL(ierr)
-      IF( lk_mpp )   CALL mpp_sum( insitu_tem_alloc )
-      !
-  END FUNCTION insitu_tem_alloc
-
-!-----------------------------------------------------------------------------------
-!
-! Calculate the insitu temperature by integrating the adiabatic lapse rate from zero 
-! to pressure at depth of tracer level. Based on UM subroutine POTTEM and function ATG
-!
-! Initial version: D. Acreman June 2006
-!
-!-----------------------------------------------------------------------------------
-
-  SUBROUTINE theta2t()
-
-    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)
-    REAL(wp), DIMENSION(jpi,jpj,jpk) :: zT            ! temperature at pressure p
-    REAL(wp), DIMENSION(jpi,jpj,jpk) :: zTB           ! temperature at p-dp
-    REAL(wp), DIMENSION(jpi,jpj,jpk) :: zTA           ! temperature at p+dp
-    REAL(wp), DIMENSION(jpi,jpj,jpk) :: zDP           ! pressure step
-    REAL(wp), DIMENSION(jpi,jpj,jpk) :: zSS           ! salinity(PSU) - 35.0
-    REAL(wp), DIMENSION(jpi,jpj,jpk) :: zLAPSE        ! adiabatic lapse rate
-
-!CDIR IEXPAND (ATG)
-
-! Set the pressure interval for the integration. The integration is carried out from 
-! zero (pressure at the surface) to the pressure at the depth of the tracer point. The
-! pressure in decibars is represented by the depth in metres. Pressures are "Oceanographic"
-! pressures equal to absolute pressure minus one atmosphere
-     zDP(:,:,:) = 0.0
-     DO jk = 1, jpkm1
-        DO jj = 1, jpj
-           DO ji = 1, jpi
-              ! These loops expanded for case where fsdept may be 1D
-              zDP(ji,jj,jk) = fsdept(ji,jj,jk) / real(inum_steps)
-           END DO
-        END DO
-     END DO
-
-! Salinity at each point
-     zSS(:,:,:)      = tsn(:,:,:,jp_sal) - 35.0 
-
-! Set initial values of temperature and pressure. zT is the temperature at pressure zP, 
-! zTB is the temperature at pressure zP-zdP and zTA is the temperature at pressure zP+zdP
-     zT(:,:,:)  = tsn(:,:,:,jp_tem)
-     zP(:,:,:)  = 0.0         ! Pressure at surface
-     CALL ATG(zP, zT, zSS, zLAPSE)
-     zTB(:,:,:) = zT(:,:,:)  - zLAPSE(:,:,:) * zDP(:,:,:)
-
-     interation: DO jstep=1, inum_steps
-        ! Calculate lapse rate (dT/dP) and hence TA
-        CALL ATG(zP, zT, zSS, zLAPSE)
-        zTA(:,:,:) = zTB(:,:,:) + 2.0 * zLAPSE(:,:,:) * zDP(:,:,:)
-        ! Have calculated TB, T and TA for this pressure, now advance solution by dP
-        zP(:,:,:)  = zP(:,:,:)  + zDP
-        zTB(:,:,:) = zT(:,:,:)
-        zT(:,:,:)  = zTA(:,:,:)
-
-     END DO interation
-
-     rinsitu_t(:,:,:) = zT(:,:,:) * tmask(:,:,:)
-     CALL lbc_lnk( rinsitu_t,  'T', 1.0)
-
-   END SUBROUTINE theta2t
-
-   SUBROUTINE ATG(P,T,DS,zLAPSE)
-
-     REAL, INTENT(IN   ) :: P(jpi,jpj,jpk)        ! PRESSURE (DECIBARS)
-     REAL, INTENT(IN   ) :: T(jpi,jpj,jpk)        ! TEMPERATURE (DEG C)
-     REAL, INTENT(IN   ) :: DS(jpi,jpj,jpk)       ! SALINITY (PSU) -35.0
-     REAL, INTENT(  OUT) :: zLAPSE(jpi,jpj,jpk)   ! LAPSE RATE
-
-       zLAPSE = ((( -2.1687E-16*T+1.8676E-14)*T-4.6206E-13)*P &
-           + ((2.7759E-12*T-1.1351E-10)*DS+((-5.4481E-14*T    &
-           + 8.733E-12)*T-6.7795E-10)*T+1.8741E-8))*P         &
-           + (-4.2393E-8*T+1.8932E-6)*DS                      &
-           + ((6.6228E-10*T-6.836E-8)*T+8.5258E-6)*T+3.5803E-5 
-
-   END SUBROUTINE ATG
-
-END MODULE diainsitutem
