Index: branches/UKMO/dev_r4650_general_vert_coord_obsoper/NEMOGCM/NEMO/OPA_SRC/OBS/diaobs.F90
===================================================================
--- branches/UKMO/dev_r4650_general_vert_coord_obsoper/NEMOGCM/NEMO/OPA_SRC/OBS/diaobs.F90	(revision 5996)
+++ branches/UKMO/dev_r4650_general_vert_coord_obsoper/NEMOGCM/NEMO/OPA_SRC/OBS/diaobs.F90	(revision 6016)
@@ -1063,5 +1063,8 @@
       IF ( ln_t3d .OR. ln_s3d ) THEN
          DO jprofset = 1, nprofsets
-            IF( ln_zco .OR. ln_zps ) THEN 
+            IF( (.NOT. lk_vvl) .AND. (ln_zco .OR. ln_zps) ) THEN 
+               IF(lwp) THEN
+                  WRITE(numout,*) 'dia_obs : calling obs_pro_opt'
+               ENDIF
                IF ( ld_enact(jprofset) ) THEN 
                   CALL obs_pro_opt( prodatqc(jprofset),                     & 
@@ -1077,9 +1080,13 @@
                ENDIF 
             ELSE
+               IF(lwp) THEN
+                  WRITE(numout,*) 'dia_obs : calling obs_pro_sco_opt'
+               ENDIF
                IF ( ld_enact(jprofset) ) THEN 
                   CALL obs_pro_sco_opt( prodatqc(jprofset),                 & 
                      &              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 +1094,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/UKMO/dev_r4650_general_vert_coord_obsoper/NEMOGCM/NEMO/OPA_SRC/OBS/obs_oper.F90
===================================================================
--- branches/UKMO/dev_r4650_general_vert_coord_obsoper/NEMOGCM/NEMO/OPA_SRC/OBS/obs_oper.F90	(revision 5996)
+++ branches/UKMO/dev_r4650_general_vert_coord_obsoper/NEMOGCM/NEMO/OPA_SRC/OBS/obs_oper.F90	(revision 6016)
@@ -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 ) 
       !!----------------------------------------------------------------------- 
@@ -547,6 +547,7 @@
          & psn,    &    ! Model salinity field 
          & ptmask       ! Land-sea mask 
-      REAL(KIND=wp), INTENT(IN), DIMENSION(kpi,jpj,kpk) :: & 
-         & pgdept       ! Model array of depth levels 
+      REAL(KIND=wp), INTENT(IN), DIMENSION(kpi,kpj,kpk) :: & 
+         & pgdept, &       ! Model array of depth T levels 
+         & pgdepw       ! Model array of depth W levels 
       INTEGER, DIMENSION(imaxavtypes), OPTIONAL :: & 
          & kdailyavtypes   ! Types for daily averages 
@@ -682,4 +683,8 @@
       END DO 
  
+      ! Initiialise depth arrays
+      zgdept = 0.0
+      zgdepw = 0.0
+      
       CALL obs_int_comm_2d( 2, 2, ipro, igrdi, igrdj, glamt, zglam ) 
       CALL obs_int_comm_2d( 2, 2, ipro, igrdi, igrdj, gphit, zgphi ) 
@@ -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 
@@ -850,5 +855,7 @@
              
                DO ikn=1,inum_obs 
-                  iend=ista+ikn-1 
+                  iend=ista+ikn-1
+                  
+                  l_zweig(:,:,1) = 0._wp 
    
                   ! This code forces the horizontal weights to be  
@@ -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) 
                             
@@ -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 
@@ -982,5 +989,7 @@
              
                DO ikn=1,inum_obs 
-                  iend=ista+ikn-1 
+                  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 
