Index: NEMO/trunk/src/SAO/nemogcm.F90
===================================================================
--- NEMO/trunk/src/SAO/nemogcm.F90	(revision 12933)
+++ NEMO/trunk/src/SAO/nemogcm.F90	(revision 13286)
@@ -29,12 +29,14 @@
    USE sao_intp
    !
+   USE prtctl         ! Print control
    USE in_out_manager ! I/O manager
    USE lib_mpp        ! distributed memory computing
    USE mppini         ! shared/distributed memory setting (mpp_init routine)
-   USE lbcnfd  , ONLY : isendto, nsndto, nfsloop, nfeloop ! Setup of north fold exchanges 
+   USE lbcnfd  , ONLY : isendto, nsndto ! Setup of north fold exchanges 
    USE lib_fortran    ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined)
 #if defined key_iomput
    USE xios           ! xIOserver
 #endif
+   USE halo_mng
 
    IMPLICIT NONE
@@ -92,11 +94,11 @@
       INTEGER ::   ios, ilocal_comm   ! local integer
       !
-      NAMELIST/namctl/ sn_cfctl,  nn_print, nn_ictls, nn_ictle,             &
-         &             nn_isplt , nn_jsplt, nn_jctls, nn_jctle,             &
-         &             ln_timing, ln_diacfl
+      NAMELIST/namctl/ sn_cfctl, ln_timing, ln_diacfl,                                &
+         &             nn_isplt,  nn_jsplt,  nn_ictls, nn_ictle, nn_jctls, nn_jctle            
       NAMELIST/namcfg/ ln_read_cfg, cn_domcfg, ln_closea, ln_write_cfg, cn_domcfg_out, ln_use_jattr
       !!----------------------------------------------------------------------
       !
       cxios_context = 'nemo'
+      nn_hls = 1
       !
       !                             !-------------------------------------------------!
@@ -205,7 +207,7 @@
       !
       IF( ln_read_cfg ) THEN            ! Read sizes in domain configuration file
-         CALL domain_cfg ( cn_cfg, nn_cfg, jpiglo, jpjglo, jpkglo, jperio )
+         CALL domain_cfg ( cn_cfg, nn_cfg, Ni0glo, Nj0glo, jpkglo, jperio )
       ELSE                              ! user-defined namelist
-         CALL usr_def_nam( cn_cfg, nn_cfg, jpiglo, jpjglo, jpkglo, jperio )
+         CALL usr_def_nam( cn_cfg, nn_cfg, Ni0glo, Nj0glo, jpkglo, jperio )
       ENDIF
       !
@@ -217,4 +219,5 @@
       CALL mpp_init
 
+      CALL halo_mng_init()
       ! Now we know the dimensions of the grid and numout has been set: we can allocate arrays
       CALL nemo_alloc()
@@ -267,23 +270,9 @@
          WRITE(numout,*) '                              sn_cfctl%procincr  = ', sn_cfctl%procincr 
          WRITE(numout,*) '                              sn_cfctl%ptimincr  = ', sn_cfctl%ptimincr 
-         WRITE(numout,*) '      level of print                  nn_print   = ', nn_print
-         WRITE(numout,*) '      Start i indice for SUM control  nn_ictls   = ', nn_ictls
-         WRITE(numout,*) '      End i indice for SUM control    nn_ictle   = ', nn_ictle
-         WRITE(numout,*) '      Start j indice for SUM control  nn_jctls   = ', nn_jctls
-         WRITE(numout,*) '      End j indice for SUM control    nn_jctle   = ', nn_jctle
-         WRITE(numout,*) '      number of proc. following i     nn_isplt   = ', nn_isplt
-         WRITE(numout,*) '      number of proc. following j     nn_jsplt   = ', nn_jsplt
          WRITE(numout,*) '      timing by routine               ln_timing  = ', ln_timing
          WRITE(numout,*) '      CFL diagnostics                 ln_diacfl  = ', ln_diacfl
       ENDIF
       !
-      nprint    = nn_print          ! convert DOCTOR namelist names into OLD names
-      nictls    = nn_ictls
-      nictle    = nn_ictle
-      njctls    = nn_jctls
-      njctle    = nn_jctle
-      isplt     = nn_isplt
-      jsplt     = nn_jsplt
-
+      IF( .NOT.ln_read_cfg )   ln_closea = .false.   ! dealing possible only with a domcfg file
       IF(lwp) THEN                  ! control print
          WRITE(numout,*)
@@ -295,44 +284,4 @@
          WRITE(numout,*) '         filename to be written                        cn_domcfg_out = ', TRIM(cn_domcfg_out)
          WRITE(numout,*) '      use file attribute if exists as i/p j-start   ln_use_jattr     = ', ln_use_jattr
-      ENDIF
-      IF( .NOT.ln_read_cfg )   ln_closea = .false.   ! dealing possible only with a domcfg file
-      !
-      !                             ! Parameter control
-      !
-      IF( sn_cfctl%l_prtctl .OR. sn_cfctl%l_prttrc ) THEN              ! sub-domain area indices for the control prints
-         IF( lk_mpp .AND. jpnij > 1 ) THEN
-            isplt = jpni   ;   jsplt = jpnj   ;   ijsplt = jpni*jpnj   ! the domain is forced to the real split domain
-         ELSE
-            IF( isplt == 1 .AND. jsplt == 1  ) THEN
-               CALL ctl_warn( ' - isplt & jsplt are equal to 1',   &
-                  &           ' - the print control will be done over the whole domain' )
-            ENDIF
-            ijsplt = isplt * jsplt            ! total number of processors ijsplt
-         ENDIF
-         IF(lwp) WRITE(numout,*)'          - The total number of processors over which the'
-         IF(lwp) WRITE(numout,*)'            print control will be done is ijsplt : ', ijsplt
-         !
-         !                              ! indices used for the SUM control
-         IF( nictls+nictle+njctls+njctle == 0 )   THEN    ! print control done over the default area
-            lsp_area = .FALSE.
-         ELSE                                             ! print control done over a specific  area
-            lsp_area = .TRUE.
-            IF( nictls < 1 .OR. nictls > jpiglo )   THEN
-               CALL ctl_warn( '          - nictls must be 1<=nictls>=jpiglo, it is forced to 1' )
-               nictls = 1
-            ENDIF
-            IF( nictle < 1 .OR. nictle > jpiglo )   THEN
-               CALL ctl_warn( '          - nictle must be 1<=nictle>=jpiglo, it is forced to jpiglo' )
-               nictle = jpiglo
-            ENDIF
-            IF( njctls < 1 .OR. njctls > jpjglo )   THEN
-               CALL ctl_warn( '          - njctls must be 1<=njctls>=jpjglo, it is forced to 1' )
-               njctls = 1
-            ENDIF
-            IF( njctle < 1 .OR. njctle > jpjglo )   THEN
-               CALL ctl_warn( '          - njctle must be 1<=njctle>=jpjglo, it is forced to jpjglo' )
-               njctle = jpjglo
-            ENDIF
-         ENDIF
       ENDIF
       !
Index: NEMO/trunk/src/SAO/sao_read.F90
===================================================================
--- NEMO/trunk/src/SAO/sao_read.F90	(revision 12933)
+++ NEMO/trunk/src/SAO/sao_read.F90	(revision 13286)
@@ -10,5 +10,5 @@
    USE netcdf
    USE oce,     ONLY: tsn, sshn
-   USE dom_oce, ONLY: nlci, nlcj, nimpp, njmpp, tmask
+   USE dom_oce, ONLY: nimpp, njmpp, tmask
    USE par_oce, ONLY: jpi, jpj, jpk
    !
@@ -94,7 +94,7 @@
          IF (ifcst .LE. ntimes) THEN
             ! Allocate temporary temperature array
-            ALLOCATE(temp_tn(nlci,nlcj,jpk))
-            ALLOCATE(temp_sn(nlci,nlcj,jpk))
-            ALLOCATE(temp_sshn(nlci,nlcj))
+            ALLOCATE(temp_tn(jpi,jpj,jpk))
+            ALLOCATE(temp_sn(jpi,jpj,jpk))
+            ALLOCATE(temp_sshn(jpi,jpj))
 
             ! Set temp_tn, temp_sn to 0.
@@ -104,8 +104,8 @@
 
             ! Create start and count arrays
-            start_n = (/ nimpp, njmpp, 1,   ifcst /)
-            count_n = (/ nlci,  nlcj,  jpk, 1     /)
-            start_s = (/ nimpp, njmpp, ifcst /)
-            count_s = (/ nlci,  nlcj,  1     /)
+            start_n = (/ nimpp, njmpp,      1, ifcst /)
+            count_n = (/   jpi,   jpj, jpk, 1        /)
+            start_s = (/ nimpp, njmpp        , ifcst /)
+            count_s = (/   jpi,   jpj,      1        /)
 
             ! Read information into temporary arrays
@@ -138,22 +138,8 @@
 
             ! Mask out missing data index
-            tsn(1:nlci,1:nlcj,1:jpk,1) = temp_tn(:,:,:) * tmask(1:nlci,1:nlcj,1:jpk)
-            tsn(1:nlci,1:nlcj,1:jpk,2) = temp_sn(:,:,:) * tmask(1:nlci,1:nlcj,1:jpk)
-            sshn(1:nlci,1:nlcj)        = temp_sshn(:,:) * tmask(1:nlci,1:nlcj,1)
-
-            ! Remove halo from tmask, tsn, sshn to prevent double obs counting
-            IF (jpi > nlci) THEN
-                tmask(nlci+1:,:,:) = 0
-                tsn(nlci+1:,:,:,1) = 0
-                tsn(nlci+1:,:,:,2) = 0
-                sshn(nlci+1:,:) = 0
-            END IF
-            IF (jpj > nlcj) THEN
-                tmask(:,nlcj+1:,:) = 0
-                tsn(:,nlcj+1:,:,1) = 0
-                tsn(:,nlcj+1:,:,2) = 0
-                sshn(:,nlcj+1:) = 0
-            END IF
-
+            tsn(1:jpi,1:jpj,1:jpk,1) = temp_tn(:,:,:) * tmask(1:jpi,1:jpj,1:jpk)
+            tsn(1:jpi,1:jpj,1:jpk,2) = temp_sn(:,:,:) * tmask(1:jpi,1:jpj,1:jpk)
+            sshn(1:jpi,1:jpj)        = temp_sshn(:,:) * tmask(1:jpi,1:jpj,1)
+            
             ! Deallocate arrays
             DEALLOCATE(temp_tn, temp_sn, temp_sshn)
