Index: unk/NEMO/OPA_SRC/DIA/ptr.F90
===================================================================
--- /trunk/NEMO/OPA_SRC/DIA/ptr.F90	(revision 134)
+++ 	(revision )
@@ -1,592 +1,0 @@
-MODULE ptr
-   !!======================================================================
-   !!                       ***  MODULE  ptr  ***
-   !! Ocean physics:  brief description of the purpose of the module
-   !!                 (please no more than 2 lines)
-   !!=====================================================================
-#if   defined key_diaptr
-   !!----------------------------------------------------------------------
-   !!   'key_diaptr'  :                    DIAgnostics: Poleward TRansports
-   !!----------------------------------------------------------------------
-   !!   exa_mpl      : liste of module subroutine (caution, never use the
-   !!   exa_mpl_init : name of the module for a routine)
-   !!   exa_mpl_stp  : Please try to use 3 letter block for routine names
-   !!----------------------------------------------------------------------
-   !! * Modules used
-   USE oce           ! ocean dynamics and active tracers
-   USE dom_oce       ! ocean space and time domain
-   USE ldftra_oce    ! ???
-   USE lib_mpp
-   USE in_out_manager
-   USE dianam
-   USE phycst
-
-   IMPLICIT NONE
-   PRIVATE
-
-   INTERFACE prt_vj
-      MODULE PROCEDURE prt_vj_3d, prt_vj_2d
-   END INTERFACE
-
-   !! *  Routine accessibility
-   PUBLIC dia_ptr_init   ! call in step module
-   PUBLIC dia_ptr        ! call by in step module
-   PUBLIC prt_vj         ! call by tra_ldf & tra_adv routines
-   PUBLIC prt_vjk        ! call by tra_ldf & tra_adv routines
-
-   !! * Share Module variables
-   LOGICAL, PUBLIC, PARAMETER ::   lk_diaptr = .TRUE.    !: poleward transport flag
-   INTEGER, PUBLIC ::    & !!: ** ptr namelist (namptr) **
-      nf_ptr = 15           !: frequency of ptr computation
-   REAL(wp), PUBLIC, DIMENSION(jpj) ::   &   ! poleward transport
-      pht_adv, pst_adv,  &  !: heat and salt: advection
-      pht_ove, pst_ove,  &  !: heat and salt: overturning
-      pht_ldf, pst_ldf,  &  !: heat and salt: lateral diffusion
-      pht_eiv, pst_eiv      !: heat and salt: bolus advection
-
-   !! Module variables
-   REAL(wp), DIMENSION(jpj,jpk) ::   &  
-      tn_jk  , sn_jk  ,  &  ! "zonal" mean temperature and salinity
-      v_msf           ,  &  ! "meridional" Stream-Function
-#if defined key_diaeiv
-      v_msf_eiv       ,  &  ! bolus "meridional" Stream-Function
-#endif
-      surf_jk_r             ! inverse of the ocean "zonal" section surface
-
-   !! * Substitutions
-#  include "domzgr_substitute.h90"
-#  include "vectopt_loop_substitute.h90"
-   !!----------------------------------------------------------------------
-   !!   OPA 9.0 , LODYC-IPSL  (2003)
-   !!----------------------------------------------------------------------
-
-CONTAINS
-
-   FUNCTION prt_vj_3d( pva )   RESULT ( p_fval )
-      !!----------------------------------------------------------------------
-      !!                    ***  ROUTINE prt_vj_3d  ***
-      !!
-      !! ** Purpose :   "zonal" and vertical sum computation of a "meridional"
-      !!      flux array
-      !!
-      !! ** Method  : - i-k sum of pva using the interior 2D vmask (vmask_i).
-      !!      pva is supposed to be a masked flux (i.e. * vmask*e1v*e3v)
-      !!
-      !! ** Action  : - p_fval: i-k-mean poleward flux of pva
-      !!
-      !! History :
-      !!   9.0  !  03-09  (G. Madec)  Original code
-      !!----------------------------------------------------------------------
-      !! * arguments
-      REAL(wp) , INTENT(in), DIMENSION(jpi,jpj,jpk) ::   &
-         pva                         ! mask flux array at V-point
-
-      !! * local declarations
-      INTEGER  ::   ji, jj, jk        ! dummy loop arguments
-      INTEGER  ::   ijpj = jpj        ! ???
-      REAL(wp),DIMENSION(jpj) ::   &
-         p_fval                       ! function value
-      !!--------------------------------------------------------------------
-
-      p_fval(:) = 0.e0
-      DO jk = 1, jpkm1
-         DO jj = 2, jpjm1
-            DO ji = fs_2, fs_jpim1   ! Vector opt.
-               p_fval(jj) = p_fval(jj) + pva(ji,jj,jk) * tmask_i(ji,jj+1) * tmask_i(ji,jj) 
-            END DO
-         END DO
-      END DO
-      IF( lk_mpp )   CALL mpp_sum( p_fval, ijpj )     !!bug  I presume
-
-   END FUNCTION prt_vj_3d
-
-
-
-   FUNCTION prt_vj_2d( pva )   RESULT ( p_fval )
-       !!----------------------------------------------------------------------
-       !!                    ***  ROUTINE prt_vj_2d  ***
-       !!
-       !! ** Purpose :   "zonal" and vertical sum computation of a "meridional"
-       !!      flux array
-       !!
-       !! ** Method  : - i-k sum of pva using the interior 2D vmask (vmask_i).
-       !!      pva is supposed to be a masked flux (i.e. * vmask*e1v*e3v)
-       !!
-       !! ** Action  : - p_fval: i-k-mean poleward flux of pva
-       !!
-       !! History :
-       !!   9.0  !  03-09  (G. Madec)  Original code
-       !!----------------------------------------------------------------------
-       !! * arguments
-       REAL(wp) , INTENT(in), DIMENSION(jpi,jpj) ::   &
-          pva                         ! mask flux array at V-point
- 
-       !! * local declarations
-       INTEGER  ::   ji, jj            ! dummy loop arguments
-       INTEGER  ::   ijpj = jpj        ! ???
-       REAL(wp),DIMENSION(jpj) ::   &
-          p_fval                       ! function value
-       !!--------------------------------------------------------------------
- 
-       p_fval(:) = 0.e0
-       DO jj = 2, jpjm1
-          DO ji = fs_2, fs_jpim1   ! Vector opt.
-             p_fval(jj) = p_fval(jj) + pva(ji,jj) * tmask_i(ji,jj+1) * tmask_i(ji,jj)
-          END DO
-       END DO
-       IF( lk_mpp )   CALL mpp_sum( p_fval, ijpj )     !!bug  I presume
- 
-    END FUNCTION prt_vj_2d
-
-
-
-   FUNCTION prt_vjk( pva )   RESULT ( p_fval )
-      !!----------------------------------------------------------------------
-      !!                    ***  ROUTINE prt_vjk  ***
-      !!
-      !! ** Purpose :   "zonal" sum computation of a "meridional" flux array
-      !!
-      !! ** Method  : - i-sum of pva using the interior 2D vmask (vmask_i).
-      !!      pva is supposed to be a masked flux (i.e. * vmask*e1v*e3v)
-      !!
-      !! ** Action  : - p_fval: i-k-mean poleward flux of pva
-      !!
-      !! History :
-      !!   9.0  !  03-09  (G. Madec)  Original code
-      !!----------------------------------------------------------------------
-      !! * arguments
-      REAL(wp) , INTENT(in), DIMENSION(jpi,jpj,jpk) ::   &
-         pva                         ! mask flux array at V-point
-
-      !! * local declarations
-      INTEGER  ::   ji, jj, jk        ! dummy loop arguments
-      REAL(wp),DIMENSION(jpj,jpk) ::   &
-         p_fval                       ! return function value
-      !!--------------------------------------------------------------------
- 
-      p_fval(:,:) = 0.e0
-      DO jk = 1, jpkm1
-         DO jj = 2, jpjm1
-            DO ji = fs_2, fs_jpim1   ! Vector opt.
-               p_fval(jj,jk) = p_fval(jj,jk) + pva(ji,jj,jk) * tmask_i(ji,jj+1) * tmask_i(ji,jj)
-            END DO
-         END DO
-      END DO
-      IF( lk_mpp)   CALL mpp_sum( p_fval, jpj*jpk )    !!bug  I presume
-
-   END FUNCTION prt_vjk
-
-   FUNCTION prt_vtjk( pva )   RESULT ( p_fval )
-      !!----------------------------------------------------------------------
-      !!                    ***  ROUTINE prt_vtjk  ***
-      !!
-      !! ** Purpose :   "zonal" mean computation of a tracer field
-      !!
-      !! ** Method  : - i-sum of mj(pva) using the interior 2D vmask (vmask_i)
-      !!      multiplied by the inverse of the surface of the "zonal" ocean
-      !!      section
-      !!
-      !! ** Action  : - p_fval: i-k-mean poleward flux of pva
-      !!
-      !! History :
-      !!   9.0  !  03-09  (G. Madec)  Original code
-      !!----------------------------------------------------------------------
-      !! * arguments
-      REAL(wp) , INTENT(in), DIMENSION(jpi,jpj,jpk) ::   &
-         pva                         ! mask flux array at V-point
- 
-      !! * local declarations
-      INTEGER  ::   ji, jj, jk        ! dummy loop arguments
-      REAL(wp),DIMENSION(jpj,jpk) ::   &
-         p_fval                       ! return function value
-      !!-------------------------------------------------------------------- 
-
-      p_fval(:,:) = 0.e0
-      DO jk = 1, jpkm1
-         DO jj = 2, jpjm1
-            DO ji = fs_2, fs_jpim1   ! Vector opt.
-               p_fval(jj,jk) = p_fval(jj,jk) + ( pva(ji,jj,jk) + pva(ji,jj+1,jk) )              &
-                  &                          * e1v(ji,jj) * fse3v(ji,jj,jk) * vmask(ji,jj,jk)   &
-                  &                          * tmask_i(ji,jj+1) * tmask_i(ji,jj)
-            END DO
-         END DO
-      END DO
-      p_fval(:,:) = p_fval(:,:) * 0.5
-      IF( lk_mpp )   CALL mpp_sum( p_fval, jpj*jpk )         !!bug  I presume
-
-   END FUNCTION prt_vtjk
-
-
-   SUBROUTINE dia_ptr( kt )
-      !!----------------------------------------------------------------------
-      !!                  ***  ROUTINE dia_ptr  ***
-      !!----------------------------------------------------------------------
-      !! * Argument
-      INTEGER, INTENT(in) ::   kt   ! ocean time step index
-
-      !! * Local variables
-      INTEGER ::   jk               ! dummy loop
-      REAL(wp) ::   &
-         zsverdrup = 1.e-6,  &      ! conversion from m3/s to Sverdrup
-         zpwatt    = 1.e-15, &      ! conversion from W    to PW
-         zggram    = 1.e-6          ! conversion from g    to Pg
-      !!----------------------------------------------------------------------
-
-      ! "zonal" mean temperature and salinity at V-points
-      tn_jk(:,:) = prt_vtjk( tn(:,:,:) ) * surf_jk_r(:,:)
-      sn_jk(:,:) = prt_vtjk( sn(:,:,:) ) * surf_jk_r(:,:)
-
-      ! "zonal" mean mass flux at V-points
-      v_msf(:,:) = prt_vjk( vn(:,:,:) ) 
-#if defined key_diaeiv
-      ! "zonal" mean bolus mass flux at V-points
-      v_msf_eiv(:,:) = prt_vjk( v_eiv(:,:,:) ) 
-      ! Bolus "Meridional" Stream-Function
-      DO jk = jpkm1, 1
-         v_msf_eiv(:,jk) = v_msf_eiv(:,jk-1) + v_msf_eiv(:,jk)
-      END DO
-      v_msf_eiv(:,:) = v_msf_eiv(:,:) * zsverdrup
-#endif
-
-      ! poleward transport: overturning component
-      pht_ove(:) = SUM( v_msf(:,:) * tn_jk(:,:), 2 )   ! SUM over jk
-      pst_ove(:) = SUM( v_msf(:,:) * sn_jk(:,:), 2 )   ! SUM over jk
-
-      ! conversion in PW and G g
-      zpwatt = zpwatt * rau0 * rcp
-      pht_adv(:) = pht_adv(:) * zpwatt
-      pht_ove(:) = pht_ove(:) * zpwatt
-      pht_ldf(:) = pht_ldf(:) * zpwatt
-      pht_eiv(:) = pht_eiv(:) * zpwatt
-      pst_adv(:) = pst_adv(:) * zggram
-      pst_ove(:) = pst_ove(:) * zggram
-      pst_ldf(:) = pst_ldf(:) * zggram
-      pst_eiv(:) = pst_eiv(:) * zggram
-
-      ! "Meridional" Stream-Function
-      DO jk = jpkm1, 1
-         v_msf(:,jk) = v_msf(:,jk-1) + v_msf(:,jk)
-      END DO
-      v_msf(:,:) = v_msf(:,:) * zsverdrup
-
-      ! output
-      CALL dia_ptr_wri( kt )
-
-   END SUBROUTINE dia_ptr
-
-
-   SUBROUTINE dia_ptr_init
-      !!----------------------------------------------------------------------
-      !!                  ***  ROUTINE dia_ptr_init  ***
-      !!                   
-      !! ** Purpose :   initialization of ....
-      !!
-      !! ** Method  :   blah blah blah ...
-      !!
-      !! ** input   :   Namlist namptr
-      !!
-      !! ** Action  :   ...  
-      !!
-      !! history :
-      !!   9.0  !  03-08  (Autor Names)  Original code
-      !!----------------------------------------------------------------------
-      !! * local declarations
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   &
-         z_1             ! temporary workspace
-
-      NAMELIST/namptr/ nf_ptr
-      !!----------------------------------------------------------------------
-
-      ! Read Namelist namptr : poleward transport parameters
-      REWIND ( numptr )
-      READ   ( numnam, namptr )
-
-
-      ! Control print
-      IF(lwp) THEN
-         WRITE(numout,*)
-         WRITE(numout,*) 'dia_ptr_init : poleward transport and msf initialization'
-         WRITE(numout,*) '~~~~~~~~~~~~'
-         WRITE(numout,*) '          Namelist namptr : set ptr parameters'
-         WRITE(numout,*) '             frequency of computation       nf_ptr  = ', nf_ptr
-      ENDIF
-
-      ! inverse of the ocean "zonal" v-point section
-      z_1(:,:,:) = 1.e0
-      surf_jk_r(:,:) = prt_vtjk( z_1(:,:,:) )
-      WHERE( surf_jk_r(:,:) /= 0.e0 )   surf_jk_r(:,:) = 1.e0 / surf_jk_r(:,:)
-
-   END SUBROUTINE dia_ptr_init
-
-#if defined key_fdir
-   !!---------------------------------------------------------------------
-   !!   'key_fdir'                                      direct access file
-   !!---------------------------------------------------------------------
-
-   SUBROUTINE dia_ptr_wri( kt )
-      !!---------------------------------------------------------------------
-      !!                ***  ROUTINE diaptr  ***
-      !!
-      !! ** Purpose :   output of poleward fluxes 
-      !! 
-      !! ** Method  :   NetCDF file
-      !!
-      !! History :
-      !!   9.0  !  03-09  (G. Madec)  Original code  
-      !!---------------------------------------------------------------------- 
-      !! * Arguments
-      INTEGER, INTENT(in) ::   kt   ! ocean time-step index
-      REAL(wp), DIMENSION(jpjglo) ::   zphi, zfoo
-      !!---------------------------------------------------------------------- 
-
-      IF( kt == nit000 ) THEN
-
-         ! Reference latitude
-         ! ------------------
-         !                                           ! =======================
-         IF( cp_cfg == "orca" ) THEN                 !   ORCA configurations
-            !                                        ! =======================
-
-            IF( jp_cfg == 05  )   iline = 192   ! i-line that passes near the North Pole
-            IF( jp_cfg == 025 )   iline = 384   ! i-line that passes near the North Pole
-            IF( jp_cfg == 2   )   iline =  48   ! i-line that passes near the North Pole
-            IF( jp_cfg == 4   )   iline =  24   ! i-line that passes near the North Pole
- 
-            zphi(:) = 0.e0   
-            DO ji = mi0(iline), mi1(iline)
-               zphi(:) = gphiv(ji,:)         ! if iline is in the local domain
-            END DO
-            ! provide the correct zphi to all local domains
-            IF( lk_mpp )   CALL mpp_sum( zphi, jpj )        
-            ! introduce arbitray northernmost grid point to avoid netcdf error
-            zphi(jpjglo) = 2*zphi(jpjglo-1)-zphi(jpjglo-2)
-
-            !                                        ! =======================
-         ELSE                                        !   OTHER configurations
-            !                                        ! =======================
-            zphi(:) = gphiv(1,:)             ! assume lat/lon coordinate, select the first i-line
-            !
-         ENDIF
- 
-         ! open the output file         
-         CALL ctlopn( numptr, 'opaptr.output', 'UNKNOWN', 'UNFORMATTED', 'SEQUENTIAL', 1, numout, lw
-p, 1 )
-
-         ! header of output
-         WRITE( numptr ) cexper, no, zdt, nf_ptr, jpj, jpk, zphi
-
-      ENDIF
-
-      IF( MOD( kt, nf_ptr ) == 0 ) THEN
-            IF(lwp) WRITE( numptr ) kt, tn_jk, sn_jk, v_msf,              &
-# if defined key_diaeiv
-               &                    pht_eiv, pst_eiv, v_msf_eiv,          &
-# endif
-               &                    pht_adv, pht_ldf, pst_adv, pst_ldf
-      ENDIF
-
-      IF( kt == nitend )   CLOSE( numptr )
-
-   END SUBROUTINE dia_ptr_wri
-
-#else
-   !!---------------------------------------------------------------------
-   !!   Default option :                                       NetCDF file
-   !!---------------------------------------------------------------------
-
-   SUBROUTINE dia_ptr_wri( kt )
-      !!---------------------------------------------------------------------
-      !!                ***  ROUTINE diaptr  ***
-      !!
-      !! ** Purpose :   output of poleward fluxes
-      !!
-      !! ** Method  :   NetCDF file
-      !!
-      !! History :
-      !!   9.0  !  03-09  (G. Madec)  Original code
-      !!----------------------------------------------------------------------
-      USE ioipsl          ! NetCDF IPSL library
-      USE daymod
-
-      !! * Arguments
-      INTEGER, INTENT(in) ::   kt   ! ocean time-step index
-
-      !! * Save variables   
-      INTEGER, SAVE ::   nhoridz, ndepidzt, ndepidzw   &
-          , ndex(1)
-
-      !! * Local variables
-      CHARACTER (len=40) ::   &
-         clhstnam, clop             ! temporary names
-      INTEGER ::   iline, it, ji    !
-      REAL(wp) ::   &
-         zsto, zout, zdt, zmax, &   ! temporary scalars
-         zjulian
-      REAL(wp), DIMENSION(jpjglo) ::   zphi, zfoo
-      !!----------------------------------------------------------------------
-      
-      ! Define frequency of output and means
-      zdt = rdt
-      IF( nacc == 1 ) zdt = rdtmin
-#if defined key_diainstant
-         zsto = nf_ptr * zdt
-         clop = "inst(x)"               ! no use of the mask value (require less cpu time)
-         !!! clop="inst(only(x))"       ! put 1.e+20 on land (very expensive!!)
-#else
-         zsto = zdt
-         clop = "ave(x)"                ! no use of the mask value (require less cpu time)
-         !!! clop="ave(only(x))"        ! put 1.e+20 on land (very expensive!!)
-#endif
-      zout = nf_ptr * zdt
-      zmax = ( nitend - nit000 + 1 ) * zdt
-      
-         
-      ! define time axis
-      it = kt - nit000 + 1
-
-      ! Initialization
-      ! --------------
-      IF( kt == nit000 ) THEN
-      
-      zdt = rdt
-      IF( nacc == 1 ) zdt = rdtmin
-
-         ! Reference latitude
-         ! ------------------
-         !                                           ! =======================
-         IF( cp_cfg == "orca" ) THEN                 !   ORCA configurations
-            !                                        ! =======================
-
-            IF( jp_cfg == 05  )   iline = 192   ! i-line that passes near the North Pole
-            IF( jp_cfg == 025 )   iline = 384   ! i-line that passes near the North Pole
-            IF( jp_cfg == 2   )   iline =  48   ! i-line that passes near the North Pole
-            IF( jp_cfg == 4   )   iline =  24   ! i-line that passes near the North Pole
-            zphi(:) = 0.e0
-            DO ji = mi0(iline), mi1(iline) 
-               zphi(:) = gphiv(ji,:)         ! if iline is in the local domain
-            END DO
-            ! provide the correct zphi to all local domains
-            IF( lk_mpp )   CALL mpp_sum( zphi, jpj )        
-
-            !                                        ! =======================
-         ELSE                                        !   OTHER configurations
-            !                                        ! =======================
-            zphi(:) = gphiv(1,:)             ! assume lat/lon coordinate, select the first i-line
-            !
-         ENDIF
-
-         ! OPEN netcdf file 
-         ! ----------------
-         ! Define frequency of output and means
-         zsto = nf_ptr * zdt
-         clop = "ave(x)"
-         zout = nf_ptr * zdt
-         zfoo(:) = 0.e0
-
-         ! Compute julian date from starting date of the run
-
-         CALL ymds2ju( nyear, nmonth, nday, 0.e0, zjulian )
-
-         CALL dia_nam( clhstnam, nf_ptr, 'diaptr' )
-         IF(lwp)WRITE( numout,*)" Name of diaptr NETCDF file ",clhstnam
-
-         ! Horizontal grid : zphi()
-         CALL histbeg(clhstnam, 1, zfoo, jpj, zphi,   &
-            1, 1, 1, jpj, 0, zjulian, zdt, nhoridz, numptr )
-         ! Vertical grids : gdept, gdepw
-         CALL histvert( numptr, "deptht", "Vertical T levels",   &
-            "m", jpk, gdept, ndepidzt )
-         CALL histvert( numptr, "depthw", "Vertical W levels",   &
-            "m", jpk, gdepw, ndepidzw )
-         
-         !  Zonal mean T and S
-         
-         CALL histdef( numptr, "zotemglo", "Zonal Mean Temperature","C" ,   &
-            1, jpj, nhoridz, jpk, 1, jpk, ndepidzt, 32, clop, zsto, zout )
-         CALL histdef( numptr, "zosalglo", "Zonal Mean Salinity","PSU"  ,   &
-            1, jpj, nhoridz, jpk, 1, jpk, ndepidzt, 32, clop, zsto, zout )
-
-         !  Meridional Stream-Function (eulerian and bolus)
-         
-         CALL histdef( numptr, "zomsfglo", "Meridional Stream-Function: global","Sv" ,   &
-            1, jpj, nhoridz, jpk, 1, jpk, ndepidzw, 32, clop, zsto, zout )
-
-         !  Heat transport 
-
-         CALL histdef( numptr, "sophtadv", "Advective Heat Transport"      ,   &
-            "PW", 1, jpj, nhoridz, 1, 1, 1, -99, 32, clop, zsto, zout )
-         CALL histdef( numptr, "sophtldf", "Diffusive Heat Transport"      ,   &
-            "PW",1, jpj, nhoridz, 1, 1, 1, -99, 32, clop, zsto, zout )
-         CALL histdef( numptr, "sophtove", "Overturning Heat Transport"    ,   &
-            "PW",1, jpj, nhoridz, 1, 1, 1, -99, 32, clop, zsto, zout )
-
-         !  Salt transport 
-
-         CALL histdef( numptr, "sopstadv", "Advective Salt Transport"      ,   &
-            "Giga g/s", 1, jpj, nhoridz, 1, 1, 1, -99, 32, clop, zsto, zout )
-         CALL histdef( numptr, "sopstldf", "Diffusive Salt Transport"      ,   &
-            "Giga g/s", 1, jpj, nhoridz, 1, 1, 1, -99, 32, clop, zsto, zout )
-         CALL histdef( numptr, "sopstove", "Overturning Salt Transport"    ,   &
-            "Giga g/s", 1, jpj, nhoridz, 1, 1, 1, -99, 32, clop, zsto, zout )
-
-#if defined key_diaeiv
-         ! Eddy induced velocity
-         CALL histdef( numptr, "zomsfeiv", "Bolus Meridional Stream-Function: global",   &
-            "Sv"      , 1, jpj, nhoridz, jpk, 1, jpk, ndepidzw, 32, clop, zsto, zout )
-         CALL histdef( numptr, "sophteiv", "Bolus Advective Heat Transport",   &
-            "PW"      , 1, jpj, nhoridz, 1, 1, 1, -99, 32, clop, zsto, zout )
-         CALL histdef( numptr, "sopsteiv", "Bolus Advective Salt Transport",   &
-            "Giga g/s", 1, jpj, nhoridz, 1, 1, 1, -99, 32, clop, zsto, zout )
-#endif
-
-         CALL histend( numptr )
-
-      ENDIF
-
-      IF( MOD( kt, nf_ptr ) == 0 ) THEN
-
-         ! define time axis
-         it= kt - nit000 + 1
-         ndex(1) = 1
-         CALL histwrite( numptr, "zotemglo", it, tn_jk    , jpj*jpk, ndex )
-         CALL histwrite( numptr, "zosalglo", it, sn_jk    , jpj*jpk, ndex )
-         CALL histwrite( numptr, "zomsfglo", it, v_msf    , jpj*jpk, ndex )
-         CALL histwrite( numptr, "sophtadv", it, pht_adv  , jpj    , ndex )
-         CALL histwrite( numptr, "sophtldf", it, pht_ldf  , jpj    , ndex )
-         CALL histwrite( numptr, "sophtove", it, pht_ove  , jpj    , ndex )
-         CALL histwrite( numptr, "sopstadv", it, pst_adv  , jpj    , ndex )
-         CALL histwrite( numptr, "sopstldf", it, pst_ldf  , jpj    , ndex )
-         CALL histwrite( numptr, "sopstove", it, pst_ove  , jpj    , ndex )
-#if defined key_diaeiv
-         CALL histwrite( numptr, "zomsfeiv", it, v_msf_eiv, jpj*jpk, ndex )
-         CALL histwrite( numptr, "sophteiv", it, pht_eiv  , jpj    , ndex )
-         CALL histwrite( numptr, "sopsteiv", it, pst_eiv  , jpj    , ndex )
-#endif
- 
-      ENDIF
-
-      ! Close the file
-      IF( kt == nitend )   CALL histclo( numptr )           ! Netcdf write
-
-   END SUBROUTINE dia_ptr_wri
-
-#endif
-
-#else
-   !!----------------------------------------------------------------------
-   !!   Default option :                                       Empty Module
-   !!----------------------------------------------------------------------
-   LOGICAL, PUBLIC, PARAMETER ::   lk_diaptr = .FALSE.    ! poleward transport flag
-   INTEGER, PUBLIC ::    & !!: ** ptr namelist (namptr) **
-      nf_ptr = 15           !: frequency of ptr computation
-CONTAINS
-   SUBROUTINE dia_ptr( kt )        ! Empty routine
-      WRITE(*,*) 'dia_ptr: You should not have seen this print! error?', kt
-   END SUBROUTINE dia_ptr
-   SUBROUTINE dia_ptr_init         ! Empty routine
-      WRITE(*,*) 'dia_ptr_init: You should not have seen this print! error?'
-   END SUBROUTINE dia_ptr_init
-#endif
-
-   !!======================================================================
-END MODULE ptr
