Index: anches/2013/dev_r3987_UKMO4_OBS/NEMOGCM/NEMO/OOO_SRC/namelist
===================================================================
--- /branches/2013/dev_r3987_UKMO4_OBS/NEMOGCM/NEMO/OOO_SRC/namelist	(revision 4119)
+++ 	(revision )
@@ -1,44 +1,0 @@
-
-!----------------------------------------------------------------------
-!       namoff Offline obs_oper namelist
-!----------------------------------------------------------------------
-!   ooo_files     specifies the files containing the model counterpart
-!   nn_ooo_idx    specifies the index within the model file
-!   nn_ooo_freq   specifies the number of timesteps between file reads
-&namoff
-   ooo_files = 'fcst.0.nc'
-   nn_ooo_idx = 1
-/
-!----------------------------------------------------------------------
-!       namcl4 Class 4 obs_oper namelist
-!----------------------------------------------------------------------
-!   cl4_date      the verfication date of the class 4 file
-!   cl4_vars      the name of the variable in the class 4 file
-!   cl4_sys       the forecast system being used e.g. FOAM
-!   cl4_cfg       the model configuration being used e.g. amm7
-!   cl4_vn        the version number e.g. 12.0
-!   cl4_prefix    prefix which denotes the output file
-!   cl4_contact   email address of file creator
-!   cl4_inst      institution related to the data within the file
-!   cl4_leadtime  lead time axis of class 4 file
-!   cl4_fcst_idx  output file forecast index
-!   cl4_fcst_len  output file forecast dimension length
-!   cl4_match_len number of match types
-!
-&namcl4
-   cl4_leadtime = 12
-   cl4_fcst_idx = 1
-   cl4_fcst_len = 1
-   cl4_match_len = 1
-   cl4_date = '20130101'
-   cl4_vars = 'forecast'
-   cl4_sys = 'FOAM'
-   cl4_cfg = 'amm7'
-   cl4_vn = '12.0'
-   cl4_prefix = 'class4'
-   cl4_contact = ''
-   cl4_inst = 'UK Met Office'
-/
-
-
-
Index: anches/2013/dev_r3987_UKMO4_OBS/NEMOGCM/NEMO/OOO_SRC/nemo.f90
===================================================================
--- /branches/2013/dev_r3987_UKMO4_OBS/NEMOGCM/NEMO/OOO_SRC/nemo.f90	(revision 4119)
+++ 	(revision )
@@ -1,12 +1,0 @@
-PROGRAM nemo
-   USE ooomod
-   IMPLICIT NONE
-   !!----------------------------------------------------------------------
-   !!                    ***  PROGRAM offline_obs_oper ***
-   !!
-   !! ** Purpose : To map model fields to the equivalent observation
-   !!              location.
-   !!----------------------------------------------------------------------
-   CALL offline_obs_oper
-END PROGRAM nemo
-
Index: /branches/2013/dev_r3987_UKMO4_OBS/NEMOGCM/NEMO/OOO_SRC/nemogcm.F90
===================================================================
--- /branches/2013/dev_r3987_UKMO4_OBS/NEMOGCM/NEMO/OOO_SRC/nemogcm.F90	(revision 4119)
+++ /branches/2013/dev_r3987_UKMO4_OBS/NEMOGCM/NEMO/OOO_SRC/nemogcm.F90	(revision 4120)
@@ -63,8 +63,12 @@
    USE xios
 #endif
+   USE ooo_data        ! Offline obs_oper data
+   USE ooo_read        ! Offline obs_oper read routines
+   USE ooo_intp        ! Offline obs_oper interpolation
 
    IMPLICIT NONE
    PRIVATE
 
+   PUBLIC   nemo_gcm    ! called by nemo.f90
    PUBLIC   nemo_init   ! needed by AGRIF
    PUBLIC   nemo_alloc  ! needed by TAM
@@ -79,4 +83,39 @@
 CONTAINS
 
+   SUBROUTINE nemo_gcm
+         !!----------------------------------------------------------------------
+         !!                    ***  SUBROUTINE offline_obs_oper ***
+         !!
+         !! ** Purpose : To use NEMO components to interpolate model fields
+         !!              to observation space.
+         !!
+         !! ** Method : 1. Initialise NEMO
+         !!             2. Initialise offline obs_oper
+         !!             3. Cycle through match ups
+         !!             4. Write results to file
+         !!
+         !!----------------------------------------------------------------------
+         !! Class 4 output stream switch
+         USE obs_fbm, ONLY: ln_cl4
+         !! Initialise NEMO
+         CALL nemo_init
+         !! Initialise Offline obs_oper data
+         CALL ooo_data_init( ln_cl4 )
+         !! Loop over various model counterparts
+         DO jimatch = 1, cl4_match_len
+            IF (jimatch .GT. 1) THEN
+               !! Initialise obs_oper
+               CALL dia_obs_init
+            END IF
+            !! Interpolate to observation space
+            CALL ooo_interp
+            !! Pipe to output files
+            CALL dia_obs_wri
+            !! Reset the obs_oper between
+            CALL dia_obs_dealloc
+         END DO
+         !! Safely stop MPI
+         IF(lk_mpp) CALL mppstop  ! end mpp communications
+   END SUBROUTINE nemo_gcm
 
    SUBROUTINE nemo_init
Index: /branches/2013/dev_r3987_UKMO4_OBS/NEMOGCM/NEMO/OOO_SRC/ooo.nml
===================================================================
--- /branches/2013/dev_r3987_UKMO4_OBS/NEMOGCM/NEMO/OOO_SRC/ooo.nml	(revision 4120)
+++ /branches/2013/dev_r3987_UKMO4_OBS/NEMOGCM/NEMO/OOO_SRC/ooo.nml	(revision 4120)
@@ -0,0 +1,44 @@
+
+!----------------------------------------------------------------------
+!       namoff Offline obs_oper namelist
+!----------------------------------------------------------------------
+!   ooo_files     specifies the files containing the model counterpart
+!   nn_ooo_idx    specifies the index within the model file
+!   nn_ooo_freq   specifies the number of timesteps between file reads
+&namoff
+   ooo_files = 'fcst.0.nc'
+   nn_ooo_idx = 1
+/
+!----------------------------------------------------------------------
+!       namcl4 Class 4 obs_oper namelist
+!----------------------------------------------------------------------
+!   cl4_date      the verfication date of the class 4 file
+!   cl4_vars      the name of the variable in the class 4 file
+!   cl4_sys       the forecast system being used e.g. FOAM
+!   cl4_cfg       the model configuration being used e.g. amm7
+!   cl4_vn        the version number e.g. 12.0
+!   cl4_prefix    prefix which denotes the output file
+!   cl4_contact   email address of file creator
+!   cl4_inst      institution related to the data within the file
+!   cl4_leadtime  lead time axis of class 4 file
+!   cl4_fcst_idx  output file forecast index
+!   cl4_fcst_len  output file forecast dimension length
+!   cl4_match_len number of match types
+!
+&namcl4
+   cl4_leadtime = 12
+   cl4_fcst_idx = 1
+   cl4_fcst_len = 1
+   cl4_match_len = 1
+   cl4_date = '20130101'
+   cl4_vars = 'forecast'
+   cl4_sys = 'FOAM'
+   cl4_cfg = 'amm7'
+   cl4_vn = '12.0'
+   cl4_prefix = 'class4'
+   cl4_contact = ''
+   cl4_inst = 'UK Met Office'
+/
+
+
+
Index: /branches/2013/dev_r3987_UKMO4_OBS/NEMOGCM/NEMO/OOO_SRC/ooo_intp.F90
===================================================================
--- /branches/2013/dev_r3987_UKMO4_OBS/NEMOGCM/NEMO/OOO_SRC/ooo_intp.F90	(revision 4120)
+++ /branches/2013/dev_r3987_UKMO4_OBS/NEMOGCM/NEMO/OOO_SRC/ooo_intp.F90	(revision 4120)
@@ -0,0 +1,48 @@
+MODULE ooo_intp
+   !!======================================================================
+   !!                    ***  MODULE ooo_intp ***
+   !! ** Purpose : Run NEMO observation operator in offline mode
+   !!======================================================================
+   !! NEMO modules
+   USE in_out_manager
+   USE diaobs
+   !! Offline obs_oper modules
+   USE ooo_read
+   USE ooo_data
+
+   IMPLICIT NONE
+   PRIVATE
+
+   PUBLIC ooo_interp
+
+   CONTAINS
+
+      SUBROUTINE ooo_interp
+         !!----------------------------------------------------------------------
+         !!                    ***  SUBROUTINE ooo_interp ***
+         !!
+         !! ** Purpose : To interpolate the model as if it were running online.
+         !!
+         !! ** Method : 1. Populate model counterparts
+         !!             2. Call dia_obs at appropriate time steps
+         !!----------------------------------------------------------------------
+         INTEGER :: istp ! time step index
+         !! Loop over entire run
+         istp = nit000
+         nstop = 0
+         DO WHILE ( istp <= nitend .AND. nstop == 0 )
+            IF (jifile <= n_files + 1) THEN
+               IF ( MOD(istp, nn_ooo_freq) == nit000 ) THEN
+                  !! Read next model counterpart
+                  CALL ooo_rea_dri(jifile)
+                  jifile = jifile + 1
+               ENDIF
+               !! Interpolate single time step
+               CALL dia_obs(istp)
+            ENDIF
+            !! Increment model step
+            istp = istp + 1
+         END DO
+      END SUBROUTINE ooo_interp
+
+END MODULE ooo_intp
Index: anches/2013/dev_r3987_UKMO4_OBS/NEMOGCM/NEMO/OOO_SRC/ooomod.F90
===================================================================
--- /branches/2013/dev_r3987_UKMO4_OBS/NEMOGCM/NEMO/OOO_SRC/ooomod.F90	(revision 4119)
+++ 	(revision )
@@ -1,80 +1,0 @@
-MODULE ooomod
-   !!======================================================================
-   !!                    ***  MODULE ooo ***
-   !! ** Purpose : Run NEMO observation operator in offline mode
-   !!======================================================================
-   !! NEMO modules
-   USE diaobs
-   USE nemogcm
-   USE lib_mpp
-   USE in_out_manager
-   USE obs_fbm, ONLY: ln_cl4
-   !! Offline obs_oper modules
-   USE ooo_data
-   USE ooo_read
-
-   IMPLICIT NONE
-   PRIVATE
-
-   PUBLIC offline_obs_oper
-
-   CONTAINS
-
-      SUBROUTINE offline_obs_oper
-         !!----------------------------------------------------------------------
-         !!                    ***  SUBROUTINE offline_obs_oper ***
-         !!
-         !! ** Purpose : To use NEMO components to interpolate model fields
-         !!              to observation space.
-         !!
-         !!----------------------------------------------------------------------
-         !! Initialise NEMO
-         CALL nemo_init
-         !! Initialise Offline obs_oper data
-         CALL ooo_data_init( ln_cl4 )
-         !! Loop over various model counterparts
-         DO jimatch = 1, cl4_match_len
-            IF (jimatch .GT. 1) THEN
-               !! Initialise obs_oper
-               CALL dia_obs_init
-            END IF
-            !! Interpolate to observation space
-            CALL ooo_interp
-            !! Pipe to output files
-            CALL dia_obs_wri
-            !! Reset the obs_oper between
-            CALL dia_obs_dealloc
-         END DO
-         !! Safely stop MPI
-         IF(lk_mpp) CALL mppstop  ! end mpp communications
-      END SUBROUTINE offline_obs_oper
-
-      SUBROUTINE ooo_interp
-         !!----------------------------------------------------------------------
-         !!                    ***  SUBROUTINE ooo_interp ***
-         !!
-         !! ** Purpose : To interpolate the model as if it were running online.
-         !!
-         !! ** Method : 1. Populate model counterparts
-         !!             2. Call dia_obs at appropriate time steps
-         !!----------------------------------------------------------------------
-         INTEGER :: istp ! time step index
-         !! Loop over entire run
-         istp = nit000
-         nstop = 0
-         DO WHILE ( istp <= nitend .AND. nstop == 0 )
-            IF (jifile <= n_files + 1) THEN
-               IF ( MOD(istp, nn_ooo_freq) == nit000 ) THEN
-                  !! Read next model counterpart
-                  CALL ooo_rea_dri(jifile)
-                  jifile = jifile + 1
-               ENDIF
-               !! Interpolate single time step
-               CALL dia_obs(istp)
-            ENDIF
-            !! Increment model step
-            istp = istp + 1
-         END DO
-      END SUBROUTINE ooo_interp
-
-END MODULE ooomod
