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 5682)
+++ 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
