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 7960)
+++ branches/UKMO/dev_r5518_obs_oper_update/NEMOGCM/NEMO/OPA_SRC/OBS/obs_surf_def.F90	(revision 7992)
@@ -50,4 +50,5 @@
       INTEGER :: npj
       INTEGER :: nsurfup    !: Observation counter used in obs_oper
+      INTEGER :: nrec       !: Number of surface observation records in window
 
       ! Arrays with size equal to the number of surface observations
@@ -56,4 +57,5 @@
          & mi,   &        !: i-th grid coord. for interpolating to surface observation
          & mj,   &        !: j-th grid coord. for interpolating to surface observation
+         & mt,   &        !: time record number for gridded data
          & nsidx,&        !: Surface observation number
          & nsfil,&        !: Surface observation number in file
@@ -67,4 +69,7 @@
          & ntyp           !: Type of surface observation product
 
+      CHARACTER(len=8), POINTER, DIMENSION(:) :: &
+         & cvars          !: Variable names
+
       CHARACTER(LEN=8), POINTER, DIMENSION(:) :: &
          & cwmo           !: WMO indentifier
@@ -90,4 +95,8 @@
          & nsstpmpp       !: Global number of surface observations per time step
 
+      ! Arrays with size equal to the number of observation records in the window
+      INTEGER, POINTER, DIMENSION(:) :: &
+         & mrecstp   ! Time step of the records
+
       ! Arrays used to store source indices when 
       ! compressing obs_surf derived types
@@ -97,4 +106,8 @@
       INTEGER, POINTER, DIMENSION(:) :: &
          & nsind          !: Source indices of surface data in compressed data
+
+      ! Is this a gridded product?
+     
+      LOGICAL :: lgrid
 
    END TYPE obs_surf
@@ -130,4 +143,5 @@
       !!* Local variables
       INTEGER :: ji
+      INTEGER :: jvar
 
       ! Set bookkeeping variables
@@ -140,4 +154,14 @@
       surf%npi      = kpi
       surf%npj      = kpj
+
+      ! Allocate arrays of size number of variables
+
+      ALLOCATE( &
+         & surf%cvars(kvar)    &
+         & )
+
+      DO jvar = 1, kvar
+         surf%cvars(jvar) = "NotSet"
+      END DO
       
       ! Allocate arrays of number of surface data size
@@ -146,4 +170,5 @@
          & surf%mi(ksurf),      &
          & surf%mj(ksurf),      &
+         & surf%mt(ksurf),      &
          & surf%nsidx(ksurf),   &
          & surf%nsfil(ksurf),   &
@@ -162,4 +187,6 @@
          & )
 
+      surf%mt(:) = -1
+
 
       ! Allocate arrays of number of surface data size * number of variables
@@ -176,4 +203,6 @@
          & )
 
+      surf%rext(:,:) = 0.0_wp 
+
       ! Allocate arrays of number of time step size
 
@@ -203,4 +232,8 @@
 
       surf%nsurfup     = 0
+      
+      ! Not gridded by default
+          
+      surf%lgrid       = .FALSE.
               
    END SUBROUTINE obs_surf_alloc
@@ -228,4 +261,5 @@
          & surf%mi,      &
          & surf%mj,      &
+         & surf%mt,      &
          & surf%nsidx,   &
          & surf%nsfil,   &
@@ -269,4 +303,10 @@
          & surf%nsstp,     &
          & surf%nsstpmpp   &
+         & )
+
+      ! Dellocate arrays of size number of variables
+
+      DEALLOCATE( &
+         & surf%cvars     &
          & )
 
@@ -350,4 +390,5 @@
             newsurf%mi(insurf)    = surf%mi(ji)
             newsurf%mj(insurf)    = surf%mj(ji)
+            newsurf%mt(insurf)    = surf%mt(ji)
             newsurf%nsidx(insurf) = surf%nsidx(ji)
             newsurf%nsfil(insurf) = surf%nsfil(ji)
@@ -392,5 +433,10 @@
       ! Set book keeping variables which do not depend on number of obs.
 
-      newsurf%nstp  = surf%nstp
+      newsurf%nstp     = surf%nstp
+      newsurf%cvars(:) = surf%cvars(:)
+      
+      ! Set gridded stuff
+      
+      newsurf%mt(insurf)    = surf%mt(ji)
  
       ! Deallocate temporary data
@@ -433,4 +479,5 @@
          oldsurf%mi(jj)    = surf%mi(ji)
          oldsurf%mj(jj)    = surf%mj(ji)
+         oldsurf%mt(jj)    = surf%mt(ji)
          oldsurf%nsidx(jj) = surf%nsidx(ji)
          oldsurf%nsfil(jj) = surf%nsfil(ji)
