Index: /branches/UKMO/dev_r5518_obs_oper_update/NEMOGCM/NEMO/OPA_SRC/OBS/obs_read_surf.F90
===================================================================
--- /branches/UKMO/dev_r5518_obs_oper_update/NEMOGCM/NEMO/OPA_SRC/OBS/obs_read_surf.F90	(revision 9307)
+++ /branches/UKMO/dev_r5518_obs_oper_update/NEMOGCM/NEMO/OPA_SRC/OBS/obs_read_surf.F90	(revision 9308)
@@ -97,4 +97,5 @@
       INTEGER :: ios
       INTEGER :: ioserrcount
+      INTEGER :: iextr
       INTEGER, PARAMETER :: jpsurfmaxtype = 1024
       INTEGER, DIMENSION(knumfiles) :: irefdate
@@ -108,5 +109,6 @@
          & iindx,    &
          & ifileidx, &
-         & isurfidx
+         & isurfidx, &
+         & iadd_std
       REAL(wp), DIMENSION(:), ALLOCATABLE :: &
          & zphi, &
@@ -122,6 +124,6 @@
 
       ! Local initialization
-      iobs = 0
-
+      iobs  = 0
+      iextr = kextr
       !-----------------------------------------------------------------------
       ! Count the number of files needed and allocate the obfbdata type
@@ -131,4 +133,5 @@
 
       ALLOCATE( inpfiles(inobf) )
+      ALLOCATE( iadd_std(inobf) )
 
       surf_files : DO jj = 1, inobf
@@ -195,4 +198,21 @@
                   ENDIF
                END DO
+            ENDIF
+
+            iadd_std(jj) = -1
+            IF ( inpfiles(jj)%nadd > 0 ) THEN
+               DO ji = 1, inpfiles(jj)%nadd
+                  IF ( TRIM( inpfiles(jj)%caddname(ji) ) == 'STD' ) THEN
+                     iextr = kextr + 1
+                     iadd_std(jj) = ji
+                  ENDIF
+               END DO
+            ENDIF
+
+            IF(lwp) THEN
+               IF ( iadd_std(jj) /= -1 ) THEN
+                  WRITE(numout,*) ' STD variable available in input file so passing it through the obs oper'
+                  WRITE(numout,*)
+               ENDIF
             ENDIF
 
@@ -339,5 +359,5 @@
          &               iindx   )
 
-      CALL obs_surf_alloc( surfdata, iobs, kvars, kextr, kstp, jpi, jpj )
+      CALL obs_surf_alloc( surfdata, iobs, kvars, iextr, kstp, jpi, jpj )
 
       ! Read obs/positions, QC, all variable and assign to surfdata
@@ -345,4 +365,9 @@
       iobs = 0
       surfdata%cvars(:)  = clvars(:)
+      IF ( ldmod .AND. ( TRIM( surfdata%cvars(1) ) == 'SLA' ) ) THEN
+         surfdata%cext(1) = 'SSH'
+         surfdata%cext(2) = 'MDT'
+      ENDIF
+      IF ( iextr > kextr ) surfdata%cext(iextr) = 'STD'
 
       ityp   (:) = 0
@@ -426,5 +451,4 @@
                surfdata%robs(iobs,1) = inpfiles(jj)%pob(1,ji,1)
 
-
                ! Model and MDT is set to fbrmdi unless read from file
                IF ( ldmod ) THEN
@@ -437,4 +461,9 @@
                   surfdata%rmod(iobs,1) = fbrmdi
                   IF ( TRIM(surfdata%cvars(1)) == 'SLA' ) surfdata%rext(iobs,:) = fbrmdi
+               ENDIF
+
+               ! STD (obs error standard deviation) read from file and passed through obs operator
+               IF ( iadd_std(jj) /= -1 ) THEN
+                  surfdata%rext(iobs,iextr) = inpfiles(jj)%padd(1,ji,iadd_std(jj),1)
                ENDIF
             ENDIF
@@ -488,4 +517,5 @@
       END DO
       DEALLOCATE( inpfiles )
+      DEALLOCATE( iadd_std )
 
    END SUBROUTINE obs_rea_surf
Index: /branches/UKMO/dev_r5518_obs_oper_update/NEMOGCM/NEMO/OPA_SRC/OBS/obs_surf_def.F90
===================================================================
--- /branches/UKMO/dev_r5518_obs_oper_update/NEMOGCM/NEMO/OPA_SRC/OBS/obs_surf_def.F90	(revision 9307)
+++ /branches/UKMO/dev_r5518_obs_oper_update/NEMOGCM/NEMO/OPA_SRC/OBS/obs_surf_def.F90	(revision 9308)
@@ -71,4 +71,7 @@
       CHARACTER(len=8), POINTER, DIMENSION(:) :: &
          & cvars          !: Variable names
+
+      CHARACTER(len=8), POINTER, DIMENSION(:) :: &
+         & cext           !: Extra field names
 
       CHARACTER(LEN=8), POINTER, DIMENSION(:) :: &
@@ -200,8 +203,13 @@
 
       ALLOCATE( & 
-         & surf%rext(ksurf,kextra) &
+         & surf%rext(ksurf,kextra), &
+         & surf%cext(kextra)        &
          & )
 
       surf%rext(:,:) = 0.0_wp 
+
+      DO ji = 1, kextra
+         surf%cext(ji) = "NotSet"
+      END DO
 
       ! Allocate arrays of number of time step size
@@ -288,5 +296,6 @@
 
       DEALLOCATE( & 
-         & surf%rext &
+         & surf%rext, &
+         & surf%cext &
          & )
 
@@ -435,4 +444,5 @@
       newsurf%nstp     = surf%nstp
       newsurf%cvars(:) = surf%cvars(:)
+      newsurf%cext(:)  = surf%cext(:)
       
       ! Set gridded stuff
Index: /branches/UKMO/dev_r5518_obs_oper_update/NEMOGCM/NEMO/OPA_SRC/OBS/obs_write.F90
===================================================================
--- /branches/UKMO/dev_r5518_obs_oper_update/NEMOGCM/NEMO/OPA_SRC/OBS/obs_write.F90	(revision 9307)
+++ /branches/UKMO/dev_r5518_obs_oper_update/NEMOGCM/NEMO/OPA_SRC/OBS/obs_write.F90	(revision 9308)
@@ -418,4 +418,6 @@
       INTEGER :: iadd
       INTEGER :: iext
+      INTEGER :: indx_std
+      INTEGER :: iadd_std
 
       IF ( PRESENT( padd ) ) THEN
@@ -431,4 +433,15 @@
       ENDIF
 
+      iadd_std = 0
+      indx_std = -1
+      IF ( surfdata%nextra > 0 ) THEN
+         DO je = 1, surfdata%nextra
+           IF ( TRIM( surfdata%cext(je) ) == 'STD' ) THEN
+             iadd_std = 1
+             indx_std = je
+           ENDIF
+         END DO
+      ENDIF
+      
       CALL init_obfbdata( fbdata )
 
@@ -440,5 +453,5 @@
 
          CALL alloc_obfbdata( fbdata, 1, surfdata%nsurf, 1, &
-            &                 2 + iadd, 1 + iext, .TRUE. )
+            &                 2 + iadd + iadd_std, 1 + iext, .TRUE. )
 
          clfiletype = 'slafb'
@@ -461,7 +474,7 @@
          fbdata%cgrid(1)      = 'T'
          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)
+            fbdata%caddname(2+iadd_std+ja) = padd%cdname(ja)
+            fbdata%caddlong(2+iadd_std+ja,1) = padd%cdlong(ja,1)
+            fbdata%caddunit(2+iadd_std+ja,1) = padd%cdunit(ja,1)
          END DO
 
@@ -597,5 +610,5 @@
       
          CALL alloc_obfbdata( fbdata, 1, surfdata%nsurf, 1, &
-            &                 1 + iadd, iext, .TRUE. )
+            &                 1 + iadd + iadd_std, iext, .TRUE. )
 
          fbdata%cname(1)      = surfdata%cvars(1)
@@ -615,7 +628,7 @@
          fbdata%cgrid(1)      = clgrid
          DO ja = 1, iadd
-            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)
+            fbdata%caddname(1+iadd_std+ja) = padd%cdname(ja)
+            fbdata%caddlong(1+iadd_std+ja,1) = padd%cdlong(ja,1)
+            fbdata%caddunit(1+iadd_std+ja,1) = padd%cdunit(ja,1)
          END DO
 
@@ -623,5 +636,11 @@
       
       fbdata%caddname(1)   = 'Hx'
-
+      IF ( indx_std /= -1 ) THEN
+         IF ( TRIM(surfdata%cvars(1)) == 'SLA' ) iadd_std = iadd_std + 1
+         fbdata%caddname(1+iadd_std)   = surfdata%cext(indx_std)
+         fbdata%caddlong(1+iadd_std,1) = 'Obs error standard deviation'
+         fbdata%caddunit(1+iadd_std,1) = fbdata%cobunit(1)
+      ENDIF
+      
       WRITE(clfname, FMT="(A,'_fdbk_',I4.4,'.nc')") TRIM(clfiletype), nproc
 
@@ -688,6 +707,10 @@
          fbdata%iobsk(1,jo,1)  = 0
          IF ( TRIM(surfdata%cvars(1)) == 'SLA' ) fbdata%pext(1,jo,1) = surfdata%rext(jo,2)
+         IF ( indx_std /= -1 ) THEN
+            fbdata%padd(1,jo,1+iadd_std,1) = surfdata%rext(jo,indx_std)
+         ENDIF
+         
          DO ja = 1, iadd
-            fbdata%padd(1,jo,2+ja,1) = &
+            fbdata%padd(1,jo,2+iadd_std+ja,1) = &
                & surfdata%rext(jo,padd%ipoint(ja))
          END DO
