New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
ooomod.F90 in branches/2013/dev_r3987_UKMO4_OBS/NEMOGCM/NEMO/OOO_SRC – NEMO

source: branches/2013/dev_r3987_UKMO4_OBS/NEMOGCM/NEMO/OOO_SRC/ooomod.F90 @ 4118

Last change on this file since 4118 was 4118, checked in by andrewryan, 11 years ago

refactored ooomod to reduce number of subroutines

File size: 2.7 KB
Line 
1MODULE ooomod
2   !!======================================================================
3   !!                    ***  MODULE ooo ***
4   !! ** Purpose : Run NEMO observation operator in offline mode
5   !!======================================================================
6   !! NEMO modules
7   USE diaobs
8   USE nemogcm
9   USE lib_mpp
10   USE in_out_manager
11   USE obs_fbm, ONLY: ln_cl4
12   !! Offline obs_oper modules
13   USE ooo_data
14   USE ooo_read
15
16   IMPLICIT NONE
17   PRIVATE
18
19   PUBLIC offline_obs_oper
20
21   CONTAINS
22
23      SUBROUTINE offline_obs_oper
24         !!----------------------------------------------------------------------
25         !!                    ***  SUBROUTINE offline_obs_oper ***
26         !!
27         !! ** Purpose : To use NEMO components to interpolate model fields
28         !!              to observation space.
29         !!
30         !!----------------------------------------------------------------------
31         !! Initialise NEMO
32         CALL nemo_init
33         !! Initialise Offline obs_oper data
34         CALL ooo_data_init( ln_cl4 )
35         !! Loop over various model counterparts
36         DO jimatch = 1, cl4_match_len
37            IF (jimatch .GT. 1) THEN
38               !! Initialise obs_oper
39               CALL dia_obs_init
40            END IF
41            !! Interpolate to observation space
42            CALL ooo_interp
43            !! Pipe to output files
44            CALL dia_obs_wri
45            !! Reset the obs_oper between
46            CALL dia_obs_dealloc
47         END DO
48         !! Safely stop MPI
49         IF(lk_mpp) CALL mppstop  ! end mpp communications
50      END SUBROUTINE offline_obs_oper
51
52      SUBROUTINE ooo_interp
53         !!----------------------------------------------------------------------
54         !!                    ***  SUBROUTINE ooo_interp ***
55         !!
56         !! ** Purpose : To interpolate the model as if it were running online.
57         !!
58         !! ** Method : 1. Populate model counterparts
59         !!             2. Call dia_obs at appropriate time steps
60         !!----------------------------------------------------------------------
61         INTEGER :: istp ! time step index
62         !! Loop over entire run
63         istp = nit000
64         nstop = 0
65         DO WHILE ( istp <= nitend .AND. nstop == 0 )
66            IF (jifile <= n_files + 1) THEN
67               IF ( MOD(istp, nn_ooo_freq) == nit000 ) THEN
68                  !! Read next model counterpart
69                  CALL ooo_rea_dri(jifile)
70                  jifile = jifile + 1
71               ENDIF
72               !! Interpolate single time step
73               CALL dia_obs(istp)
74            ENDIF
75            !! Increment model step
76            istp = istp + 1
77         END DO
78      END SUBROUTINE ooo_interp
79
80END MODULE ooomod
Note: See TracBrowser for help on using the repository browser.