Index: branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/IOM/in_out_manager.F90
===================================================================
--- branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/IOM/in_out_manager.F90	(revision 2497)
+++ branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/IOM/in_out_manager.F90	(revision 2498)
@@ -9,4 +9,5 @@
    !!             3.0  !  2008-06  (G. Madec)   add ctmp4 to ctmp10
    !!             3.2  !  2009-08  (S. MAsson)  add new ctl_opn
+   !!             3.3  !  2010-10  (A. Coward)  add NetCDF4 usage
    !!----------------------------------------------------------------------
 
@@ -16,8 +17,7 @@
    !!   getunit    : give the index of an unused logical unit
    !!----------------------------------------------------------------------
-   USE par_kind        ! kind definition
-   USE par_oce         ! ocean parameter
-   USE lib_print       ! formated print library
-   USE nc4interface
+   USE par_oce       ! ocean parameter
+   USE lib_print     ! formated print library
+   USE nc4interface  ! NetCDF4 interface
 
    IMPLICIT NONE
@@ -27,42 +27,42 @@
    !!                   namrun namelist parameters
    !!----------------------------------------------------------------------
-   CHARACTER(len=16)  ::   cn_exp        = "exp0"      !: experiment name used for output filename
-   CHARACTER(len=32)  ::   cn_ocerst_in  = "restart"   !: suffix of ocean restart name (input)
-   CHARACTER(len=32)  ::   cn_ocerst_out = "restart"   !: suffix of ocean restart name (output)
-   LOGICAL            ::   ln_rstart     = .FALSE.     !: start from (F) rest or (T) a restart file
-   INTEGER            ::   nn_no         = 0           !: job number
-   INTEGER            ::   nn_rstctl     = 0           !: control of the time step (0, 1 or 2)
-   INTEGER            ::   nn_rstssh     = 0           !: hand made initilization of ssh or not (1/0)
-   INTEGER            ::   nn_it000      = 1           !: index of the first time step
-   INTEGER            ::   nn_itend      = 10          !: index of the last time step
-   INTEGER            ::   nn_date0      = 961115      !: initial calendar date aammjj
-   INTEGER            ::   nn_leapy      = 0           !: Leap year calendar flag (0/1 or 30)
-   INTEGER            ::   nn_istate     = 0           !: initial state output flag (0/1)
-   INTEGER            ::   nn_write      =   10        !: model standard output frequency
-   INTEGER            ::   nn_stock      =   10        !: restart file frequency
-   LOGICAL            ::   ln_dimgnnn    = .FALSE.     !: type of dimgout. (F): 1 file for all proc
+   CHARACTER(lc) ::   cn_exp        = "exp0"      !: experiment name used for output filename
+   CHARACTER(lc) ::   cn_ocerst_in  = "restart"   !: suffix of ocean restart name (input)
+   CHARACTER(lc) ::   cn_ocerst_out = "restart"   !: suffix of ocean restart name (output)
+   LOGICAL       ::   ln_rstart     = .FALSE.     !: start from (F) rest or (T) a restart file
+   INTEGER       ::   nn_no         = 0           !: job number
+   INTEGER       ::   nn_rstctl     = 0           !: control of the time step (0, 1 or 2)
+   INTEGER       ::   nn_rstssh     = 0           !: hand made initilization of ssh or not (1/0)
+   INTEGER       ::   nn_it000      = 1           !: index of the first time step
+   INTEGER       ::   nn_itend      = 10          !: index of the last time step
+   INTEGER       ::   nn_date0      = 961115      !: initial calendar date aammjj
+   INTEGER       ::   nn_leapy      = 0           !: Leap year calendar flag (0/1 or 30)
+   INTEGER       ::   nn_istate     = 0           !: initial state output flag (0/1)
+   INTEGER       ::   nn_write      =   10        !: model standard output frequency
+   INTEGER       ::   nn_stock      =   10        !: restart file frequency
+   LOGICAL       ::   ln_dimgnnn    = .FALSE.     !: type of dimgout. (F): 1 file for all proc
                                                        !:                  (T): 1 file per proc
-   LOGICAL            ::   ln_mskland    = .FALSE.     !: mask land points in NetCDF outputs (costly: + ~15%)
-   LOGICAL            ::   ln_clobber    = .FALSE.     !: clobber (overwrite) an existing file
-   INTEGER            ::   nn_chunksz    = 0           !: chunksize (bytes) for NetCDF file (working only with iom_nf90 routines)
+   LOGICAL       ::   ln_mskland    = .FALSE.     !: mask land points in NetCDF outputs (costly: + ~15%)
+   LOGICAL       ::   ln_clobber    = .FALSE.     !: clobber (overwrite) an existing file
+   INTEGER       ::   nn_chunksz    = 0           !: chunksize (bytes) for NetCDF file (works only with iom_nf90 routines)
 #if defined key_netcdf4
    !!----------------------------------------------------------------------
-   !!                   namnc4 namelist parameters
-   !!----------------------------------------------------------------------
-                                                       !: =========================================================================
-                                                       !: The following four values determine the partitioning of the output fields
-                                                       !: into netcdf4 chunks. They are unrelated to the nn_chunk_sz setting which is
-                                                       !: for runtime optimisation. The individual netcdf4 chunks can be optionally 
-                                                       !: gzipped (recommended) leading to significant reductions in I/O volumes 
-   INTEGER            ::   nn_nchunks_i  = 1           !: number of chunks required in the i-dimension (only with iom_nf90 routines and key_netcdf4)
-   INTEGER            ::   nn_nchunks_j  = 1           !: number of chunks required in the j-dimension (only with iom_nf90 routines and key_netcdf4)
-   INTEGER            ::   nn_nchunks_k  = 1           !: number of chunks required in the k-dimension (only with iom_nf90 routines and key_netcdf4)
-   INTEGER            ::   nn_nchunks_t  = 1           !: number of chunks required in the t-dimension (only with iom_nf90 routines and key_netcdf4)
-   LOGICAL            ::   ln_nc4zip     = .TRUE.      !: netcdf4 usage. (T): chunk and compress output datasets using the HDF5 sublayers of netcdf4
-                                                       !:                (F): ignore chunking request and use the netcdf4 library to produce netcdf3-compatible files 
+   !!                   namnc4 namelist parameters                         (key_netcdf4)
+   !!----------------------------------------------------------------------
+   ! The following four values determine the partitioning of the output fields
+   ! into netcdf4 chunks. They are unrelated to the nn_chunk_sz setting which is
+   ! for runtime optimisation. The individual netcdf4 chunks can be optionally 
+   ! gzipped (recommended) leading to significant reductions in I/O volumes 
+   !                                   !!!**  variables only used with iom_nf90 routines and key_netcdf4 **
+   INTEGER ::   nn_nchunks_i = 1        !: number of chunks required in the i-dimension 
+   INTEGER ::   nn_nchunks_j = 1        !: number of chunks required in the j-dimension 
+   INTEGER ::   nn_nchunks_k = 1        !: number of chunks required in the k-dimension 
+   INTEGER ::   nn_nchunks_t = 1        !: number of chunks required in the t-dimension 
+   LOGICAL ::   ln_nc4zip    = .TRUE.   !: netcdf4 usage: (T) chunk and compress output using the HDF5 sublayers of netcdf4
+   !                                    !                 (F) ignore chunking request and use the netcdf4 library 
+   !                                    !                     to produce netcdf3-compatible files 
 #endif
-
 !$AGRIF_DO_NOT_TREAT
-   TYPE(snc4_ctl)     :: snc4set                       !: netcdf4 chunking control structure (always needed for decision making)
+   TYPE(snc4_ctl)     :: snc4set        !: netcdf4 chunking control structure (always needed for decision making)
 !$AGRIF_END_DO_NOT_TREAT
 
@@ -71,68 +71,68 @@
    !! (this should disappear in a near futur)
 
-   CHARACTER(len=16)  ::   cexper                      !: experiment name used for output filename
-   INTEGER            ::   no                          !: job number
-   INTEGER            ::   nrstdt                      !: control of the time step (0, 1 or 2)
-   INTEGER            ::   nit000                      !: index of the first time step
-   INTEGER            ::   nitend                      !: index of the last time step
-   INTEGER            ::   ndate0                      !: initial calendar date aammjj
-   INTEGER            ::   nleapy                      !: Leap year calendar flag (0/1 or 30)
-   INTEGER            ::   ninist                      !: initial state output flag (0/1)
-   INTEGER            ::   nwrite                      !: model standard output frequency
-   INTEGER            ::   nstock                      !: restart file frequency
+   CHARACTER(lc) ::   cexper                      !: experiment name used for output filename
+   INTEGER       ::   no                          !: job number
+   INTEGER       ::   nrstdt                      !: control of the time step (0, 1 or 2)
+   INTEGER       ::   nit000                      !: index of the first time step
+   INTEGER       ::   nitend                      !: index of the last time step
+   INTEGER       ::   ndate0                      !: initial calendar date aammjj
+   INTEGER       ::   nleapy                      !: Leap year calendar flag (0/1 or 30)
+   INTEGER       ::   ninist                      !: initial state output flag (0/1)
+   INTEGER       ::   nwrite                      !: model standard output frequency
+   INTEGER       ::   nstock                      !: restart file frequency
 
    !!----------------------------------------------------------------------
    !! was in restart but moved here because of the OFF line... better solution should be found...
    !!----------------------------------------------------------------------
-   INTEGER            ::   nitrst                 !: time step at which restart file should be written
+   INTEGER ::   nitrst   !: time step at which restart file should be written
 
    !!----------------------------------------------------------------------
    !!                    output monitoring
    !!----------------------------------------------------------------------
-   LOGICAL            ::   ln_ctl     = .FALSE.   !: run control for debugging
-   INTEGER            ::   nn_print     =    0    !: level of print (0 no print)
-   INTEGER            ::   nn_ictls     =    0    !: Start i indice for the SUM control
-   INTEGER            ::   nn_ictle     =    0    !: End   i indice for the SUM control
-   INTEGER            ::   nn_jctls     =    0    !: Start j indice for the SUM control
-   INTEGER            ::   nn_jctle     =    0    !: End   j indice for the SUM control
-   INTEGER            ::   nn_isplt     =    1    !: number of processors following i
-   INTEGER            ::   nn_jsplt     =    1    !: number of processors following j
-   INTEGER            ::   nn_bench     =    0    !: benchmark parameter (0/1)
-   INTEGER            ::   nn_bit_cmp   =    0    !: bit reproducibility  (0/1)
-
-   !                                              !: OLD namelist names
-   INTEGER ::   nprint, nictls, nictle, njctls, njctle, isplt, jsplt, nbench
-
-   INTEGER            ::   ijsplt     =    1      !: nb of local domain = nb of processors
+   LOGICAL ::   ln_ctl     = .FALSE.   !: run control for debugging
+   INTEGER ::   nn_print     =    0    !: level of print (0 no print)
+   INTEGER ::   nn_ictls     =    0    !: Start i indice for the SUM control
+   INTEGER ::   nn_ictle     =    0    !: End   i indice for the SUM control
+   INTEGER ::   nn_jctls     =    0    !: Start j indice for the SUM control
+   INTEGER ::   nn_jctle     =    0    !: End   j indice for the SUM control
+   INTEGER ::   nn_isplt     =    1    !: number of processors following i
+   INTEGER ::   nn_jsplt     =    1    !: number of processors following j
+   INTEGER ::   nn_bench     =    0    !: benchmark parameter (0/1)
+   INTEGER ::   nn_bit_cmp   =    0    !: bit reproducibility  (0/1)
+
+   !                                          
+   INTEGER ::   nprint, nictls, nictle, njctls, njctle, isplt, jsplt, nbench    !: OLD namelist names
+
+   INTEGER ::   ijsplt     =    1      !: nb of local domain = nb of processors
 
    !!----------------------------------------------------------------------
    !!                        logical units
    !!----------------------------------------------------------------------
-   INTEGER            ::   numstp     =   -1      !: logical unit for time step
-   INTEGER            ::   numout     =    6      !: logical unit for output print
-   INTEGER            ::   numnam     =   -1      !: logical unit for namelist
-   INTEGER            ::   numnam_ice =   -1      !: logical unit for ice namelist
-   INTEGER            ::   numevo_ice =   -1      !: logical unit for ice variables (temp. evolution)
-   INTEGER            ::   numsol     =   -1      !: logical unit for solver statistics
+   INTEGER ::   numstp     =   -1      !: logical unit for time step
+   INTEGER ::   numout     =    6      !: logical unit for output print
+   INTEGER ::   numnam     =   -1      !: logical unit for namelist
+   INTEGER ::   numnam_ice =   -1      !: logical unit for ice namelist
+   INTEGER ::   numevo_ice =   -1      !: logical unit for ice variables (temp. evolution)
+   INTEGER ::   numsol     =   -1      !: logical unit for solver statistics
 
    !!----------------------------------------------------------------------
    !!                          Run control  
    !!----------------------------------------------------------------------
-   INTEGER            ::   nstop = 0                !: error flag (=number of reason for a premature stop run)
-   INTEGER            ::   nwarn = 0                !: warning flag (=number of warning found during the run)
-   CHARACTER(len=200) ::   ctmp1, ctmp2, ctmp3      !: temporary characters 1 to 3
-   CHARACTER(len=200) ::   ctmp4, ctmp5, ctmp6      !: temporary characters 4 to 6
-   CHARACTER(len=200) ::   ctmp7, ctmp8, ctmp9      !: temporary characters 7 to 9
-   CHARACTER(len=200) ::   ctmp10                   !: temporary character 10
-   CHARACTER (len=64) ::   cform_err = "(/,' ===>>> : E R R O R',     /,'         ===========',/)"       !:
-   CHARACTER (len=64) ::   cform_war = "(/,' ===>>> : W A R N I N G', /,'         ===============',/)"   !:
-   LOGICAL            ::   lwp      = .FALSE.       !: boolean : true on the 1st processor only
-   LOGICAL            ::   lsp_area = .TRUE.        !: to make a control print over a specific area
+   INTEGER       ::   nstop = 0             !: error flag (=number of reason for a premature stop run)
+   INTEGER       ::   nwarn = 0             !: warning flag (=number of warning found during the run)
+   CHARACTER(lc) ::   ctmp1, ctmp2, ctmp3   !: temporary characters 1 to 3
+   CHARACTER(lc) ::   ctmp4, ctmp5, ctmp6   !: temporary characters 4 to 6
+   CHARACTER(lc) ::   ctmp7, ctmp8, ctmp9   !: temporary characters 7 to 9
+   CHARACTER(lc) ::   ctmp10                !: temporary character 10
+   CHARACTER(lc) ::   cform_err = "(/,' ===>>> : E R R O R',     /,'         ===========',/)"       !:
+   CHARACTER(lc) ::   cform_war = "(/,' ===>>> : W A R N I N G', /,'         ===============',/)"   !:
+   LOGICAL       ::   lwp      = .FALSE.    !: boolean : true on the 1st processor only
+   LOGICAL       ::   lsp_area = .TRUE.     !: to make a control print over a specific area
+
    !!----------------------------------------------------------------------
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
-
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
 CONTAINS
 
@@ -151,5 +151,5 @@
       nstop = nstop + 1 
       IF(lwp) THEN
-         WRITE(numout,"(/,' ===>>> : E R R O R',     /,'         ===========',/)") 
+         WRITE(numout,cform_err)
          IF( PRESENT(cd1 ) ) WRITE(numout,*) cd1
          IF( PRESENT(cd2 ) ) WRITE(numout,*) cd2
@@ -185,5 +185,5 @@
       nwarn = nwarn + 1 
       IF(lwp) THEN
-         WRITE(numout,"(/,' ===>>> : W A R N I N G', /,'         ===============',/)") 
+         WRITE(numout,cform_war)
          IF( PRESENT(cd1 ) ) WRITE(numout,*) cd1
          IF( PRESENT(cd2 ) ) WRITE(numout,*) cd2
@@ -202,5 +202,5 @@
 
 
-   SUBROUTINE ctl_opn ( knum, cdfile, cdstat, cdform, cdacce, klengh, kout, ldwp, karea )
+   SUBROUTINE ctl_opn( knum, cdfile, cdstat, cdform, cdacce, klengh, kout, ldwp, karea )
       !!----------------------------------------------------------------------
       !!                  ***  ROUTINE ctl_opn  ***
@@ -209,10 +209,5 @@
       !!
       !! ** Method  :   Fortan open
-      !!
-      !! History :
-      !!        !  1995-12  (G. Madec)  Original code
-      !!   8.5  !  2002-06  (G. Madec)  F90: Free form and module
-      !!----------------------------------------------------------------------
-
+      !!----------------------------------------------------------------------
       INTEGER          , INTENT(  out) ::   knum      ! logical unit to open
       CHARACTER(len=*) , INTENT(in   ) ::   cdfile    ! file name to open
@@ -227,4 +222,5 @@
       CHARACTER(len=80) ::   clfile
       INTEGER           ::   iost
+      !!----------------------------------------------------------------------
 
       ! adapt filename
Index: branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/module_example
===================================================================
--- branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/module_example	(revision 2497)
+++ branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/module_example	(revision 2498)
@@ -26,6 +26,6 @@
 
    TYPE ::   FLD_E                !: Structure type definition
-      CHARACTER(len = 256) ::   clname      ! clname description 
-      INTEGER              ::   nfreqh      ! nfreqh description 
+      CHARACTER(lc) ::   clname      ! clname description (default length, lc, is 256, see par_kind.F90)
+      INTEGER       ::   nfreqh      ! nfreqh description 
    END TYPE FLD_E 
 
Index: branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90
===================================================================
--- branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90	(revision 2497)
+++ branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90	(revision 2498)
@@ -75,5 +75,5 @@
    PUBLIC   nemo_init   ! needed by AGRIF
 
-   CHARACTER (len=64) ::   cform_aaa="( /, 'AAAAAAAA', / ) "     ! flag for output listing
+   CHARACTER(lc) ::   cform_aaa="( /, 'AAAAAAAA', / ) "     ! flag for output listing
 
    !!----------------------------------------------------------------------
Index: branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/oce.F90
===================================================================
--- branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/oce.F90	(revision 2497)
+++ branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/oce.F90	(revision 2498)
@@ -14,5 +14,4 @@
 
    LOGICAL         , PUBLIC ::   l_traldf_rot = .FALSE.  !: rotated laplacian operator for lateral diffusion
-   CHARACTER(len=3), PUBLIC ::   l_adv                   !: flag for the advection scheme used (= 'ce2', 'tvd' ...)
 
    !! dynamics and tracer fields                  ! before ! now    ! after   ! the after trends becomes the fields
Index: branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/par_kind.F90
===================================================================
--- branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/par_kind.F90	(revision 2497)
+++ branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/par_kind.F90	(revision 2498)
@@ -4,10 +4,6 @@
    !! Ocean :  define the kind of real for the whole model
    !!======================================================================
-   !! History :
-   !!   8.5   02/06  (G. Madec)  Original code
-   !!----------------------------------------------------------------------
-   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
-   !! $Id$ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! History :  1.0  ! 2002-06  (G. Madec)  Original code
+   !!            3.3  ! 2010-12  (G. Madec)  add a standard length of character strings
    !!----------------------------------------------------------------------
 
@@ -15,8 +11,6 @@
    PRIVATE
 
-   INTEGER, PUBLIC, PARAMETER ::    &  !:
-      jpbyt   = 8       ,           &  !: real size for mpp communications
-      jpbytda = 4       ,           &  !: real size in input data files 4 or 8
-      jpbi3e  = 4                      !: real size for T3E
+   INTEGER, PUBLIC, PARAMETER ::   jpbyt   = 8    !: real size for mpp communications
+   INTEGER, PUBLIC, PARAMETER ::   jpbytda = 4    !: real size in input data files 4 or 8
 
    ! Number model from which the SELECTED_*_KIND are requested:
@@ -27,13 +21,20 @@
    !            exponent = 37     exponent = 307
 
-   INTEGER, PUBLIC, PARAMETER ::        &  !: Floating point section
-      sp = SELECTED_REAL_KIND( 6, 37),  &  !: single precision (real 4)
-      dp = SELECTED_REAL_KIND(12,307),  &  !: double precision (real 8)
-      wp = dp                              !: working precision
+   !                                                                !!** Floating point **
+   INTEGER, PUBLIC, PARAMETER ::   sp = SELECTED_REAL_KIND( 6, 37)   !: single precision (real 4)
+   INTEGER, PUBLIC, PARAMETER ::   dp = SELECTED_REAL_KIND(12,307)   !: double precision (real 8)
+   INTEGER, PUBLIC, PARAMETER ::   wp = dp                              !: working precision
 
-   INTEGER, PUBLIC, PARAMETER ::        &  !: Integer section
-      i4 = SELECTED_INT_KIND(9) ,       &  !: single precision (integer 4)
-      i8 = SELECTED_INT_KIND(14)           !: double precision (integer 8)
+   !                                                                !!** Integer **
+   INTEGER, PUBLIC, PARAMETER ::   i4 = SELECTED_INT_KIND( 9)        !: single precision (integer 4)
+   INTEGER, PUBLIC, PARAMETER ::   i8 = SELECTED_INT_KIND(14)        !: double precision (integer 8)
+   
+   !                                                                !!** Integer **
+   INTEGER, PUBLIC, PARAMETER ::   lc = 256                          !: Lenght of Character strings
 
-!!----------------------------------------------------------------------
+   !!----------------------------------------------------------------------
+   !! NEMO 3.3 , NEMO Consortium (2010)
+   !! $Id$ 
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
 END MODULE par_kind
