Index: /trunk/NEMO/C1D_SRC/c1d.F90
===================================================================
--- /trunk/NEMO/C1D_SRC/c1d.F90	(revision 899)
+++ /trunk/NEMO/C1D_SRC/c1d.F90	(revision 899)
@@ -0,0 +1,70 @@
+MODULE ini1d
+   !!======================================================================
+   !!                     ***  MODULE  ini1D  ***
+   !! Ocean state   :  1D initialization
+   !!=====================================================================
+#if defined key_c1d
+   !!----------------------------------------------------------------------
+   !!   'key_cf1d'               1D Configuration
+   !!----------------------------------------------------------------------
+   !!   init_1d   : initial mask
+   !!----------------------------------------------------------------------
+   !! * Modules used
+   USE dom_oce         ! ocean space and time domain 
+   USE phycst
+   USE in_out_manager
+
+   IMPLICIT NONE
+   PRIVATE
+
+   !! * Share Module variables
+   LOGICAL, PUBLIC, PARAMETER ::  lk_c1d = .TRUE.       !: 1D flag
+
+   !! * Routine accessibility
+   PUBLIC init_1d   ! routine called by OPA.F90
+
+   !!----------------------------------------------------------------------
+   !!   OPA 9.0 , LOCEAN-IPSL (2005) 
+   !! $Header$ 
+   !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt 
+   !!----------------------------------------------------------------------
+
+CONTAINS
+
+   SUBROUTINE init_1d
+      !!----------------------------------------------------------------------
+      !!                   ***  ROUTINE init_1d  ***
+      !! 
+      !! ** Purpose :   Re-Initialization of masks on 1D configuration
+      !!
+      !! ** Method  :
+      !!
+      !! History :
+      !!   9.0  !  04-09  (C. Ethe) 1D configuration
+      !!----------------------------------------------------------------------
+      !! * Local declarations
+      !!----------------------------------------------------------------------
+
+      IF(lwp) WRITE(numout,*)
+      IF(lwp) WRITE(numout,*) 'init_1d :  masks on 1D configuration'
+      IF(lwp) WRITE(numout,*) '~~~~~~~~~'
+
+      ! set umask and vmask equal tmask in 1D configuration
+      umask(:,:,:) = tmask(:,:,:)
+      vmask(:,:,:) = tmask(:,:,:)     
+
+   END SUBROUTINE init_1d
+
+#else
+   !!----------------------------------------------------------------------
+   !!   Default key                                     NO 1D Config
+   !!----------------------------------------------------------------------
+   LOGICAL , PUBLIC, PARAMETER ::   lk_c1d = .FALSE.    !: internal damping flag
+CONTAINS
+   SUBROUTINE init_1d       ! Empty routine
+
+   END SUBROUTINE init_1d
+#endif
+
+   !!=====================================================================
+END MODULE ini1d
Index: unk/NEMO/C1D_SRC/diawri1d.F90
===================================================================
--- /trunk/NEMO/C1D_SRC/diawri1d.F90	(revision 898)
+++ 	(revision )
@@ -1,469 +1,0 @@
-MODULE diawri1d
-   !!======================================================================
-   !!                     ***  MODULE  diawri1d  ***
-   !! Ocean diagnostics :  write ocean output files
-   !!=====================================================================
-#if defined key_cfg_1d
-   !!----------------------------------------------------------------------
-   !!   'key_cfg_1d'               1D Configuration
-   !!----------------------------------------------------------------------  
-   !!----------------------------------------------------------------------
-   !! * Modules used
-   USE oce             ! ocean dynamics and tracers 
-   USE dom_oce         ! ocean space and time domain
-   USE zdf_oce         ! ocean vertical physics
-   USE sbc_oce         ! surface boundary condition: ocean
-   USE sbc_ice         ! surface boundary condition: ice
-   USE zdftke          ! TKE vertical mixing
-   USE zdfkpp          ! KPP vertical mixing
-   USE sol_oce         ! solver variables
-   USE ice_oce         ! ice variables
-   USE phycst          ! physical constants
-   USE ocfzpt          ! ???
-   USE zdfmxl          ! mixed layer
-   USE daymod          ! calendar
-   USE dianam          ! build name of file (routine)
-   USE diawri
-   USE zdfddm          ! vertical  physics: double diffusion
-   USE diahth          ! thermocline diagnostics
-   USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
-   USE in_out_manager  ! I/O manager
-
-   IMPLICIT NONE
-   PRIVATE
-
-   !! * Accessibility
-   PUBLIC dia_wri_1d                 ! routines called by step.F90
-   !! * Module variables
-   INTEGER ::   &
-      nid_T, nz_T, nh_T, ndim_T, ndim_hT,      &   ! grid_T file
-      ndex(1)                                      ! ???
-   INTEGER, DIMENSION(jpi*jpj) ::   &
-      ndex_hT
-   INTEGER, DIMENSION(jpi*jpj*jpk) ::   &
-      ndex_T
-
-   !! * Substitutions
-#  include "zdfddm_substitute.h90"
-   !!----------------------------------------------------------------------
-   !!   OPA 9.0 , LOCEAN-IPSL  (2005)
-   !! $Id$
-   !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt
-   !!----------------------------------------------------------------------
-
-CONTAINS
-   !!----------------------------------------------------------------------
-   !!   Default option                                   NetCDF output file
-   !!----------------------------------------------------------------------
-   !!   dia_wri_1d       : create the standart NetCDF output files
-   !!   dia_wri_state_1d : create an output NetCDF file for a single
-   !!                      instantaeous ocean state and forcing fields
-   !!----------------------------------------------------------------------
-
-   SUBROUTINE dia_wri_1d( kt, kindic )
-      !!---------------------------------------------------------------------
-      !!                  ***  ROUTINE dia_wri_1d  ***
-      !!                   
-      !! ** Purpose :   Standard output of opa: dynamics and tracer fields 
-      !!      NETCDF format is used by default 
-      !!
-      !! ** Method  :   At the beginning of the first time step (nit000), 
-      !!      define all the NETCDF files and fields
-      !!      At each time step call histdef to compute the mean if ncessary
-      !!      Each nwrite time step, output the instantaneous or mean fields
-      !!      IF kindic <0, output of fields before the model interruption.
-      !!      IF kindic =0, time step loop
-      !!      IF kindic >0, output of fields before the time step loop
-      !!
-      !! History :
-      !!        !  91-03  (M.-A. Foujols)  Original code
-      !!        !  91-11  (G. Madec)
-      !!        !  92-06  (M. Imbard)  correction restart file
-      !!        !  92-07  (M. Imbard)  split into diawri and rstwri
-      !!        !  93-03  (M. Imbard)  suppress writibm
-      !!        !  98-01  (C. Levy)  NETCDF format using ioipsl INTERFACE
-      !!        !  99-02  (E. Guilyardi)  name of netCDF files + variables
-      !!   8.5  !  02-09  (G. Madec)  F90: Free form and module
-      !!   9.0  !  04-10  (C. Ethe)   1D Configuration
-      !!    "   !  05-11  (V. Garnier) Surface pressure gradient organization
-      !!----------------------------------------------------------------------
-      !! * Modules used
-      USE ioipsl
-
-      !! * Arguments
-      INTEGER, INTENT( in ) ::   kt      ! ocean time-step index
-      INTEGER, INTENT( in ) ::   kindic  ! 
-
-      !! * Local declarations
-      LOGICAL ::   ll_print = .FALSE.    ! =T print and flush numout
-      CHARACTER (len=40) ::           &
-         clhstnam, clop, clmx            ! temporary names
-      INTEGER ::   inum = 11             ! temporary logical unit
-      INTEGER ::   &
-         ji, jj, ik                      ! dummy loop indices
-      INTEGER ::   &
-         iimi, iima, ipk, it,         &  ! temporary integers
-         ijmi, ijma                      !    "          "
-      REAL(wp) ::   &
-         zsto, zout, zmax,            &  ! temporary scalars
-         zjulian, zdt                    !    "         "
-      REAL(wp), DIMENSION(jpi,jpj) :: &
-         zw2d                            ! temporary workspace
-      !!----------------------------------------------------------------------
-      
-      ! 0. Initialisation
-      ! -----------------
-      
-      ! local variable for debugging
-      ll_print = .FALSE.
-      ll_print = ll_print .AND. lwp
-
-      ! Define frequency of output and means
-      zdt = rdt
-      IF( nacc == 1 ) zdt = rdtmin
-#if defined key_diainstant
-      zsto = nwrite * 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 = nwrite * zdt
-      zmax = ( nitend - nit000 + 1 ) * zdt
-
-      ! Define indices of the horizontal output zoom and vertical limit storage
-      iimi = 1      ;      iima = jpi
-      ijmi = 1      ;      ijma = jpj
-      ipk = jpk
-
-      ! define time axis
-      it = kt - nit000 + 1
-
-
-      ! 1. Define NETCDF files and fields at beginning of first time step
-      ! -----------------------------------------------------------------
-
-      IF(ll_print) WRITE(numout,*) 'dia_wri_1d kt = ', kt, ' kindic ', kindic
-
-      IF( kt == nit000 ) THEN
-
-         ! Define the NETCDF files (one per grid)
-         
-         ! Compute julian date from starting date of the run
-         CALL ymds2ju( nyear, nmonth, nday, 0.e0, zjulian )
-         IF(lwp)WRITE(numout,*)
-         IF(lwp)WRITE(numout,*) 'Date 0 used :', nit000, ' YEAR ', nyear,   &
-            &                    ' MONTH ', nmonth, ' DAY ', nday, 'Julian day : ', zjulian
-         IF(lwp)WRITE(numout,*) ' indexes of zoom = ', iimi, iima, ijmi, ijma,   &
-                                 ' limit storage in depth = ', ipk
-
-         ! WRITE root name in date.file for use by postpro
-         CALL dia_nam( clhstnam, nwrite,' ' )
-         CALL ctlopn( inum, 'date.file', 'UNKNOWN', 'FORMATTED', 'SEQUENTIAL', 1, numout, lwp, 1 )
-         WRITE(inum,*) clhstnam
-         CLOSE(inum)
-         
-         ! Define the T grid FILE ( nid_T )
-         
-         CALL dia_nam( clhstnam, nwrite, 'grid_T' )
-         IF(lwp) WRITE(numout,*) " Name of NETCDF file ", clhstnam    ! filename
-         CALL histbeg( clhstnam, jpi, glamt, jpj, gphit,           &  ! Horizontal grid: glamt and gphit
-            &          iimi, iima-iimi+1, ijmi, ijma-ijmi+1,       &
-            &          0, zjulian, zdt, nh_T, nid_T, domain_id=nidom )
-         CALL histvert( nid_T, "deptht", "Vertical T levels",      &  ! Vertical grid: gdept
-            &           "m", ipk, gdept_0, nz_T )
-         !                                                            ! Index of ocean points
-         CALL wheneq( jpi*jpj*ipk, tmask, 1, 1., ndex_T , ndim_T  )      ! volume
-         CALL wheneq( jpi*jpj    , tmask, 1, 1., ndex_hT, ndim_hT )      ! surface
-
-
-         ! Declare all the output fields as NETCDF variables
-
-         !                                                                                      !!! nid_T : 3D
-         CALL histdef( nid_T, "votemper", "Temperature"                        , "C"      ,   &  ! tn
-            &          jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout )
-         CALL histdef( nid_T, "vosaline", "Salinity"                           , "PSU"    ,   &  ! sn
-            &          jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout )
-         !                                                                                      !!! nid_T : 2D
-         CALL histdef( nid_T, "sosstsst", "Sea Surface temperature"            , "C"      ,   &  ! sst
-            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
-         CALL histdef( nid_T, "sosaline", "Sea Surface Salinity"               , "PSU"    ,   &  ! sss
-            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
-
-!!$#if ! defined key_dynspg_rl && ( defined key_lim2 || defined key_lim2 )
-!!$         ! sowaflup = sowaflep + sorunoff + sowafldp + a term associated to
-!!$         !    internal damping to Levitus that can be diagnosed from others
-!!$         ! sowaflcd = sowaflep + sorunoff + sowafldp + iowaflup
-!!$         CALL histdef( nid_T, "iowaflup", "Ice=>ocean net freshwater"          , "kg/m2/s",   &  ! fsalt
-!!$            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
-!!$         CALL histdef( nid_T, "sowaflep", "atmos=>ocean net freshwater"        , "kg/m2/s",   &  ! fmass
-!!$            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
-!!$#endif
-         CALL histdef( nid_T, "sowaflup", "Net Upward Water Flux"              , "Kg/m2/s",   &  ! emp
-            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
-         CALL histdef( nid_T, "sorunoff", "Runoffs"                            , "Kg/m2/s",   &  ! runoffs
-            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
-         CALL histdef( nid_T, "sowaflcd", "concentration/dilution water flux"  , "kg/m2/s",   &  ! emps
-            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
-         CALL histdef( nid_T, "sosalflx", "Surface Salt Flux"                  , "Kg/m2/s",   &  ! emps * sn
-            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
-         CALL histdef( nid_T, "sohefldo", "Net Downward Heat Flux"             , "W/m2"   ,   &  ! qsr + qns
-            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
-         CALL histdef( nid_T, "soshfldo", "Shortwave Radiation"                , "W/m2"   ,   &  ! qsr
-            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
-         CALL histdef( nid_T, "somxl010", "Mixed Layer Depth 0.01"             , "m"      ,   &  ! hmlp
-            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
-#if defined key_zdfkpp
-         CALL histdef( nid_T, "sokppekd", "Ekman depth                     "   , "m"      ,   &  ! sokppekd
-            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
-         CALL histdef( nid_T, "sokppbld", "Boundary Layer Depth            "   , "m"      ,   &  ! sokppbld
-            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
-#endif
-         CALL histdef( nid_T, "somxlavt", "AVT : bottom of the mixed layer    ", "m"      ,   &  ! avt_mxl
-            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
-         CALL histdef( nid_T, "somixhgt", "Turbocline Depth"                   , "m"      ,   &  ! hmld
-            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
-         CALL histdef( nid_T, "soicecov", "Ice Cover"                          , "[0,1]"  ,   &  ! freeze
-            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
-#if ! defined key_coupled 
-         CALL histdef( nid_T, "sohefldp", "Surface Heat Flux: Damping"         , "W/m2"   ,   &  ! qrp
-            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
-         CALL histdef( nid_T, "sowafldp", "Surface Water Flux: Damping"        , "Kg/m2/s",   &  ! erp
-            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
-         CALL histdef( nid_T, "sosafldp", "Surface salt flux: damping"         , "Kg/m2/s",   &  ! erp * sn
-            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
-#endif
-
-#if ( defined key_coupled && ! ( defined key_lim3 || defined key_lim2 ) ) 
-         CALL histdef( nid_T, "sohefldp", "Surface Heat Flux: Damping"         , "W/m2"   ,   &  ! qrp
-            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
-         CALL histdef( nid_T, "sowafldp", "Surface Water Flux: Damping"        , "Kg/m2/s",   &  ! erp
-            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
-         CALL histdef( nid_T, "sosafldp", "Surface salt flux: Damping"         , "Kg/m2/s",   &  ! erp * sn
-            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
-#endif
-         clmx ="l_max(only(x))"    ! max index on a period
-         CALL histdef( nid_T, "sobowlin", "Bowl Index"                         , "W-point",   &  ! bowl INDEX 
-            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clmx, zsto, zout )
-#if defined key_diahth
-         CALL histdef( nid_T, "sothedep", "Thermocline Depth"                  , "m"      ,   & ! hth
-            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
-         CALL histdef( nid_T, "so20chgt", "Depth of 20C isotherm"              , "m"      ,   & ! hd20
-            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
-         CALL histdef( nid_T, "so28chgt", "Depth of 28C isotherm"              , "m"      ,   & ! hd28
-            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
-         CALL histdef( nid_T, "sohtc300", "Heat content 300 m"                 , "W"      ,   & ! htc3
-            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
-#endif
-
-#if ( defined key_lim3 || defined key_lim2 ) && defined key_coupled
-         CALL histdef( nid_T,"soicetem" , "Ice Surface Temperature"            , "K"      ,   &  ! tn_ice
-            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
-         CALL histdef( nid_T,"soicealb" , "Ice Albedo"                         , "[0,1]"  ,   &  ! alb_ice
-            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
-#endif 
-
-         !                                                                                      !!! nid_U : 3D
-         CALL histdef( nid_T, "vozocrtx", "Zonal Current"                      , "m/s"    ,   &  ! un
-            &          jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout )
-#if defined key_diaeiv
-         CALL histdef( nid_T, "vozoeivu", "Zonal EIV Current"                  , "m/s"    ,   &  ! u_eiv
-            &          jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout )
-#endif
-         !                                                                                      !!! nid_U : 2D
-         CALL histdef( nid_T, "sozotaux", "Wind Stress along i-axis"           , "N/m2"   ,   &  ! utau
-            &          jpi, jpj, nh_T, 1  , 1, 1  , - 99, 32, clop, zsto, zout )
-
-         !                                                                                      !!! nid_V : 3D
-         CALL histdef( nid_T, "vomecrty", "Meridional Current"                 , "m/s"    ,   &  ! vn
-            &          jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout )
-#if defined key_diaeiv
-         CALL histdef( nid_T, "vomeeivv", "Meridional EIV Current"             , "m/s"    ,   &  ! v_eiv
-            &          jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout )
-#endif
-         !                                                                                      !!! nid_V : 2D
-         CALL histdef( nid_T, "sometauy", "Wind Stress along j-axis"           , "N/m2"   ,   &  ! vtau
-            &          jpi, jpj, nh_T, 1  , 1, 1  , - 99, 32, clop, zsto, zout )
-#if defined key_zdftke
-         !                                                                                      !!! nid_W : 3D
-         CALL histdef( nid_T, "votlsdis", " Dissipation Turbulent Lenght Scale", "m"      ,   &  ! e_dis
-            &          jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout )
-         !
-         CALL histdef( nid_T, "votlsmix", " Mixing Turbulent Lenght Scale"     , "m"      ,   &  ! e_mix
-            &          jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout )
-         !
-         CALL histdef( nid_T, "votlspdl", " Prandl Number",                      "-"       ,   &  ! e_pdl
-            &          jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout )
-         !
-         CALL histdef( nid_T, "votlsric", " Local Richardson Number",            "-"       ,   &  ! e_ric
-            &          jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout )
-         !
-         CALL histdef( nid_T, "votkeend", "TKE: Turbulent kinetic energy"       , "m2/s"   ,   &  ! TKE
-            &          jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout )
-#endif
-#if defined key_zdfkpp
-         !                                                                                      !!! nid_W : 3D
-         CALL histdef( nid_T, "vokpprig", " Gradient Richardson Number"        ,  "-"      ,   &  ! rig
-            &          jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout )
-         !
-         CALL histdef( nid_T, "vokpprib", " Bulk Richardson Number    "        ,  "-"      ,   &   ! rib
-            &          jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout )
-         !
-         CALL histdef( nid_T, "vokppbsf", " Buoyancy forcing          "        , "N/m2"    ,   &  ! sokppbsf
-            &          jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout )
-         !
-         CALL histdef( nid_T, "vokppmol", "Moning Obukhov length scale     "   , "m"       ,   &  ! sokppmol
-            &          jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout )
-#endif
-         !
-         CALL histdef( nid_T, "voeosbn2", "Brunt-Vaisala Frequency"             , "m2/s2"  ,   &  ! rn2
-            &          jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout )
-
-         CALL histdef( nid_T, "votkeavt", "Vertical Eddy Diffusivity"          , "m2/s"   ,   &  ! avt
-            &          jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout )
-
-         CALL histdef( nid_T, "votkeevd", "Enhanced Vertical Diffusivity",       "m2/s"   ,   &  ! avt_evd
-            &          jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout )
-
-         CALL histdef( nid_T, "votkeavm", "Vertical Eddy Viscosity",             "m2/s"   ,   &  ! avmu
-            &          jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout )
-         !
-         CALL histdef( nid_T, "votkeevm", "Enhanced Vertical Viscosity",         "m2/s"   ,   &  ! avmu_evd
-            &          jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout )
-
-         IF( lk_zdfddm ) THEN
-            CALL histdef( nid_T,"voddmavs","Salt Vertical Eddy Diffusivity"    , "m2/s"   ,   &  ! avs
-               &          jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout )
-         ENDIF
-
-         CALL histend( nid_T )
-
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'End of NetCDF Initialization'
-         IF(ll_print) CALL FLUSH(numout )
-
-      ENDIF
-
-      ! 2. Start writing data
-      ! ---------------------
-
-      ! ndex(1) est utilise ssi l'avant dernier argument est diffferent de 
-      ! la taille du tableau en sortie. Dans ce cas , l'avant dernier argument
-      ! donne le nombre d'elements, et ndex la liste des indices a sortir
-
-      IF( lwp .AND. MOD( kt, nwrite ) == 0 ) THEN 
-         WRITE(numout,*) 'dia_wri : write model outputs in NetCDF files at ', kt, 'time-step'
-         WRITE(numout,*) '~~~~~~ '
-      ENDIF
-
-      ! Write fields on T grid
-      CALL histwrite( nid_T, "votemper", it, tn            , ndim_T , ndex_T  )   ! temperature
-      CALL histwrite( nid_T, "vosaline", it, sn            , ndim_T , ndex_T  )   ! salinity
-      CALL histwrite( nid_T, "sosstsst", it, tn(:,:,1)     , ndim_hT, ndex_hT )   ! sea surface temperature
-      CALL histwrite( nid_T, "sosaline", it, sn(:,:,1)     , ndim_hT, ndex_hT )   ! sea surface salinity
-#if ! defined key_dynspg_rl && ( defined key_lim3 || defined key_lim2 )
-      CALL histwrite( nid_T, "iowaflup", it, fsalt(:,:)    , ndim_hT, ndex_hT )   ! ice=>ocean water flux
-      CALL histwrite( nid_T, "sowaflep", it, fmass(:,:)    , ndim_hT, ndex_hT )   ! atmos=>ocean water flux
-#endif
-      CALL histwrite( nid_T, "sowaflup", it, emp           , ndim_hT, ndex_hT )   ! upward water flux
-      CALL histwrite( nid_T, "sorunoff", it, runoff        , ndim_hT, ndex_hT )   ! runoff
-      CALL histwrite( nid_T, "sowaflcd", it, emps          , ndim_hT, ndex_hT )   ! c/d water flux
-      zw2d(:,:) = emps(:,:) * sn(:,:,1) * tmask(:,:,1)
-      CALL histwrite( nid_T, "sosalflx", it, zw2d          , ndim_hT, ndex_hT )   ! c/d salt flux
-      CALL histwrite( nid_T, "sohefldo", it, qsr + qns     , ndim_hT, ndex_hT )   ! total heat flux
-      CALL histwrite( nid_T, "soshfldo", it, qsr           , ndim_hT, ndex_hT )   ! solar heat flux
-      CALL histwrite( nid_T, "somxl010", it, hmlp          , ndim_hT, ndex_hT )   ! mixed layer depth
-#if defined key_zdfkpp
-      CALL histwrite( nid_T, "sokppekd", it, ekdp          , ndim_hT, ndex_hT )   ! Ekman depht
-      CALL histwrite( nid_T, "sokppbld", it, hkpp          , ndim_hT, ndex_hT )   ! boundary layer depth 
-#endif  
-      ! store the vertical eddy diffusivity coef. at the bottom of the mixed layer
-      DO jj = 1, jpj
-         DO ji = 1, jpi
-            ik = nmln(ji,jj)
-            zw2d(ji,jj) = avt(ji,jj,ik) * tmask(ji,jj,1)
-         END DO
-      END DO
-      CALL histwrite( nid_T, "somxlavt", it, zw2d          , ndim_hT, ndex_hT )   ! Kz at bottom of mixed layer 
-      CALL histwrite( nid_T, "somixhgt", it, hmld          , ndim_hT, ndex_hT )   ! turbocline depth
-      CALL histwrite( nid_T, "soicecov", it, freeze        , ndim_hT, ndex_hT )   ! ice cover 
-#if ! defined key_coupled
-      CALL histwrite( nid_T, "sohefldp", it, qrp           , ndim_hT, ndex_hT )   ! heat flux damping
-      CALL histwrite( nid_T, "sowafldp", it, erp           , ndim_hT, ndex_hT )   ! freshwater flux damping
-      zw2d(:,:) = erp(:,:) * sn(:,:,1) * tmask(:,:,1)
-      CALL histwrite( nid_T, "sosafldp", it, zw2d          , ndim_hT, ndex_hT )   ! salt flux damping
-#endif
-#if ( defined key_coupled && ! ( defined key_lim3 || defined key_lim2 ) ) 
-      CALL histwrite( nid_T, "sohefldp", it, qrp           , ndim_hT, ndex_hT )   ! heat flux damping
-      CALL histwrite( nid_T, "sowafldp", it, erp           , ndim_hT, ndex_hT )   ! freshwater flux damping
-         zw2d(:,:) = erp(:,:) * sn(:,:,1) * tmask(:,:,1)
-      CALL histwrite( nid_T, "sosafldp", it, zw2d          , ndim_hT, ndex_hT )   ! salt flux damping
-#endif
-         zw2d(:,:) = FLOAT( nmln(:,:) ) * tmask(:,:,1)
-      CALL histwrite( nid_T, "sobowlin", it, zw2d          , ndim_hT, ndex_hT )   ! ???
-
-#if defined key_diahth
-      CALL histwrite( nid_T, "sothedep", it, hth           , ndim_hT, ndex_hT )   ! depth of the thermocline
-      CALL histwrite( nid_T, "so20chgt", it, hd20          , ndim_hT, ndex_hT )   ! depth of the 20 isotherm
-      CALL histwrite( nid_T, "so28chgt", it, hd28          , ndim_hT, ndex_hT )   ! depth of the 28 isotherm
-      CALL histwrite( nid_T, "sohtc300", it, htc3          , ndim_hT, ndex_hT )   ! first 300m heaat content
-#endif
-#if ( defined key_lim3 || defined key_lim2 ) &&  defined key_coupled 
-      CALL histwrite( nid_T, "soicetem", it, tn_ice        , ndim_hT, ndex_hT )   ! surf. ice temperature
-      CALL histwrite( nid_T, "soicealb", it, alb_ice       , ndim_hT, ndex_hT )   ! ice albedo
-#endif
-
-      CALL histwrite( nid_T, "vozocrtx", it, un            , ndim_T , ndex_T )    ! i-current
-      CALL histwrite( nid_T, "sozotaux", it, utau          , ndim_hT, ndex_hT )   ! i-wind stress
-      CALL histwrite( nid_T, "vomecrty", it, vn            , ndim_T , ndex_T  )   ! j-current
-      CALL histwrite( nid_T, "sometauy", it, vtau          , ndim_hT, ndex_hT )   ! j-wind stress
-#if defined key_zdftke
-      CALL histwrite( nid_T, "votlsdis", it, e_dis         , ndim_T , ndex_T )    ! Diss. Turb. lenght scale
-      CALL histwrite( nid_T, "votlsmix", it, e_mix         , ndim_T , ndex_T )    ! Mixing Turb. lenght scale
-      CALL histwrite( nid_T, "votlspdl", it, e_pdl         , ndim_T , ndex_T )    ! Prandl number
-      CALL histwrite( nid_T, "votlsric", it, e_ric         , ndim_T , ndex_T )    ! local Richardson number
-      CALL histwrite( nid_T, "votkeend", it, en            , ndim_T , ndex_T )    ! TKE
-#endif
-#if defined key_zdfkpp
-      CALL histwrite( nid_T, "vokpprig", it, rig           , ndim_T , ndex_T )    ! gradient Richardson number
-      CALL histwrite( nid_T, "vokpprib", it, rib           , ndim_T , ndex_T )    ! bulk Richardson number
-      CALL histwrite( nid_T, "vokppbsf", it, buof          , ndim_T , ndex_T )    ! buoyancy forcing
-      CALL histwrite( nid_T, "vokppmol", it, mols          , ndim_T , ndex_T )    ! Moning-Obukov length scale
-#endif
-      CALL histwrite( nid_T, "voeosbn2", it, rn2           , ndim_T , ndex_T )    ! Brunt-Vaisala Frequency
-      CALL histwrite( nid_T, "votkeavt", it, avt           , ndim_T , ndex_T )    ! T vert. eddy diff. coef.
-      CALL histwrite( nid_T, "votkeevd", it, avt_evd       , ndim_T , ndex_T )    ! T enhan. vert. eddy diff. coef.
-      CALL histwrite( nid_T, "votkeavm", it, avmu          , ndim_T , ndex_T )    ! T vert. eddy visc. coef.
-      CALL histwrite( nid_T, "votkeevm", it, avmu_evd      , ndim_T , ndex_T )    ! T enhan. vert. eddy visc. coef.
-      IF( lk_zdfddm ) THEN
-         CALL histwrite( nid_T, "voddmavs", it, fsavs(:,:,:), ndim_T, ndex_T )    ! S vert. eddy diff. coef.
-      ENDIF
-
-      ! 3. Synchronise and close all files
-      ! ---------------------------------------
-      IF( MOD( kt, nwrite ) == 0 .OR. kindic < 0 ) THEN
-         CALL histsync( nid_T )
-      ENDIF
-
-      !  Create an output files (output.abort.nc) if S < 0 or u > 20 m/s
-      IF( kindic < 0 )   CALL dia_wri_state( 'output.abort' )
-
-      IF( kt == nitend .OR. kindic < 0 ) THEN
-         CALL histclo( nid_T )
-      ENDIF
-
-   END SUBROUTINE dia_wri_1d
-#else
-   !!----------------------------------------------------------------------
-   !!   Default key                                     NO 1D Config
-   !!----------------------------------------------------------------------
-CONTAINS
-   SUBROUTINE dia_wri_1d ( kt, kindic )
-      WRITE(*,*) 'dia_wri_1d: You should not have seen this print! error?', kt, kindic
-   END SUBROUTINE dia_wri_1d
-#endif
-
-   !!======================================================================
-END MODULE diawri1d
Index: /trunk/NEMO/C1D_SRC/diawri_c1d.F90
===================================================================
--- /trunk/NEMO/C1D_SRC/diawri_c1d.F90	(revision 899)
+++ /trunk/NEMO/C1D_SRC/diawri_c1d.F90	(revision 899)
@@ -0,0 +1,469 @@
+MODULE diawri1d
+   !!======================================================================
+   !!                     ***  MODULE  diawri1d  ***
+   !! Ocean diagnostics :  write ocean output files
+   !!=====================================================================
+#if defined key_c1d
+   !!----------------------------------------------------------------------
+   !!   'key_c1d'               1D Configuration
+   !!----------------------------------------------------------------------  
+   !!----------------------------------------------------------------------
+   !! * Modules used
+   USE oce             ! ocean dynamics and tracers 
+   USE dom_oce         ! ocean space and time domain
+   USE zdf_oce         ! ocean vertical physics
+   USE sbc_oce         ! surface boundary condition: ocean
+   USE sbc_ice         ! surface boundary condition: ice
+   USE zdftke          ! TKE vertical mixing
+   USE zdfkpp          ! KPP vertical mixing
+   USE sol_oce         ! solver variables
+   USE ice_oce         ! ice variables
+   USE phycst          ! physical constants
+   USE ocfzpt          ! ???
+   USE zdfmxl          ! mixed layer
+   USE daymod          ! calendar
+   USE dianam          ! build name of file (routine)
+   USE diawri
+   USE zdfddm          ! vertical  physics: double diffusion
+   USE diahth          ! thermocline diagnostics
+   USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
+   USE in_out_manager  ! I/O manager
+
+   IMPLICIT NONE
+   PRIVATE
+
+   !! * Accessibility
+   PUBLIC dia_wri_1d                 ! routines called by step.F90
+   !! * Module variables
+   INTEGER ::   &
+      nid_T, nz_T, nh_T, ndim_T, ndim_hT,      &   ! grid_T file
+      ndex(1)                                      ! ???
+   INTEGER, DIMENSION(jpi*jpj) ::   &
+      ndex_hT
+   INTEGER, DIMENSION(jpi*jpj*jpk) ::   &
+      ndex_T
+
+   !! * Substitutions
+#  include "zdfddm_substitute.h90"
+   !!----------------------------------------------------------------------
+   !!   OPA 9.0 , LOCEAN-IPSL  (2005)
+   !! $Id$
+   !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt
+   !!----------------------------------------------------------------------
+
+CONTAINS
+   !!----------------------------------------------------------------------
+   !!   Default option                                   NetCDF output file
+   !!----------------------------------------------------------------------
+   !!   dia_wri_1d       : create the standart NetCDF output files
+   !!   dia_wri_state_1d : create an output NetCDF file for a single
+   !!                      instantaeous ocean state and forcing fields
+   !!----------------------------------------------------------------------
+
+   SUBROUTINE dia_wri_1d( kt, kindic )
+      !!---------------------------------------------------------------------
+      !!                  ***  ROUTINE dia_wri_1d  ***
+      !!                   
+      !! ** Purpose :   Standard output of opa: dynamics and tracer fields 
+      !!      NETCDF format is used by default 
+      !!
+      !! ** Method  :   At the beginning of the first time step (nit000), 
+      !!      define all the NETCDF files and fields
+      !!      At each time step call histdef to compute the mean if ncessary
+      !!      Each nwrite time step, output the instantaneous or mean fields
+      !!      IF kindic <0, output of fields before the model interruption.
+      !!      IF kindic =0, time step loop
+      !!      IF kindic >0, output of fields before the time step loop
+      !!
+      !! History :
+      !!        !  91-03  (M.-A. Foujols)  Original code
+      !!        !  91-11  (G. Madec)
+      !!        !  92-06  (M. Imbard)  correction restart file
+      !!        !  92-07  (M. Imbard)  split into diawri and rstwri
+      !!        !  93-03  (M. Imbard)  suppress writibm
+      !!        !  98-01  (C. Levy)  NETCDF format using ioipsl INTERFACE
+      !!        !  99-02  (E. Guilyardi)  name of netCDF files + variables
+      !!   8.5  !  02-09  (G. Madec)  F90: Free form and module
+      !!   9.0  !  04-10  (C. Ethe)   1D Configuration
+      !!    "   !  05-11  (V. Garnier) Surface pressure gradient organization
+      !!----------------------------------------------------------------------
+      !! * Modules used
+      USE ioipsl
+
+      !! * Arguments
+      INTEGER, INTENT( in ) ::   kt      ! ocean time-step index
+      INTEGER, INTENT( in ) ::   kindic  ! 
+
+      !! * Local declarations
+      LOGICAL ::   ll_print = .FALSE.    ! =T print and flush numout
+      CHARACTER (len=40) ::           &
+         clhstnam, clop, clmx            ! temporary names
+      INTEGER ::   inum = 11             ! temporary logical unit
+      INTEGER ::   &
+         ji, jj, ik                      ! dummy loop indices
+      INTEGER ::   &
+         iimi, iima, ipk, it,         &  ! temporary integers
+         ijmi, ijma                      !    "          "
+      REAL(wp) ::   &
+         zsto, zout, zmax,            &  ! temporary scalars
+         zjulian, zdt                    !    "         "
+      REAL(wp), DIMENSION(jpi,jpj) :: &
+         zw2d                            ! temporary workspace
+      !!----------------------------------------------------------------------
+      
+      ! 0. Initialisation
+      ! -----------------
+      
+      ! local variable for debugging
+      ll_print = .FALSE.
+      ll_print = ll_print .AND. lwp
+
+      ! Define frequency of output and means
+      zdt = rdt
+      IF( nacc == 1 ) zdt = rdtmin
+#if defined key_diainstant
+      zsto = nwrite * 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 = nwrite * zdt
+      zmax = ( nitend - nit000 + 1 ) * zdt
+
+      ! Define indices of the horizontal output zoom and vertical limit storage
+      iimi = 1      ;      iima = jpi
+      ijmi = 1      ;      ijma = jpj
+      ipk = jpk
+
+      ! define time axis
+      it = kt - nit000 + 1
+
+
+      ! 1. Define NETCDF files and fields at beginning of first time step
+      ! -----------------------------------------------------------------
+
+      IF(ll_print) WRITE(numout,*) 'dia_wri_1d kt = ', kt, ' kindic ', kindic
+
+      IF( kt == nit000 ) THEN
+
+         ! Define the NETCDF files (one per grid)
+         
+         ! Compute julian date from starting date of the run
+         CALL ymds2ju( nyear, nmonth, nday, 0.e0, zjulian )
+         IF(lwp)WRITE(numout,*)
+         IF(lwp)WRITE(numout,*) 'Date 0 used :', nit000, ' YEAR ', nyear,   &
+            &                    ' MONTH ', nmonth, ' DAY ', nday, 'Julian day : ', zjulian
+         IF(lwp)WRITE(numout,*) ' indexes of zoom = ', iimi, iima, ijmi, ijma,   &
+                                 ' limit storage in depth = ', ipk
+
+         ! WRITE root name in date.file for use by postpro
+         CALL dia_nam( clhstnam, nwrite,' ' )
+         CALL ctlopn( inum, 'date.file', 'UNKNOWN', 'FORMATTED', 'SEQUENTIAL', 1, numout, lwp, 1 )
+         WRITE(inum,*) clhstnam
+         CLOSE(inum)
+         
+         ! Define the T grid FILE ( nid_T )
+         
+         CALL dia_nam( clhstnam, nwrite, 'grid_T' )
+         IF(lwp) WRITE(numout,*) " Name of NETCDF file ", clhstnam    ! filename
+         CALL histbeg( clhstnam, jpi, glamt, jpj, gphit,           &  ! Horizontal grid: glamt and gphit
+            &          iimi, iima-iimi+1, ijmi, ijma-ijmi+1,       &
+            &          0, zjulian, zdt, nh_T, nid_T, domain_id=nidom )
+         CALL histvert( nid_T, "deptht", "Vertical T levels",      &  ! Vertical grid: gdept
+            &           "m", ipk, gdept_0, nz_T )
+         !                                                            ! Index of ocean points
+         CALL wheneq( jpi*jpj*ipk, tmask, 1, 1., ndex_T , ndim_T  )      ! volume
+         CALL wheneq( jpi*jpj    , tmask, 1, 1., ndex_hT, ndim_hT )      ! surface
+
+
+         ! Declare all the output fields as NETCDF variables
+
+         !                                                                                      !!! nid_T : 3D
+         CALL histdef( nid_T, "votemper", "Temperature"                        , "C"      ,   &  ! tn
+            &          jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout )
+         CALL histdef( nid_T, "vosaline", "Salinity"                           , "PSU"    ,   &  ! sn
+            &          jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout )
+         !                                                                                      !!! nid_T : 2D
+         CALL histdef( nid_T, "sosstsst", "Sea Surface temperature"            , "C"      ,   &  ! sst
+            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
+         CALL histdef( nid_T, "sosaline", "Sea Surface Salinity"               , "PSU"    ,   &  ! sss
+            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
+
+!!$#if ! defined key_dynspg_rl && ( defined key_lim2 || defined key_lim2 )
+!!$         ! sowaflup = sowaflep + sorunoff + sowafldp + a term associated to
+!!$         !    internal damping to Levitus that can be diagnosed from others
+!!$         ! sowaflcd = sowaflep + sorunoff + sowafldp + iowaflup
+!!$         CALL histdef( nid_T, "iowaflup", "Ice=>ocean net freshwater"          , "kg/m2/s",   &  ! fsalt
+!!$            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
+!!$         CALL histdef( nid_T, "sowaflep", "atmos=>ocean net freshwater"        , "kg/m2/s",   &  ! fmass
+!!$            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
+!!$#endif
+         CALL histdef( nid_T, "sowaflup", "Net Upward Water Flux"              , "Kg/m2/s",   &  ! emp
+            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
+         CALL histdef( nid_T, "sorunoff", "Runoffs"                            , "Kg/m2/s",   &  ! runoffs
+            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
+         CALL histdef( nid_T, "sowaflcd", "concentration/dilution water flux"  , "kg/m2/s",   &  ! emps
+            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
+         CALL histdef( nid_T, "sosalflx", "Surface Salt Flux"                  , "Kg/m2/s",   &  ! emps * sn
+            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
+         CALL histdef( nid_T, "sohefldo", "Net Downward Heat Flux"             , "W/m2"   ,   &  ! qsr + qns
+            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
+         CALL histdef( nid_T, "soshfldo", "Shortwave Radiation"                , "W/m2"   ,   &  ! qsr
+            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
+         CALL histdef( nid_T, "somxl010", "Mixed Layer Depth 0.01"             , "m"      ,   &  ! hmlp
+            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
+#if defined key_zdfkpp
+         CALL histdef( nid_T, "sokppekd", "Ekman depth                     "   , "m"      ,   &  ! sokppekd
+            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
+         CALL histdef( nid_T, "sokppbld", "Boundary Layer Depth            "   , "m"      ,   &  ! sokppbld
+            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
+#endif
+         CALL histdef( nid_T, "somxlavt", "AVT : bottom of the mixed layer    ", "m"      ,   &  ! avt_mxl
+            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
+         CALL histdef( nid_T, "somixhgt", "Turbocline Depth"                   , "m"      ,   &  ! hmld
+            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
+         CALL histdef( nid_T, "soicecov", "Ice Cover"                          , "[0,1]"  ,   &  ! freeze
+            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
+#if ! defined key_coupled 
+         CALL histdef( nid_T, "sohefldp", "Surface Heat Flux: Damping"         , "W/m2"   ,   &  ! qrp
+            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
+         CALL histdef( nid_T, "sowafldp", "Surface Water Flux: Damping"        , "Kg/m2/s",   &  ! erp
+            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
+         CALL histdef( nid_T, "sosafldp", "Surface salt flux: damping"         , "Kg/m2/s",   &  ! erp * sn
+            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
+#endif
+
+#if ( defined key_coupled && ! ( defined key_lim3 || defined key_lim2 ) ) 
+         CALL histdef( nid_T, "sohefldp", "Surface Heat Flux: Damping"         , "W/m2"   ,   &  ! qrp
+            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
+         CALL histdef( nid_T, "sowafldp", "Surface Water Flux: Damping"        , "Kg/m2/s",   &  ! erp
+            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
+         CALL histdef( nid_T, "sosafldp", "Surface salt flux: Damping"         , "Kg/m2/s",   &  ! erp * sn
+            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
+#endif
+         clmx ="l_max(only(x))"    ! max index on a period
+         CALL histdef( nid_T, "sobowlin", "Bowl Index"                         , "W-point",   &  ! bowl INDEX 
+            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clmx, zsto, zout )
+#if defined key_diahth
+         CALL histdef( nid_T, "sothedep", "Thermocline Depth"                  , "m"      ,   & ! hth
+            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
+         CALL histdef( nid_T, "so20chgt", "Depth of 20C isotherm"              , "m"      ,   & ! hd20
+            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
+         CALL histdef( nid_T, "so28chgt", "Depth of 28C isotherm"              , "m"      ,   & ! hd28
+            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
+         CALL histdef( nid_T, "sohtc300", "Heat content 300 m"                 , "W"      ,   & ! htc3
+            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
+#endif
+
+#if ( defined key_lim3 || defined key_lim2 ) && defined key_coupled
+         CALL histdef( nid_T,"soicetem" , "Ice Surface Temperature"            , "K"      ,   &  ! tn_ice
+            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
+         CALL histdef( nid_T,"soicealb" , "Ice Albedo"                         , "[0,1]"  ,   &  ! alb_ice
+            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
+#endif 
+
+         !                                                                                      !!! nid_U : 3D
+         CALL histdef( nid_T, "vozocrtx", "Zonal Current"                      , "m/s"    ,   &  ! un
+            &          jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout )
+#if defined key_diaeiv
+         CALL histdef( nid_T, "vozoeivu", "Zonal EIV Current"                  , "m/s"    ,   &  ! u_eiv
+            &          jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout )
+#endif
+         !                                                                                      !!! nid_U : 2D
+         CALL histdef( nid_T, "sozotaux", "Wind Stress along i-axis"           , "N/m2"   ,   &  ! utau
+            &          jpi, jpj, nh_T, 1  , 1, 1  , - 99, 32, clop, zsto, zout )
+
+         !                                                                                      !!! nid_V : 3D
+         CALL histdef( nid_T, "vomecrty", "Meridional Current"                 , "m/s"    ,   &  ! vn
+            &          jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout )
+#if defined key_diaeiv
+         CALL histdef( nid_T, "vomeeivv", "Meridional EIV Current"             , "m/s"    ,   &  ! v_eiv
+            &          jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout )
+#endif
+         !                                                                                      !!! nid_V : 2D
+         CALL histdef( nid_T, "sometauy", "Wind Stress along j-axis"           , "N/m2"   ,   &  ! vtau
+            &          jpi, jpj, nh_T, 1  , 1, 1  , - 99, 32, clop, zsto, zout )
+#if defined key_zdftke
+         !                                                                                      !!! nid_W : 3D
+         CALL histdef( nid_T, "votlsdis", " Dissipation Turbulent Lenght Scale", "m"      ,   &  ! e_dis
+            &          jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout )
+         !
+         CALL histdef( nid_T, "votlsmix", " Mixing Turbulent Lenght Scale"     , "m"      ,   &  ! e_mix
+            &          jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout )
+         !
+         CALL histdef( nid_T, "votlspdl", " Prandl Number",                      "-"       ,   &  ! e_pdl
+            &          jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout )
+         !
+         CALL histdef( nid_T, "votlsric", " Local Richardson Number",            "-"       ,   &  ! e_ric
+            &          jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout )
+         !
+         CALL histdef( nid_T, "votkeend", "TKE: Turbulent kinetic energy"       , "m2/s"   ,   &  ! TKE
+            &          jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout )
+#endif
+#if defined key_zdfkpp
+         !                                                                                      !!! nid_W : 3D
+         CALL histdef( nid_T, "vokpprig", " Gradient Richardson Number"        ,  "-"      ,   &  ! rig
+            &          jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout )
+         !
+         CALL histdef( nid_T, "vokpprib", " Bulk Richardson Number    "        ,  "-"      ,   &   ! rib
+            &          jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout )
+         !
+         CALL histdef( nid_T, "vokppbsf", " Buoyancy forcing          "        , "N/m2"    ,   &  ! sokppbsf
+            &          jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout )
+         !
+         CALL histdef( nid_T, "vokppmol", "Moning Obukhov length scale     "   , "m"       ,   &  ! sokppmol
+            &          jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout )
+#endif
+         !
+         CALL histdef( nid_T, "voeosbn2", "Brunt-Vaisala Frequency"             , "m2/s2"  ,   &  ! rn2
+            &          jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout )
+
+         CALL histdef( nid_T, "votkeavt", "Vertical Eddy Diffusivity"          , "m2/s"   ,   &  ! avt
+            &          jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout )
+
+         CALL histdef( nid_T, "votkeevd", "Enhanced Vertical Diffusivity",       "m2/s"   ,   &  ! avt_evd
+            &          jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout )
+
+         CALL histdef( nid_T, "votkeavm", "Vertical Eddy Viscosity",             "m2/s"   ,   &  ! avmu
+            &          jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout )
+         !
+         CALL histdef( nid_T, "votkeevm", "Enhanced Vertical Viscosity",         "m2/s"   ,   &  ! avmu_evd
+            &          jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout )
+
+         IF( lk_zdfddm ) THEN
+            CALL histdef( nid_T,"voddmavs","Salt Vertical Eddy Diffusivity"    , "m2/s"   ,   &  ! avs
+               &          jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout )
+         ENDIF
+
+         CALL histend( nid_T )
+
+         IF(lwp) WRITE(numout,*)
+         IF(lwp) WRITE(numout,*) 'End of NetCDF Initialization'
+         IF(ll_print) CALL FLUSH(numout )
+
+      ENDIF
+
+      ! 2. Start writing data
+      ! ---------------------
+
+      ! ndex(1) est utilise ssi l'avant dernier argument est diffferent de 
+      ! la taille du tableau en sortie. Dans ce cas , l'avant dernier argument
+      ! donne le nombre d'elements, et ndex la liste des indices a sortir
+
+      IF( lwp .AND. MOD( kt, nwrite ) == 0 ) THEN 
+         WRITE(numout,*) 'dia_wri : write model outputs in NetCDF files at ', kt, 'time-step'
+         WRITE(numout,*) '~~~~~~ '
+      ENDIF
+
+      ! Write fields on T grid
+      CALL histwrite( nid_T, "votemper", it, tn            , ndim_T , ndex_T  )   ! temperature
+      CALL histwrite( nid_T, "vosaline", it, sn            , ndim_T , ndex_T  )   ! salinity
+      CALL histwrite( nid_T, "sosstsst", it, tn(:,:,1)     , ndim_hT, ndex_hT )   ! sea surface temperature
+      CALL histwrite( nid_T, "sosaline", it, sn(:,:,1)     , ndim_hT, ndex_hT )   ! sea surface salinity
+#if ! defined key_dynspg_rl && ( defined key_lim3 || defined key_lim2 )
+      CALL histwrite( nid_T, "iowaflup", it, fsalt(:,:)    , ndim_hT, ndex_hT )   ! ice=>ocean water flux
+      CALL histwrite( nid_T, "sowaflep", it, fmass(:,:)    , ndim_hT, ndex_hT )   ! atmos=>ocean water flux
+#endif
+      CALL histwrite( nid_T, "sowaflup", it, emp           , ndim_hT, ndex_hT )   ! upward water flux
+      CALL histwrite( nid_T, "sorunoff", it, runoff        , ndim_hT, ndex_hT )   ! runoff
+      CALL histwrite( nid_T, "sowaflcd", it, emps          , ndim_hT, ndex_hT )   ! c/d water flux
+      zw2d(:,:) = emps(:,:) * sn(:,:,1) * tmask(:,:,1)
+      CALL histwrite( nid_T, "sosalflx", it, zw2d          , ndim_hT, ndex_hT )   ! c/d salt flux
+      CALL histwrite( nid_T, "sohefldo", it, qsr + qns     , ndim_hT, ndex_hT )   ! total heat flux
+      CALL histwrite( nid_T, "soshfldo", it, qsr           , ndim_hT, ndex_hT )   ! solar heat flux
+      CALL histwrite( nid_T, "somxl010", it, hmlp          , ndim_hT, ndex_hT )   ! mixed layer depth
+#if defined key_zdfkpp
+      CALL histwrite( nid_T, "sokppekd", it, ekdp          , ndim_hT, ndex_hT )   ! Ekman depht
+      CALL histwrite( nid_T, "sokppbld", it, hkpp          , ndim_hT, ndex_hT )   ! boundary layer depth 
+#endif  
+      ! store the vertical eddy diffusivity coef. at the bottom of the mixed layer
+      DO jj = 1, jpj
+         DO ji = 1, jpi
+            ik = nmln(ji,jj)
+            zw2d(ji,jj) = avt(ji,jj,ik) * tmask(ji,jj,1)
+         END DO
+      END DO
+      CALL histwrite( nid_T, "somxlavt", it, zw2d          , ndim_hT, ndex_hT )   ! Kz at bottom of mixed layer 
+      CALL histwrite( nid_T, "somixhgt", it, hmld          , ndim_hT, ndex_hT )   ! turbocline depth
+      CALL histwrite( nid_T, "soicecov", it, freeze        , ndim_hT, ndex_hT )   ! ice cover 
+#if ! defined key_coupled
+      CALL histwrite( nid_T, "sohefldp", it, qrp           , ndim_hT, ndex_hT )   ! heat flux damping
+      CALL histwrite( nid_T, "sowafldp", it, erp           , ndim_hT, ndex_hT )   ! freshwater flux damping
+      zw2d(:,:) = erp(:,:) * sn(:,:,1) * tmask(:,:,1)
+      CALL histwrite( nid_T, "sosafldp", it, zw2d          , ndim_hT, ndex_hT )   ! salt flux damping
+#endif
+#if ( defined key_coupled && ! ( defined key_lim3 || defined key_lim2 ) ) 
+      CALL histwrite( nid_T, "sohefldp", it, qrp           , ndim_hT, ndex_hT )   ! heat flux damping
+      CALL histwrite( nid_T, "sowafldp", it, erp           , ndim_hT, ndex_hT )   ! freshwater flux damping
+         zw2d(:,:) = erp(:,:) * sn(:,:,1) * tmask(:,:,1)
+      CALL histwrite( nid_T, "sosafldp", it, zw2d          , ndim_hT, ndex_hT )   ! salt flux damping
+#endif
+         zw2d(:,:) = FLOAT( nmln(:,:) ) * tmask(:,:,1)
+      CALL histwrite( nid_T, "sobowlin", it, zw2d          , ndim_hT, ndex_hT )   ! ???
+
+#if defined key_diahth
+      CALL histwrite( nid_T, "sothedep", it, hth           , ndim_hT, ndex_hT )   ! depth of the thermocline
+      CALL histwrite( nid_T, "so20chgt", it, hd20          , ndim_hT, ndex_hT )   ! depth of the 20 isotherm
+      CALL histwrite( nid_T, "so28chgt", it, hd28          , ndim_hT, ndex_hT )   ! depth of the 28 isotherm
+      CALL histwrite( nid_T, "sohtc300", it, htc3          , ndim_hT, ndex_hT )   ! first 300m heaat content
+#endif
+#if ( defined key_lim3 || defined key_lim2 ) &&  defined key_coupled 
+      CALL histwrite( nid_T, "soicetem", it, tn_ice        , ndim_hT, ndex_hT )   ! surf. ice temperature
+      CALL histwrite( nid_T, "soicealb", it, alb_ice       , ndim_hT, ndex_hT )   ! ice albedo
+#endif
+
+      CALL histwrite( nid_T, "vozocrtx", it, un            , ndim_T , ndex_T )    ! i-current
+      CALL histwrite( nid_T, "sozotaux", it, utau          , ndim_hT, ndex_hT )   ! i-wind stress
+      CALL histwrite( nid_T, "vomecrty", it, vn            , ndim_T , ndex_T  )   ! j-current
+      CALL histwrite( nid_T, "sometauy", it, vtau          , ndim_hT, ndex_hT )   ! j-wind stress
+#if defined key_zdftke
+      CALL histwrite( nid_T, "votlsdis", it, e_dis         , ndim_T , ndex_T )    ! Diss. Turb. lenght scale
+      CALL histwrite( nid_T, "votlsmix", it, e_mix         , ndim_T , ndex_T )    ! Mixing Turb. lenght scale
+      CALL histwrite( nid_T, "votlspdl", it, e_pdl         , ndim_T , ndex_T )    ! Prandl number
+      CALL histwrite( nid_T, "votlsric", it, e_ric         , ndim_T , ndex_T )    ! local Richardson number
+      CALL histwrite( nid_T, "votkeend", it, en            , ndim_T , ndex_T )    ! TKE
+#endif
+#if defined key_zdfkpp
+      CALL histwrite( nid_T, "vokpprig", it, rig           , ndim_T , ndex_T )    ! gradient Richardson number
+      CALL histwrite( nid_T, "vokpprib", it, rib           , ndim_T , ndex_T )    ! bulk Richardson number
+      CALL histwrite( nid_T, "vokppbsf", it, buof          , ndim_T , ndex_T )    ! buoyancy forcing
+      CALL histwrite( nid_T, "vokppmol", it, mols          , ndim_T , ndex_T )    ! Moning-Obukov length scale
+#endif
+      CALL histwrite( nid_T, "voeosbn2", it, rn2           , ndim_T , ndex_T )    ! Brunt-Vaisala Frequency
+      CALL histwrite( nid_T, "votkeavt", it, avt           , ndim_T , ndex_T )    ! T vert. eddy diff. coef.
+      CALL histwrite( nid_T, "votkeevd", it, avt_evd       , ndim_T , ndex_T )    ! T enhan. vert. eddy diff. coef.
+      CALL histwrite( nid_T, "votkeavm", it, avmu          , ndim_T , ndex_T )    ! T vert. eddy visc. coef.
+      CALL histwrite( nid_T, "votkeevm", it, avmu_evd      , ndim_T , ndex_T )    ! T enhan. vert. eddy visc. coef.
+      IF( lk_zdfddm ) THEN
+         CALL histwrite( nid_T, "voddmavs", it, fsavs(:,:,:), ndim_T, ndex_T )    ! S vert. eddy diff. coef.
+      ENDIF
+
+      ! 3. Synchronise and close all files
+      ! ---------------------------------------
+      IF( MOD( kt, nwrite ) == 0 .OR. kindic < 0 ) THEN
+         CALL histsync( nid_T )
+      ENDIF
+
+      !  Create an output files (output.abort.nc) if S < 0 or u > 20 m/s
+      IF( kindic < 0 )   CALL dia_wri_state( 'output.abort' )
+
+      IF( kt == nitend .OR. kindic < 0 ) THEN
+         CALL histclo( nid_T )
+      ENDIF
+
+   END SUBROUTINE dia_wri_1d
+#else
+   !!----------------------------------------------------------------------
+   !!   Default key                                     NO 1D Config
+   !!----------------------------------------------------------------------
+CONTAINS
+   SUBROUTINE dia_wri_1d ( kt, kindic )
+      WRITE(*,*) 'dia_wri_1d: You should not have seen this print! error?', kt, kindic
+   END SUBROUTINE dia_wri_1d
+#endif
+
+   !!======================================================================
+END MODULE diawri1d
Index: unk/NEMO/C1D_SRC/dyncor1d.F90
===================================================================
--- /trunk/NEMO/C1D_SRC/dyncor1d.F90	(revision 898)
+++ 	(revision )
@@ -1,169 +1,0 @@
-MODULE dyncor1d
-   !!======================================================================
-   !!                     ***  MODULE  ini1D  ***
-   !! Ocean state   :  1D initialization
-   !!=====================================================================
-#if defined key_cfg_1d
-   !!----------------------------------------------------------------------
-   !!   'key_cfg_1d'               1D Configuration
-   !!----------------------------------------------------------------------
-   !!----------------------------------------------------------------------
-   !!   fcorio_1d   : Coriolis factor at T-point
-   !!   dyn_cor_1d  : vorticity trend due to Coriolis
-   !!----------------------------------------------------------------------
-   !! * Modules used
-   USE oce            ! ocean dynamics and tracers
-   USE dom_oce        ! ocean space and time domain
-   USE phycst         ! physical constants
-   USE in_out_manager ! I/O manager
-   USE prtctl         ! Print control
-
-   IMPLICIT NONE
-   PRIVATE
-
-   !! * Routine accessibility
-   PUBLIC fcorio_1d   ! routine called by OPA.F90
-   PUBLIC dyn_cor_1d  ! routine called by step1d.F90
-
-   !! * Substitutions
-#  include "vectopt_loop_substitute.h90"
-   !!----------------------------------------------------------------------
-   !!   OPA 9.0 , LOCEAN-IPSL (2005) 
-   !! $Header$ 
-   !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt 
-   !!----------------------------------------------------------------------
-
-CONTAINS
-
-   SUBROUTINE fcorio_1d
-      !!----------------------------------------------------------------------
-      !!                   ***  ROUTINE fcorio_1d  ***
-      !! 
-      !! ** Purpose : Compute the Coriolis factor at T-point
-      !!
-      !! ** Method  :
-      !!
-      !! History :
-      !!   9.0  !  04-09  (C. Ethe) 1D configuration
-      !!----------------------------------------------------------------------
-      !! * Local declarations
-      !!----------------------------------------------------------------------
-      REAL(wp) ::   &
-         zphi0, zbeta, zf0         !  temporary scalars
- 
-
-      !!----------------------------------------------------------------------
-
-      ! ================= !
-      !  Coriolis factor  !
-      ! ================= !
-      IF(lwp) WRITE(numout,*)
-      IF(lwp) WRITE(numout,*) 'fcorio_1d : Coriolis factor at T-point'
-      IF(lwp) WRITE(numout,*) '~~~~~~~~~~~'
-
-      SELECT CASE( jphgr_msh )   ! type of horizontal mesh
-
-      CASE ( 0, 1, 4 )               ! mesh on the sphere
-
-         ff(:,:) = 2. * omega * SIN( rad * gphit(:,:) ) 
-
-      CASE ( 2 )                     ! f-plane at ppgphi0 
-
-         ff(:,:) = 2. * omega * SIN( rad * ppgphi0 )
-
-         IF(lwp) WRITE(numout,*) '          f-plane: Coriolis parameter = constant = ', ff(1,1)
-
-      CASE ( 3 )                     ! beta-plane
-
-         zbeta   = 2. * omega * COS( rad * ppgphi0 ) / ra                     ! beta at latitude ppgphi0
-         zphi0   = ppgphi0 - FLOAT( jpjglo/2) * ppe2_m *1.e-3  / ( ra * rad ) ! latitude of the first row F-points
-         zf0     = 2. * omega * SIN( rad * zphi0 )                            ! compute f0 1st point south
-
-         ff(:,:) = ( zf0  + zbeta * gphit(:,:) * 1.e+3 )                      ! f = f0 +beta* y ( y=0 at south)
-
-         IF(lwp) WRITE(numout,*) '          Beta-plane: Beta parameter = constant = ', ff(1,1)
-         IF(lwp) WRITE(numout,*) '                      Coriolis parameter varies from ', ff(1,1),' to ', ff(1,jpj)
-
-      CASE ( 5 )                     ! beta-plane and rotated domain
-
-         zbeta = 2. * omega * COS( rad * ppgphi0 ) / ra                     ! beta at latitude ppgphi0
-         zphi0 = 15.e0                                                      ! latitude of the first row F-points
-         zf0   = 2. * omega * SIN( rad * zphi0 )                            ! compute f0 1st point south
-
-         ff(:,:) = ( zf0 + zbeta * ABS( gphit(:,:) - zphi0 ) * rad * ra )   ! f = f0 +beta* y ( y=0 at south)
-
-         IF(lwp) WRITE(numout,*) '          Beta-plane: Beta parameter = constant = ', ff(1,1)
-         IF(lwp) WRITE(numout,*) '                      Coriolis parameter varies from ', ff(1,1),' to ', ff(1,jpj)
-
-      END SELECT
-
-   END SUBROUTINE fcorio_1d
-
-
-   SUBROUTINE dyn_cor_1d( kt )
-      !!----------------------------------------------------------------------
-      !!                   ***  ROUTINE dyn_cor_1d  ***
-      !! 
-      !! ** Purpose :   Compute the now total vorticity trend and add it to 
-      !!               the general trend of the momentum equation
-      !!
-      !! ** Method  :
-      !!
-      !! History :
-      !!   9.0  !  04-09  (C. Ethe) 1D configuration
-      !!----------------------------------------------------------------------
-      !! * Arguments
-      INTEGER, INTENT( in ) ::   kt        ! ocean time-step index
-
-      !! * Local declarations
-      INTEGER ::   ji, jj, jk              ! dummy loop indices
-      REAL(wp) ::   &
-         zua, zva                          ! temporary scalars
-
-      !!----------------------------------------------------------------------
-
-      IF( kt == nit000 ) THEN
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'dyn_cor_1d : total vorticity trend in 1D'
-         IF(lwp) WRITE(numout,*) '~~~~~~~~~~'
-      ENDIF
-
-      DO jk = 1, jpkm1
-         DO jj = 2, jpjm1
-            DO ji = fs_2, fs_jpim1   ! vector opt.
-               zua =    ff(ji,jj) * vn(ji,jj,jk)
-               zva =  - ff(ji,jj) * un(ji,jj,jk)
-               ua(ji,jj,jk) = ua(ji,jj,jk) + zua
-               va(ji,jj,jk) = va(ji,jj,jk) + zva
-            END DO
-         END DO
-      END DO   
-
-      IF(ln_ctl)   THEN
-         CALL prt_ctl(tab3d_1=ua, clinfo1=' cor  - Ua: ', mask1=umask, &
-            &         tab3d_2=va, clinfo2=' Va: ', mask2=vmask)
-      ENDIF
-
-!     IF(l_ctl) THEN         ! print sum trends (used for debugging)
-!        zua = SUM( ua(2:nictl,2:njctl,1:jpkm1) * umask(2:nictl,2:njctl,1:jpkm1) )
-!        zva = SUM( va(2:nictl,2:njctl,1:jpkm1) * vmask(2:nictl,2:njctl,1:jpkm1) )
-!        WRITE(numout,*) ' cor  - Ua: ', zua-u_ctl, ' Va: ', zva-v_ctl
-!        u_ctl = zua   ;   v_ctl = zva
-!     ENDIF
-
-   END SUBROUTINE dyn_cor_1d
-
-#else
-   !!----------------------------------------------------------------------
-   !!   Default key                                     NO 1D Config
-   !!----------------------------------------------------------------------
-CONTAINS
-   SUBROUTINE fcorio_1d      ! Empty routine
-   END SUBROUTINE fcorio_1d   
-   SUBROUTINE dyn_cor_1d ( kt )
-      WRITE(*,*) 'dyn_cor_1d: You should not have seen this print! error?', kt
-   END SUBROUTINE dyn_cor_1d
-#endif
-
-   !!=====================================================================
-END MODULE dyncor1d
Index: /trunk/NEMO/C1D_SRC/dyncor_c1d.F90
===================================================================
--- /trunk/NEMO/C1D_SRC/dyncor_c1d.F90	(revision 899)
+++ /trunk/NEMO/C1D_SRC/dyncor_c1d.F90	(revision 899)
@@ -0,0 +1,169 @@
+MODULE dyncor1d
+   !!======================================================================
+   !!                     ***  MODULE  ini1D  ***
+   !! Ocean state   :  1D initialization
+   !!=====================================================================
+#if defined key_c1d
+   !!----------------------------------------------------------------------
+   !!   'key_c1d'               1D Configuration
+   !!----------------------------------------------------------------------
+   !!----------------------------------------------------------------------
+   !!   fcorio_1d   : Coriolis factor at T-point
+   !!   dyn_cor_1d  : vorticity trend due to Coriolis
+   !!----------------------------------------------------------------------
+   !! * Modules used
+   USE oce            ! ocean dynamics and tracers
+   USE dom_oce        ! ocean space and time domain
+   USE phycst         ! physical constants
+   USE in_out_manager ! I/O manager
+   USE prtctl         ! Print control
+
+   IMPLICIT NONE
+   PRIVATE
+
+   !! * Routine accessibility
+   PUBLIC fcorio_1d   ! routine called by OPA.F90
+   PUBLIC dyn_cor_1d  ! routine called by step1d.F90
+
+   !! * Substitutions
+#  include "vectopt_loop_substitute.h90"
+   !!----------------------------------------------------------------------
+   !!   OPA 9.0 , LOCEAN-IPSL (2005) 
+   !! $Header$ 
+   !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt 
+   !!----------------------------------------------------------------------
+
+CONTAINS
+
+   SUBROUTINE fcorio_1d
+      !!----------------------------------------------------------------------
+      !!                   ***  ROUTINE fcorio_1d  ***
+      !! 
+      !! ** Purpose : Compute the Coriolis factor at T-point
+      !!
+      !! ** Method  :
+      !!
+      !! History :
+      !!   9.0  !  04-09  (C. Ethe) 1D configuration
+      !!----------------------------------------------------------------------
+      !! * Local declarations
+      !!----------------------------------------------------------------------
+      REAL(wp) ::   &
+         zphi0, zbeta, zf0         !  temporary scalars
+ 
+
+      !!----------------------------------------------------------------------
+
+      ! ================= !
+      !  Coriolis factor  !
+      ! ================= !
+      IF(lwp) WRITE(numout,*)
+      IF(lwp) WRITE(numout,*) 'fcorio_1d : Coriolis factor at T-point'
+      IF(lwp) WRITE(numout,*) '~~~~~~~~~~~'
+
+      SELECT CASE( jphgr_msh )   ! type of horizontal mesh
+
+      CASE ( 0, 1, 4 )               ! mesh on the sphere
+
+         ff(:,:) = 2. * omega * SIN( rad * gphit(:,:) ) 
+
+      CASE ( 2 )                     ! f-plane at ppgphi0 
+
+         ff(:,:) = 2. * omega * SIN( rad * ppgphi0 )
+
+         IF(lwp) WRITE(numout,*) '          f-plane: Coriolis parameter = constant = ', ff(1,1)
+
+      CASE ( 3 )                     ! beta-plane
+
+         zbeta   = 2. * omega * COS( rad * ppgphi0 ) / ra                     ! beta at latitude ppgphi0
+         zphi0   = ppgphi0 - FLOAT( jpjglo/2) * ppe2_m *1.e-3  / ( ra * rad ) ! latitude of the first row F-points
+         zf0     = 2. * omega * SIN( rad * zphi0 )                            ! compute f0 1st point south
+
+         ff(:,:) = ( zf0  + zbeta * gphit(:,:) * 1.e+3 )                      ! f = f0 +beta* y ( y=0 at south)
+
+         IF(lwp) WRITE(numout,*) '          Beta-plane: Beta parameter = constant = ', ff(1,1)
+         IF(lwp) WRITE(numout,*) '                      Coriolis parameter varies from ', ff(1,1),' to ', ff(1,jpj)
+
+      CASE ( 5 )                     ! beta-plane and rotated domain
+
+         zbeta = 2. * omega * COS( rad * ppgphi0 ) / ra                     ! beta at latitude ppgphi0
+         zphi0 = 15.e0                                                      ! latitude of the first row F-points
+         zf0   = 2. * omega * SIN( rad * zphi0 )                            ! compute f0 1st point south
+
+         ff(:,:) = ( zf0 + zbeta * ABS( gphit(:,:) - zphi0 ) * rad * ra )   ! f = f0 +beta* y ( y=0 at south)
+
+         IF(lwp) WRITE(numout,*) '          Beta-plane: Beta parameter = constant = ', ff(1,1)
+         IF(lwp) WRITE(numout,*) '                      Coriolis parameter varies from ', ff(1,1),' to ', ff(1,jpj)
+
+      END SELECT
+
+   END SUBROUTINE fcorio_1d
+
+
+   SUBROUTINE dyn_cor_1d( kt )
+      !!----------------------------------------------------------------------
+      !!                   ***  ROUTINE dyn_cor_1d  ***
+      !! 
+      !! ** Purpose :   Compute the now total vorticity trend and add it to 
+      !!               the general trend of the momentum equation
+      !!
+      !! ** Method  :
+      !!
+      !! History :
+      !!   9.0  !  04-09  (C. Ethe) 1D configuration
+      !!----------------------------------------------------------------------
+      !! * Arguments
+      INTEGER, INTENT( in ) ::   kt        ! ocean time-step index
+
+      !! * Local declarations
+      INTEGER ::   ji, jj, jk              ! dummy loop indices
+      REAL(wp) ::   &
+         zua, zva                          ! temporary scalars
+
+      !!----------------------------------------------------------------------
+
+      IF( kt == nit000 ) THEN
+         IF(lwp) WRITE(numout,*)
+         IF(lwp) WRITE(numout,*) 'dyn_cor_1d : total vorticity trend in 1D'
+         IF(lwp) WRITE(numout,*) '~~~~~~~~~~'
+      ENDIF
+
+      DO jk = 1, jpkm1
+         DO jj = 2, jpjm1
+            DO ji = fs_2, fs_jpim1   ! vector opt.
+               zua =    ff(ji,jj) * vn(ji,jj,jk)
+               zva =  - ff(ji,jj) * un(ji,jj,jk)
+               ua(ji,jj,jk) = ua(ji,jj,jk) + zua
+               va(ji,jj,jk) = va(ji,jj,jk) + zva
+            END DO
+         END DO
+      END DO   
+
+      IF(ln_ctl)   THEN
+         CALL prt_ctl(tab3d_1=ua, clinfo1=' cor  - Ua: ', mask1=umask, &
+            &         tab3d_2=va, clinfo2=' Va: ', mask2=vmask)
+      ENDIF
+
+!     IF(l_ctl) THEN         ! print sum trends (used for debugging)
+!        zua = SUM( ua(2:nictl,2:njctl,1:jpkm1) * umask(2:nictl,2:njctl,1:jpkm1) )
+!        zva = SUM( va(2:nictl,2:njctl,1:jpkm1) * vmask(2:nictl,2:njctl,1:jpkm1) )
+!        WRITE(numout,*) ' cor  - Ua: ', zua-u_ctl, ' Va: ', zva-v_ctl
+!        u_ctl = zua   ;   v_ctl = zva
+!     ENDIF
+
+   END SUBROUTINE dyn_cor_1d
+
+#else
+   !!----------------------------------------------------------------------
+   !!   Default key                                     NO 1D Config
+   !!----------------------------------------------------------------------
+CONTAINS
+   SUBROUTINE fcorio_1d      ! Empty routine
+   END SUBROUTINE fcorio_1d   
+   SUBROUTINE dyn_cor_1d ( kt )
+      WRITE(*,*) 'dyn_cor_1d: You should not have seen this print! error?', kt
+   END SUBROUTINE dyn_cor_1d
+#endif
+
+   !!=====================================================================
+END MODULE dyncor1d
Index: unk/NEMO/C1D_SRC/dynnxt1d.F90
===================================================================
--- /trunk/NEMO/C1D_SRC/dynnxt1d.F90	(revision 898)
+++ 	(revision )
@@ -1,150 +1,0 @@
-MODULE dynnxt1d
-   !!======================================================================
-   !!                       ***  MODULE  dynnxt1d  ***
-   !! Ocean dynamics: time stepping in 1D configuration
-   !!======================================================================
-#if defined key_cfg_1d
-   !!----------------------------------------------------------------------
-   !!   'key_cfg_1d'               1D Configuration
-   !!----------------------------------------------------------------------  
-   !!----------------------------------------------------------------------
-   !!   dyn_nxt_1d   : update the horizontal velocity from the momentum trend
-   !!----------------------------------------------------------------------
-   !! * Modules used
-   USE oce             ! ocean dynamics and tracers
-   USE dom_oce         ! ocean space and time domain
-   USE in_out_manager  ! I/O manager
-   USE lbclnk          ! lateral boundary condition (or mpp link)
-   USE prtctl          ! Print control
-
-   IMPLICIT NONE
-   PRIVATE
-
-   !! * Accessibility
-   PUBLIC dyn_nxt_1d                ! routine called by step.F90
-   !!----------------------------------------------------------------------
-
-CONTAINS
-
-   SUBROUTINE dyn_nxt_1d ( kt )
-      !!----------------------------------------------------------------------
-      !!                  ***  ROUTINE dyn_nxt_1d  ***
-      !!                   
-      !! ** Purpose :   Compute the after horizontal velocity from the 
-      !!      momentum trend.
-      !!
-      !! ** Method  :   Apply lateral boundary conditions on the trends (ua,va) 
-      !!      through calls to routine lbc_lnk.
-      !!      After velocity is compute using a leap-frog scheme environment:
-      !!         (ua,va) = (ub,vb) + 2 rdt (ua,va)
-      !!      Time filter applied on now horizontal velocity to avoid the
-      !!      divergence of two consecutive time-steps and swap of dynamics
-      !!      arrays to start the next time step:
-      !!         (ub,vb) = (un,vn) + atfp [ (ub,vb) + (ua,va) - 2 (un,vn) ]
-      !!         (un,vn) = (ua,va) 
-      !!
-      !! ** Action : - Update ub,vb arrays, the before horizontal velocity
-      !!             - Update un,vn arrays, the now horizontal velocity
-      !!
-      !! History :
-      !!        !  87-02  (P. Andrich, D. L Hostis)  Original code
-      !!        !  90-10  (C. Levy, G. Madec)
-      !!        !  93-03  (M. Guyon)  symetrical conditions
-      !!        !  97-02  (G. Madec & M. Imbard)  opa, release 8.0
-      !!        !  97-04  (A. Weaver)  Euler forward step
-      !!        !  97-06  (G. Madec)  lateral boudary cond., lbc routine
-      !!   8.5  !  02-08  (G. Madec)  F90: Free form and module
-      !!        !  04-10  (C. Ethe) 1D configuration
-      !!----------------------------------------------------------------------
-      !! * Arguments
-      INTEGER, INTENT( in ) ::   kt      ! ocean time-step index
-
-      !! * Local declarations
-      INTEGER  ::   ji, jj, jk   ! dummy loop indices
-      REAL(wp) ::   z2dt         ! temporary scalar
-      !!----------------------------------------------------------------------
-      !!   OPA 9.0 , LOCEAN-IPSL (2005) 
-      !! $Header$ 
-      !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt 
-      !!----------------------------------------------------------------------
-
-      IF( kt == nit000 ) THEN
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'dyn_nxt_1d : time stepping on 1D configuation'
-         IF(lwp) WRITE(numout,*) '~~~~~~~'
-      ENDIF
-
-      ! Local constant initialization
-      z2dt = 2. * rdt
-      IF( neuler == 0 .AND. kt == nit000 )  z2dt = rdt
-
-      ! Lateral boundary conditions on ( ua, va )
-      CALL lbc_lnk( ua, 'U', -1. )
-      CALL lbc_lnk( va, 'V', -1. )
-
-      !                                                ! ===============
-      DO jk = 1, jpkm1                                 ! Horizontal slab
-         !                                             ! ===============
-         ! Next velocity
-         ! -------------
-         DO jj = 1, jpj                      ! caution: don't use (:,:) for this loop
-            DO ji = 1, jpi                   ! it causes optimization problems on NEC in auto-tasking
-               ! Leap-frog time stepping
-               ua(ji,jj,jk) = ( ub(ji,jj,jk) + z2dt * ua(ji,jj,jk) ) * umask(ji,jj,jk)
-               va(ji,jj,jk) = ( vb(ji,jj,jk) + z2dt * va(ji,jj,jk) ) * vmask(ji,jj,jk)
-            END DO
-         END DO
-         !                                             ! ===============
-      END DO                                           !   End of slab
-      !                                                ! ===============
- 
-     !                                                ! ===============
-      DO jk = 1, jpkm1                                 ! Horizontal slab
-         !                                             ! ===============
-         ! Time filter and swap of dynamics arrays
-         ! ------------------------------------------
-         IF( neuler == 0 .AND. kt == nit000 ) THEN
-            DO jj = 1, jpj                      ! caution: don't use (:,:) for this loop
-               DO ji = 1, jpi                   ! it causes optimization problems on NEC in auto-tasking
-                  ! Euler (forward) time stepping
-                  ub(ji,jj,jk) = un(ji,jj,jk)
-                  vb(ji,jj,jk) = vn(ji,jj,jk)
-                  un(ji,jj,jk) = ua(ji,jj,jk)
-                  vn(ji,jj,jk) = va(ji,jj,jk)
-               END DO
-            END DO
-         ELSE
-            DO jj = 1, jpj                      ! caution: don't use (:,:) for this loop
-               DO ji = 1, jpi                   ! it causes optimization problems on NEC in auto-tasking
-                  ! Leap-frog time stepping
-                  ub(ji,jj,jk) = atfp * ( ub(ji,jj,jk) + ua(ji,jj,jk) ) + atfp1 * un(ji,jj,jk)
-                  vb(ji,jj,jk) = atfp * ( vb(ji,jj,jk) + va(ji,jj,jk) ) + atfp1 * vn(ji,jj,jk)
-                  un(ji,jj,jk) = ua(ji,jj,jk)
-                  vn(ji,jj,jk) = va(ji,jj,jk)
-               END DO
-            END DO
-         ENDIF
-         !                                             ! ===============
-      END DO                                           !   End of slab
-      !                                                ! ===============
-
-      IF(ln_ctl)   THEN
-         CALL prt_ctl(tab3d_1=un, clinfo1=' nxt_1d  - Un: ', mask1=umask, &
-            &         tab3d_2=vn, clinfo2=' Vn: ', mask2=vmask)
-      ENDIF
-
-!     IF(l_ctl)   WRITE(numout,*) ' nxt  - Un: ', SUM(un(2:nictl,2:njctl,1:jpkm1)*umask(2:nictl,2:njctl,1:jpkm1)), &
-!     &                                  ' Vn: ', SUM(vn(2:nictl,2:njctl,1:jpkm1)*vmask(2:nictl,2:njctl,1:jpkm1))
-
-   END SUBROUTINE dyn_nxt_1d
-#else
-   !!----------------------------------------------------------------------
-   !!   Default key                                     NO 1D Config
-   !!----------------------------------------------------------------------
-CONTAINS
-   SUBROUTINE dyn_nxt_1d ( kt )
-      WRITE(*,*) 'dyn_nxt_1d: You should not have seen this print! error?', kt
-   END SUBROUTINE dyn_nxt_1d
-#endif
-   !!======================================================================
-END MODULE dynnxt1d
Index: /trunk/NEMO/C1D_SRC/dynnxt_c1d.F90
===================================================================
--- /trunk/NEMO/C1D_SRC/dynnxt_c1d.F90	(revision 899)
+++ /trunk/NEMO/C1D_SRC/dynnxt_c1d.F90	(revision 899)
@@ -0,0 +1,150 @@
+MODULE dynnxt1d
+   !!======================================================================
+   !!                       ***  MODULE  dynnxt1d  ***
+   !! Ocean dynamics: time stepping in 1D configuration
+   !!======================================================================
+#if defined key_c1d
+   !!----------------------------------------------------------------------
+   !!   'key_c1d'               1D Configuration
+   !!----------------------------------------------------------------------  
+   !!----------------------------------------------------------------------
+   !!   dyn_nxt_1d   : update the horizontal velocity from the momentum trend
+   !!----------------------------------------------------------------------
+   !! * Modules used
+   USE oce             ! ocean dynamics and tracers
+   USE dom_oce         ! ocean space and time domain
+   USE in_out_manager  ! I/O manager
+   USE lbclnk          ! lateral boundary condition (or mpp link)
+   USE prtctl          ! Print control
+
+   IMPLICIT NONE
+   PRIVATE
+
+   !! * Accessibility
+   PUBLIC dyn_nxt_1d                ! routine called by step.F90
+   !!----------------------------------------------------------------------
+
+CONTAINS
+
+   SUBROUTINE dyn_nxt_1d ( kt )
+      !!----------------------------------------------------------------------
+      !!                  ***  ROUTINE dyn_nxt_1d  ***
+      !!                   
+      !! ** Purpose :   Compute the after horizontal velocity from the 
+      !!      momentum trend.
+      !!
+      !! ** Method  :   Apply lateral boundary conditions on the trends (ua,va) 
+      !!      through calls to routine lbc_lnk.
+      !!      After velocity is compute using a leap-frog scheme environment:
+      !!         (ua,va) = (ub,vb) + 2 rdt (ua,va)
+      !!      Time filter applied on now horizontal velocity to avoid the
+      !!      divergence of two consecutive time-steps and swap of dynamics
+      !!      arrays to start the next time step:
+      !!         (ub,vb) = (un,vn) + atfp [ (ub,vb) + (ua,va) - 2 (un,vn) ]
+      !!         (un,vn) = (ua,va) 
+      !!
+      !! ** Action : - Update ub,vb arrays, the before horizontal velocity
+      !!             - Update un,vn arrays, the now horizontal velocity
+      !!
+      !! History :
+      !!        !  87-02  (P. Andrich, D. L Hostis)  Original code
+      !!        !  90-10  (C. Levy, G. Madec)
+      !!        !  93-03  (M. Guyon)  symetrical conditions
+      !!        !  97-02  (G. Madec & M. Imbard)  opa, release 8.0
+      !!        !  97-04  (A. Weaver)  Euler forward step
+      !!        !  97-06  (G. Madec)  lateral boudary cond., lbc routine
+      !!   8.5  !  02-08  (G. Madec)  F90: Free form and module
+      !!        !  04-10  (C. Ethe) 1D configuration
+      !!----------------------------------------------------------------------
+      !! * Arguments
+      INTEGER, INTENT( in ) ::   kt      ! ocean time-step index
+
+      !! * Local declarations
+      INTEGER  ::   ji, jj, jk   ! dummy loop indices
+      REAL(wp) ::   z2dt         ! temporary scalar
+      !!----------------------------------------------------------------------
+      !!   OPA 9.0 , LOCEAN-IPSL (2005) 
+      !! $Header$ 
+      !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt 
+      !!----------------------------------------------------------------------
+
+      IF( kt == nit000 ) THEN
+         IF(lwp) WRITE(numout,*)
+         IF(lwp) WRITE(numout,*) 'dyn_nxt_1d : time stepping on 1D configuation'
+         IF(lwp) WRITE(numout,*) '~~~~~~~'
+      ENDIF
+
+      ! Local constant initialization
+      z2dt = 2. * rdt
+      IF( neuler == 0 .AND. kt == nit000 )  z2dt = rdt
+
+      ! Lateral boundary conditions on ( ua, va )
+      CALL lbc_lnk( ua, 'U', -1. )
+      CALL lbc_lnk( va, 'V', -1. )
+
+      !                                                ! ===============
+      DO jk = 1, jpkm1                                 ! Horizontal slab
+         !                                             ! ===============
+         ! Next velocity
+         ! -------------
+         DO jj = 1, jpj                      ! caution: don't use (:,:) for this loop
+            DO ji = 1, jpi                   ! it causes optimization problems on NEC in auto-tasking
+               ! Leap-frog time stepping
+               ua(ji,jj,jk) = ( ub(ji,jj,jk) + z2dt * ua(ji,jj,jk) ) * umask(ji,jj,jk)
+               va(ji,jj,jk) = ( vb(ji,jj,jk) + z2dt * va(ji,jj,jk) ) * vmask(ji,jj,jk)
+            END DO
+         END DO
+         !                                             ! ===============
+      END DO                                           !   End of slab
+      !                                                ! ===============
+ 
+     !                                                ! ===============
+      DO jk = 1, jpkm1                                 ! Horizontal slab
+         !                                             ! ===============
+         ! Time filter and swap of dynamics arrays
+         ! ------------------------------------------
+         IF( neuler == 0 .AND. kt == nit000 ) THEN
+            DO jj = 1, jpj                      ! caution: don't use (:,:) for this loop
+               DO ji = 1, jpi                   ! it causes optimization problems on NEC in auto-tasking
+                  ! Euler (forward) time stepping
+                  ub(ji,jj,jk) = un(ji,jj,jk)
+                  vb(ji,jj,jk) = vn(ji,jj,jk)
+                  un(ji,jj,jk) = ua(ji,jj,jk)
+                  vn(ji,jj,jk) = va(ji,jj,jk)
+               END DO
+            END DO
+         ELSE
+            DO jj = 1, jpj                      ! caution: don't use (:,:) for this loop
+               DO ji = 1, jpi                   ! it causes optimization problems on NEC in auto-tasking
+                  ! Leap-frog time stepping
+                  ub(ji,jj,jk) = atfp * ( ub(ji,jj,jk) + ua(ji,jj,jk) ) + atfp1 * un(ji,jj,jk)
+                  vb(ji,jj,jk) = atfp * ( vb(ji,jj,jk) + va(ji,jj,jk) ) + atfp1 * vn(ji,jj,jk)
+                  un(ji,jj,jk) = ua(ji,jj,jk)
+                  vn(ji,jj,jk) = va(ji,jj,jk)
+               END DO
+            END DO
+         ENDIF
+         !                                             ! ===============
+      END DO                                           !   End of slab
+      !                                                ! ===============
+
+      IF(ln_ctl)   THEN
+         CALL prt_ctl(tab3d_1=un, clinfo1=' nxt_1d  - Un: ', mask1=umask, &
+            &         tab3d_2=vn, clinfo2=' Vn: ', mask2=vmask)
+      ENDIF
+
+!     IF(l_ctl)   WRITE(numout,*) ' nxt  - Un: ', SUM(un(2:nictl,2:njctl,1:jpkm1)*umask(2:nictl,2:njctl,1:jpkm1)), &
+!     &                                  ' Vn: ', SUM(vn(2:nictl,2:njctl,1:jpkm1)*vmask(2:nictl,2:njctl,1:jpkm1))
+
+   END SUBROUTINE dyn_nxt_1d
+#else
+   !!----------------------------------------------------------------------
+   !!   Default key                                     NO 1D Config
+   !!----------------------------------------------------------------------
+CONTAINS
+   SUBROUTINE dyn_nxt_1d ( kt )
+      WRITE(*,*) 'dyn_nxt_1d: You should not have seen this print! error?', kt
+   END SUBROUTINE dyn_nxt_1d
+#endif
+   !!======================================================================
+END MODULE dynnxt1d
Index: unk/NEMO/C1D_SRC/icestp1d.F90
===================================================================
--- /trunk/NEMO/C1D_SRC/icestp1d.F90	(revision 898)
+++ 	(revision )
@@ -1,386 +1,0 @@
-MODULE icestp1d
-   !!======================================================================
-   !!                       ***  MODULE icestp1d   ***
-   !!   Sea-Ice model : 1D LIM Sea ice model time-stepping
-   !!======================================================================
-   !! History :   9.0  !  04-10  (C. Ethe)  from icestp, 1D configuration
-   !!----------------------------------------------------------------------
-#if defined key_cfg_1d && ( defined key_lim3 || defined key_lim2 )
-   !!----------------------------------------------------------------------
-   !!   'key_cfg_1d'  .AND.                                1D Configuration
-   !!   'key_lim2' OR 'key_lim3' :             LIM 2.0 or 3.0 sea-ice model
-   !!----------------------------------------------------------------------
-   !!----------------------------------------------------------------------
-   !!   ice_stp_1d       : sea-ice model time-stepping
-   !!----------------------------------------------------------------------
-   USE dom_oce         ! ocean space and time domain
-   USE oce             ! dynamics and tracers variables
-   USE in_out_manager  ! I/O manager
-   USE ice_oce         ! ice variables
-   USE dom_ice_2       ! LIM sea-ice domain
-   USE sbc_oce         ! surface boundary condition: ocean
-   USE sbc_ice         ! surface boundary condition: ice
-   USE daymod          ! calendar
-   USE phycst          ! Define parameters for the routines
-   USE ice_2           ! ice variables
-   USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
-   USE limthd_2
-   USE limwri_2
-   USE limrst_2
-
-   USE tradmp          ! damping salinity trend
-   USE dtatem          ! ocean temperature data
-   USE dtasal          ! ocean salinity data
-   USE ocfzpt          ! surface ocean freezing point
-   USE prtctl          ! Print control
-
-
-   IMPLICIT NONE
-   PRIVATE
-
-   PUBLIC   ice_stp_1d  ! called by step.F90
-
-   !! * Substitutions
-#  include "domzgr_substitute.h90"
-#  include "vectopt_loop_substitute.h90"
-   !!----------------------------------------------------------------------
-   !!   LIM 2.0 , UCL-LOCEAN-IPSL (2006) 
-   !! $Id$
-   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
-
-CONTAINS
-
-   SUBROUTINE ice_stp_1d ( kt )
-      !!---------------------------------------------------------------------
-      !!                  ***  ROUTINE ice_stp_1d  ***
-      !!                   
-      !! ** Purpose :   Louvain la Neuve Sea Ice Model time stepping 
-      !!
-      !! ** Action  : - call the ice dynamics routine 
-      !!              - call the ice advection/diffusion routine 
-      !!              - call the ice thermodynamics routine 
-      !!              - call the routine that computes mass and 
-      !!                heat fluxes at the ice/ocean interface
-      !!              - save the outputs 
-      !!              - save the outputs for restart when necessary
-      !!----------------------------------------------------------------------
-      INTEGER, INTENT(in) ::   kt         ! ocean time-step index
-
-      INTEGER                      ::   ji, jj                        ! dummy loop indices
-      REAL(wp)                     ::   ztair2                        ! temporary scalar
-      REAL(wp), DIMENSION(jpi,jpj) ::   zsss_io, zsss2_io, zsss3_io   ! tempory workspaces
-      !!----------------------------------------------------------------------
-
-      IF( kt == nit000 ) THEN
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'ice_stp_1d : Louvain la Neuve Ice Model (LIM)' 
-         IF(lwp) WRITE(numout,*) '~~~~~~~   forced case using bulk formulea'
-         !  Initialize fluxes fields
-         gtaux(:,:) = 0.e0
-         gtauy(:,:) = 0.e0
-      ENDIF
-
-      ! Temperature , salinity and horizonta wind
-      ! sst_io  and sss_io, u_io and v_io  are initialized at nit000 in limistate.F90 (or limrst.F90) with :
-      !              sst_io = sst_io + (nfice - 1) * (tn(:,:,1)+rt0 )
-      !              sss_io = sss_io + (nfice - 1) * sn(:,:,1)
-      !              u_io   = u_io   + (nfice - 1) * un(:,:,1)
-      !              v_io   = v_io   + (nfice - 1) * vn(:,:,1)
-      !    cumulate fields
-      !
-      sst_io(:,:) = sst_io(:,:) + tn(:,:,1) + rt0
-      sss_io(:,:) = sss_io(:,:) + sn(:,:,1)
-      u_io  (:,:) = u_io  (:,:) + un(:,:,1)
-      v_io  (:,:) = v_io  (:,:) + vn(:,:,1)
- 
-      
-      IF( MOD( kt-1, nfice ) == 0 ) THEN
-         
-         ! The LIM model is going to be call
-         sst_io(:,:) = sst_io(:,:) / FLOAT( nfice ) * tmask(:,:,1)
-         sss_io(:,:) = sss_io(:,:) / FLOAT( nfice )
-         u_io  (:,:) = u_io  (:,:) / FLOAT( nfice )
-         v_io  (:,:) = v_io  (:,:) / FLOAT( nfice )
-         gtaux (:,:) = utau  (:,:)
-         gtauy (:,:) = vtau  (:,:)
-
-         zsss_io (:,:) = SQRT( sss_io(:,:) ) 
-         zsss2_io(:,:) =  sss_io(:,:) *  sss_io(:,:)
-         zsss3_io(:,:) = zsss_io(:,:) * zsss_io(:,:) * zsss_io(:,:)
-
-         DO jj = 1, jpj
-            DO ji = 1, jpi
-               tfu(ji,jj)  = ABS ( rt0 - 0.0575       *   sss_io(ji,jj)   &
-                  &                    + 1.710523e-03 * zsss3_io(ji,jj)   &
-                  &                    - 2.154996e-04 * zsss2_io(ji,jj) ) * tms(ji,jj)
-            END DO
-         END DO
-         
-         
-         IF(ln_ctl) THEN         ! print mean trends (used for debugging)
-            CALL prt_ctl_info('Ice Forcings ')
-            CALL prt_ctl(tab2d_1=qsr_oce ,clinfo1=' qsr_oce  : ', tab2d_2=qsr_ice , clinfo2=' qsr_ice   : ')
-            CALL prt_ctl(tab2d_1=qnsr_oce,clinfo1=' qnsr_oce : ', tab2d_2=qnsr_ice, clinfo2=' qnsr_ice  : ')
-            CALL prt_ctl(tab2d_1=evap    ,clinfo1=' evap     : ')
-            CALL prt_ctl(tab2d_1=tprecip ,clinfo1=' precip   : ', tab2d_2=sprecip , clinfo2=' Snow      : ')
-            CALL prt_ctl(tab2d_1=gtaux   ,clinfo1=' u-stress : ', tab2d_2=gtauy   , clinfo2=' v-stress  : ')
-            CALL prt_ctl(tab2d_1=sst_io  ,clinfo1=' sst      : ', tab2d_2=sss_io  , clinfo2=' sss       : ')
-            CALL prt_ctl(tab2d_1=u_io    ,clinfo1=' u_io     : ', tab2d_2=v_io    , clinfo2=' v_io      : ')
-            CALL prt_ctl(tab2d_1=hsnif   ,clinfo1=' hsnif  1 : ', tab2d_2=hicif   , clinfo2=' hicif     : ')
-            CALL prt_ctl(tab2d_1=frld    ,clinfo1=' frld   1 : ', tab2d_2=sist    , clinfo2=' sist      : ')
-         ENDIF
-                                                                      
-         DO jj = 1, jpj
-            DO ji = 1, jpi
-               tio_u(ji,jj) = - gtaux(ji,jj) / rau0
-               tio_v(ji,jj) = - gtauy(ji,jj) / rau0               
-               ztair2       = gtaux(ji,jj) * gtaux(ji,jj) + gtauy(ji,jj) * gtauy(ji,jj)           
-               ust2s(ji,jj) = ( SQRT( ztair2  )  / rau0 )  * tms(ji,jj)  
-            END DO
-         END DO
-
-         !                                                           !-----------------------!
-         CALL lim_rst_opn( kt )                                      ! Open Ice restart file !
-         !                                                           !-----------------------!
-
-         !                                                           !--------------------!
-         CALL lim_thd( kt )                                          ! Ice thermodynamics !
-         !                                                           !--------------------!
-         IF(ln_ctl) THEN
-            CALL prt_ctl(tab2d_1=hsnif ,clinfo1=' hsnif  2 : ', tab2d_2=hicif , clinfo2=' hicif     : ')
-            CALL prt_ctl(tab2d_1=frld  ,clinfo1=' frld   2 : ', tab2d_2=sist  , clinfo2=' sist      : ')
-            CALL prt_ctl(tab2d_1=u_io  ,clinfo1=' u_io   4 : ', tab2d_2=v_io  , clinfo2=' v_io      : ')
-            CALL prt_ctl(tab2d_1=tio_u  ,clinfo1=' tio_u  4 : ', tab2d_2=tio_v  , clinfo2=' tio_v     : ')
-         ENDIF
-
-
-
-         ! Mass and heat fluxes from ice to ocean
-         !                                                           !------------------------------!
-         CALL lim_flx                                                ! Ice/Ocean Mass & Heat fluxes !
-         !                                                           !------------------------------!
-
-         IF(ln_ctl) THEN
-            CALL prt_ctl(tab2d_1=hsnif ,clinfo1=' hsnif  7 : ', tab2d_2=hicif , clinfo2=' hicif   : ')
-            CALL prt_ctl(tab2d_1=frld  ,clinfo1=' frld   7 : ', tab2d_2=sist  , clinfo2=' sist      : ')
-            CALL prt_ctl(tab2d_1=tio_u  ,clinfo1=' tio_u  7 : ', tab2d_2=tio_v  , clinfo2=' tio_v     : ')
-         ENDIF
-         !                                                           !-------------!
-         CALL lim_wri( kt )                                          ! Ice outputs !
-         !                                                           !-------------!
-
-         !                                                           !------------------------!
-         IF( lrst_ice ) CALL lim_rst_write( kt )                     ! Write Ice restart file !
-         !                                                           !------------------------!
-
-         ! Re-initialization of forcings
-         qsr_oce (:,:) = 0.e0
-         qsr_ice (:,:) = 0.e0
-         qnsr_oce(:,:) = 0.e0
-         qnsr_ice(:,:) = 0.e0 
-         dqns_ice(:,:) = 0.e0 
-         tprecip (:,:) = 0.e0 
-         sprecip (:,:) = 0.e0
-         qla_ice (:,:) = 0.e0
-         dqla_ice(:,:) = 0.e0
-         fr1_i0  (:,:) = 0.e0
-         fr2_i0  (:,:) = 0.e0
-         evap    (:,:) = 0.e0
-
-        CALL oce_sbc_1d ( kt )
-
-      ENDIF
-
-   END SUBROUTINE ice_stp_1d
-   
-   
-   SUBROUTINE oce_sbc_1d( kt )
-      !!---------------------------------------------------------------------
-      !!                   ***  ROUTINE oce_sbc_1d  ***
-      !!                    
-      !! ** Purpose : - Ocean surface boundary conditions with LIM sea-ice
-      !!        model in forced mode using bulk formulea
-      !!----------------------------------------------------------------------
-      INTEGER, INTENT(in) ::   kt   ! ocean time step
-      !
-      INTEGER  ::   ji, jj                   ! dummy loop indices
-      REAL(wp) ::   ztxy
-      !!----------------------------------------------------------------------
-
-      ! 1. initialization to zero at kt = nit000
-      ! ---------------------------------------
-      
-      IF( kt == nit000 ) THEN     
-         qsr    (:,:) = 0.e0
-         qns    (:,:) = 0.e0
-         qrp    (:,:) = 0.e0
-         emp    (:,:) = 0.e0
-         emps   (:,:) = 0.e0
-         erp    (:,:) = 0.e0
-#if ! defined key_dynspg_rl 
-         dmp    (:,:) = 0.e0
-#endif
-      ENDIF
-
-      CALL oce_sbc_dmp       ! Computation of internal and evaporation damping terms       
-
-      ! Surface Ocean fluxes
-      ! ====================
-      
-      ! Surface heat flux (W/m2)
-      ! -----------------
-      
-      qns (:,:) = fnsolar(:,:)                    ! non solar heat flux
-      qsr (:,:) = fsolar(:,:)                     ! solar flux
-      
-#if ! defined key_dynspg_rl     
-      ! total concentration/dilution effect (use on SSS)
-      emps(:,:) = fmass(:,:) + fsalt(:,:) + runoff(:,:) + erp(:,:) + empold
-      
-      ! total volume flux (use on sea-surface height)
-      emp (:,:) = fmass(:,:) -   dmp(:,:) + runoff(:,:) + erp(:,:) + empold      
-#else
-      ! Rigid-lid (emp=emps=E-P-R+Erp)
-      emps(:,:) = fmass(:,:) + fsalt(:,:) + runoff(:,:) + erp(:,:)     ! freshwater flux
-      emp (:,:) = emps(:,:)
-      
-#endif
-      
-      ! Surface stress
-      ! --------------
-      
-      ! update the stress beloww sea-ice area
-      DO jj = 1, jpjm1
-         DO ji = 1, fs_jpim1   ! vertor opt.
-            ztxy        = freezn(ji,jj)             ! ice/ocean indicator at T-points
-            utau(ji,jj) = (1.-ztxy) * utau(ji,jj) + ztxy * ftaux(ji,jj)    ! stress at the ocean surface
-            vtau(ji,jj) = (1.-ztxy) * vtau(ji,jj) + ztxy * ftauy(ji,jj)
-         END DO
-      END DO
-      
-      ! boundary condition on the stress (utau,vtau)
-      CALL lbc_lnk( utau, 'U', -1. )
-      CALL lbc_lnk( vtau, 'V', -1. )
-      
-      ! Re-initialization of fluxes
-      sst_io(:,:) = 0.e0
-      sss_io(:,:) = 0.e0
-      u_io  (:,:) = 0.e0
-      v_io  (:,:) = 0.e0
-      !
-   END SUBROUTINE oce_sbc_1d
-   
-#if defined key_dtasal
-   !!----------------------------------------------------------------------
-   !!   'key_dtasal'                                          salinity data
-   !!----------------------------------------------------------------------
-   SUBROUTINE oce_sbc_dmp
-      !!---------------------------------------------------------------------
-      !!                   ***  ROUTINE oce_sbc_dmp  ***
-      !!                    
-      !! ** Purpose : Computation of internal and evaporation damping terms 
-      !!        for ocean surface boundary conditions 
-      !!----------------------------------------------------------------------
-      INTEGER  ::   ji, jj                   ! dummy loop indices
-      REAL(wp) ::   zerp, zsrp
-#if ! defined key_dynspg_rl
-      REAL(wp) ::   zwei
-      REAL(wp) ::   zerpplus(jpi,jpj), zerpminus(jpi,jpj)
-      REAL(wp) ::   zplus, zminus, zadefi
-# if defined key_tradmp
-      INTEGER jk
-      REAL(wp), DIMENSION(jpi,jpj) ::   zstrdmp
-# endif
-#endif
-      !!----------------------------------------------------------------------
-
-      ! sea ice indicator (1 or 0)
-      DO jj = 1, jpj
-         DO ji = 1, jpi
-            freezn(ji,jj) = MAX(0., SIGN(1., freeze(ji,jj)-rsmall) )
-         END DO
-      END DO
-
-      ! Initialisation
-      ! --------------
-      ! Restoring coefficients on SST and SSS   
-      zsrp = dqdt0 * ro0cpr * rauw   ! (Kg/m2/s) 
-
-#if ! defined key_dynspg_rl 
-      ! Free-surface
-         
-      ! Internal damping
-# if defined key_tradmp
-      ! Vertical mean of dampind trend (computed in tradmp module)
-      zstrdmp(:,:) = 0.e0
-      DO jk = 1, jpk
-         zstrdmp(:,:) = zstrdmp(:,:) + strdmp(:,:,jk) * fse3t(:,:,jk)
-      END DO
-      ! volume flux associated to internal damping to climatology
-      dmp(:,:) = zstrdmp(:,:) * rauw / ( sss_io(:,:) + 1.e-20 )
-# else
-      dmp(:,:) = 0.e0            ! No internal damping
-# endif
-      
-      !   evaporation damping term ( Surface restoring )
-      zerpplus (:,:) = 0.e0
-      zerpminus(:,:) = 0.e0
-      zplus          =  15. / rday
-      zminus         = -15. / rday
-      
-      DO jj = 1, jpj
-         DO ji = 1, jpi
-            zerp = ( 1. - 2.*upsrnfh(ji,jj) ) * zsrp   &
-               & * ( sss_io(ji,jj) - s_dta(ji,jj,1) )     &
-               & / ( sss_io(ji,jj) + 1.e-20        )
-            erp(ji,jj) = zerp
-            zerpplus (ji,jj) = MAX( erp(ji,jj), 0.e0 )
-            zerpminus(ji,jj) = MIN( erp(ji,jj), 0.e0 )
-         END DO
-      END DO
-
-      aplus  = 0.e0
-      aminus = 0.e0
-      DO jj = 1, jpj
-         DO ji = 1, jpi
-            zwei   = e1t(ji,jj) * e2t(ji,jj) * tmask_i(ji,jj)
-            aplus  = aplus  + zerpplus (ji,jj) * zwei
-            aminus = aminus - zerpminus(ji,jj) * zwei
-         END DO
-      END DO
-
-      IF(ln_ctl)   WRITE(numout,*) ' oce_sbc_dmp : a+ = ', aplus, ' a- = ', aminus
-#else
-      ! Rigid-lid (emp=emps=E-P-R+Erp)
-      
-      erp(:,:) = ( 1. - freezn(:,:) ) * zsrp    &   ! surface restoring term
-         &     * ( sss_io(:,:) - s_dta(:,:,1) )     &
-         &     / ( sss_io(:,:) + 1.e-20      )
-#endif
-
-   END SUBROUTINE oce_sbc_dmp
-   
-#else
-   !!----------------------------------------------------------------------
-   !!   Dummy routine                                      NO salinity data
-   !!----------------------------------------------------------------------
-   SUBROUTINE oce_sbc_dmp         ! Dummy routine
-      WRITE(*,*) 'oce_sbc_dmp: you should not have seen that print! error?'
-   END SUBROUTINE oce_sbc_dmp
-#endif
-#else
-   !!----------------------------------------------------------------------
-   !!   Default option           Dummy module   NO 1D && NO LIM sea-ice model
-   !!----------------------------------------------------------------------
-CONTAINS
-   SUBROUTINE ice_stp_1d ( kt )     ! Dummy routine
-      WRITE(*,*) 'ice_stp_1d: You should not have seen this print! error?', kt
-   END SUBROUTINE ice_stp_1d
-   SUBROUTINE oce_sbc_1d ( kt )     ! Dummy routine
-      WRITE(*,*) 'oce_sbc_1d: You should not have seen this print! error?', kt
-   END SUBROUTINE oce_sbc_1d
-#endif   
-
-   !!======================================================================
-END MODULE icestp1d
Index: unk/NEMO/C1D_SRC/ini1d.F90
===================================================================
--- /trunk/NEMO/C1D_SRC/ini1d.F90	(revision 898)
+++ 	(revision )
@@ -1,70 +1,0 @@
-MODULE ini1d
-   !!======================================================================
-   !!                     ***  MODULE  ini1D  ***
-   !! Ocean state   :  1D initialization
-   !!=====================================================================
-#if defined key_cfg_1d
-   !!----------------------------------------------------------------------
-   !!   'key_cfg_1d'               1D Configuration
-   !!----------------------------------------------------------------------
-   !!   init_1d   : initial mask
-   !!----------------------------------------------------------------------
-   !! * Modules used
-   USE dom_oce         ! ocean space and time domain 
-   USE phycst
-   USE in_out_manager
-
-   IMPLICIT NONE
-   PRIVATE
-
-   !! * Share Module variables
-   LOGICAL, PUBLIC, PARAMETER ::  lk_cfg_1d = .TRUE.       !: 1D flag
-
-   !! * Routine accessibility
-   PUBLIC init_1d   ! routine called by OPA.F90
-
-   !!----------------------------------------------------------------------
-   !!   OPA 9.0 , LOCEAN-IPSL (2005) 
-   !! $Header$ 
-   !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt 
-   !!----------------------------------------------------------------------
-
-CONTAINS
-
-   SUBROUTINE init_1d
-      !!----------------------------------------------------------------------
-      !!                   ***  ROUTINE init_1d  ***
-      !! 
-      !! ** Purpose :   Re-Initialization of masks on 1D configuration
-      !!
-      !! ** Method  :
-      !!
-      !! History :
-      !!   9.0  !  04-09  (C. Ethe) 1D configuration
-      !!----------------------------------------------------------------------
-      !! * Local declarations
-      !!----------------------------------------------------------------------
-
-      IF(lwp) WRITE(numout,*)
-      IF(lwp) WRITE(numout,*) 'init_1d :  masks on 1D configuration'
-      IF(lwp) WRITE(numout,*) '~~~~~~~~~'
-
-      ! set umask and vmask equal tmask in 1D configuration
-      umask(:,:,:) = tmask(:,:,:)
-      vmask(:,:,:) = tmask(:,:,:)     
-
-   END SUBROUTINE init_1d
-
-#else
-   !!----------------------------------------------------------------------
-   !!   Default key                                     NO 1D Config
-   !!----------------------------------------------------------------------
-   LOGICAL , PUBLIC, PARAMETER ::   lk_cfg_1d = .FALSE.    !: internal damping flag
-CONTAINS
-   SUBROUTINE init_1d       ! Empty routine
-
-   END SUBROUTINE init_1d
-#endif
-
-   !!=====================================================================
-END MODULE ini1d
Index: unk/NEMO/C1D_SRC/step1d.F90
===================================================================
--- /trunk/NEMO/C1D_SRC/step1d.F90	(revision 898)
+++ 	(revision )
@@ -1,285 +1,0 @@
-MODULE step1d
-   !!======================================================================
-   !!                       ***  MODULE step1D  ***
-   !! Time-stepping    : manager of the ocean, tracer and ice time stepping
-   !!======================================================================
-#if defined key_cfg_1d
-   !!----------------------------------------------------------------------
-   !!   'key_cfg_1d'               1D Configuration
-   !!----------------------------------------------------------------------  
-   !!----------------------------------------------------------------------
-   !!   stp_1d           : OPA system time-stepping on 1 direction
-   !!----------------------------------------------------------------------
-   !! * Modules used
-   USE oce             ! ocean dynamics and tracers variables
-   USE dom_oce         ! ocean space and time domain variables 
-   USE zdf_oce         ! ocean vertical physics variables
-   USE sbc_oce         ! surface boundary condition: ocean
-   USE ldftra_oce
-   USE ldfdyn_oce
-   USE in_out_manager  ! I/O manager
-   USE lbclnk
-
-   USE daymod          ! calendar                         (day     routine)
-
-   USE dtatem          ! ocean temperature data           (dta_tem routine)
-   USE dtasal          ! ocean salinity    data           (dta_sal routine)
-   USE ocfzpt          ! surface ocean freezing point    (oc_fz_pt routine)
-
-   USE trcstp          ! passive tracer time-stepping     (trc_stp routine)
-
-   USE dynzdf          ! vertical diffusion               (dyn_zdf routine)
-
-   USE traqsr          ! solar radiation penetration      (tra_qsr routine)
-   USE tranxt          ! time-stepping                    (tra_nxt routine)
-   USE trazdf          ! vertical diffusion               (tra_zdf routine)
-   USE trasbc          ! surface boundary condition       (tra_sbc routine)
-
-   USE eosbn2
-
-   USE zdfbfr          ! bottom friction                  (zdf_bfr routine)
-   USE zdftke          ! TKE vertical mixing              (zdf_tke routine)
-   USE zdfkpp          ! KPP vertical mixing              (zdf_kpp routine)
-   USE zdfddm          ! double diffusion mixing          (zdf_ddm routine)
-   USE zdfevd          ! enhanced vertical diffusion      (zdf_evd routine)
-   USE zdfric          ! Richardson vertical mixing       (zdf_ric routine)
-   USE zdfmxl          ! Mixed-layer depth                (zdf_mxl routine)
-
-   USE dyncor1d
-   USE dynnxt1d
-   USE diawri1d        ! Standard run outputs             (dia_wri_1d routine)
-
-   USE ice_oce         ! sea-ice variable
-   USE icestp1d        ! sea-ice time-stepping             (ice_stp routine)
-
-   USE diawri          ! Standard run outputs             (dia_wri_state routine)
-
-
-   USE stpctl          ! time stepping control            (stp_ctl routine)
-   USE restart         ! ocean restart                    (rst_wri routine)
-   USE prtctl          ! Print control                    (prt_ctl routine)
-   IMPLICIT NONE
-   PRIVATE
-
-   !! * Routine accessibility
-   PUBLIC stp_1d            ! called by opa.F90
-
-   !! * Substitutions
-#  include "domzgr_substitute.h90"
-#  include "zdfddm_substitute.h90"
-   !!----------------------------------------------------------------------
-   !!   OPA 9.0 , LOCEAN-IPSL (2005) 
-   !! $Id$
-   !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt 
-   !!----------------------------------------------------------------------
-
-CONTAINS
-
-   SUBROUTINE stp_1d( kstp )
-      !!----------------------------------------------------------------------
-      !!                     ***  ROUTINE stp1D  ***
-      !!                      
-      !! ** Purpose : - Time stepping of OPA (momentum and active tracer eqs.)
-      !!              - Time stepping of LIM (dynamic and thermodynamic eqs.)
-      !! 
-      !! ** Method  : -1- Update forcings and data  
-      !!              -2- Update ocean physics 
-      !!              -3- Compute the t and s trends 
-      !!              -4- Update t and s 
-      !!              -5- Compute the momentum trends
-      !!              -6- Update the horizontal velocity
-      !!              -7- Compute the diagnostics variables (rd,N2, div,cur,w)
-      !!              -8- Outputs and diagnostics
-      !!
-      !! History :
-      !!        !  91-03  ()  Original code
-      !!        !  91-11  (G. Madec)
-      !!        !  92-06  (M. Imbard)  add a first output record
-      !!        !  96-04  (G. Madec)  introduction of dynspg
-      !!        !  96-04  (M.A. Foujols)  introduction of passive tracer
-      !!   8.0  !  97-06  (G. Madec)  new architecture of call
-      !!   8.2  !  97-06  (G. Madec, M. Imbard, G. Roullet)  free surface
-      !!   8.2  !  99-02  (G. Madec, N. Grima)  hpg implicit
-      !!   8.2  !  00-07  (J-M Molines, M. Imbard)  Open Bondary Conditions
-      !!   9.0  !  02-06  (G. Madec)  free form, suppress macro-tasking
-      !!        !  04-10  (C. Ethe) 1D configuration
-      !!----------------------------------------------------------------------
-      !! * Arguments
-      INTEGER, INTENT( in ) ::   kstp   ! ocean time-step index
-
-      !! * local declarations
-      INTEGER ::   indic    ! error indicator if < 0
-!!      INTEGER ::   ii0, ii1, ij0, ij1   ! temporary integers
-      !! ---------------------------------------------------------------------
-
-      indic = 1                    ! reset to no error condition
-      adatrj = adatrj + rdt/86400._wp
-
-      CALL day( kstp )             ! Calendar
-
-      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-      ! Update data, open boundaries and Forcings
-      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
-      IF( lk_dtatem  )   CALL dta_tem( kstp )         ! update 3D temperature data
-
-      IF( lk_dtasal  )   CALL dta_sal( kstp )         ! Salinity data
-
-      IF( lk_dtasst  )   CALL dta_sst( kstp )         ! Sea Surface Temperature data
-
-                         CALL tau( kstp )             ! wind stress
-
-                         CALL flx_rnf( kstp )         ! runoff data
-
-                         CALL flx( kstp )             ! heat and freshwater fluxes
-
-      IF( lk_ice_lim )  THEN 
-                        CALL ice_stp_1d( kstp )      ! sea-ice model (Update stress & fluxes)
-      ELSE
-                        CALL oce_sbc( kstp )         ! ocean surface boudaries
-      ENDIF
-
-      IF( ln_fwb     )   CALL flx_fwb( kstp )         ! freshwater budget
-
-
-      IF( kstp == nit000 ) THEN 
-         IF( ninist == 1 ) THEN                       ! Output the initial state and forcings
-            CALL dia_wri_state( 'output.init' )
-         ENDIF
-      ENDIF
-
-      IF(ln_ctl) THEN         ! print mean trends (used for debugging)
-         CALL prt_ctl(tab2d_1=emp    , clinfo1=' emp  -   : ', mask1=tmask, ovlap=1)
-         CALL prt_ctl(tab2d_1=emps   , clinfo1=' emps -   : ', mask1=tmask, ovlap=1)
-         CALL prt_ctl(tab2d_1=qns    , clinfo1=' qns  -   : ', mask1=tmask, ovlap=1)
-         CALL prt_ctl(tab2d_1=qsr    , clinfo1=' qsr  -   : ', mask1=tmask, ovlap=1)
-         CALL prt_ctl(tab3d_1=tmask  , clinfo1=' tmask    : ', mask1=tmask, ovlap=1, kdim=jpk)
-         CALL prt_ctl(tab3d_1=tn     , clinfo1=' sst  -   : ', mask1=tmask, ovlap=1, kdim=1)
-         CALL prt_ctl(tab3d_1=sn     , clinfo1=' sss  -   : ', mask1=tmask, ovlap=1, kdim=1)
-         CALL prt_ctl(tab2d_1=utau   , clinfo1=' tau  - u : ', mask1=umask, &
-            &         tab2d_2=vtau   , clinfo2='      - v : ', mask2=vmask, ovlap=1)
-      ENDIF
-
-
-
-      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-      ! Ocean physics update
-      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-      !-----------------------------------------------------------------------
-      !  VERTICAL PHYSICS
-      !-----------------------------------------------------------------------
-      ! N.B. ua, va, ta, sa arrays are used as workspace in this section
-      !-----------------------------------------------------------------------
-
-                       CALL bn2( tb, sb, rn2 )              ! before Brunt-Vaisala frequency
-      
-      !                                                     ! Vertical eddy viscosity and diffusivity coefficients
-      IF( lk_zdfric )   CALL zdf_ric( kstp )                       ! Richardson number dependent Kz
-      IF( lk_zdftke )   CALL zdf_tke( kstp )                       ! TKE closure scheme for Kz
-      IF( lk_zdfkpp )   CALL zdf_kpp( kstp )                       ! KPP scheme for Kz
-      IF( lk_zdfcst )   avt (:,:,:) = avt0 * tmask(:,:,:)          ! Constant Kz (reset avt to the background value)
-
-
-      IF( ln_zdfevd )   CALL zdf_evd( kstp )                 ! enhanced vertical eddy diffusivity
-
-      IF( lk_zdfddm .AND. .NOT. lk_zdfkpp)   &
-         &              CALL zdf_ddm( kstp )                 ! double diffusive mixing
-
-                        CALL zdf_bfr( kstp )                 ! bottom friction
-
-                        CALL zdf_mxl( kstp )                 ! mixed layer depth
-
-
-#if defined key_passivetrc
-      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-      ! Passive Tracer Model
-      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-      ! N.B. ua, va, ta, sa arrays are used as workspace in this section
-      !-----------------------------------------------------------------------
-
-                               CALL trc_stp( kstp, indic )            ! time-stepping
-
-#endif
-
-
-      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-      ! Active tracers
-      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-      ! N.B. ua, va arrays are used as workspace in this section
-      !-----------------------------------------------------------------------
-
-                               ta(:,:,:) = 0.e0               ! set tracer trends to zero
-                               sa(:,:,:) = 0.e0
-
-                               CALL tra_sbc( kstp )           ! surface boundary condition
-
-      IF( ln_traqsr        )   CALL tra_qsr( kstp )           ! penetrative solar radiation qsr
-
-      IF( lk_zdfkpp        )   CALL tra_kpp( kstp )           ! KPP non-local tracer fluxes
-
-                               CALL tra_zdf( kstp )           ! vertical mixing
-
-                               CALL tra_nxt( kstp )           ! tracer fields at next time step
-
-                               CALL eos( tb, sb, rhd, rhop )       ! now (swap=before) in situ density for dynhpg module
-
-      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-      ! Dynamics
-      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-      ! N.B. ta, sa arrays are used as workspace in this section 
-      !-----------------------------------------------------------------------
-
-                               ua(:,:,:) = 0.e0               ! set dynamics trends to zero
-                               va(:,:,:) = 0.e0
-  
-                               CALL dyn_cor_1d     ( kstp )
-      !                                                       ! vertical diffusion
-                               CALL dyn_zdf( kstp )      
-
-!i bug lbc sur emp
-      CALL lbc_lnk( emp, 'T', 1. )
-!i
- 
-                                CALL dyn_nxt_1d( kstp )          ! lateral velocity at next time step 
-
-
-      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-      ! Computation of diagnostic variables
-      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-      ! N.B. ua, va, ta, sa arrays are used as workspace in this section
-      !-----------------------------------------------------------------------
-
-                               CALL oc_fz_pt                    ! ocean surface freezing temperature
-
-
-      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-      ! Control, diagnostics and outputs
-      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-      ! N.B. ua, va, ta, sa arrays are used as workspace in this section
-      !-----------------------------------------------------------------------
-
-      !                                            ! Time loop: control and print
-                       CALL stp_ctl( kstp, indic )
-                       IF ( indic < 0 ) CALL ctl_stop( 'step1d: indic < 0' )
-
-      IF ( nstop == 0 ) THEN
-         !                                         ! Diagnostics:
-         !                                         ! save and outputs
-                           CALL rst_write  ( kstp )              ! ocean model: restart file output
-                           CALL dia_wri_1d ( kstp, indic )       ! ocean model: outputs
-
-      ENDIF
-
-
-   END SUBROUTINE stp_1d
-#else
-   !!----------------------------------------------------------------------
-   !!   Default key                                     NO 1D Config
-   !!----------------------------------------------------------------------
-CONTAINS
-   SUBROUTINE stp_1d ( kt )
-      WRITE(*,*) 'stp_1d: You should not have seen this print! error?', kt
-   END SUBROUTINE stp_1d
-#endif
-   !!======================================================================
-END MODULE step1d
Index: /trunk/NEMO/C1D_SRC/step_c1d.F90
===================================================================
--- /trunk/NEMO/C1D_SRC/step_c1d.F90	(revision 899)
+++ /trunk/NEMO/C1D_SRC/step_c1d.F90	(revision 899)
@@ -0,0 +1,285 @@
+MODULE step1d
+   !!======================================================================
+   !!                       ***  MODULE step1D  ***
+   !! Time-stepping    : manager of the ocean, tracer and ice time stepping
+   !!======================================================================
+#if defined key_cfg_1d
+   !!----------------------------------------------------------------------
+   !!   'key_cfg_1d'               1D Configuration
+   !!----------------------------------------------------------------------  
+   !!----------------------------------------------------------------------
+   !!   stp_1d           : OPA system time-stepping on 1 direction
+   !!----------------------------------------------------------------------
+   !! * Modules used
+   USE oce             ! ocean dynamics and tracers variables
+   USE dom_oce         ! ocean space and time domain variables 
+   USE zdf_oce         ! ocean vertical physics variables
+   USE sbc_oce         ! surface boundary condition: ocean
+   USE ldftra_oce
+   USE ldfdyn_oce
+   USE in_out_manager  ! I/O manager
+   USE lbclnk
+
+   USE daymod          ! calendar                         (day     routine)
+
+   USE dtatem          ! ocean temperature data           (dta_tem routine)
+   USE dtasal          ! ocean salinity    data           (dta_sal routine)
+   USE ocfzpt          ! surface ocean freezing point    (oc_fz_pt routine)
+
+   USE trcstp          ! passive tracer time-stepping     (trc_stp routine)
+
+   USE dynzdf          ! vertical diffusion               (dyn_zdf routine)
+
+   USE traqsr          ! solar radiation penetration      (tra_qsr routine)
+   USE tranxt          ! time-stepping                    (tra_nxt routine)
+   USE trazdf          ! vertical diffusion               (tra_zdf routine)
+   USE trasbc          ! surface boundary condition       (tra_sbc routine)
+
+   USE eosbn2
+
+   USE zdfbfr          ! bottom friction                  (zdf_bfr routine)
+   USE zdftke          ! TKE vertical mixing              (zdf_tke routine)
+   USE zdfkpp          ! KPP vertical mixing              (zdf_kpp routine)
+   USE zdfddm          ! double diffusion mixing          (zdf_ddm routine)
+   USE zdfevd          ! enhanced vertical diffusion      (zdf_evd routine)
+   USE zdfric          ! Richardson vertical mixing       (zdf_ric routine)
+   USE zdfmxl          ! Mixed-layer depth                (zdf_mxl routine)
+
+   USE dyncor1d
+   USE dynnxt1d
+   USE diawri1d        ! Standard run outputs             (dia_wri_1d routine)
+
+   USE ice_oce         ! sea-ice variable
+   USE icestp1d        ! sea-ice time-stepping             (ice_stp routine)
+
+   USE diawri          ! Standard run outputs             (dia_wri_state routine)
+
+
+   USE stpctl          ! time stepping control            (stp_ctl routine)
+   USE restart         ! ocean restart                    (rst_wri routine)
+   USE prtctl          ! Print control                    (prt_ctl routine)
+   IMPLICIT NONE
+   PRIVATE
+
+   !! * Routine accessibility
+   PUBLIC stp_1d            ! called by opa.F90
+
+   !! * Substitutions
+#  include "domzgr_substitute.h90"
+#  include "zdfddm_substitute.h90"
+   !!----------------------------------------------------------------------
+   !!   OPA 9.0 , LOCEAN-IPSL (2005) 
+   !! $Id$
+   !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt 
+   !!----------------------------------------------------------------------
+
+CONTAINS
+
+   SUBROUTINE stp_1d( kstp )
+      !!----------------------------------------------------------------------
+      !!                     ***  ROUTINE stp1D  ***
+      !!                      
+      !! ** Purpose : - Time stepping of OPA (momentum and active tracer eqs.)
+      !!              - Time stepping of LIM (dynamic and thermodynamic eqs.)
+      !! 
+      !! ** Method  : -1- Update forcings and data  
+      !!              -2- Update ocean physics 
+      !!              -3- Compute the t and s trends 
+      !!              -4- Update t and s 
+      !!              -5- Compute the momentum trends
+      !!              -6- Update the horizontal velocity
+      !!              -7- Compute the diagnostics variables (rd,N2, div,cur,w)
+      !!              -8- Outputs and diagnostics
+      !!
+      !! History :
+      !!        !  91-03  ()  Original code
+      !!        !  91-11  (G. Madec)
+      !!        !  92-06  (M. Imbard)  add a first output record
+      !!        !  96-04  (G. Madec)  introduction of dynspg
+      !!        !  96-04  (M.A. Foujols)  introduction of passive tracer
+      !!   8.0  !  97-06  (G. Madec)  new architecture of call
+      !!   8.2  !  97-06  (G. Madec, M. Imbard, G. Roullet)  free surface
+      !!   8.2  !  99-02  (G. Madec, N. Grima)  hpg implicit
+      !!   8.2  !  00-07  (J-M Molines, M. Imbard)  Open Bondary Conditions
+      !!   9.0  !  02-06  (G. Madec)  free form, suppress macro-tasking
+      !!        !  04-10  (C. Ethe) 1D configuration
+      !!----------------------------------------------------------------------
+      !! * Arguments
+      INTEGER, INTENT( in ) ::   kstp   ! ocean time-step index
+
+      !! * local declarations
+      INTEGER ::   indic    ! error indicator if < 0
+!!      INTEGER ::   ii0, ii1, ij0, ij1   ! temporary integers
+      !! ---------------------------------------------------------------------
+
+      indic = 1                    ! reset to no error condition
+      adatrj = adatrj + rdt/86400._wp
+
+      CALL day( kstp )             ! Calendar
+
+      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+      ! Update data, open boundaries and Forcings
+      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
+
+      IF( lk_dtatem  )   CALL dta_tem( kstp )         ! update 3D temperature data
+
+      IF( lk_dtasal  )   CALL dta_sal( kstp )         ! Salinity data
+
+      IF( lk_dtasst  )   CALL dta_sst( kstp )         ! Sea Surface Temperature data
+
+                         CALL tau( kstp )             ! wind stress
+
+                         CALL flx_rnf( kstp )         ! runoff data
+
+                         CALL flx( kstp )             ! heat and freshwater fluxes
+
+      IF( lk_ice_lim )  THEN 
+                        CALL ice_stp_1d( kstp )      ! sea-ice model (Update stress & fluxes)
+      ELSE
+                        CALL oce_sbc( kstp )         ! ocean surface boudaries
+      ENDIF
+
+      IF( ln_fwb     )   CALL flx_fwb( kstp )         ! freshwater budget
+
+
+      IF( kstp == nit000 ) THEN 
+         IF( ninist == 1 ) THEN                       ! Output the initial state and forcings
+            CALL dia_wri_state( 'output.init' )
+         ENDIF
+      ENDIF
+
+      IF(ln_ctl) THEN         ! print mean trends (used for debugging)
+         CALL prt_ctl(tab2d_1=emp    , clinfo1=' emp  -   : ', mask1=tmask, ovlap=1)
+         CALL prt_ctl(tab2d_1=emps   , clinfo1=' emps -   : ', mask1=tmask, ovlap=1)
+         CALL prt_ctl(tab2d_1=qns    , clinfo1=' qns  -   : ', mask1=tmask, ovlap=1)
+         CALL prt_ctl(tab2d_1=qsr    , clinfo1=' qsr  -   : ', mask1=tmask, ovlap=1)
+         CALL prt_ctl(tab3d_1=tmask  , clinfo1=' tmask    : ', mask1=tmask, ovlap=1, kdim=jpk)
+         CALL prt_ctl(tab3d_1=tn     , clinfo1=' sst  -   : ', mask1=tmask, ovlap=1, kdim=1)
+         CALL prt_ctl(tab3d_1=sn     , clinfo1=' sss  -   : ', mask1=tmask, ovlap=1, kdim=1)
+         CALL prt_ctl(tab2d_1=utau   , clinfo1=' tau  - u : ', mask1=umask, &
+            &         tab2d_2=vtau   , clinfo2='      - v : ', mask2=vmask, ovlap=1)
+      ENDIF
+
+
+
+      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+      ! Ocean physics update
+      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
+      !-----------------------------------------------------------------------
+      !  VERTICAL PHYSICS
+      !-----------------------------------------------------------------------
+      ! N.B. ua, va, ta, sa arrays are used as workspace in this section
+      !-----------------------------------------------------------------------
+
+                       CALL bn2( tb, sb, rn2 )              ! before Brunt-Vaisala frequency
+      
+      !                                                     ! Vertical eddy viscosity and diffusivity coefficients
+      IF( lk_zdfric )   CALL zdf_ric( kstp )                       ! Richardson number dependent Kz
+      IF( lk_zdftke )   CALL zdf_tke( kstp )                       ! TKE closure scheme for Kz
+      IF( lk_zdfkpp )   CALL zdf_kpp( kstp )                       ! KPP scheme for Kz
+      IF( lk_zdfcst )   avt (:,:,:) = avt0 * tmask(:,:,:)          ! Constant Kz (reset avt to the background value)
+
+
+      IF( ln_zdfevd )   CALL zdf_evd( kstp )                 ! enhanced vertical eddy diffusivity
+
+      IF( lk_zdfddm .AND. .NOT. lk_zdfkpp)   &
+         &              CALL zdf_ddm( kstp )                 ! double diffusive mixing
+
+                        CALL zdf_bfr( kstp )                 ! bottom friction
+
+                        CALL zdf_mxl( kstp )                 ! mixed layer depth
+
+
+#if defined key_passivetrc
+      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+      ! Passive Tracer Model
+      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
+      ! N.B. ua, va, ta, sa arrays are used as workspace in this section
+      !-----------------------------------------------------------------------
+
+                               CALL trc_stp( kstp, indic )            ! time-stepping
+
+#endif
+
+
+      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+      ! Active tracers
+      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
+      ! N.B. ua, va arrays are used as workspace in this section
+      !-----------------------------------------------------------------------
+
+                               ta(:,:,:) = 0.e0               ! set tracer trends to zero
+                               sa(:,:,:) = 0.e0
+
+                               CALL tra_sbc( kstp )           ! surface boundary condition
+
+      IF( ln_traqsr        )   CALL tra_qsr( kstp )           ! penetrative solar radiation qsr
+
+      IF( lk_zdfkpp        )   CALL tra_kpp( kstp )           ! KPP non-local tracer fluxes
+
+                               CALL tra_zdf( kstp )           ! vertical mixing
+
+                               CALL tra_nxt( kstp )           ! tracer fields at next time step
+
+                               CALL eos( tb, sb, rhd, rhop )       ! now (swap=before) in situ density for dynhpg module
+
+      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+      ! Dynamics
+      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
+      ! N.B. ta, sa arrays are used as workspace in this section 
+      !-----------------------------------------------------------------------
+
+                               ua(:,:,:) = 0.e0               ! set dynamics trends to zero
+                               va(:,:,:) = 0.e0
+  
+                               CALL dyn_cor_1d     ( kstp )
+      !                                                       ! vertical diffusion
+                               CALL dyn_zdf( kstp )      
+
+!i bug lbc sur emp
+      CALL lbc_lnk( emp, 'T', 1. )
+!i
+ 
+                                CALL dyn_nxt_1d( kstp )          ! lateral velocity at next time step 
+
+
+      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+      ! Computation of diagnostic variables
+      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
+      ! N.B. ua, va, ta, sa arrays are used as workspace in this section
+      !-----------------------------------------------------------------------
+
+                               CALL oc_fz_pt                    ! ocean surface freezing temperature
+
+
+      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+      ! Control, diagnostics and outputs
+      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
+      ! N.B. ua, va, ta, sa arrays are used as workspace in this section
+      !-----------------------------------------------------------------------
+
+      !                                            ! Time loop: control and print
+                       CALL stp_ctl( kstp, indic )
+                       IF ( indic < 0 ) CALL ctl_stop( 'step1d: indic < 0' )
+
+      IF ( nstop == 0 ) THEN
+         !                                         ! Diagnostics:
+         !                                         ! save and outputs
+                           CALL rst_write  ( kstp )              ! ocean model: restart file output
+                           CALL dia_wri_1d ( kstp, indic )       ! ocean model: outputs
+
+      ENDIF
+
+
+   END SUBROUTINE stp_1d
+#else
+   !!----------------------------------------------------------------------
+   !!   Default key                                     NO 1D Config
+   !!----------------------------------------------------------------------
+CONTAINS
+   SUBROUTINE stp_1d ( kt )
+      WRITE(*,*) 'stp_1d: You should not have seen this print! error?', kt
+   END SUBROUTINE stp_1d
+#endif
+   !!======================================================================
+END MODULE step1d
Index: /trunk/NEMO/OFF_SRC/par_ORCA_R2.h90
===================================================================
--- /trunk/NEMO/OFF_SRC/par_ORCA_R2.h90	(revision 898)
+++ /trunk/NEMO/OFF_SRC/par_ORCA_R2.h90	(revision 899)
@@ -45,5 +45,5 @@
       jpnisl  = 400             !: maximum number of points per island
 
-#elif defined key_cfg_1d
+#elif defined key_c1d
       ! global domain size     !!! *  global domain  *
       jpiglo  = 3     ,      &  !: 1st dimension of global domain --> i
Index: /trunk/NEMO/OPA_SRC/DOM/domzgr.F90
===================================================================
--- /trunk/NEMO/OPA_SRC/DOM/domzgr.F90	(revision 898)
+++ /trunk/NEMO/OPA_SRC/DOM/domzgr.F90	(revision 899)
@@ -569,5 +569,5 @@
       ! ================
 
-      IF( .NOT. lk_cfg_1d )   THEN
+      IF( .NOT. lk_c1d )   THEN
 
          ! Suppress isolated ocean grid points
Index: /trunk/NEMO/OPA_SRC/ZDF/zdfkpp.F90
===================================================================
--- /trunk/NEMO/OPA_SRC/ZDF/zdfkpp.F90	(revision 898)
+++ /trunk/NEMO/OPA_SRC/ZDF/zdfkpp.F90	(revision 899)
@@ -130,5 +130,5 @@
       evmean  
  
-#if defined key_cfg_1d
+#if defined key_c1d
    REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) ::   &
       rig                   ,  &  ! gradient Richardson number
@@ -352,5 +352,5 @@
                   zsh2   = 0.5 * 0.5 * ( zdku2 + zdkv2 ) * ze3sqr
                   zri    = MAX( rn2(ji,jj,jk), 0. ) / ( zsh2 + epsln ) 
-#if defined key_cfg_1d
+#if defined key_c1d
                   ! save the gradient richardson number
                   rig(ji,jj,jk) = zri * tmask(ji,jj,jk)
@@ -515,5 +515,5 @@
             zucube     = zustar(ji,jj) * zustar(ji,jj) * zustar(ji,jj) 
             zmoa(ji)   = zucube / ( vonk * ( zbuofdep + epsln ) )   
-#if defined key_cfg_1d
+#if defined key_c1d
             ! store the surface buoyancy forcing
             zstabl        = 0.5 + SIGN( 0.5, zbuofdep )
@@ -744,5 +744,5 @@
                ! Save the Richardson number 
                zria  (ji)   = zrib  
-#if defined key_cfg_1d
+#if defined key_c1d
                ! store buoyancy length scale
                buof(ji,jj,jk) = zbuofdep * tmask(ji,jj,jk) 
Index: /trunk/NEMO/OPA_SRC/ZDF/zdftke.F90
===================================================================
--- /trunk/NEMO/OPA_SRC/ZDF/zdftke.F90	(revision 898)
+++ /trunk/NEMO/OPA_SRC/ZDF/zdftke.F90	(revision 899)
@@ -68,5 +68,5 @@
       &                  ri_c  = 2._wp / 9._wp      !: critic Richardson number
 
-# if defined key_cfg_1d
+# if defined key_c1d
    !                                                                   ! 1D cfg only
    REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) ::   e_dis, e_mix,      &  ! dissipation and mixing turbulent lengh scales
@@ -270,5 +270,5 @@
       END SELECT
 
-# if defined key_cfg_1d
+# if defined key_c1d
       ! save mixing and dissipation turbulent length scales
       e_dis(:,:,:) = zmxld(:,:,:)
@@ -368,5 +368,5 @@
                   ! local Richardson number
                   zri  = MAX( rn2(ji,jj,jk), 0. ) / ( zsh2 + 1.e-20 )
-# if defined key_cfg_1d
+# if defined key_c1d
                   ! save masked local Richardson number in zmxlm array
                   e_ric(ji,jj,jk) = zri * tmask(ji,jj,jk)
@@ -400,5 +400,5 @@
       END SELECT
 
-# if defined key_cfg_1d
+# if defined key_c1d
       !  save masked Prandlt number
       e_pdl(:,:,2:jpkm1) = zmxld(:,:,2:jpkm1)
Index: /trunk/NEMO/OPA_SRC/istate.F90
===================================================================
--- /trunk/NEMO/OPA_SRC/istate.F90	(revision 898)
+++ /trunk/NEMO/OPA_SRC/istate.F90	(revision 899)
@@ -127,5 +127,5 @@
          CALL eos( tb, sb, rhd, rhop )        ! before potential and in situ densities
          
-         IF( ln_zps .AND. .NOT. lk_cfg_1d )   &
+         IF( ln_zps .AND. .NOT. lk_c1d )   &
             &             CALL zps_hde( nit000, tb, sb, rhd,  &  ! Partial steps: before Horizontal DErivative
             &                                  gtu, gsu, gru, &  ! of t, s, rd at the bottom ocean level
Index: /trunk/NEMO/OPA_SRC/opa.F90
===================================================================
--- /trunk/NEMO/OPA_SRC/opa.F90	(revision 898)
+++ /trunk/NEMO/OPA_SRC/opa.F90	(revision 899)
@@ -124,5 +124,5 @@
       IF( lk_mpp )   CALL mpp_max(nstop)
 
-      IF( lk_cfg_1d ) THEN 
+      IF( lk_c1d ) THEN 
          istp = nit000
          DO WHILE ( istp <= nitend .AND. nstop == 0 )
@@ -269,5 +269,5 @@
       IF( ln_ctl )      CALL prt_ctl_init   ! Print control
 
-      IF( lk_cfg_1d )   CALL fcorio_1d      ! redefine Coriolis at T-point
+      IF( lk_c1d )      CALL fcorio_1d      ! redefine Coriolis at T-point
 
       IF( lk_obc    )   CALL obc_init       ! Open boundaries 
@@ -310,5 +310,5 @@
       IF(lwp) WRITE(numout,cform_aaa)       ! Flag AAAAAAA
 
-      IF( lk_cfg_1d  )  THEN 
+      IF( lk_c1d  )  THEN 
          CALL init_1d
       ENDIF
Index: /trunk/NEMO/OPA_SRC/par_ORCA_R2.h90
===================================================================
--- /trunk/NEMO/OPA_SRC/par_ORCA_R2.h90	(revision 898)
+++ /trunk/NEMO/OPA_SRC/par_ORCA_R2.h90	(revision 899)
@@ -63,5 +63,5 @@
       jpnisl  = 400             !: maximum number of points per island
 
-#elif defined key_cfg_1d
+#elif defined key_c1d
       ! global domain size     !!! *  global domain  *
    INTEGER    &
Index: /trunk/NEMO/OPA_SRC/par_oce.F90
===================================================================
--- /trunk/NEMO/OPA_SRC/par_oce.F90	(revision 898)
+++ /trunk/NEMO/OPA_SRC/par_oce.F90	(revision 899)
@@ -28,6 +28,6 @@
    INTEGER, PUBLIC, PARAMETER ::    &  !: 
       jpni   = 1,                   &  !: number of processors following i 
-      jpnj   = 1,                   &  !: number of processors following j
-      jpnij  = 1                       !: nb of local domain = nb of processors 
+      jpnj   = 2,                   &  !: number of processors following j
+      jpnij  = 2                       !: nb of local domain = nb of processors 
       !                                !  ( <= jpni x jpnj )
 #else
Index: /trunk/NEMO/OPA_SRC/restart.F90
===================================================================
--- /trunk/NEMO/OPA_SRC/restart.F90	(revision 898)
+++ /trunk/NEMO/OPA_SRC/restart.F90	(revision 899)
@@ -290,5 +290,5 @@
          CALL eos( tb, sb, rhd, rhop )        ! before potential and in situ densities
       ENDIF
-      IF( ln_zps .AND. .NOT. lk_cfg_1d ) THEN
+      IF( ln_zps .AND. .NOT. lk_c1d ) THEN
          IF( iom_varid( numror, 'gtu', ldstop = .FALSE. ) > 0 ) THEN
             CALL iom_get( numror, jpdom_autoglo, 'gtu' , gtu )
Index: /trunk/NEMO/TOP_SRC/SMS/p4zsed.F
===================================================================
--- /trunk/NEMO/TOP_SRC/SMS/p4zsed.F	(revision 898)
+++ /trunk/NEMO/TOP_SRC/SMS/p4zsed.F	(revision 899)
@@ -296,5 +296,5 @@
         DO jj=1,jpj
           DO ji=1,jpi
-#if ! defined key_cfg_1d && ( defined key_orca_r4 || defined key_orca_r2 || defined key_orca_r05 || defined key_orca_r025 )
+#if ! defined key_c1d && ( defined key_orca_r4 || defined key_orca_r2 || defined key_orca_r05 || defined key_orca_r025 )
         zfact=nitrpot(ji,jj,jk)*denitot/nitrpottot
 #else
Index: /trunk/NEMO/TOP_SRC/TRP/trcbbl.F90
===================================================================
--- /trunk/NEMO/TOP_SRC/TRP/trcbbl.F90	(revision 898)
+++ /trunk/NEMO/TOP_SRC/TRP/trcbbl.F90	(revision 899)
@@ -5,5 +5,5 @@
    !!                                  layer scheme
    !!==============================================================================
-#if  defined key_passivetrc && ( defined key_trcbbl_dif   ||   defined key_trcbbl_adv ) && ! defined key_cfg_1d
+#if  defined key_passivetrc && ( defined key_trcbbl_dif   ||   defined key_trcbbl_adv ) && ! defined key_c1d
    !!----------------------------------------------------------------------
    !!   'key_trcbbl_dif'   or            diffusive bottom boundary layer
Index: /trunk/NEMO/TOP_SRC/trc.F90
===================================================================
--- /trunk/NEMO/TOP_SRC/trc.F90	(revision 898)
+++ /trunk/NEMO/TOP_SRC/trc.F90	(revision 899)
@@ -194,5 +194,5 @@
   !!  1D configuration
   !! --------------------------------------------------
-#if defined key_cfg_1d
+#if defined key_cf1d
       LOGICAL, PARAMETER ::   lk_trccfg_1d   = .TRUE.   !: 1D pass. tracer configuration flag
 #else   
Index: /trunk/NEMO/TOP_SRC/trcrst.F90
===================================================================
--- /trunk/NEMO/TOP_SRC/trcrst.F90	(revision 898)
+++ /trunk/NEMO/TOP_SRC/trcrst.F90	(revision 899)
@@ -110,5 +110,5 @@
 
 #if defined key_trc_pisces 
-#   if ! defined key_cfg_1d && ( defined key_orca_r4 || defined key_orca_r2 || defined key_orca_r05 || defined key_orca_r025 )
+#   if ! defined key_c1d && ( defined key_orca_r4 || defined key_orca_r2 || defined key_orca_r05 || defined key_orca_r025 )
       REAL(wp) ::  ztrasum
 #   endif
@@ -218,5 +218,5 @@
 #if defined key_trc_pisces 
 
-#if ! defined key_cfg_1d && ( defined key_orca_r4 || defined key_orca_r2 || defined key_orca_r05 || defined key_orca_r025 ) 
+#if ! defined key_c1d && ( defined key_orca_r4 || defined key_orca_r2 || defined key_orca_r05 || defined key_orca_r025 ) 
 
       ztrasum = 0.
