Index: /branches/2015/dev_r5072_UKMO2_OBS_simplification/NEMOGCM/NEMO/OPA_SRC/OBS/diaobs.F90
===================================================================
--- /branches/2015/dev_r5072_UKMO2_OBS_simplification/NEMOGCM/NEMO/OPA_SRC/OBS/diaobs.F90	(revision 5703)
+++ /branches/2015/dev_r5072_UKMO2_OBS_simplification/NEMOGCM/NEMO/OPA_SRC/OBS/diaobs.F90	(revision 5704)
@@ -137,11 +137,11 @@
       REAL(dp) :: rn_dobsini     ! Obs window start date YYYYMMDD.HHMMSS
       REAL(dp) :: rn_dobsend     ! Obs window end date   YYYYMMDD.HHMMSS
-      REAL(wp), DIMENSION(jpi,jpj) :: &
+      REAL(wp), POINTER, DIMENSION(:,:) :: &
          & zglam1, &             ! Model longitudes for profile variable 1
          & zglam2                ! Model longitudes for profile variable 2
-      REAL(wp), DIMENSION(jpi,jpj) :: &
+      REAL(wp), POINTER, DIMENSION(:,:) :: &
          & zgphi1, &             ! Model latitudes for profile variable 1
          & zgphi2                ! Model latitudes for profile variable 2
-      REAL(wp), DIMENSION(jpi,jpj,jpk) :: &
+      REAL(wp), POINTER, DIMENSION(:,:,:) :: &
          & zmask1, &             ! Model land/sea mask associated with variable 1
          & zmask2                ! Model land/sea mask associated with variable 2
@@ -159,4 +159,11 @@
          &            nn_msshc, rn_mdtcorr, rn_mdtcutoff,             &
          &            nn_profdavtypes
+
+      CALL wrk_alloc( jpi, jpj, zglam1 )
+      CALL wrk_alloc( jpi, jpj, zglam2 )
+      CALL wrk_alloc( jpi, jpj, zgphi1 )
+      CALL wrk_alloc( jpi, jpj, zgphi2 )
+      CALL wrk_alloc( jpi, jpj, jpk, zmask1 )
+      CALL wrk_alloc( jpi, jpj, jpk, zmask2 )
 
       !-----------------------------------------------------------------------
@@ -409,4 +416,5 @@
             CALL obs_pre_prof( profdata(jtype), profdataqc(jtype), &
                &               llvar1, llvar2, &
+               &               jpi, jpj, jpk, &
                &               zmask1, zglam1, zgphi1, zmask2, zglam2, zgphi2,  &
                &               ln_nea, kdailyavtypes = nn_profdavtypes )
@@ -451,4 +459,11 @@
 
       ENDIF
+
+      CALL wrk_dealloc( jpi, jpj, zglam1 )
+      CALL wrk_dealloc( jpi, jpj, zglam2 )
+      CALL wrk_dealloc( jpi, jpj, zgphi1 )
+      CALL wrk_dealloc( jpi, jpj, zgphi2 )
+      CALL wrk_dealloc( jpi, jpj, jpk, zmask1 )
+      CALL wrk_dealloc( jpi, jpj, jpk, zmask2 )
 
    END SUBROUTINE dia_obs_init
@@ -500,13 +515,14 @@
       INTEGER :: jtype             ! Data loop variable
       INTEGER :: jvar              ! Variable number
-      REAL(wp), DIMENSION(jpi,jpj,jpk) :: &
+      INTEGER :: ji, jj            ! Loop counters
+      REAL(wp), POINTER, DIMENSION(:,:,:) :: &
          & zprofvar1, &            ! Model values for 1st variable in a prof ob
          & zprofvar2               ! Model values for 2nd variable in a prof ob
-      REAL(wp), DIMENSION(jpi,jpj,jpk) :: &
+      REAL(wp), POINTER, DIMENSION(:,:,:) :: &
          & zprofmask1, &           ! Mask associated with zprofvar1
          & zprofmask2              ! Mask associated with zprofvar2
-      REAL(wp), DIMENSION(jpi,jpj)     :: &
+      REAL(wp), POINTER, DIMENSION(:,:) :: &
          & zsurfvar                ! Model values equivalent to surface ob.
-      REAL(wp), DIMENSION(jpi,jpj) :: &
+      REAL(wp), POINTER, DIMENSION(:,:) :: &
          & zglam1,    &            ! Model longitudes for prof variable 1
          & zglam2,    &            ! Model longitudes for prof variable 2
@@ -518,4 +534,14 @@
       LOGICAL :: llnightav        ! Logical for calculating night-time average
 
+      !Allocate local work arrays
+      CALL wrk_alloc( jpi, jpj, jpk, zprofvar1 )
+      CALL wrk_alloc( jpi, jpj, jpk, zprofvar2 )
+      CALL wrk_alloc( jpi, jpj, jpk, zprofmask1 )
+      CALL wrk_alloc( jpi, jpj, jpk, zprofmask2 )
+      CALL wrk_alloc( jpi, jpj, zsurfvar )
+      CALL wrk_alloc( jpi, jpj, zglam1 )
+      CALL wrk_alloc( jpi, jpj, zglam2 )
+      CALL wrk_alloc( jpi, jpj, zgphi1 )
+      CALL wrk_alloc( jpi, jpj, zgphi2 )
 #if ! defined key_lim2 && ! defined key_lim3
       CALL wrk_alloc(jpi,jpj,frld) 
@@ -591,5 +617,18 @@
 #if defined key_lim2 || defined key_lim3
             CASE('sic')
-               zsurfvar(:,:) = 1._wp - frld(:,:)
+               IF ( kstp == 0 ) THEN
+                  IF ( lwp .AND. surfdataqc(jtype)%nsstpmpp(1) > 0 ) THEN
+                     CALL ctl_warn( 'Sea-ice not initialised on zeroth '// &
+                        &           'time-step but some obs are valid then.' )
+                     WRITE(numout,*)surfdataqc(jtype)%nsstpmpp(1), &
+                        &           ' sea-ice obs will be missed'
+                  ENDIF
+                  surfdataqc(jtype)%nsurfup = surfdataqc(jtype)%nsurfup + &
+                     &                        surfdataqc(jtype)%nsstp(1)
+                  CYCLE
+               ELSE
+                  zsurfvar(:,:) = 1._wp - frld(:,:)
+               ENDIF
+
                llnightav = .FALSE.
 #endif
@@ -604,11 +643,20 @@
       ENDIF
 
+      CALL wrk_dealloc( jpi, jpj, jpk, zprofvar1 )
+      CALL wrk_dealloc( jpi, jpj, jpk, zprofvar2 )
+      CALL wrk_dealloc( jpi, jpj, jpk, zprofmask1 )
+      CALL wrk_dealloc( jpi, jpj, jpk, zprofmask2 )
+      CALL wrk_dealloc( jpi, jpj, zsurfvar )
+      CALL wrk_dealloc( jpi, jpj, zglam1 )
+      CALL wrk_dealloc( jpi, jpj, zglam2 )
+      CALL wrk_dealloc( jpi, jpj, zgphi1 )
+      CALL wrk_dealloc( jpi, jpj, zgphi2 )
 #if ! defined key_lim2 && ! defined key_lim3
-      CALL wrk_dealloc(jpi,jpj,frld) 
+      CALL wrk_dealloc(jpi,jpj,frld)
 #endif
 
    END SUBROUTINE dia_obs
 
-   SUBROUTINE dia_obs_wri 
+   SUBROUTINE dia_obs_wri
       !!----------------------------------------------------------------------
       !!                    ***  ROUTINE dia_obs_wri  ***
@@ -618,5 +666,5 @@
       !! ** Method  : Call observation diagnostic output routines
       !!
-      !! ** Action  : 
+      !! ** Action  :
       !!
       !! History :
@@ -628,8 +676,15 @@
       !!        !  15-08  (M. Martin) Combined writing for prof and surf types
       !!----------------------------------------------------------------------
+      !! * Modules used
+      USE obs_rot_vel          ! Rotation of velocities
+
       IMPLICIT NONE
 
       !! * Local declarations
       INTEGER :: jtype                    ! Data set loop variable
+      INTEGER :: jo, jvar, jk
+      REAL(wp), DIMENSION(:), ALLOCATABLE :: &
+         & zu, &
+         & zv
 
       !-----------------------------------------------------------------------
@@ -640,9 +695,39 @@
 
          DO jtype = 1, nproftypes
+
+            IF ( TRIM(cobstypesprof(jtype)) == 'vel' ) THEN
+
+               ! For velocity data, rotate the model velocities to N/S, E/W
+               ! using the compressed data structure.
+               ALLOCATE( &
+                  & zu(profdataqc(jtype)%nvprot(1)), &
+                  & zv(profdataqc(jtype)%nvprot(2))  &
+                  & )
+
+               CALL obs_rotvel( profdataqc(jtype), nn_2dint, zu, zv )
+
+               DO jo = 1, profdataqc(jtype)%nprof
+                  DO jvar = 1, 2
+                     DO jk = profdataqc(jtype)%npvsta(jo,jvar), profdataqc(jtype)%npvend(jo,jvar)
+
+                        IF ( jvar == 1 ) THEN
+                           profdataqc(jtype)%var(jvar)%vmod(jk) = zu(jk)
+                        ELSE
+                           profdataqc(jtype)%var(jvar)%vmod(jk) = zv(jk)
+                        ENDIF
+
+                     END DO
+                  END DO
+               END DO
+
+               DEALLOCATE( zu )
+               DEALLOCATE( zv )
+
+            END IF
 
             CALL obs_prof_decompress( profdataqc(jtype), &
                &                      profdata(jtype), .TRUE., numout )
 
-            CALL obs_wri_prof( profdata(jtype), nn_2dint )
+            CALL obs_wri_prof( profdata(jtype) )
 
          END DO
Index: /branches/2015/dev_r5072_UKMO2_OBS_simplification/NEMOGCM/NEMO/OPA_SRC/OBS/obs_inter_sup.F90
===================================================================
--- /branches/2015/dev_r5072_UKMO2_OBS_simplification/NEMOGCM/NEMO/OPA_SRC/OBS/obs_inter_sup.F90	(revision 5703)
+++ /branches/2015/dev_r5072_UKMO2_OBS_simplification/NEMOGCM/NEMO/OPA_SRC/OBS/obs_inter_sup.F90	(revision 5704)
@@ -35,5 +35,5 @@
 CONTAINS
 
-   SUBROUTINE obs_int_comm_3d( kptsi, kptsj, kobs, kpk, kgrdi, kgrdj, &
+   SUBROUTINE obs_int_comm_3d( kptsi, kptsj, kobs, kpi, kpj, kpk, kgrdi, kgrdj, &
       &                        pval, pgval, kproc )
       !!----------------------------------------------------------------------
@@ -57,4 +57,6 @@
       INTEGER, INTENT(IN) :: kptsj     ! Number of j horizontal points per stencil
       INTEGER, INTENT(IN) :: kobs      ! Local number of observations
+      INTEGER, INTENT(IN) :: kpi       ! Number of points in i direction
+      INTEGER, INTENT(IN) :: kpj       ! Number of points in j direction
       INTEGER, INTENT(IN) :: kpk       ! Number of levels
       INTEGER, DIMENSION(kptsi,kptsj,kobs), INTENT(IN) :: &
@@ -63,5 +65,5 @@
       INTEGER, OPTIONAL, DIMENSION(kptsi,kptsj,kobs), INTENT(IN) :: &
          & kproc            ! Precomputed processor for each i,j,iobs points
-      REAL(KIND=wp), DIMENSION(jpi,jpj,kpk), INTENT(IN) ::&
+      REAL(KIND=wp), DIMENSION(kpi,kpj,kpk), INTENT(IN) ::&
          & pval             ! Local 3D array to extract data from
       REAL(KIND=wp), DIMENSION(kptsi,kptsj,kpk,kobs), INTENT(OUT) ::&
@@ -73,10 +75,10 @@
          IF (PRESENT(kproc)) THEN
 
-            CALL obs_int_comm_3d_global( kptsi, kptsj, kobs, kpk, kgrdi, &
+            CALL obs_int_comm_3d_global( kptsi, kptsj, kobs, kpi, kpj, kpk, kgrdi, &
                &                         kgrdj, pval, pgval, kproc=kproc )
 
          ELSE
 
-            CALL obs_int_comm_3d_global( kptsi, kptsj, kobs, kpk, kgrdi, &
+            CALL obs_int_comm_3d_global( kptsi, kptsj, kobs, kpi, kpj, kpk, kgrdi, &
                &                         kgrdj, pval, pgval )
 
@@ -85,5 +87,5 @@
       ELSE
 
-         CALL obs_int_comm_3d_local( kptsi, kptsj, kobs, kpk, kgrdi, kgrdj, &
+         CALL obs_int_comm_3d_local( kptsi, kptsj, kobs, kpi, kpj, kpk, kgrdi, kgrdj, &
             &                        pval, pgval )
 
@@ -92,5 +94,5 @@
    END SUBROUTINE obs_int_comm_3d
 
-   SUBROUTINE obs_int_comm_2d( kptsi, kptsj, kobs, kgrdi, kgrdj, pval, pgval, &
+   SUBROUTINE obs_int_comm_2d( kptsi, kptsj, kobs, kpi, kpj, kgrdi, kgrdj, pval, pgval, &
       &                        kproc )
       !!----------------------------------------------------------------------
@@ -111,4 +113,6 @@
       INTEGER, INTENT(IN) :: kptsj        ! Number of j horizontal points per stencil
       INTEGER, INTENT(IN) :: kobs          ! Local number of observations
+      INTEGER, INTENT(IN) :: kpi          ! Number of model grid points in i direction
+      INTEGER, INTENT(IN) :: kpj          ! Number of model grid points in j direction
       INTEGER, DIMENSION(kptsi,kptsj,kobs), INTENT(IN) :: &
          & kgrdi, &         ! i,j indicies for each stencil
@@ -116,5 +120,5 @@
       INTEGER, OPTIONAL, DIMENSION(kptsi,kptsj,kobs), INTENT(IN) :: &
          & kproc            ! Precomputed processor for each i,j,iobs points
-      REAL(KIND=wp), DIMENSION(jpi,jpj), INTENT(IN) ::&
+      REAL(KIND=wp), DIMENSION(kpi,kpj), INTENT(IN) ::&
          & pval             ! Local 3D array to extra data from
       REAL(KIND=wp), DIMENSION(kptsi,kptsj,kobs), INTENT(OUT) ::&
@@ -136,9 +140,9 @@
       IF (PRESENT(kproc)) THEN
 
-         CALL obs_int_comm_3d( kptsi, kptsj, kobs, 1, kgrdi, kgrdj, zval, &
+         CALL obs_int_comm_3d( kptsi, kptsj, kobs, kpi, kpj, 1, kgrdi, kgrdj, zval, &
             &                  zgval, kproc=kproc )
       ELSE
 
-         CALL obs_int_comm_3d( kptsi, kptsj, kobs, 1, kgrdi, kgrdj, zval, &
+         CALL obs_int_comm_3d( kptsi, kptsj, kobs, kpi, kpj, 1, kgrdi, kgrdj, zval, &
             &                  zgval )
 
@@ -154,5 +158,5 @@
    END SUBROUTINE obs_int_comm_2d
 
-   SUBROUTINE obs_int_comm_3d_global( kptsi, kptsj, kobs, kpk, kgrdi, kgrdj, &
+   SUBROUTINE obs_int_comm_3d_global( kptsi, kptsj, kobs, kpi, kpj, kpk, kgrdi, kgrdj, &
       &                               pval, pgval, kproc )
       !!----------------------------------------------------------------------
@@ -174,4 +178,6 @@
       INTEGER, INTENT(IN) :: kptsj     ! Number of j horizontal points per stencil
       INTEGER, INTENT(IN) :: kobs      ! Local number of observations
+      INTEGER, INTENT(IN) :: kpi       ! Number of model points in i direction
+      INTEGER, INTENT(IN) :: kpj       ! Number of model points in j direction
       INTEGER, INTENT(IN) :: kpk       ! Number of levels
       INTEGER, DIMENSION(kptsi,kptsj,kobs), INTENT(IN) :: &
@@ -180,5 +186,5 @@
       INTEGER, OPTIONAL, DIMENSION(kptsi,kptsj,kobs), INTENT(IN) :: &
          & kproc            ! Precomputed processor for each i,j,iobs points
-      REAL(KIND=wp), DIMENSION(jpi,jpj,kpk), INTENT(IN) ::&
+      REAL(KIND=wp), DIMENSION(kpi,kpj,kpk), INTENT(IN) ::&
          & pval             ! Local 3D array to extract data from
       REAL(KIND=wp), DIMENSION(kptsi,kptsj,kpk,kobs), INTENT(OUT) ::&
@@ -207,11 +213,11 @@
 
       ! Check valid points
-      
+
       IF ( ( MAXVAL(kgrdi) > jpiglo ) .OR. ( MINVAL(kgrdi) < 1 ) .OR. &
          & ( MAXVAL(kgrdj) > jpjglo ) .OR. ( MINVAL(kgrdj) < 1 ) ) THEN
-         
+
          CALL ctl_stop( 'Error in obs_int_comm_3d_global', &
             &           'Point outside global domain' )
-         
+
       ENDIF
 
@@ -323,5 +329,5 @@
    END SUBROUTINE obs_int_comm_3d_global
    
-   SUBROUTINE obs_int_comm_3d_local( kptsi, kptsj, kobs, kpk, kgrdi, kgrdj, &
+   SUBROUTINE obs_int_comm_3d_local( kptsi, kptsj, kobs, kpi, kpj, kpk, kgrdi, kgrdj, &
       &                              pval, pgval )
       !!----------------------------------------------------------------------
@@ -343,9 +349,11 @@
       INTEGER, INTENT(IN) :: kptsj        ! Number of j horizontal points per stencil
       INTEGER, INTENT(IN) :: kobs         ! Local number of observations
+      INTEGER, INTENT(IN) :: kpi          ! Number of model points in i direction
+      INTEGER, INTENT(IN) :: kpj          ! Number of model points in j direction
       INTEGER, INTENT(IN) :: kpk          ! Number of levels
       INTEGER, DIMENSION(kptsi,kptsj,kobs), INTENT(IN) :: &
          & kgrdi, &         ! i,j indicies for each stencil
          & kgrdj
-      REAL(KIND=wp), DIMENSION(jpi,jpj,kpk), INTENT(IN) ::&
+      REAL(KIND=wp), DIMENSION(kpi,kpj,kpk), INTENT(IN) ::&
          & pval             ! Local 3D array to extract data from
       REAL(KIND=wp), DIMENSION(kptsi,kptsj,kpk,kobs), INTENT(OUT) ::&
Index: /branches/2015/dev_r5072_UKMO2_OBS_simplification/NEMOGCM/NEMO/OPA_SRC/OBS/obs_oper.F90
===================================================================
--- /branches/2015/dev_r5072_UKMO2_OBS_simplification/NEMOGCM/NEMO/OPA_SRC/OBS/obs_oper.F90	(revision 5703)
+++ /branches/2015/dev_r5072_UKMO2_OBS_simplification/NEMOGCM/NEMO/OPA_SRC/OBS/obs_oper.F90	(revision 5704)
@@ -283,13 +283,13 @@
       END DO
 
-      CALL obs_int_comm_2d( 2, 2, ipro, igrdi1, igrdj1, plam1, zglam1 )
-      CALL obs_int_comm_2d( 2, 2, ipro, igrdi1, igrdj1, pphi1, zgphi1 )
-      CALL obs_int_comm_3d( 2, 2, ipro, kpk, igrdi1, igrdj1, pmask1, zmask1 )
-      CALL obs_int_comm_3d( 2, 2, ipro, kpk, igrdi1, igrdj1, pvar1,   zint1 )
+      CALL obs_int_comm_2d( 2, 2, ipro, kpi, kpj, igrdi1, igrdj1, plam1, zglam1 )
+      CALL obs_int_comm_2d( 2, 2, ipro, kpi, kpj, igrdi1, igrdj1, pphi1, zgphi1 )
+      CALL obs_int_comm_3d( 2, 2, ipro, kpi, kpj, kpk, igrdi1, igrdj1, pmask1, zmask1 )
+      CALL obs_int_comm_3d( 2, 2, ipro, kpi, kpj, kpk, igrdi1, igrdj1, pvar1,   zint1 )
       
-      CALL obs_int_comm_2d( 2, 2, ipro, igrdi2, igrdj2, plam2, zglam2 )
-      CALL obs_int_comm_2d( 2, 2, ipro, igrdi2, igrdj2, pphi2, zgphi2 )
-      CALL obs_int_comm_3d( 2, 2, ipro, kpk, igrdi2, igrdj2, pmask2, zmask2 )
-      CALL obs_int_comm_3d( 2, 2, ipro, kpk, igrdi2, igrdj2, pvar2,   zint2 )
+      CALL obs_int_comm_2d( 2, 2, ipro, kpi, kpj, igrdi2, igrdj2, plam2, zglam2 )
+      CALL obs_int_comm_2d( 2, 2, ipro, kpi, kpj, igrdi2, igrdj2, pphi2, zgphi2 )
+      CALL obs_int_comm_3d( 2, 2, ipro, kpi, kpj, kpk, igrdi2, igrdj2, pmask2, zmask2 )
+      CALL obs_int_comm_3d( 2, 2, ipro, kpi, kpj, kpk, igrdi2, igrdj2, pvar2,   zint2 )
 
       ! At the end of the day also get interpolated means
@@ -301,7 +301,7 @@
             & )
 
-         CALL obs_int_comm_3d( 2, 2, ipro, kpk, igrdi1, igrdj1, &
+         CALL obs_int_comm_3d( 2, 2, ipro, kpi, kpj, kpk, igrdi1, igrdj1, &
             &                  prodatqc%vdmean(:,:,:,1), zinm1 )
-         CALL obs_int_comm_3d( 2, 2, ipro, kpk, igrdi2, igrdj2, &
+         CALL obs_int_comm_3d( 2, 2, ipro, kpi, kpj, kpk, igrdi2, igrdj2, &
             &                  prodatqc%vdmean(:,:,:,2), zinm2 )
 
@@ -649,11 +649,11 @@
       END DO
 
-      CALL obs_int_comm_2d( 2, 2, isurf, &
+      CALL obs_int_comm_2d( 2, 2, isurf, kpi, kpj, &
          &                  igrdi, igrdj, glamt, zglam )
-      CALL obs_int_comm_2d( 2, 2, isurf, &
+      CALL obs_int_comm_2d( 2, 2, isurf, kpi, kpj, &
          &                  igrdi, igrdj, gphit, zgphi )
-      CALL obs_int_comm_2d( 2, 2, isurf, &
+      CALL obs_int_comm_2d( 2, 2, isurf, kpi, kpj, &
          &                  igrdi, igrdj, psurfmask, zmask )
-      CALL obs_int_comm_2d( 2, 2, isurf, &
+      CALL obs_int_comm_2d( 2, 2, isurf, kpi, kpj, &
          &                  igrdi, igrdj, psurf, zsurf )
 
@@ -665,5 +665,5 @@
             & )
 
-         CALL obs_int_comm_2d( 2, 2, isurf, igrdi, igrdj, &
+         CALL obs_int_comm_2d( 2, 2, isurf, kpi, kpj, igrdi, igrdj, &
             &               surfdataqc%vdmean(:,:), zsurfm )
 
Index: /branches/2015/dev_r5072_UKMO2_OBS_simplification/NEMOGCM/NEMO/OPA_SRC/OBS/obs_prep.F90
===================================================================
--- /branches/2015/dev_r5072_UKMO2_OBS_simplification/NEMOGCM/NEMO/OPA_SRC/OBS/obs_prep.F90	(revision 5703)
+++ /branches/2015/dev_r5072_UKMO2_OBS_simplification/NEMOGCM/NEMO/OPA_SRC/OBS/obs_prep.F90	(revision 5704)
@@ -234,4 +234,5 @@
 
    SUBROUTINE obs_pre_prof( profdata, prodatqc, ld_var1, ld_var2, &
+      &                     kpi, kpj, kpk, &
       &                     zmask1, pglam1, pgphi1, zmask2, pglam2, pgphi2,  &
       &                     ld_nea, kdailyavtypes )
@@ -264,10 +265,11 @@
       LOGICAL, INTENT(IN) :: ld_var2
       LOGICAL, INTENT(IN) :: ld_nea               ! Switch for rejecting observation near land
+      INTEGER, INTENT(IN) :: kpi, kpj, kpk        ! Local domain sizes
       INTEGER, DIMENSION(imaxavtypes), OPTIONAL :: &
          & kdailyavtypes                          ! Types for daily averages
-      REAL(wp), INTENT(IN), DIMENSION(jpi,jpj,jpk) :: &
+      REAL(wp), INTENT(IN), DIMENSION(kpi,kpj,kpk) :: &
          & zmask1, &
          & zmask2
-      REAL(wp), INTENT(IN), DIMENSION(jpi,jpj) :: &
+      REAL(wp), INTENT(IN), DIMENSION(kpi,kpj) :: &
          & pglam1, &
          & pglam2, &
@@ -953,7 +955,7 @@
       END DO
       
-      CALL obs_int_comm_2d( 2, 2, kobsno, igrdi, igrdj, pmask, zgmsk )
-      CALL obs_int_comm_2d( 2, 2, kobsno, igrdi, igrdj, plam, zglam )
-      CALL obs_int_comm_2d( 2, 2, kobsno, igrdi, igrdj, pphi, zgphi )
+      CALL obs_int_comm_2d( 2, 2, kobsno, kpi, kpj, igrdi, igrdj, pmask, zgmsk )
+      CALL obs_int_comm_2d( 2, 2, kobsno, kpi, kpj, igrdi, igrdj, plam, zglam )
+      CALL obs_int_comm_2d( 2, 2, kobsno, kpi, kpj, igrdi, igrdj, pphi, zgphi )
 
       DO jobs = 1, kobsno
@@ -1128,7 +1130,7 @@
       END DO
       
-      CALL obs_int_comm_3d( 2, 2, kprofno, kpk, igrdi, igrdj, pmask, zgmsk )
-      CALL obs_int_comm_2d( 2, 2, kprofno, igrdi, igrdj, plam, zglam )
-      CALL obs_int_comm_2d( 2, 2, kprofno, igrdi, igrdj, pphi, zgphi )
+      CALL obs_int_comm_3d( 2, 2, kprofno, kpi, kpj, kpk, igrdi, igrdj, pmask, zgmsk )
+      CALL obs_int_comm_2d( 2, 2, kprofno, kpi, kpj, igrdi, igrdj, plam, zglam )
+      CALL obs_int_comm_2d( 2, 2, kprofno, kpi, kpj, igrdi, igrdj, pphi, zgphi )
 
       DO jobs = 1, kprofno
Index: /branches/2015/dev_r5072_UKMO2_OBS_simplification/NEMOGCM/NEMO/OPA_SRC/OBS/obs_read_altbias.F90
===================================================================
--- /branches/2015/dev_r5072_UKMO2_OBS_simplification/NEMOGCM/NEMO/OPA_SRC/OBS/obs_read_altbias.F90	(revision 5703)
+++ /branches/2015/dev_r5072_UKMO2_OBS_simplification/NEMOGCM/NEMO/OPA_SRC/OBS/obs_read_altbias.F90	(revision 5704)
@@ -164,11 +164,11 @@
       END DO
 
-      CALL obs_int_comm_2d( 2, 2, sladata%nsurf, &
+      CALL obs_int_comm_2d( 2, 2, sladata%nsurf, jpi, jpj, &
          &                  igrdi, igrdj, glamt, zglam )
-      CALL obs_int_comm_2d( 2, 2, sladata%nsurf, &
+      CALL obs_int_comm_2d( 2, 2, sladata%nsurf, jpi, jpj, &
          &                  igrdi, igrdj, gphit, zgphi )
-      CALL obs_int_comm_2d( 2, 2, sladata%nsurf, &
+      CALL obs_int_comm_2d( 2, 2, sladata%nsurf, jpi, jpj, &
          &                  igrdi, igrdj, tmask(:,:,1), zmask )
-      CALL obs_int_comm_2d( 2, 2, sladata%nsurf, &
+      CALL obs_int_comm_2d( 2, 2, sladata%nsurf, jpi, jpj, &
          &                  igrdi, igrdj, z_altbias, zbias )
 
Index: /branches/2015/dev_r5072_UKMO2_OBS_simplification/NEMOGCM/NEMO/OPA_SRC/OBS/obs_read_prof.F90
===================================================================
--- /branches/2015/dev_r5072_UKMO2_OBS_simplification/NEMOGCM/NEMO/OPA_SRC/OBS/obs_read_prof.F90	(revision 5703)
+++ /branches/2015/dev_r5072_UKMO2_OBS_simplification/NEMOGCM/NEMO/OPA_SRC/OBS/obs_read_prof.F90	(revision 5704)
@@ -124,7 +124,10 @@
          & itypvar2mpp 
       INTEGER, DIMENSION(:), ALLOCATABLE :: &
-         & iobsi,    &
-         & iobsj,    &
-         & iproc,    &
+         & iobsi1,    &
+         & iobsj1,    &
+         & iproc1,    &
+         & iobsi2,    &
+         & iobsj2,    &
+         & iproc2,    &
          & iindx,    &
          & ifileidx, &
@@ -298,7 +301,7 @@
 
             IF ( inpfiles(jj)%nobs > 0 ) THEN
-               inpfiles(jj)%iproc = -1
-               inpfiles(jj)%iobsi = -1
-               inpfiles(jj)%iobsj = -1
+               inpfiles(jj)%iproc(:,:) = -1
+               inpfiles(jj)%iobsi(:,:) = -1
+               inpfiles(jj)%iobsj(:,:) = -1
             ENDIF
             inowin = 0
@@ -314,7 +317,10 @@
             ALLOCATE( zlam(inowin)  )
             ALLOCATE( zphi(inowin)  )
-            ALLOCATE( iobsi(inowin) )
-            ALLOCATE( iobsj(inowin) )
-            ALLOCATE( iproc(inowin) )
+            ALLOCATE( iobsi1(inowin) )
+            ALLOCATE( iobsj1(inowin) )
+            ALLOCATE( iproc1(inowin) )
+            ALLOCATE( iobsi2(inowin) )
+            ALLOCATE( iobsj2(inowin) )
+            ALLOCATE( iproc2(inowin) )
             inowin = 0
             DO ji = 1, inpfiles(jj)%nobs
@@ -330,5 +336,16 @@
             END DO
 
-            CALL obs_grid_search( inowin, zlam, zphi, iobsi, iobsj, iproc, 'T' )
+            IF ( TRIM( inpfiles(jj)%cname(1) ) == 'POTM' ) THEN
+               CALL obs_grid_search( inowin, zlam, zphi, iobsi1, iobsj1, &
+                  &                  iproc1, 'T' )
+               iobsi2(:) = iobsi1(:)
+               iobsj2(:) = iobsj1(:)
+               iproc2(:) = iproc1(:)
+            ELSEIF ( TRIM( inpfiles(jj)%cname(1) ) == 'UVEL' ) THEN
+               CALL obs_grid_search( inowin, zlam, zphi, iobsi1, iobsj1, &
+                  &                  iproc1, 'U' )
+               CALL obs_grid_search( inowin, zlam, zphi, iobsi2, iobsj2, &
+                  &                  iproc2, 'V' )
+            ENDIF
 
             inowin = 0
@@ -340,10 +357,18 @@
                   & ( inpfiles(jj)%ptim(ji) <= djulend(jj) )       ) THEN
                   inowin = inowin + 1
-                  inpfiles(jj)%iproc(ji,1) = iproc(inowin)
-                  inpfiles(jj)%iobsi(ji,1) = iobsi(inowin)
-                  inpfiles(jj)%iobsj(ji,1) = iobsj(inowin)
+                  inpfiles(jj)%iproc(ji,1) = iproc1(inowin)
+                  inpfiles(jj)%iobsi(ji,1) = iobsi1(inowin)
+                  inpfiles(jj)%iobsj(ji,1) = iobsj1(inowin)
+                  inpfiles(jj)%iproc(ji,2) = iproc2(inowin)
+                  inpfiles(jj)%iobsi(ji,2) = iobsi2(inowin)
+                  inpfiles(jj)%iobsj(ji,2) = iobsj2(inowin)
+                  IF ( inpfiles(jj)%iproc(ji,1) /= &
+                     & inpfiles(jj)%iproc(ji,2) ) THEN
+                     CALL ctl_stop( 'Error in obs_read_prof:', &
+                        & 'var1 and var2 observation on different processors')
+                  ENDIF
                ENDIF
             END DO
-            DEALLOCATE( zlam, zphi, iobsi, iobsj, iproc )
+            DEALLOCATE( zlam, zphi, iobsi1, iobsj1, iproc1, iobsi2, iobsj2, iproc2 )
 
             DO ji = 1, inpfiles(jj)%nobs
@@ -547,6 +572,8 @@
 
                ! Coordinate search parameters
-               profdata%mi  (iprof,:) = inpfiles(jj)%iobsi(ji,1)
-               profdata%mj  (iprof,:) = inpfiles(jj)%iobsj(ji,1)
+               profdata%mi  (iprof,1) = inpfiles(jj)%iobsi(ji,1)
+               profdata%mj  (iprof,1) = inpfiles(jj)%iobsj(ji,1)
+               profdata%mi  (iprof,2) = inpfiles(jj)%iobsi(ji,2)
+               profdata%mj  (iprof,2) = inpfiles(jj)%iobsj(ji,2)
 
                ! Profile WMO number
@@ -633,5 +660,5 @@
                      profdata%var(1)%nvlidx(ivar1t) = ij
 
-                     ! Profile potential var1 value
+                     ! Profile var1 value
                      IF ( ( inpfiles(jj)%ivlqc(ij,ji,1) <= 2 ) .AND. &
                         & ( inpfiles(jj)%idqc(ij,ji) <= 2 ) ) THEN
@@ -658,6 +685,8 @@
 
                      ! Profile insitu T value
-                     profdata%var(1)%vext(ivar1t,1) = &
-                        &                inpfiles(jj)%pext(ij,ji,1)
+                     IF ( TRIM( inpfiles(jj)%cname(1) ) == 'POTM' ) THEN
+                        profdata%var(1)%vext(ivar1t,1) = &
+                           &                inpfiles(jj)%pext(ij,ji,1)
+                     ENDIF
 
                   ENDIF
Index: /branches/2015/dev_r5072_UKMO2_OBS_simplification/NEMOGCM/NEMO/OPA_SRC/OBS/obs_read_surf.F90
===================================================================
--- /branches/2015/dev_r5072_UKMO2_OBS_simplification/NEMOGCM/NEMO/OPA_SRC/OBS/obs_read_surf.F90	(revision 5703)
+++ /branches/2015/dev_r5072_UKMO2_OBS_simplification/NEMOGCM/NEMO/OPA_SRC/OBS/obs_read_surf.F90	(revision 5704)
@@ -197,4 +197,6 @@
             ENDIF
 
+            IF (lwp) WRITE(numout,*)'Observation file contains ',inpfiles(jj)%nobs,' observations'
+
             !------------------------------------------------------------------
             !  Change longitude (-180,180)
@@ -398,4 +400,7 @@
                surfdata%mj  (iobs) = inpfiles(jj)%iobsj(ji,1)
 
+               ! WMO number
+               surfdata%cwmo(iobs) = inpfiles(jj)%cdwmo(ji)
+
                ! Instrument type
                READ( inpfiles(jj)%cdtyp(ji), '(I4)', IOSTAT = ios, ERR = 901 ) itype
Index: /branches/2015/dev_r5072_UKMO2_OBS_simplification/NEMOGCM/NEMO/OPA_SRC/OBS/obs_readmdt.F90
===================================================================
--- /branches/2015/dev_r5072_UKMO2_OBS_simplification/NEMOGCM/NEMO/OPA_SRC/OBS/obs_readmdt.F90	(revision 5703)
+++ /branches/2015/dev_r5072_UKMO2_OBS_simplification/NEMOGCM/NEMO/OPA_SRC/OBS/obs_readmdt.F90	(revision 5704)
@@ -108,5 +108,6 @@
 
       ! Remove the offset between the MDT used with the sla and the model MDT
-      IF( nn_msshc == 1 .OR. nn_msshc == 2 )   CALL obs_offset_mdt( z_mdt, zfill )
+      IF( nn_msshc == 1 .OR. nn_msshc == 2 ) &
+         & CALL obs_offset_mdt( jpi, jpj, z_mdt, zfill )
 
       ! Intepolate the MDT already on the model grid at the observation point
@@ -134,8 +135,8 @@
       END DO
 
-      CALL obs_int_comm_2d( 2, 2, sladata%nsurf, igrdi, igrdj, glamt  , zglam )
-      CALL obs_int_comm_2d( 2, 2, sladata%nsurf, igrdi, igrdj, gphit  , zgphi )
-      CALL obs_int_comm_2d( 2, 2, sladata%nsurf, igrdi, igrdj, mdtmask, zmask )
-      CALL obs_int_comm_2d( 2, 2, sladata%nsurf, igrdi, igrdj, z_mdt  , zmdtl )
+      CALL obs_int_comm_2d( 2, 2, sladata%nsurf, jpi, jpj, igrdi, igrdj, glamt  , zglam )
+      CALL obs_int_comm_2d( 2, 2, sladata%nsurf, jpi, jpj, igrdi, igrdj, gphit  , zgphi )
+      CALL obs_int_comm_2d( 2, 2, sladata%nsurf, jpi, jpj, igrdi, igrdj, mdtmask, zmask )
+      CALL obs_int_comm_2d( 2, 2, sladata%nsurf, jpi, jpj, igrdi, igrdj, z_mdt  , zmdtl )
 
       DO jobs = 1, sladata%nsurf
@@ -168,10 +169,9 @@
       CALL wrk_dealloc(jpi,jpj,z_mdt,mdtmask) 
       IF(lwp)WRITE(numout,*) ' ------------- '
-      CALL FLUSH(numout)
       !
    END SUBROUTINE obs_rea_mdt
 
 
-   SUBROUTINE obs_offset_mdt( mdt, zfill )
+   SUBROUTINE obs_offset_mdt( kpi, kpj, mdt, zfill )
       !!---------------------------------------------------------------------
       !!
@@ -186,6 +186,7 @@
       !! ** Action  : 
       !!----------------------------------------------------------------------
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(inout) ::   mdt     ! MDT used on the model grid
-      REAL(wp)                    , INTENT(in   ) ::   zfill 
+      INTEGER, INTENT(IN) ::  kpi, kpj
+      REAL(wp), DIMENSION(kpi,kpj), INTENT(INOUT) ::   mdt     ! MDT used on the model grid
+      REAL(wp)                    , INTENT(IN   ) ::   zfill 
       ! 
       INTEGER  :: ji, jj
Index: /branches/2015/dev_r5072_UKMO2_OBS_simplification/NEMOGCM/NEMO/OPA_SRC/OBS/obs_rot_vel.F90
===================================================================
--- /branches/2015/dev_r5072_UKMO2_OBS_simplification/NEMOGCM/NEMO/OPA_SRC/OBS/obs_rot_vel.F90	(revision 5703)
+++ /branches/2015/dev_r5072_UKMO2_OBS_simplification/NEMOGCM/NEMO/OPA_SRC/OBS/obs_rot_vel.F90	(revision 5704)
@@ -140,23 +140,23 @@
       END DO
 
-      CALL obs_int_comm_2d( 2, 2, profdata%nprof, igrdiu, igrdju, &
+      CALL obs_int_comm_2d( 2, 2, profdata%nprof, jpi, jpj, igrdiu, igrdju, &
          &                  glamu, zglamu )
-      CALL obs_int_comm_2d( 2, 2, profdata%nprof, igrdiu, igrdju, &
+      CALL obs_int_comm_2d( 2, 2, profdata%nprof, jpi, jpj, igrdiu, igrdju, &
          &                  gphiu, zgphiu )
-      CALL obs_int_comm_2d( 2, 2, profdata%nprof, igrdiu, igrdju, &
+      CALL obs_int_comm_2d( 2, 2, profdata%nprof, jpi, jpj, igrdiu, igrdju, &
          &                  umask(:,:,1), zmasku )
-      CALL obs_int_comm_2d( 2, 2, profdata%nprof, igrdiu, igrdju, &
+      CALL obs_int_comm_2d( 2, 2, profdata%nprof, jpi, jpj, igrdiu, igrdju, &
          &                  zsingu, zsinlu )
-      CALL obs_int_comm_2d( 2, 2, profdata%nprof, igrdiu, igrdju, &
+      CALL obs_int_comm_2d( 2, 2, profdata%nprof, jpi, jpj, igrdiu, igrdju, &
          &                  zcosgu, zcoslu )
-      CALL obs_int_comm_2d( 2, 2, profdata%nprof, igrdiv, igrdjv, &
+      CALL obs_int_comm_2d( 2, 2, profdata%nprof, jpi, jpj, igrdiv, igrdjv, &
          &                  glamv, zglamv )
-      CALL obs_int_comm_2d( 2, 2, profdata%nprof, igrdiv, igrdjv, &
+      CALL obs_int_comm_2d( 2, 2, profdata%nprof, jpi, jpj, igrdiv, igrdjv, &
          &                  gphiv, zgphiv )
-      CALL obs_int_comm_2d( 2, 2, profdata%nprof, igrdiv, igrdjv, &
+      CALL obs_int_comm_2d( 2, 2, profdata%nprof, jpi, jpj, igrdiv, igrdjv, &
          &                  vmask(:,:,1), zmaskv )
-      CALL obs_int_comm_2d( 2, 2, profdata%nprof, igrdiv, igrdjv, &
+      CALL obs_int_comm_2d( 2, 2, profdata%nprof, jpi, jpj, igrdiv, igrdjv, &
          &                  zsingv, zsinlv )
-      CALL obs_int_comm_2d( 2, 2, profdata%nprof, igrdiv, igrdjv, &
+      CALL obs_int_comm_2d( 2, 2, profdata%nprof, jpi, jpj, igrdiv, igrdjv, &
          &                  zcosgv, zcoslv )
 
@@ -195,7 +195,7 @@
          DO jk = profdata%npvsta(ji,1), profdata%npvend(ji,1)
             IF ( ( profdata%var(1)%vmod(jk) /= fbrmdi ) .AND. &
-               & ( profdata%var(1)%vmod(jk) /= fbrmdi ) ) THEN
+               & ( profdata%var(2)%vmod(jk) /= fbrmdi ) ) THEN
                pu(jk) = profdata%var(1)%vmod(jk) * zcos - &
-                  &     profdata%var(2)%vmod(jk) * zsin 
+                  &     profdata%var(2)%vmod(jk) * zsin
                pv(jk) = profdata%var(2)%vmod(jk) * zcos + &
                   &     profdata%var(1)%vmod(jk) * zsin
@@ -204,4 +204,5 @@
                pv(jk) = fbrmdi
             ENDIF
+
          END DO
 
Index: /branches/2015/dev_r5072_UKMO2_OBS_simplification/NEMOGCM/NEMO/OPA_SRC/OBS/obs_write.F90
===================================================================
--- /branches/2015/dev_r5072_UKMO2_OBS_simplification/NEMOGCM/NEMO/OPA_SRC/OBS/obs_write.F90	(revision 5703)
+++ /branches/2015/dev_r5072_UKMO2_OBS_simplification/NEMOGCM/NEMO/OPA_SRC/OBS/obs_write.F90	(revision 5704)
@@ -27,5 +27,4 @@
    USE obs_conv             ! Conversion between units
    USE obs_const
-   USE obs_rot_vel          ! Rotation of velocities
    USE obs_mpp              ! MPP support routines for observation diagnostics
    USE lib_mpp		    ! MPP routines
@@ -55,5 +54,5 @@
 CONTAINS
 
-   SUBROUTINE obs_wri_prof( profdata, k2dint, padd, pext )
+   SUBROUTINE obs_wri_prof( profdata, padd, pext )
       !!-----------------------------------------------------------------------
       !!
@@ -78,5 +77,4 @@
       !! * Arguments
       TYPE(obs_prof), INTENT(INOUT) :: profdata      ! Full set of profile data
-      INTEGER, INTENT(IN)        :: k2dint           ! Horizontal interpolation method
       TYPE(obswriinfo), OPTIONAL :: padd             ! Additional info for each variable
       TYPE(obswriinfo), OPTIONAL :: pext             ! Extra info
@@ -96,7 +94,4 @@
       INTEGER :: iext
       REAL(wp) :: zpres
-      REAL(wp), DIMENSION(:), ALLOCATABLE :: &
-         & zu, &
-         & zv
 
       IF ( PRESENT( padd ) ) THEN
@@ -156,5 +151,5 @@
 
          clfiletype='velfb'
-         CALL alloc_obfbdata( fbdata, 2, profdata%nprof, ilevel, 2, 0, .TRUE. )
+         CALL alloc_obfbdata( fbdata, 2, profdata%nprof, ilevel, 1, 0, .TRUE. )
          fbdata%cname(1)      = profdata%cvars(1)
          fbdata%cname(2)      = profdata%cvars(2)
@@ -172,21 +167,11 @@
          fbdata%caddunit(1,1) = 'm/s'
          fbdata%caddunit(1,2) = 'm/s'
-         fbdata%caddname(2)   = 'HxG'
-         fbdata%caddlong(2,1) = 'Model interpolated zonal velocity (model grid)'
-         fbdata%caddlong(2,2) = 'Model interpolated meridional velocity (model grid)'
-         fbdata%caddunit(2,1) = 'm/s'
-         fbdata%caddunit(2,2) = 'm/s' 
          fbdata%cgrid(1)      = 'U' 
          fbdata%cgrid(2)      = 'V'
          DO ja = 1, iadd
-            fbdata%caddname(2+ja) = padd%cdname(ja)
-            fbdata%caddlong(2+ja,1) = padd%cdlong(ja,1)
-            fbdata%caddunit(2+ja,1) = padd%cdunit(ja,1)
-         END DO
-         ALLOCATE( &
-            & zu(profdata%nvprot(1)), &
-            & zv(profdata%nvprot(2))  &
-            & )
-         CALL obs_rotvel( profdata, k2dint, zu, zv )
+            fbdata%caddname(1+ja) = padd%cdname(ja)
+            fbdata%caddlong(1+ja,1) = padd%cdlong(ja,1)
+            fbdata%caddunit(1+ja,1) = padd%cdunit(ja,1)
+         END DO
 
       END SELECT
@@ -203,5 +188,5 @@
       ENDIF
 
-      ! Transform obs_prof data structure into obfbdata structure
+      ! Transform obs_prof data structure into obfb data structure
       fbdata%cdjuldref = '19500101000000'
       DO jo = 1, profdata%nprof
@@ -246,14 +231,5 @@
             DO jk = profdata%npvsta(jo,jvar), profdata%npvend(jo,jvar)
                ik = profdata%var(jvar)%nvlidx(jk)
-               IF ( TRIM(profdata%cvars(1)) == 'POTM' ) THEN
-                  fbdata%padd(ik,jo,1,jvar) = profdata%var(jvar)%vmod(jk)
-               ELSE IF ( TRIM(profdata%cvars(1)) == 'UVEL' ) THEN
-                  IF ( jvar == 1 ) THEN
-                     fbdata%padd(ik,jo,1,jvar) = zu(jk)
-                  ELSE
-                     fbdata%padd(ik,jo,1,jvar) = zv(jk)
-                  ENDIF
-                  fbdata%padd(ik,jo,2,jvar) = profdata%var(jvar)%vmod(jk)
-               ENDIF
+               fbdata%padd(ik,jo,1,jvar) = profdata%var(jvar)%vmod(jk)
                fbdata%pob(ik,jo,jvar)    = profdata%var(jvar)%vobs(jk)
                fbdata%pdep(ik,jo)        = profdata%var(jvar)%vdep(jk)
@@ -277,5 +253,6 @@
                      & profdata%var(jvar)%vext(jk,pext%ipoint(je))
                END DO
-               IF ( jvar == 1 ) THEN
+               IF ( ( jvar == 1 ) .AND. &
+                  & ( TRIM(profdata%cvars(1)) == 'POTM' ) ) THEN
                   fbdata%pext(ik,jo,1) = profdata%var(jvar)%vext(jk,1)
                ENDIF 
@@ -365,9 +342,9 @@
       CALL init_obfbdata( fbdata )
 
-      CALL alloc_obfbdata( fbdata, 1, surfdata%nsurf, 1, &
-         &                 2 + iadd, 1 + iext, .TRUE. )
-
       SELECT CASE ( TRIM(surfdata%cvars(1)) )
       CASE('SLA')
+
+         CALL alloc_obfbdata( fbdata, 1, surfdata%nsurf, 1, &
+            &                 2 + iadd, 1 + iext, .TRUE. )
 
          clfiletype = 'slafb'
@@ -397,4 +374,7 @@
       CASE('SST')
 
+         CALL alloc_obfbdata( fbdata, 1, surfdata%nsurf, 1, &
+            &                 1 + iadd, iext, .TRUE. )
+
          clfiletype = 'sstfb'
          fbdata%cname(1)      = surfdata%cvars(1)
@@ -415,5 +395,8 @@
          END DO
 
-      CASE('SEAICE')
+      CASE('ICECON')
+
+         CALL alloc_obfbdata( fbdata, 1, surfdata%nsurf, 1, &
+            &                 1 + iadd, iext, .TRUE. )
 
          clfiletype = 'sicfb'
@@ -448,5 +431,5 @@
       ENDIF
 
-      ! Transform obs_prof data structure into obfbdata structure
+      ! Transform surf data structure into obfbdata structure
       fbdata%cdjuldref = '19500101000000'
       DO jo = 1, surfdata%nsurf
@@ -549,4 +532,5 @@
       REAL(wp) :: zsumx2
       REAL(wp) :: zomb
+      
 
       IF (lwp) THEN
Index: /branches/2015/dev_r5072_UKMO2_OBS_simplification/NEMOGCM/SETTE/sette.sh
===================================================================
--- /branches/2015/dev_r5072_UKMO2_OBS_simplification/NEMOGCM/SETTE/sette.sh	(revision 5703)
+++ /branches/2015/dev_r5072_UKMO2_OBS_simplification/NEMOGCM/SETTE/sette.sh	(revision 5704)
@@ -1159,4 +1159,6 @@
     set_namelist namelist_cfg ln_sst .true.
     set_namelist namelist_cfg ln_sla .true.
+    set_namelist namelist_cfg ln_sic .true.
+    set_namelist namelist_cfg ln_vel3d .true.
     set_namelist namelist_cfg ln_bkgwri .true.
     set_namelist namelist_cfg ln_trainc .true.
@@ -1195,4 +1197,6 @@
     set_namelist namelist_cfg ln_sst .true.
     set_namelist namelist_cfg ln_sla .true.
+    set_namelist namelist_cfg ln_sic .true.
+    set_namelist namelist_cfg ln_vel3d .true.
     set_namelist namelist_cfg ln_bkgwri .true.
     set_namelist namelist_cfg ln_trainc .true.
Index: /branches/2015/dev_r5072_UKMO2_OBS_simplification/NEMOGCM/TOOLS/OBSTOOLS/src/fbgenerate.F90
===================================================================
--- /branches/2015/dev_r5072_UKMO2_OBS_simplification/NEMOGCM/TOOLS/OBSTOOLS/src/fbgenerate.F90	(revision 5703)
+++ /branches/2015/dev_r5072_UKMO2_OBS_simplification/NEMOGCM/TOOLS/OBSTOOLS/src/fbgenerate.F90	(revision 5704)
@@ -219,5 +219,5 @@
       CALL set_spatial_coords_grid(lats,lons,nobs,nlats,nlons,FillValue_real)
    ELSE
-      CALL set_spatial_coords(lats,lons,nobs,FillValue_real)
+      CALL set_spatial_coords(lats,lons,nobs,nlats,nlons,FillValue_real)
    END IF
    
Index: /branches/2015/dev_r5072_UKMO2_OBS_simplification/NEMOGCM/TOOLS/OBSTOOLS/src/fbgenerate_coords.F90
===================================================================
--- /branches/2015/dev_r5072_UKMO2_OBS_simplification/NEMOGCM/TOOLS/OBSTOOLS/src/fbgenerate_coords.F90	(revision 5703)
+++ /branches/2015/dev_r5072_UKMO2_OBS_simplification/NEMOGCM/TOOLS/OBSTOOLS/src/fbgenerate_coords.F90	(revision 5704)
@@ -26,5 +26,5 @@
 
 
-	SUBROUTINE set_spatial_coords(lats,lons,n,FillVal)
+	SUBROUTINE set_spatial_coords(lats,lons,n,nlats,nlons,FillVal)
 	IMPLICIT NONE	
 	INTEGER :: i, j, k, p, nlats, nlons, nlats_in_list, nlons_in_list
@@ -436,5 +436,7 @@
 					array(j,:,k) = array(j,1,k)
 				END DO
-				
+			! If single depth and only first profile has a value then set the rest based on that
+			ELSE IF ((n > 1) .AND. (m == 1) .AND. (array(1,2,k) == FillVal)) THEN
+			        array(1,2:,k) = array(1,1,k)
 			ELSE 
 	   		array(:,:,k) = array(:,:,k)
Index: /branches/2015/dev_r5072_UKMO2_OBS_simplification/NEMOGCM/TOOLS/OBSTOOLS/src/test_fbgenerate.F90
===================================================================
--- /branches/2015/dev_r5072_UKMO2_OBS_simplification/NEMOGCM/TOOLS/OBSTOOLS/src/test_fbgenerate.F90	(revision 5703)
+++ /branches/2015/dev_r5072_UKMO2_OBS_simplification/NEMOGCM/TOOLS/OBSTOOLS/src/test_fbgenerate.F90	(revision 5704)
@@ -392,5 +392,5 @@
 	lat_array_out(:) = (/1.0_fbdp/)
 	lon_array_out(:) = (/1.0_fbdp/)
-	CALL set_spatial_coords(lat_array_in,lon_array_in,1,FV_real)
+	CALL set_spatial_coords(lat_array_in,lon_array_in,1,1,1,FV_real)
 	okay = test_arrays(lat_array_in,lat_array_out)
 	okay_too = test_arrays(lon_array_in,lon_array_out)
@@ -417,5 +417,5 @@
 	lat_array_out(:) = (/1.0_fbdp, 1.0_fbdp, 1.0_fbdp, 1.0_fbdp/)
 	lon_array_out(:) = (/1.0_fbdp, 2.0_fbdp, 3.0_fbdp, 4.0_fbdp/)
-	CALL set_spatial_coords(lat_array_in,lon_array_in,4,FV_real)
+	CALL set_spatial_coords(lat_array_in,lon_array_in,4,4,4,FV_real)
 	okay = test_arrays(lat_array_in,lat_array_out)
 	okay_too = test_arrays(lon_array_in,lon_array_out)
@@ -442,5 +442,5 @@
 	lat_array_out(:) = (/1.0_fbdp, 1.0_fbdp, 1.0_fbdp/)
 	lon_array_out(:) = (/1.0_fbdp, 2.0_fbdp, 3.0_fbdp/)
-	CALL set_spatial_coords(lat_array_in,lon_array_in,3,FV_real)
+	CALL set_spatial_coords(lat_array_in,lon_array_in,3,3,3,FV_real)
 	okay = test_arrays(lat_array_in,lat_array_out)
 	okay_too = test_arrays(lon_array_in,lon_array_out)
@@ -467,5 +467,5 @@
 	lat_array_out(:) = (/1.0_fbdp, 1.0_fbdp, 1.0_fbdp, 1.0_fbdp, 1.0_fbdp/)
 	lon_array_out(:) = (/1.0_fbdp, 2.0_fbdp, 3.0_fbdp, 4.0_fbdp, 5.0_fbdp/)
-	CALL set_spatial_coords(lat_array_in,lon_array_in,5,FV_real)
+	CALL set_spatial_coords(lat_array_in,lon_array_in,5,5,5,FV_real)
 	okay = test_arrays(lat_array_in,lat_array_out)
 	okay_too = test_arrays(lon_array_in,lon_array_out)
@@ -492,5 +492,5 @@
 	lat_array_out(:) = (/1.0_fbdp, 2.0_fbdp, 3.0_fbdp, 4.0_fbdp, 5.0_fbdp/)
 	lon_array_out(:) = (/1.0_fbdp, 1.0_fbdp, 1.0_fbdp, 1.0_fbdp, 1.0_fbdp/)
-	CALL set_spatial_coords(lat_array_in,lon_array_in,5,FV_real)
+	CALL set_spatial_coords(lat_array_in,lon_array_in,5,5,5,FV_real)
 	okay = test_arrays(lat_array_in,lat_array_out)
 	okay_too = test_arrays(lon_array_in,lon_array_out)
@@ -517,5 +517,5 @@
 	lat_array_out(:) = (/1.0_fbdp, 2.0_fbdp, 3.0_fbdp, 4.0_fbdp, 5.0_fbdp/)
 	lon_array_out(:) = (/1.0_fbdp, 2.0_fbdp, 3.0_fbdp, 4.0_fbdp, 5.0_fbdp/)
-	CALL set_spatial_coords(lat_array_in,lon_array_in,5,FV_real)
+	CALL set_spatial_coords(lat_array_in,lon_array_in,5,5,5,FV_real)
 	okay = test_arrays(lat_array_in,lat_array_out)
 	okay_too = test_arrays(lon_array_in,lon_array_out)
@@ -559,5 +559,5 @@
 								10.0_fbdp, 20.0_fbdp, 30.0_fbdp, 40.0_fbdp, 50.0_fbdp,&
 								10.0_fbdp, 20.0_fbdp, 30.0_fbdp, 40.0_fbdp, 50.0_fbdp/)
-	CALL set_spatial_coords(lat_array_in,lon_array_in,25,FV_real)
+	CALL set_spatial_coords(lat_array_in,lon_array_in,25,25,25,FV_real)
 	okay = test_arrays(lat_array_in,lat_array_out)
 	okay_too = test_arrays(lon_array_in,lon_array_out)
@@ -601,5 +601,5 @@
 								10.0_fbdp, 20.0_fbdp, 30.0_fbdp, 40.0_fbdp, 50.0_fbdp,&
 								10.0_fbdp, 20.0_fbdp, 30.0_fbdp, 40.0_fbdp, 50.0_fbdp/)
-	CALL set_spatial_coords(lat_array_in,lon_array_in,25,FV_real)
+	CALL set_spatial_coords(lat_array_in,lon_array_in,25,25,25,FV_real)
 	okay = test_arrays(lat_array_in,lat_array_out)
 	okay_too = test_arrays(lon_array_in,lon_array_out)
@@ -628,5 +628,5 @@
 	lat_array_out(:) = (/1.0_fbdp, 2.0_fbdp, 3.0_fbdp, 4.0_fbdp, 5.0_fbdp/)
 	lon_array_out(:) = (/10.0_fbdp, 20.0_fbdp, 30.0_fbdp, 40.0_fbdp, 50.0_fbdp/)
-	CALL set_spatial_coords(lat_array_in,lon_array_in,5,FV_real)
+	CALL set_spatial_coords(lat_array_in,lon_array_in,5,5,5,FV_real)
 	okay = test_arrays(lat_array_in,lat_array_out)
 	okay_too = test_arrays(lon_array_in,lon_array_out)
@@ -655,5 +655,5 @@
 	lat_array_out(:) = (/10.0_fbdp, 20.0_fbdp, 30.0_fbdp, 40.0_fbdp, 50.0_fbdp/)
 	lon_array_out(:) = (/1.0_fbdp, 2.0_fbdp, 3.0_fbdp, 4.0_fbdp, 5.0_fbdp/)
-	CALL set_spatial_coords(lat_array_in,lon_array_in,5,FV_real)
+	CALL set_spatial_coords(lat_array_in,lon_array_in,5,5,5,FV_real)
 	okay = test_arrays(lat_array_in,lat_array_out)
 	okay_too = test_arrays(lon_array_in,lon_array_out)
@@ -698,5 +698,5 @@
 								1.0_fbdp, 2.0_fbdp, 3.0_fbdp, 4.0_fbdp, 5.0_fbdp,&
 								1.0_fbdp, 2.0_fbdp, 3.0_fbdp, 4.0_fbdp, 5.0_fbdp/)
-	CALL set_spatial_coords(lat_array_in,lon_array_in,25,FV_real)
+	CALL set_spatial_coords(lat_array_in,lon_array_in,25,25,25,FV_real)
 	okay = test_arrays(lat_array_in,lat_array_out)
 	okay_too = test_arrays(lon_array_in,lon_array_out)
@@ -724,5 +724,5 @@
 	lat_array_out(:) = (/1.0_fbdp, 1.0_fbdp, 1.0_fbdp, 1.0_fbdp, 1.0_fbdp/)
 	lon_array_out(:) = (/1.0_fbdp, 2.0_fbdp, 3.0_fbdp, 4.0_fbdp, 5.0_fbdp/)
-	CALL set_spatial_coords(lat_array_in,lon_array_in,5,FV_real)
+	CALL set_spatial_coords(lat_array_in,lon_array_in,5,5,5,FV_real)
 	okay = test_arrays(lat_array_in,lat_array_out)
 	okay_too = test_arrays(lon_array_in,lon_array_out)
@@ -764,5 +764,5 @@
 								10.0_fbdp, 20.0_fbdp, 30.0_fbdp, 40.0_fbdp,&
 								10.0_fbdp, 20.0_fbdp, 30.0_fbdp, 40.0_fbdp/)
-	CALL set_spatial_coords(lat_array_in,lon_array_in,20,FV_real)
+	CALL set_spatial_coords(lat_array_in,lon_array_in,20,20,20,FV_real)
 	okay = test_arrays(lat_array_in,lat_array_out)
 	okay_too = test_arrays(lon_array_in,lon_array_out)
