Index: branches/2015/dev_MetOffice_merge_2015/NEMOGCM/NEMO/OPA_SRC/OBS/diaobs.F90
===================================================================
--- branches/2015/dev_MetOffice_merge_2015/NEMOGCM/NEMO/OPA_SRC/OBS/diaobs.F90	(revision 5978)
+++ branches/2015/dev_MetOffice_merge_2015/NEMOGCM/NEMO/OPA_SRC/OBS/diaobs.F90	(revision 5979)
@@ -1081,5 +1081,6 @@
                      &              kstp, jpi, jpj, jpk, nit000, idaystp,   & 
                      &              tsn(:,:,:,jp_tem), tsn(:,:,:,jp_sal),   & 
-                     &              fsdept(:,:,:), tmask, n1dint, n2dint,   & 
+                     &              fsdept(:,:,:), fsdepw(:,:,:),           &
+                     &              tmask, n1dint, n2dint,   & 
                      &              kdailyavtypes = endailyavtypes ) 
                ELSE 
@@ -1087,5 +1088,6 @@
                      &              kstp, jpi, jpj, jpk, nit000, idaystp,   & 
                      &              tsn(:,:,:,jp_tem), tsn(:,:,:,jp_sal),   & 
-                     &              fsdept(:,:,:), tmask, n1dint, n2dint ) 
+                     &              fsdept(:,:,:), fsdepw(:,:,:),           &
+                     &              tmask, n1dint, n2dint ) 
                ENDIF 
             ENDIF
Index: branches/2015/dev_MetOffice_merge_2015/NEMOGCM/NEMO/OPA_SRC/OBS/obs_oper.F90
===================================================================
--- branches/2015/dev_MetOffice_merge_2015/NEMOGCM/NEMO/OPA_SRC/OBS/obs_oper.F90	(revision 5978)
+++ branches/2015/dev_MetOffice_merge_2015/NEMOGCM/NEMO/OPA_SRC/OBS/obs_oper.F90	(revision 5979)
@@ -331,5 +331,5 @@
             zobsk(:) = obfillflt
 
-	    IF ( ANY (idailyavtypes(:) == prodatqc%ntyp(jobs)) ) THEN
+         IF ( ANY (idailyavtypes(:) == prodatqc%ntyp(jobs)) ) THEN
 
                IF ( idayend == 0 )  THEN
@@ -464,5 +464,5 @@
 
    SUBROUTINE obs_pro_sco_opt( prodatqc, kt, kpi, kpj, kpk, kit000, kdaystp, & 
-      &                    ptn, psn, pgdept, ptmask, k1dint, k2dint, & 
+      &                    ptn, psn, pgdept, pgdepw, ptmask, k1dint, k2dint, & 
       &                    kdailyavtypes ) 
       !!----------------------------------------------------------------------- 
@@ -548,5 +548,6 @@
          & ptmask       ! Land-sea mask 
       REAL(KIND=wp), INTENT(IN), DIMENSION(kpi,jpj,kpk) :: & 
-         & pgdept       ! Model array of depth levels 
+         & pgdept       ! Model array of depth T levels 
+         & pgdepw       ! Model array of depth W levels 
       INTEGER, DIMENSION(imaxavtypes), OPTIONAL :: & 
          & kdailyavtypes   ! Types for daily averages 
@@ -681,4 +682,8 @@
          igrdj(2,2,iobs) = prodatqc%mj(jobs,1) 
       END DO 
+     
+      ! Initialise depth arrays
+      zgdept = 0.0
+      zgdepw = 0.0
  
       CALL obs_int_comm_2d( 2, 2, ipro, igrdi, igrdj, glamt, zglam ) 
@@ -687,7 +692,7 @@
       CALL obs_int_comm_3d( 2, 2, ipro, kpk, igrdi, igrdj, ptn,   zintt ) 
       CALL obs_int_comm_3d( 2, 2, ipro, kpk, igrdi, igrdj, psn,   zints ) 
-      CALL obs_int_comm_3d( 2, 2, ipro, kpk, igrdi, igrdj, fsdept(:,:,:), & 
+      CALL obs_int_comm_3d( 2, 2, ipro, kpk, igrdi, igrdj, pgdept(:,:,:), & 
         &                     zgdept ) 
-      CALL obs_int_comm_3d( 2, 2, ipro, kpk, igrdi, igrdj, fsdepw(:,:,:), & 
+      CALL obs_int_comm_3d( 2, 2, ipro, kpk, igrdi, igrdj, pgdepw(:,:,:), & 
         &                     zgdepw ) 
  
@@ -780,19 +785,19 @@
                            IF ( k1dint == 1 ) THEN 
                               CALL obs_int_z1d_spl( kpk, & 
-                                 &     zinmt(iin,ijn,:,jobs), & 
-                                 &     zobs2k, zgdept(iin,ijn,:,jobs), & 
-                                 &     zmask(iin,ijn,:,jobs)) 
+                                 &     zinmt(iin,ijn,:,iobs), & 
+                                 &     zobs2k, zgdept(iin,ijn,:,iobs), & 
+                                 &     zmask(iin,ijn,:,iobs)) 
                            ENDIF 
        
                            CALL obs_level_search(kpk, & 
-                              &    zgdept(iin,ijn,:,jobs), & 
+                              &    zgdept(iin,ijn,:,iobs), & 
                               &    inum_obs, prodatqc%var(1)%vdep(ista:iend), & 
                               &    iv_indic) 
                            CALL obs_int_z1d(kpk, iv_indic, k1dint, inum_obs, & 
                               &    prodatqc%var(1)%vdep(ista:iend), & 
-                              &    zinmt(iin,ijn,:,jobs), & 
+                              &    zinmt(iin,ijn,:,iobs), & 
                               &    zobs2k, interp_corner(iin,ijn,:), & 
-                              &    zgdept(iin,ijn,:,jobs), & 
-                              &    zmask(iin,ijn,:,jobs)) 
+                              &    zgdept(iin,ijn,:,iobs), & 
+                              &    zmask(iin,ijn,:,iobs)) 
        
                         ENDDO 
@@ -823,20 +828,20 @@
                         IF ( k1dint == 1 ) THEN 
                            CALL obs_int_z1d_spl( kpk, & 
-                              &    zintt(iin,ijn,:,jobs),& 
-                              &    zobs2k, zgdept(iin,ijn,:,jobs), & 
-                              &    zmask(iin,ijn,:,jobs)) 
+                              &    zintt(iin,ijn,:,iobs),& 
+                              &    zobs2k, zgdept(iin,ijn,:,iobs), & 
+                              &    zmask(iin,ijn,:,iobs)) 
   
                         ENDIF 
        
                         CALL obs_level_search(kpk, & 
-                            &        zgdept(iin,ijn,:,jobs),& 
+                            &        zgdept(iin,ijn,:,iobs),& 
                             &        inum_obs, prodatqc%var(1)%vdep(ista:iend), & 
                             &         iv_indic) 
                         CALL obs_int_z1d(kpk, iv_indic, k1dint, inum_obs,     & 
                             &          prodatqc%var(1)%vdep(ista:iend),     & 
-                            &          zintt(iin,ijn,:,jobs),            & 
+                            &          zintt(iin,ijn,:,iobs),            & 
                             &          zobs2k,interp_corner(iin,ijn,:), & 
-                            &          zgdept(iin,ijn,:,jobs),         & 
-                            &          zmask(iin,ijn,:,jobs) )      
+                            &          zgdept(iin,ijn,:,iobs),         & 
+                            &          zmask(iin,ijn,:,iobs) )      
          
                      ENDDO 
@@ -851,5 +856,7 @@
                DO ikn=1,inum_obs 
                   iend=ista+ikn-1 
-   
+
+                  l_zweig(:,:,1) = 0._wp 
+
                   ! This code forces the horizontal weights to be  
                   ! zero IF the observation is below the bottom of the  
@@ -861,9 +868,9 @@
      
                         depth_loop1: DO ik=kpk,2,-1 
-                           IF(zmask(iin,ijn,ik-1,jobs ) > 0.9 )THEN   
+                           IF(zmask(iin,ijn,ik-1,iobs ) > 0.9 )THEN   
                             
                               l_zweig(iin,ijn,1) = &  
                                  & zweig(iin,ijn,1) * & 
-                                 & MAX( SIGN(1._wp,(zgdepw(iin,ijn,ik,jobs) ) & 
+                                 & MAX( SIGN(1._wp,(zgdepw(iin,ijn,ik,iobs) ) & 
                                  &  - prodatqc%var(1)%vdep(iend)),0._wp) 
                             
@@ -899,6 +906,6 @@
                    
                      ! vertically interpolate all 4 corners 
-                     ista = prodatqc%npvsta(jobs,2) 
-                     iend = prodatqc%npvend(jobs,2) 
+                     ista = prodatqc%npvsta(iobs,2) 
+                     iend = prodatqc%npvend(iobs,2) 
                      inum_obs = iend - ista + 1 
                      ALLOCATE(interp_corner(2,2,inum_obs),iv_indic(inum_obs)) 
@@ -911,19 +918,19 @@
                            IF ( k1dint == 1 ) THEN 
                               CALL obs_int_z1d_spl( kpk, & 
-                                 &     zinms(iin,ijn,:,jobs), & 
-                                 &     zobs2k, zgdept(iin,ijn,:,jobs), & 
-                                 &     zmask(iin,ijn,:,jobs)) 
+                                 &     zinms(iin,ijn,:,iobs), & 
+                                 &     zobs2k, zgdept(iin,ijn,:,iobs), & 
+                                 &     zmask(iin,ijn,:,iobs)) 
                            ENDIF 
        
                            CALL obs_level_search(kpk, & 
-                              &    zgdept(iin,ijn,:,jobs), & 
+                              &    zgdept(iin,ijn,:,iobs), & 
                               &    inum_obs, prodatqc%var(2)%vdep(ista:iend), & 
                               &    iv_indic) 
                            CALL obs_int_z1d(kpk, iv_indic, k1dint, inum_obs, & 
                               &    prodatqc%var(2)%vdep(ista:iend), & 
-                              &    zinms(iin,ijn,:,jobs), & 
+                              &    zinms(iin,ijn,:,iobs), & 
                               &    zobs2k, interp_corner(iin,ijn,:), & 
-                              &    zgdept(iin,ijn,:,jobs), & 
-                              &    zmask(iin,ijn,:,jobs)) 
+                              &    zgdept(iin,ijn,:,iobs), & 
+                              &    zmask(iin,ijn,:,iobs)) 
        
                         ENDDO 
@@ -955,20 +962,20 @@
                         IF ( k1dint == 1 ) THEN 
                            CALL obs_int_z1d_spl( kpk, & 
-                              &    zints(iin,ijn,:,jobs),& 
-                              &    zobs2k, zgdept(iin,ijn,:,jobs), & 
-                              &    zmask(iin,ijn,:,jobs)) 
+                              &    zints(iin,ijn,:,iobs),& 
+                              &    zobs2k, zgdept(iin,ijn,:,iobs), & 
+                              &    zmask(iin,ijn,:,iobs)) 
   
                         ENDIF 
        
                         CALL obs_level_search(kpk, & 
-                           &        zgdept(iin,ijn,:,jobs),& 
+                           &        zgdept(iin,ijn,:,iobs),& 
                            &        inum_obs, prodatqc%var(2)%vdep(ista:iend), & 
                            &         iv_indic) 
                         CALL obs_int_z1d(kpk, iv_indic, k1dint, inum_obs,  & 
                            &          prodatqc%var(2)%vdep(ista:iend),     & 
-                           &          zints(iin,ijn,:,jobs),               & 
+                           &          zints(iin,ijn,:,iobs),               & 
                            &          zobs2k,interp_corner(iin,ijn,:),     & 
-                           &          zgdept(iin,ijn,:,jobs),              & 
-                           &          zmask(iin,ijn,:,jobs) )      
+                           &          zgdept(iin,ijn,:,iobs),              & 
+                           &          zmask(iin,ijn,:,iobs) )      
          
                      ENDDO 
@@ -983,4 +990,6 @@
                DO ikn=1,inum_obs 
                   iend=ista+ikn-1 
+
+                  l_zweig(:,:,1) = 0._wp
    
                   ! This code forces the horizontal weights to be  
@@ -993,9 +1002,9 @@
      
                         depth_loop2: DO ik=kpk,2,-1 
-                           IF(zmask(iin,ijn,ik-1,jobs ) > 0.9 )THEN   
+                           IF(zmask(iin,ijn,ik-1,iobs ) > 0.9 )THEN   
                             
                               l_zweig(iin,ijn,1) = &  
                                  &  zweig(iin,ijn,1) * & 
-                                 &  MAX( SIGN(1._wp,(zgdepw(iin,ijn,ik,jobs) ) & 
+                                 &  MAX( SIGN(1._wp,(zgdepw(iin,ijn,ik,iobs) ) & 
                                  &  - prodatqc%var(2)%vdep(iend)),0._wp) 
                             
@@ -1029,5 +1038,7 @@
          & zmask, & 
          & zintt, & 
-         & zints  & 
+         & zints, & 
+         & zgdept,&
+         & zgdepw &
          & ) 
       ! At the end of the day also get interpolated means 
