Index: trunk/NEMOGCM/NEMO/OPA_SRC/C1D/dtauvd.F90
===================================================================
--- trunk/NEMOGCM/NEMO/OPA_SRC/C1D/dtauvd.F90	(revision 5215)
+++ trunk/NEMOGCM/NEMO/OPA_SRC/C1D/dtauvd.F90	(revision 6140)
@@ -4,19 +4,20 @@
    !! Ocean data  :  read ocean U & V current data from gridded data
    !!======================================================================
-   !! History :  3.5   ! 2013-08  (D. Calvert)  Original code
-   !!----------------------------------------------------------------------
-
-   !!----------------------------------------------------------------------
-   !!   dta_uvd_init   : read namelist and allocate data structures
-   !!   dta_uvd        : read and time-interpolate ocean U & V current data
-   !!----------------------------------------------------------------------
-   USE oce             ! ocean dynamics and tracers
-   USE dom_oce         ! ocean space and time domain
-   USE fldread         ! read input fields
-   USE in_out_manager  ! I/O manager
-   USE phycst          ! physical constants
-   USE lib_mpp         ! MPP library
-   USE wrk_nemo        ! Memory allocation
-   USE timing          ! Timing
+   !! History :  3.5  ! 2013-08  (D. Calvert)  Original code
+   !!----------------------------------------------------------------------
+
+   !!----------------------------------------------------------------------
+   !!   dta_uvd_init  : read namelist and allocate data structures
+   !!   dta_uvd       : read and time-interpolate ocean U & V current data
+   !!----------------------------------------------------------------------
+   USE oce            ! ocean dynamics and tracers
+   USE phycst         ! physical constants
+   USE dom_oce        ! ocean space and time domain
+   !
+   USE in_out_manager ! I/O manager
+   USE fldread        ! read input fields
+   USE lib_mpp        ! MPP library
+   USE wrk_nemo       ! Memory allocation
+   USE timing         ! Timing
 
    IMPLICIT NONE
@@ -26,13 +27,11 @@
    PUBLIC   dta_uvd        ! called by istate.F90 and dyndmp.90
 
-   LOGICAL , PUBLIC ::   ln_uvd_init         ! Flag to initialise with U & V current data
-   LOGICAL , PUBLIC ::   ln_uvd_dyndmp       ! Flag for Newtonian damping toward U & V current data
+   LOGICAL , PUBLIC ::   ln_uvd_init     ! Flag to initialise with U & V current data
+   LOGICAL , PUBLIC ::   ln_uvd_dyndmp   ! Flag for Newtonian damping toward U & V current data
 
    TYPE(FLD), ALLOCATABLE, DIMENSION(:) ::   sf_uvd   ! structure for input U & V current (file information and data)
 
-   !! * Substitutions
-#  include "domzgr_substitute.h90"
-   !!----------------------------------------------------------------------
-   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
+   !!----------------------------------------------------------------------
+   !! NEMO/OPA 3.7 , NEMO Consortium (2015)
    !! $Id$ 
    !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
@@ -50,27 +49,25 @@
       !!              - fld_fill data structure with namelist information
       !!----------------------------------------------------------------------
-      LOGICAL, INTENT(in), OPTIONAL ::   ld_dyndmp         ! force the initialization when dyndmp is used
-      !
-      INTEGER ::   ierr0, ierr1, ierr2, ierr3              ! temporary integers
-      !
-      CHARACTER(len=100)            ::   cn_dir            ! Root directory for location of files to be used
-      TYPE(FLD_N), DIMENSION(2)     ::   suv_i             ! Combined U & V namelist information
-      TYPE(FLD_N)                   ::   sn_ucur, sn_vcur  ! U & V data namelist information
+      LOGICAL, INTENT(in), OPTIONAL ::   ld_dyndmp   ! force the initialization when dyndmp is used
+      !
+      INTEGER ::   ios, ierr0, ierr1, ierr2, ierr3     ! local integers
+      CHARACTER(len=100)        ::   cn_dir            ! Root directory for location of files to be used
+      TYPE(FLD_N), DIMENSION(2) ::   suv_i             ! Combined U & V namelist information
+      TYPE(FLD_N)               ::   sn_ucur, sn_vcur  ! U & V data namelist information
       !!
       NAMELIST/namc1d_uvd/ ln_uvd_init, ln_uvd_dyndmp, cn_dir, sn_ucur, sn_vcur
-      INTEGER  ::   ios
-      !!----------------------------------------------------------------------
-      !
-      IF( nn_timing == 1 )  CALL timing_start('dta_uvd_init')
-      !
-      ierr0 = 0  ;  ierr1 = 0  ;  ierr2 = 0  ;  ierr3 = 0
+      !!----------------------------------------------------------------------
+      !
+      IF( nn_timing == 1 )   CALL timing_start('dta_uvd_init')
+      !
+      ierr0 = 0   ;   ierr1 = 0   ;   ierr2 = 0  ;   ierr3 = 0
 
       REWIND( numnam_ref )              ! Namelist namc1d_uvd in reference namelist : 
       READ  ( numnam_ref, namc1d_uvd, IOSTAT = ios, ERR = 901)
-901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namc1d_uvd in reference namelist', lwp )
-
+901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namc1d_uvd in reference namelist', lwp )
+      !
       REWIND( numnam_cfg )              ! Namelist namc1d_uvd in configuration namelist : Parameters of the run
       READ  ( numnam_cfg, namc1d_uvd, IOSTAT = ios, ERR = 902 )
-902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namc1d_uvd in configuration namelist', lwp )
+902   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namc1d_uvd in configuration namelist', lwp )
       IF(lwm) WRITE ( numond, namc1d_uvd )
 
@@ -149,13 +146,7 @@
       !!----------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )  CALL timing_start('dta_uvd')
+      IF( nn_timing == 1 )   CALL timing_start('dta_uvd')
       !
       CALL fld_read( kt, 1, sf_uvd )      !==   read U & V current data at time step kt   ==!
-      !
-      !
-      !                                   !==   ORCA_R2 configuration and U & V current damping   ==! 
-      IF( cp_cfg == "orca" .AND. jp_cfg == 2 .AND. ln_uvd_dyndmp ) THEN    ! some hand made alterations
-         !!! EMPTY- to be added for running in 3D context !!!
-      ENDIF
       !
       puvd(:,:,:,1) = sf_uvd(1)%fnow(:,:,:)                 ! NO mask
@@ -164,5 +155,5 @@
       IF( ln_sco ) THEN                   !==   s- or mixed s-zps-coordinate   ==!
          !
-         CALL wrk_alloc( jpk, zup, zvp )
+         CALL wrk_alloc( jpk,   zup, zvp )
          !
          IF( kt == nit000 .AND. lwp )THEN
@@ -174,5 +165,5 @@
             DO ji = 1, jpi                ! determines the interpolated U & V current profiles at each (i,j) point
                DO jk = 1, jpk
-                  zl = fsdept(ji,jj,jk)
+                  zl = gdept_n(ji,jj,jk)
                   IF    ( zl < gdept_1d(1  ) ) THEN          ! extrapolate above the first level of data
                      zup(jk) =  puvd(ji,jj,1    ,1)
@@ -200,5 +191,5 @@
          END DO
          ! 
-         CALL wrk_dealloc( jpk, zup, zvp )
+         CALL wrk_dealloc( jpk,   zup, zvp )
          ! 
       ELSE                                !==   z- or zps- coordinate   ==!
@@ -222,25 +213,4 @@
       ENDIF
       !
-      IF( lwp .AND. kt == nit000 ) THEN   ! control print
-         WRITE(numout,*) ' U current '
-         WRITE(numout,*)
-         WRITE(numout,*)'  level = 1'
-         CALL prihre( puvd(:,:,1    ,1), jpi, jpj, 1, jpi, 20, 1, jpj, 20, 1., numout )
-         WRITE(numout,*)'  level = ', jpk/2
-         CALL prihre( puvd(:,:,jpk/2,1), jpi, jpj, 1, jpi, 20, 1, jpj, 20, 1., numout )
-         WRITE(numout,*)'  level = ', jpkm1
-         CALL prihre( puvd(:,:,jpkm1,1), jpi, jpj, 1, jpi, 20, 1, jpj, 20, 1., numout )
-         WRITE(numout,*)
-         WRITE(numout,*) ' V current '
-         WRITE(numout,*)
-         WRITE(numout,*)'  level = 1'
-         CALL prihre( puvd(:,:,1    ,2), jpi, jpj, 1, jpi, 20, 1, jpj, 20, 1., numout )
-         WRITE(numout,*)'  level = ', jpk/2
-         CALL prihre( puvd(:,:,jpk/2,2), jpi, jpj, 1, jpi, 20, 1, jpj, 20, 1., numout )
-         WRITE(numout,*)'  level = ', jpkm1
-         CALL prihre( puvd(:,:,jpkm1,2), jpi, jpj, 1, jpi, 20, 1, jpj, 20, 1., numout )
-         WRITE(numout,*)
-      ENDIF
-      !
       IF( .NOT. ln_uvd_dyndmp    ) THEN   !==   deallocate U & V current structure   ==! 
          !                                !==   (data used only for initialization)  ==!
