Index: branches/2012/dev_r3379_CMCC6_topbfm/NEMOGCM/CONFIG/cfg.txt
===================================================================
--- branches/2012/dev_r3379_CMCC6_topbfm/NEMOGCM/CONFIG/cfg.txt	(revision 3380)
+++ branches/2012/dev_r3379_CMCC6_topbfm/NEMOGCM/CONFIG/cfg.txt	(revision 3398)
@@ -1,3 +1,2 @@
-GYRE OPA_SRC
 GYRE_LOBSTER OPA_SRC TOP_SRC
 ORCA2_LIM3 OPA_SRC LIM_SRC_3
@@ -7,2 +6,6 @@
 ORCA2_LIM OPA_SRC LIM_SRC_2 NST_SRC
 ORCA2_OFF_PISCES OPA_SRC OFF_SRC TOP_SRC
+GYRE OPA_SRC
+PELAGOS025 OPA_SRC LIM_SRC_2 NST_SRC TOP_SRC
+GYRE_BFM OPA_SRC TOP_SRC
+PELAGOS OPA_SRC LIM_SRC_2 NST_SRC TOP_SRC
Index: branches/2012/dev_r3379_CMCC6_topbfm/NEMOGCM/EXTERNAL/IOIPSL/tools/flio_rbld.f90
===================================================================
--- branches/2012/dev_r3379_CMCC6_topbfm/NEMOGCM/EXTERNAL/IOIPSL/tools/flio_rbld.f90	(revision 3380)
+++ branches/2012/dev_r3379_CMCC6_topbfm/NEMOGCM/EXTERNAL/IOIPSL/tools/flio_rbld.f90	(revision 3398)
@@ -678,4 +678,12 @@
               io_sl(v_d_ul(iv))=it
             ENDIF
+          ENDIF
+!-------- Initialize to zero variables data 
+          ! approximate dimension
+          IF ( it == 1 .AND. l_cgd) THEN
+          ! Enter I*J I*J is larger thant total number of single files
+            if ( ((f_d_l(1)/(d_s_l(1,1)-3)) * (f_d_l(2)/(d_s_l(2,1)-3) )) .gt. d_n_t ) then 
+              CALL ZeroFill (f_id_o, f_v_nm(iv), f_d_l, v_d_nb(iv), v_type(iv), v_d_i(1:v_d_nb(iv),iv))
+            endif
           ENDIF
         ENDIF
@@ -1621,4 +1629,156 @@
 END SUBROUTINE flrb_rg
 !===
+SUBROUTINE ZeroFill(f_id_o,f_v_nm,f_d_l,v_d_nb,v_type,v_d_i)
+
+  IMPLICIT NONE
+! Character length
+  INTEGER,PARAMETER :: chlen=256
+
+  INTEGER              :: v_d_nb, v_type ! variable # of dims, variable type, var Unlim dimension
+  INTEGER              :: f_id_o         ! Output file ID
+  INTEGER,DIMENSION(:) :: f_d_l, v_d_i    ! Global dimensions, variable dimensio ID
+  CHARACTER(LEN=chlen) :: f_v_nm         ! Variable name
+  INTEGER,DIMENSION(:),ALLOCATABLE :: dims
+
+  INTEGER(KIND=i_2) :: i2_0d
+  INTEGER(KIND=i_2), ALLOCATABLE :: i2_1d(:), i2_2d(:,:), i2_3d(:,:,:), i2_4d(:,:,:,:), i2_5d(:,:,:,:,:)
+  INTEGER(KIND=i_4) :: i4_0d
+  INTEGER(KIND=i_4), ALLOCATABLE :: i4_1d(:), i4_2d(:,:), i4_3d(:,:,:), i4_4d(:,:,:,:), i4_5d(:,:,:,:,:)
+  REAL(KIND=r_4) :: r4_0d
+  REAL(KIND=r_4), ALLOCATABLE    :: r4_1d(:), r4_2d(:,:), r4_3d(:,:,:), r4_4d(:,:,:,:), r4_5d(:,:,:,:,:)
+  REAL(KIND=r_8) :: r8_0d
+  REAL(KIND=r_8), ALLOCATABLE    :: r8_1d(:), r8_2d(:,:), r8_3d(:,:,:), r8_4d(:,:,:,:), r8_5d(:,:,:,:,:)
+  
+  ! write(*,*) ' Into my sub... TOM'
+  ! write(*,*) f_id_o, TRIM(f_v_nm), v_d_nb , v_type
+  write(*,*) 'Variable: ',TRIM(f_v_nm), ' intiliazed to zero'
+  write(*,*)
+
+  ! define variable dimension
+  ALLOCATE(dims(v_d_nb)) 
+  dims=f_d_l(v_d_i)
+  SELECT CASE(v_type) 
+    ! INTEGER 1 and 2 
+    CASE (flio_i1,flio_i2)
+      SELECT CASE (v_d_nb)
+       CASE(1)
+         ALLOCATE(i2_1d(dims(1)))
+         i2_1d=0
+         CALL flioputv (f_id_o,TRIM(f_v_nm),i2_1d)
+         DEALLOCATE(i2_1d)
+       CASE(2)
+         ALLOCATE(i2_2d(dims(1),dims(2)))
+         i2_2d=0
+         CALL flioputv (f_id_o,TRIM(f_v_nm),i2_2d) 
+         DEALLOCATE(i2_2d)
+       CASE(3)
+         ALLOCATE(i2_3d(dims(1),dims(2),dims(3)))
+         i2_3d=0
+         CALL flioputv (f_id_o,TRIM(f_v_nm),i2_3d)
+         DEALLOCATE(i2_3d)
+       CASE(4)
+         ALLOCATE(i2_4d(dims(1),dims(2),dims(3),dims(4)))
+         i2_4d=0
+         CALL flioputv (f_id_o,TRIM(f_v_nm),i2_4d)
+         DEALLOCATE(i2_4d)
+       CASE(5)
+         ALLOCATE(i2_5d(dims(1),dims(2),dims(3),dims(4),dims(5)))
+         i2_5d=0
+         CALL flioputv (f_id_o,TRIM(f_v_nm),i2_5d)
+         DEALLOCATE(i2_5d)
+      END SELECT
+    ! INTEGER 4
+    CASE (flio_i4)
+      SELECT CASE (v_d_nb)
+       CASE(1)
+         ALLOCATE(i4_1d(dims(1)))
+         i4_1d=0
+         CALL flioputv (f_id_o,TRIM(f_v_nm),i4_1d)
+         DEALLOCATE(i4_1d)
+       CASE(2)
+         ALLOCATE(i4_2d(dims(1),dims(2)))
+         i4_2d=0
+         CALL flioputv (f_id_o,TRIM(f_v_nm),i4_2d)
+         DEALLOCATE(i4_2d)
+       CASE(3)
+         ALLOCATE(i4_3d(dims(1),dims(2),dims(3)))
+         i4_3d=0
+         CALL flioputv (f_id_o,TRIM(f_v_nm),i4_3d)
+         DEALLOCATE(i4_3d)
+       CASE(4)
+         ALLOCATE(i4_4d(dims(1),dims(2),dims(3),dims(4)))
+         i4_4d=0
+         CALL flioputv (f_id_o,TRIM(f_v_nm),i4_4d)
+         DEALLOCATE(i4_4d)
+       CASE(5)
+         ALLOCATE(i4_5d(dims(1),dims(2),dims(3),dims(4),dims(5)))
+         i4_5d=0
+         CALL flioputv (f_id_o,TRIM(f_v_nm),i4_5d)
+         DEALLOCATE(i4_5d)
+      END SELECT
+    ! FLOAT 4
+    CASE (flio_r4)
+      SELECT CASE (v_d_nb)
+       CASE(1)
+         ALLOCATE(r4_1d(dims(1)))
+         r4_1d=0
+         CALL flioputv (f_id_o,TRIM(f_v_nm),r4_1d) 
+         DEALLOCATE(r4_1d)
+       CASE(2)
+         ALLOCATE(r4_2d(dims(1),dims(2)))
+         r4_2d=0
+         CALL flioputv (f_id_o,TRIM(f_v_nm),r4_2d) 
+         DEALLOCATE(r4_2d)
+       CASE(3)
+         ALLOCATE(r4_3d(dims(1),dims(2),dims(3)))
+         r4_3d=0
+         CALL flioputv (f_id_o,TRIM(f_v_nm),r4_3d) 
+         DEALLOCATE(r4_3d)
+       CASE(4)
+         ALLOCATE(r4_4d(dims(1),dims(2),dims(3),dims(4)))
+         r4_4d=0
+         CALL flioputv (f_id_o,TRIM(f_v_nm),r4_4d)
+         DEALLOCATE(r4_4d)
+       CASE(5)
+         ALLOCATE(r4_5d(dims(1),dims(2),dims(3),dims(4),dims(5)))
+         r4_5d=0
+         CALL flioputv (f_id_o,TRIM(f_v_nm),r4_5d)
+         DEALLOCATE(r4_5d)
+      END SELECT
+    ! FLOAT 8
+    CASE (flio_r8)
+      SELECT CASE (v_d_nb)
+       CASE(1)
+         ALLOCATE(r8_1d(dims(1)))
+         r8_1d=0
+         CALL flioputv (f_id_o,TRIM(f_v_nm),r8_1d)
+         DEALLOCATE(r8_1d)
+       CASE(2)
+         ALLOCATE(r8_2d(dims(1),dims(2)))
+         r8_2d=0
+         CALL flioputv (f_id_o,TRIM(f_v_nm),r8_2d) 
+         DEALLOCATE(r8_2d)
+       CASE(3)
+         ALLOCATE(r8_3d(dims(1),dims(2),dims(3)))
+         r8_3d=0
+         CALL flioputv (f_id_o,TRIM(f_v_nm),r8_3d)
+         DEALLOCATE(r8_3d)
+       CASE(4)
+         ALLOCATE(r8_4d(dims(1),dims(2),dims(3),dims(4)))
+         r8_4d=0
+         CALL flioputv (f_id_o,TRIM(f_v_nm),r8_4d)
+         DEALLOCATE(r8_4d)
+       CASE(5)
+         ALLOCATE(r8_5d(dims(1),dims(2),dims(3),dims(4),dims(5)))
+         r8_5d=0
+         CALL flioputv (f_id_o,TRIM(f_v_nm),r8_5d)
+         DEALLOCATE(r8_5d)
+      END SELECT
+  END SELECT
+
+  DEALLOCATE (dims)
+
+END SUBROUTINE
+!===
 !--------------------
 END PROGRAM flio_rbld
Index: branches/2012/dev_r3379_CMCC6_topbfm/NEMOGCM/NEMO/OPA_SRC/SBC/fldread.F90
===================================================================
--- branches/2012/dev_r3379_CMCC6_topbfm/NEMOGCM/NEMO/OPA_SRC/SBC/fldread.F90	(revision 3380)
+++ branches/2012/dev_r3379_CMCC6_topbfm/NEMOGCM/NEMO/OPA_SRC/SBC/fldread.F90	(revision 3398)
@@ -831,4 +831,5 @@
          IF( LEN( TRIM(sdf_n(jf)%wname) ) > 0 )   sdf(jf)%wgtname = TRIM( cdir )//TRIM( sdf_n(jf)%wname )
          sdf(jf)%vcomp   = sdf_n(jf)%vcomp
+         sdf(jf)%rotn    = .FALSE.
       END DO
 
Index: branches/2012/dev_r3379_CMCC6_topbfm/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk_core.F90
===================================================================
--- branches/2012/dev_r3379_CMCC6_topbfm/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk_core.F90	(revision 3380)
+++ branches/2012/dev_r3379_CMCC6_topbfm/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk_core.F90	(revision 3398)
@@ -49,5 +49,4 @@
    PUBLIC   turb_core_2z         ! routine calles in sbcblk_mfs module
 
-   INTEGER , PARAMETER ::   jpfld   = 9           ! maximum number of files to read 
    INTEGER , PARAMETER ::   jp_wndi = 1           ! index of 10m wind velocity (i-component) (m/s)    at T-point
    INTEGER , PARAMETER ::   jp_wndj = 2           ! index of 10m wind velocity (j-component) (m/s)    at T-point
@@ -59,4 +58,12 @@
    INTEGER , PARAMETER ::   jp_snow = 8           ! index of snow (solid prcipitation)       (kg/m2/s)
    INTEGER , PARAMETER ::   jp_tdif = 9           ! index of tau diff associated to HF tau   (N/m2)   at T-point
+#if defined key_orca_r025
+   INTEGER , PARAMETER ::   jp_swc  = 10          ! index of GEWEX correction for SW radiation  at T-point
+   INTEGER , PARAMETER ::   jp_lwc  = 11          ! index of GEWEX correction for LW radiation  at T-point
+   INTEGER , PARAMETER ::   jp_prc  = 12          ! index of PMWC correction forat T-point
+   INTEGER , PARAMETER ::   jpfld   = 12          ! maximum number of files to read
+#else
+   INTEGER , PARAMETER ::   jpfld   = 9           ! maximum number of files to read
+#endif
    
    TYPE(FLD), ALLOCATABLE, DIMENSION(:) ::   sf   ! structure of input fields (file informations, fields read)
@@ -75,4 +82,14 @@
    LOGICAL  ::   ln_taudif = .FALSE.   ! logical flag to use the "mean of stress module - module of mean stress" data
    REAL(wp) ::   rn_pfac   = 1.        ! multiplication factor for precipitation
+#if defined key_orca_r025
+   LOGICAL  ::   ln_printdia= .TRUE.     ! logical flag for height of air temp. and hum
+   LOGICAL  ::   ln_netsw   = .TRUE.     ! logical flag for height of air temp. and hum
+   LOGICAL  ::   ln_core_graceopt=.FALSE., ln_core_spinup=.FALSE.
+   LOGICAL  ::   ln_gwxc = .TRUE.
+   LOGICAL  ::   ln_corad_antar =.FALSE., ln_corad_arc =.FALSE. , ln_cotair_arc = .FALSE.
+   LOGICAL  ::   ln_coprecip =.FALSE.
+   REAL(wp) ::   rn_qns_bias = 0._wp     ! heat flux bias
+
+#endif
 
    !! * Substitutions
@@ -117,4 +134,7 @@
       !!              - emp, emps   evaporation minus precipitation
       !!----------------------------------------------------------------------
+#if defined key_orca_r025 && key_lim2
+      USE ice_2
+#endif
       INTEGER, INTENT(in) ::   kt   ! ocean time step
       !!
@@ -122,4 +142,5 @@
       INTEGER  ::   ifpr     ! dummy loop indice
       INTEGER  ::   jfld     ! dummy loop arguments
+      INTEGER  ::   ji, jj
       !!
       CHARACTER(len=100) ::  cn_dir   !   Root directory for location of core files
@@ -128,8 +149,25 @@
       TYPE(FLD_N) ::   sn_qlw , sn_tair, sn_prec, sn_snow      !   "                                 "
       TYPE(FLD_N) ::   sn_tdif                                 !   "                                 "
+#if defined key_orca_r025
+      TYPE(FLD_N) ::   sn_swc, sn_lwc                          !   "                                 "
+      TYPE(FLD_N) ::   sn_prc
+      INTEGER  ::   iter_shapiro = 250
+      REAL :: zzlat, zzlat1, zzlat2, zfrld, ztmp
+      REAL(wp), DIMENSION(jpi,jpj):: xyt,z_qsr,z_qlw,z_qsr1,z_qlw1,z_tair
+      REAL(wp), DIMENSION(jpi,jpj):: zqsr_lr, zqsr_hr, zqlw_lr, zqlw_hr, zprec_hr, zprec_lr
+      CHARACTER(len=20)  ::  c_kind='ORCA_GLOB'
+      NAMELIST/namsbc_core/ cn_dir , ln_2m  , ln_taudif, rn_pfac,           &
+         &                  sn_wndi, sn_wndj, sn_humi  , sn_qsr ,           &
+         &                  sn_qlw , sn_tair, sn_prec  , sn_snow, sn_tdif,  &
+         &                  sn_swc , sn_lwc , sn_prc   , ln_gwxc,           &
+         &                  ln_corad_antar, ln_corad_arc, ln_cotair_arc, ln_coprecip ,  &
+         &                  rn_qns_bias, ln_printdia, ln_netsw, ln_core_graceopt,ln_core_spinup
+      !!---------------------------------------------------------------------
+#else
       NAMELIST/namsbc_core/ cn_dir , ln_2m  , ln_taudif, rn_pfac,           &
          &                  sn_wndi, sn_wndj, sn_humi  , sn_qsr ,           &
          &                  sn_qlw , sn_tair, sn_prec  , sn_snow, sn_tdif
       !!---------------------------------------------------------------------
+#endif
 
       !                                         ! ====================== !
@@ -151,4 +189,9 @@
          sn_snow = FLD_N( 'snow'   ,    -1     , 'snow'   ,  .true.    , .false. ,   'yearly'  , ''       , ''       )
          sn_tdif = FLD_N( 'taudif' ,    24     , 'taudif' ,  .true.    , .false. ,   'yearly'  , ''       , ''       )
+#if defined key_orca_r025
+         sn_swc  = FLD_N( 'swc'    ,    24     ,  'swc'   ,  .true.    , .false. ,   'yearly'  , ''       , ''       )
+         sn_lwc  = FLD_N( 'lwc'    ,    24     ,  'lwc'   ,  .true.    , .false. ,   'yearly'  , ''       , ''       )
+         sn_prc  = FLD_N( 'prc'    ,    24     ,  'prc'   ,  .true.    , .false. ,   'yearly'  , ''       , ''       )
+#endif
          !
          REWIND( numnam )                          ! read in namlist namsbc_core
@@ -171,4 +214,11 @@
          lhftau = ln_taudif                        ! do we use HF tau information?
          jfld = jpfld - COUNT( (/.NOT. lhftau/) )
+#if defined key_orca_r025
+         slf_i(jp_swc ) = sn_swc
+         slf_i(jp_lwc ) = sn_lwc
+         slf_i(jp_prc ) = sn_prc
+         IF( .NOT. ln_gwxc )     jfld = jfld - 2
+         IF( .NOT. ln_coprecip ) jfld = jfld - 1
+#endif
          !
          ALLOCATE( sf(jfld), STAT=ierror )         ! set sf structure
@@ -185,6 +235,114 @@
       CALL fld_read( kt, nn_fsbc, sf )        ! input fields provided at the current time-step
 
-      !                                                        ! surface ocean fluxes computed with CLIO bulk formulea
-      IF( MOD( kt - 1, nn_fsbc ) == 0 )   CALL blk_oce_core( sf, sst_m, ssu_m, ssv_m )
+      IF( MOD( kt - 1, nn_fsbc ) == 0 ) THEN
+
+#if defined key_orca_r025
+      ! Introduce ERA-Interim filtering and correction
+
+         IF( ln_gwxc ) THEN
+
+           call Shapiro_1D(sf(jp_qsr)%fnow(:,:,1),iter_shapiro, c_kind, zqsr_lr)
+           zqsr_hr(:,:)=sf(jp_qsr)%fnow(:,:,1)-zqsr_lr(:,:)          ! We get large scale and small scale
+
+           call Shapiro_1D(sf(jp_qlw)%fnow(:,:,1),iter_shapiro, c_kind, zqlw_lr)
+           zqlw_hr(:,:)=sf(jp_qlw)%fnow(:,:,1)-zqlw_lr(:,:)          ! We get large scale and small scale
+
+           z_qsr1(:,:)=zqsr_lr(:,:)*sf(jp_swc)%fnow(:,:,1) + zqsr_hr(:,:)
+           z_qlw1(:,:)=zqlw_lr(:,:)*sf(jp_lwc)%fnow(:,:,1) + zqlw_hr(:,:)
+
+           DO jj=1,jpj
+             DO ji=1,jpi
+               z_qsr1(ji,jj)=max(z_qsr1(ji,jj),0.0)
+               z_qlw1(ji,jj)=max(z_qlw1(ji,jj),0.0)
+             END DO
+           END DO
+
+         ENDIF
+
+         IF( ln_coprecip ) THEN
+
+           call Shapiro_1D(sf(jp_prec)%fnow(:,:,1),iter_shapiro,c_kind,zprec_lr)
+           zprec_hr(:,:)=sf(jp_prec)%fnow(:,:,1)-zprec_lr(:,:)       ! We get large scale and small scale
+
+           DO jj=1,jpj
+             DO ji=1,jpi
+               IF( zprec_lr(ji,jj) .GT. 0._wp ) THEN
+                  ztmp = LOG( ( 1000._wp + sf(jp_prc)%fnow(ji,jj,1) ) * EXP( zprec_lr(ji,jj) ) / 1000._wp )
+                  sf(jp_prec)%fnow(ji,jj,1) = max(ztmp+zprec_hr(ji,jj),0.0)
+               ENDIF
+             END DO
+           END DO
+
+         ENDIF
+
+         IF ( ln_corad_antar ) THEN           ! correction of SW and LW in the Southern Ocean
+
+           z_qsr(:,:)=0.8*z_qsr1(:,:)
+           z_qlw(:,:)=1.1*z_qlw1(:,:)
+           xyt(:,:) = 0.e0
+           zzlat1 = -65.
+           zzlat2 = -60.
+           DO jj = 1, jpj
+             DO ji = 1, jpi
+               zzlat = gphit(ji,jj)
+               IF ( zzlat >= zzlat1 .AND. zzlat <= zzlat2 ) THEN
+                  xyt(ji,jj) = (zzlat2-zzlat)/(zzlat2-zzlat1)
+               ELSE IF ( zzlat < zzlat1 ) THEN
+                  xyt(ji,jj) = 1
+               ENDIF
+             END DO
+           END DO
+           z_qsr1(:,:)=z_qsr(:,:)*xyt(:,:)+(1.0-xyt(:,:))*z_qsr1(:,:)
+           z_qlw1(:,:)=z_qlw(:,:)*xyt(:,:)+(1.0-xyt(:,:))*z_qlw1(:,:)
+
+         ENDIF
+
+         IF ( ln_corad_arc ) THEN         ! correction of SW in the Arctic Ocean
+
+           z_qsr(:,:)=0.7*z_qsr1(:,:)
+           xyt(:,:) = 0.e0
+           zzlat1 = 78.
+           zzlat2 = 82.
+           DO jj = 1, jpj
+             DO ji = 1, jpi
+               zzlat = gphit(ji,jj)
+               IF ( zzlat >= zzlat1 .AND. zzlat <= zzlat2 ) THEN
+                  xyt(ji,jj) = (zzlat-zzlat1)/(zzlat2-zzlat1)
+               ELSE IF ( zzlat > zzlat2 ) THEN
+                  xyt(ji,jj) = 1
+               ENDIF
+             END DO
+           END DO
+           z_qsr1(:,:)=z_qsr(:,:)*xyt(:,:)+(1.0-xyt(:,:))*z_qsr1(:,:)
+
+         ENDIF
+
+         sf(jp_qsr)%fnow(:,:,1)=z_qsr1(:,:)
+         sf(jp_qlw)%fnow(:,:,1)=z_qlw1(:,:)
+
+#if defined key_lim2
+         IF ( ln_cotair_arc ) THEN           ! correction of Air Temperature in the Arctic Ocean
+
+           z_tair(:,:)=sf(jp_tair)%fnow(:,:,1) - 2.0
+           xyt(:,:) = 0.e0 ; zzlat1 = 78. ; zzlat2 = 82.
+           DO jj = 1, jpj
+             DO ji = 1, jpi
+               zzlat = gphit(ji,jj) ; zfrld=frld(ji,jj)
+               IF ( zzlat >= zzlat1 .AND. zzlat <= zzlat2 .AND. zfrld < 0.85 ) THEN
+                  xyt(ji,jj) = (zzlat-zzlat1)/(zzlat2-zzlat1)
+               ELSE IF ( zzlat > zzlat2 .AND. zfrld < 0.85 ) THEN
+                  xyt(ji,jj) = 1
+               ENDIF
+             END DO
+           END DO
+           sf(jp_tair)%fnow(:,:,1)=z_tair(:,:)*xyt(:,:)+(1.0-xyt(:,:))*sf(jp_tair)%fnow(:,:,1)
+
+         ENDIF
+#endif
+
+#endif
+         CALL blk_oce_core( sf, sst_m, ssu_m, ssv_m )   ! surface ocean fluxes computed with CLIO bulk formule
+
+      ENDIF
 
 #if defined key_cice
@@ -332,4 +490,9 @@
       IF( lhftau ) THEN 
 !CDIR COLLAPSE
+#if defined key_orca_r025
+         ! Changed!!! Multiply by QSCAT correction
+         zwnd_i(:,:) = zwnd_i(:,:) * sf(jp_tdif)%fnow(:,:,1)
+         zwnd_j(:,:) = zwnd_j(:,:) * sf(jp_tdif)%fnow(:,:,1)
+#endif
          taum(:,:) = taum(:,:) + sf(jp_tdif)%fnow(:,:,1)
       ENDIF
@@ -946,5 +1109,88 @@
       !
     END FUNCTION psi_h
-  
+ 
+    SUBROUTINE Shapiro_1D(rla_varin,id_np, cd_overlap, rlpa_varout) !GIG
+      !!=====================================================================
+      !!
+      !! Description: This function applies a 1D Shapiro filter
+      !!              (3 points filter) horizontally to a 2D field
+      !!              in regular grid
+      !! Arguments :
+      !!            rla_varin   : Input variable to filter
+      !!            zla_mask    : Input mask variable
+      !!            id_np       : Number of Shapiro filter iterations
+      !!            cd_overlap  : Logical argument for periodical condition
+      !!                          (global ocean case)
+      !!            rlpa_varout : Output filtered variable
+      !!
+      !! History : 08/2009  S. CAILLEAU : from 1st version of N. FERRY
+      !!           09/2009  C. REGNIER  : Corrections
+      !!
+      !!=====================================================================
+      IMPLICIT NONE
+      INTEGER, INTENT(IN)                       :: id_np
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(IN)  :: rla_varin !GIG
+      CHARACTER(len=20), INTENT(IN)             :: cd_overlap !GIG
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(OUT) :: rlpa_varout !GIG
+
+      REAL(wp), DIMENSION(jpi,jpj)              :: rlpa_varout_tmp
+      REAL, PARAMETER                           :: rl_alpha = 1./2.    ! fixed stability coefficient (isotrope case)
+      REAL, parameter                           :: rap_aniso_diff_XY=2.25 ! anisotrope case
+      REAL                                      :: alphax,alphay, znum, zden,test
+      INTEGER                                   :: ji, jj, jn, nn
+!
+!! rap_aniso_diff_XY=2.25 : valeur trouvée empiriquement pour 140 itération po% ur le filtre de Shapiro et
+!! pour un rapport d'anisotopie de 1.5 : on filtre de plus rapidement en x qu'eny.
+!------------------------------------------------------------------------------
+!
+! Loop on several filter iterations
+
+!     Global ocean case
+      IF (( cd_overlap == 'MERCA_GLOB' )   .OR.   &
+          ( cd_overlap == 'REGULAR_GLOB' ) .OR.   &
+          ( cd_overlap == 'ORCA_GLOB' )) THEN
+             rlpa_varout(:,:) = rla_varin(:,:)
+             rlpa_varout_tmp(:,:) = rlpa_varout(:,:)
+!
+
+       alphax=1./2.
+       alphay=1./2.
+!  Dx/Dy=rap_aniso_diff_XY  , D_ = vitesse de diffusion
+!  140 passes du fitre, Lx/Ly=1.5, le rap_aniso_diff_XY correspondant est:
+       IF ( rap_aniso_diff_XY .GE. 1. ) alphay=alphay/rap_aniso_diff_XY
+       IF ( rap_aniso_diff_XY .LT. 1. ) alphax=alphax*rap_aniso_diff_XY
+
+        DO jn = 1,id_np   ! number of passes of the filter
+            DO ji = 2,jpim1
+               DO jj = 2,jpjm1
+                  ! We crop on the coast
+                   znum = rlpa_varout_tmp(ji,jj)   &
+                          + 0.25*alphax*(rlpa_varout_tmp(ji-1,jj  )-rlpa_varout_tmp(ji,jj))*tmask(ji-1,jj  ,1)  &
+                          + 0.25*alphax*(rlpa_varout_tmp(ji+1,jj  )-rlpa_varout_tmp(ji,jj))*tmask(ji+1,jj  ,1)  &
+                          + 0.25*alphay*(rlpa_varout_tmp(ji  ,jj-1)-rlpa_varout_tmp(ji,jj))*tmask(ji  ,jj-1,1)  &
+                          + 0.25*alphay*(rlpa_varout_tmp(ji  ,jj+1)-rlpa_varout_tmp(ji,jj))*tmask(ji  ,jj+1,1)
+                   rlpa_varout(ji,jj)=znum*tmask(ji,jj,1)+rla_varin(ji,jj)*(1.-tmask(ji,jj,1))
+                ENDDO  ! end loop ji
+            ENDDO  ! end loop jj
+!
+!
+!           Periodical condition in case of cd_overlap (global ocean)
+!           - on a mercator projection grid we consider that singular point at poles
+!             are a mean of the values at points of the previous latitude
+!           - on ORCA and regular grid we copy the values at points of the previous latitude
+            IF ( cd_overlap == 'MERCAT_GLOB' ) THEN
+!GIG case unchecked
+               rlpa_varout(1,1) = SUM(rlpa_varout(:,2)) / jpi
+               rlpa_varout(jpi,jpj) = SUM(rlpa_varout(:,jpj-1)) / jpi
+            ELSE
+               call lbc_lnk(rlpa_varout, 'T', 1.) ! Boundary condition
+            ENDIF
+            rlpa_varout_tmp(:,:) = rlpa_varout(:,:)
+         ENDDO  ! end loop jn
+      ENDIF
+
+!
+    END SUBROUTINE Shapiro_1D
+
    !!======================================================================
 END MODULE sbcblk_core
Index: branches/2012/dev_r3379_CMCC6_topbfm/NEMOGCM/NEMO/OPA_SRC/SBC/sbcrnf.F90
===================================================================
--- branches/2012/dev_r3379_CMCC6_topbfm/NEMOGCM/NEMO/OPA_SRC/SBC/sbcrnf.F90	(revision 3380)
+++ branches/2012/dev_r3379_CMCC6_topbfm/NEMOGCM/NEMO/OPA_SRC/SBC/sbcrnf.F90	(revision 3398)
@@ -58,7 +58,7 @@
    REAL(wp) ::   r1_rau0   ! = 1 / rau0 
 
-   TYPE(FLD), ALLOCATABLE, DIMENSION(:) ::   sf_rnf       ! structure: river runoff (file information, fields read)
-   TYPE(FLD), ALLOCATABLE, DIMENSION(:) ::   sf_s_rnf     ! structure: river runoff salinity (file information, fields read)  
-   TYPE(FLD), ALLOCATABLE, DIMENSION(:) ::   sf_t_rnf     ! structure: river runoff temperature (file information, fields read)  
+   TYPE(FLD), PUBLIC, ALLOCATABLE, DIMENSION(:) ::   sf_rnf       ! structure: river runoff (file information, fields read)
+   TYPE(FLD), PUBLIC, ALLOCATABLE, DIMENSION(:) ::   sf_s_rnf     ! structure: river runoff salinity (file information, fields read)  
+   TYPE(FLD), PUBLIC, ALLOCATABLE, DIMENSION(:) ::   sf_t_rnf     ! structure: river runoff temperature (file information, fields read)  
  
    !! * Substitutions  
Index: branches/2012/dev_r3379_CMCC6_topbfm/NEMOGCM/NEMO/TOP_SRC/MY_TRC/par_my_trc.F90
===================================================================
--- branches/2012/dev_r3379_CMCC6_topbfm/NEMOGCM/NEMO/TOP_SRC/MY_TRC/par_my_trc.F90	(revision 3380)
+++ branches/2012/dev_r3379_CMCC6_topbfm/NEMOGCM/NEMO/TOP_SRC/MY_TRC/par_my_trc.F90	(revision 3398)
@@ -42,5 +42,5 @@
    !!---------------------------------------------------------------------
    LOGICAL, PUBLIC, PARAMETER ::   lk_my_trc     = .TRUE.   !: PTS flag 
-   INTEGER, PUBLIC, PARAMETER ::   jp_my_trc     =  2       !: number of PTS tracers
+   INTEGER, PUBLIC, PARAMETER ::   jp_my_trc     =  1       !: number of PTS tracers
    INTEGER, PUBLIC, PARAMETER ::   jp_my_trc_2d  =  0       !: additional 2d output arrays ('key_trc_diaadd')
    INTEGER, PUBLIC, PARAMETER ::   jp_my_trc_3d  =  0       !: additional 3d output arrays ('key_trc_diaadd')
@@ -49,5 +49,4 @@
    ! assign an index in trc arrays for each PTS prognostic variables
    INTEGER, PUBLIC, PARAMETER ::   jpmyt1 = jp_lm + 1     !: 1st MY_TRC tracer
-   INTEGER, PUBLIC, PARAMETER ::   jpmyt2 = jp_lm + 2     !: 2nd MY_TRC tracer
 
 #else
Index: branches/2012/dev_r3379_CMCC6_topbfm/NEMOGCM/NEMO/TOP_SRC/MY_TRC/trcsms_my_trc.F90
===================================================================
--- branches/2012/dev_r3379_CMCC6_topbfm/NEMOGCM/NEMO/TOP_SRC/MY_TRC/trcsms_my_trc.F90	(revision 3380)
+++ branches/2012/dev_r3379_CMCC6_topbfm/NEMOGCM/NEMO/TOP_SRC/MY_TRC/trcsms_my_trc.F90	(revision 3398)
@@ -62,10 +62,4 @@
       END WHERE
 
-      WHERE( ((glamt <= -165) .OR. (glamt >= 160)) .AND. (gphit <= -76) .AND. (gphit >=-80))
-        trn(:,:,1,jpmyt2) = 1._wp
-        trb(:,:,1,jpmyt2) = 1._wp
-        tra(:,:,1,jpmyt2) = 0._wp
-      END WHERE
-
       IF( l_trdtrc ) THEN      ! Save the trends in the ixed layer
           DO jn = jp_myt0, jp_myt1
Index: branches/2012/dev_r3379_CMCC6_topbfm/NEMOGCM/NEMO/TOP_SRC/TRP/trcadv.F90
===================================================================
--- branches/2012/dev_r3379_CMCC6_topbfm/NEMOGCM/NEMO/TOP_SRC/TRP/trcadv.F90	(revision 3380)
+++ branches/2012/dev_r3379_CMCC6_topbfm/NEMOGCM/NEMO/TOP_SRC/TRP/trcadv.F90	(revision 3398)
@@ -82,13 +82,13 @@
       IF( kt == nittrc000 )   CALL trc_adv_ctl          ! initialisation & control of options
 
-#if ! defined key_pisces
-      IF( neuler == 0 .AND. kt == nittrc000 ) THEN     ! at nittrc000
-         r2dt(:) =  rdttrc(:)           ! = rdttrc (restarting with Euler time stepping)
-      ELSEIF( kt <= nittrc000 + 1 ) THEN          ! at nittrc000 or nittrc000+1
-         r2dt(:) = 2. * rdttrc(:)       ! = 2 rdttrc (leapfrog)
+      IF( ln_top_euler) THEN
+         r2dt(:) =  rdttrc(:)              ! = rdttrc (use Euler time stepping)
+      ELSE
+         IF( neuler == 0 .AND. kt == nittrc000 ) THEN     ! at nittrc000
+            r2dt(:) =  rdttrc(:)           ! = rdttrc (restarting with Euler time stepping)
+         ELSEIF( kt <= nittrc000 + 1 ) THEN          ! at nittrc000 or nittrc000+1
+            r2dt(:) = 2. * rdttrc(:)       ! = 2 rdttrc (leapfrog)
+         ENDIF
       ENDIF
-#else
-      r2dt(:) =  rdttrc(:)              ! = rdttrc (for PISCES use Euler time stepping)
-#endif
 
       !                                                   ! effective transport
Index: branches/2012/dev_r3379_CMCC6_topbfm/NEMOGCM/NEMO/TOP_SRC/TRP/trcnam_trp.F90
===================================================================
--- branches/2012/dev_r3379_CMCC6_topbfm/NEMOGCM/NEMO/TOP_SRC/TRP/trcnam_trp.F90	(revision 3380)
+++ branches/2012/dev_r3379_CMCC6_topbfm/NEMOGCM/NEMO/TOP_SRC/TRP/trcnam_trp.F90	(revision 3398)
@@ -81,5 +81,5 @@
       NAMELIST/namtrc_rad/ ln_trcrad
 #if defined key_trcdmp
-      NAMELIST/namtrc_dmp/ nn_hdmp_tr, nn_zdmp_tr, rn_surf_tr, &
+      NAMELIST/namtrc_dmp/ ln_trcdmp, nn_hdmp_tr, nn_zdmp_tr, rn_surf_tr, &
         &                  rn_bot_tr , rn_dep_tr , nn_file_tr
 #endif
@@ -156,4 +156,5 @@
          WRITE(numout,*) '~~~~~~~'
          WRITE(numout,*) '   Namelist namtrc_dmp : set damping parameter'
+         WRITE(numout,*) '      add a damping term or not      ln_trcdmp = ', ln_trcdmp
          WRITE(numout,*) '      tracer damping option          nn_hdmp_tr = ', nn_hdmp_tr
          WRITE(numout,*) '      mixed layer damping option     nn_zdmp_tr = ', nn_zdmp_tr, '(zoom: forced to 0)'
Index: branches/2012/dev_r3379_CMCC6_topbfm/NEMOGCM/NEMO/TOP_SRC/TRP/trczdf.F90
===================================================================
--- branches/2012/dev_r3379_CMCC6_topbfm/NEMOGCM/NEMO/TOP_SRC/TRP/trczdf.F90	(revision 3380)
+++ branches/2012/dev_r3379_CMCC6_topbfm/NEMOGCM/NEMO/TOP_SRC/TRP/trczdf.F90	(revision 3398)
@@ -73,13 +73,13 @@
       IF( kt == nittrc000 )   CALL zdf_ctl          ! initialisation & control of options
 
-#if ! defined key_pisces
-      IF( neuler == 0 .AND. kt == nittrc000 ) THEN     ! at nittrc000
-         r2dt(:) =  rdttrc(:)           ! = rdttrc (restarting with Euler time stepping)
-      ELSEIF( kt <= nittrc000 + 1 ) THEN          ! at nittrc000 or nittrc000+1
-         r2dt(:) = 2. * rdttrc(:)       ! = 2 rdttrc (leapfrog)
+      IF( ln_top_euler) THEN
+         r2dt(:) =  rdttrc(:)              ! = rdttrc (use Euler time stepping)
+      ELSE
+         IF( neuler == 0 .AND. kt == nittrc000 ) THEN     ! at nittrc000
+            r2dt(:) =  rdttrc(:)           ! = rdttrc (restarting with Euler time stepping)
+         ELSEIF( kt <= nittrc000 + 1 ) THEN          ! at nittrc000 or nittrc000+1
+            r2dt(:) = 2. * rdttrc(:)       ! = 2 rdttrc (leapfrog)
+         ENDIF
       ENDIF
-#else
-      r2dt(:) =  rdttrc(:)              ! = rdttrc (for PISCES use Euler time stepping)
-#endif
 
       IF( l_trdtrc )  THEN
Index: branches/2012/dev_r3379_CMCC6_topbfm/NEMOGCM/NEMO/TOP_SRC/trc.F90
===================================================================
--- branches/2012/dev_r3379_CMCC6_topbfm/NEMOGCM/NEMO/TOP_SRC/trc.F90	(revision 3380)
+++ branches/2012/dev_r3379_CMCC6_topbfm/NEMOGCM/NEMO/TOP_SRC/trc.F90	(revision 3398)
@@ -25,4 +25,5 @@
    INTEGER, PUBLIC                                                 ::   numnat        !: logicla unit for the passive tracer NAMELIST
    INTEGER, PUBLIC                                                 ::   numstr        !: logical unit for tracer statistics
+   LOGICAL, PUBLIC                                                 ::   ln_top_euler  !: boolean term for euler integration in the first timestep
 
    !! passive tracers fields (before,now,after)
@@ -68,5 +69,4 @@
    CHARACTER(len = 80), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)    ::  ctrcln         !: trccer field long name
    CHARACTER(len = 20), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)    ::  ctrcun         !: tracer unit
-   LOGICAL            , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)    ::  ln_trc_ini     !: Initialisation from data input file
    LOGICAL            , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)    ::  ln_trc_wri     !: save the tracer or not
 
@@ -76,4 +76,11 @@
       CHARACTER(len = 20)  :: units    !: unit
    END TYPE DIAG
+
+   !! information for inputs
+   !! --------------------------------------------------
+   LOGICAL            , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)    ::  ln_trc_ini     !: Initialisation from data input file
+   LOGICAL            , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)    ::  ln_trc_obc     !: Use open boundary condition data
+   LOGICAL            , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)    ::  ln_trc_sbc     !: Use surface boundary condition data
+   LOGICAL            , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)    ::  ln_trc_cbc     !: Use coastal boundary condition data
 
    !! additional 2D/3D outputs namelist
Index: branches/2012/dev_r3379_CMCC6_topbfm/NEMOGCM/NEMO/TOP_SRC/trcnam.F90
===================================================================
--- branches/2012/dev_r3379_CMCC6_topbfm/NEMOGCM/NEMO/TOP_SRC/trcnam.F90	(revision 3380)
+++ branches/2012/dev_r3379_CMCC6_topbfm/NEMOGCM/NEMO/TOP_SRC/trcnam.F90	(revision 3398)
@@ -60,5 +60,6 @@
       !!
       NAMELIST/namtrc/ nn_dttrc, nn_writetrc, ln_rsttr, nn_rsttr, &
-         &             cn_trcrst_in, cn_trcrst_out, sn_tracer, ln_trcdta, ln_trcdmp
+         &             cn_trcrst_in, cn_trcrst_out, sn_tracer, ln_trcdta, ln_trcdmp, &
+         &             ln_top_euler
 #if defined key_trdmld_trc  || defined key_trdtrc
       NAMELIST/namtrc_trd/ nn_trd_trc, nn_ctls_trc, rn_ucf_trc, &
@@ -79,4 +80,5 @@
       nn_dttrc      = 1                 ! default values
       nn_writetrc   = 10 
+      ln_top_euler  = .FALSE.
       ln_rsttr      = .FALSE.
       nn_rsttr      =  0
@@ -120,4 +122,5 @@
          WRITE(numout,*) '   Read inputs data from file (y/n)             ln_trcdta     = ', ln_trcdta
          WRITE(numout,*) '   Damping of passive tracer (y/n)              ln_trcdmp     = ', ln_trcdmp
+         WRITE(numout,*) '   Use euler integration for TRC (y/n)          ln_top_euler  = ', ln_top_euler
          WRITE(numout,*) ' '
          DO jn = 1, jptra
Index: branches/2012/dev_r3379_CMCC6_topbfm/NEMOGCM/NEMO/TOP_SRC/trcsub.F90
===================================================================
--- branches/2012/dev_r3379_CMCC6_topbfm/NEMOGCM/NEMO/TOP_SRC/trcsub.F90	(revision 3380)
+++ branches/2012/dev_r3379_CMCC6_topbfm/NEMOGCM/NEMO/TOP_SRC/trcsub.F90	(revision 3398)
@@ -29,4 +29,7 @@
    USE sbc_oce         ! surface boundary condition: ocean
    USE bdy_oce
+#if defined key_obc
+   USE obc_oce, ONLY: obctmsk
+#endif
 #if defined key_agrif
    USE agrif_opa_update
