1 | MODULE off_oper |
---|
2 | !!---------------------------------------------------------------------- |
---|
3 | !! *** MODULE off_oper *** |
---|
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 off_data |
---|
14 | USE off_read |
---|
15 | CONTAINS |
---|
16 | SUBROUTINE off_oper_init |
---|
17 | !!---------------------------------------------------------------------- |
---|
18 | !! *** SUBROUTINE off_oper_init *** |
---|
19 | !! |
---|
20 | !! ** Purpose : To initialise the model as if it were running online. |
---|
21 | !! |
---|
22 | !!---------------------------------------------------------------------- |
---|
23 | IMPLICIT NONE |
---|
24 | !! Initialise NEMO |
---|
25 | CALL nemo_init |
---|
26 | !! Initialise Offline obs_oper data |
---|
27 | CALL off_data_init( ln_cl4 ) |
---|
28 | END SUBROUTINE off_oper_init |
---|
29 | |
---|
30 | SUBROUTINE off_obs_oper |
---|
31 | !!---------------------------------------------------------------------- |
---|
32 | !! *** SUBROUTINE off_obs_oper *** |
---|
33 | !! |
---|
34 | !! ** Purpose : To use NEMO components to interpolate model fields |
---|
35 | !! to observation space. |
---|
36 | !! |
---|
37 | !!---------------------------------------------------------------------- |
---|
38 | IMPLICIT NONE |
---|
39 | !! Initialise offline obs_oper |
---|
40 | CALL off_oper_init |
---|
41 | !! Loop over various model counterparts |
---|
42 | DO jimatch = 1, cl4_match_len |
---|
43 | IF (jimatch .GT. 1) THEN |
---|
44 | !! Initialise obs_oper |
---|
45 | CALL dia_obs_init |
---|
46 | END IF |
---|
47 | !! Interpolate to observation space |
---|
48 | CALL off_oper_interp |
---|
49 | !! Pipe to output files |
---|
50 | CALL dia_obs_wri |
---|
51 | !! Reset the obs_oper |
---|
52 | CALL dia_obs_dealloc |
---|
53 | END DO |
---|
54 | !! Safely stop MPI |
---|
55 | CALL off_oper_stop |
---|
56 | END SUBROUTINE off_obs_oper |
---|
57 | |
---|
58 | SUBROUTINE off_oper_interp |
---|
59 | !!---------------------------------------------------------------------- |
---|
60 | !! *** SUBROUTINE off_oper_interp *** |
---|
61 | !! |
---|
62 | !! ** Purpose : To interpolate the model as if it were running online. |
---|
63 | !! |
---|
64 | !! ** Method : 1. Populate model counterparts |
---|
65 | !! 2. Call dia_obs at appropriate time steps |
---|
66 | !!---------------------------------------------------------------------- |
---|
67 | IMPLICIT NONE |
---|
68 | INTEGER :: istp ! time step index |
---|
69 | !! Loop over entire run |
---|
70 | istp = nit000 |
---|
71 | nstop = 0 |
---|
72 | DO WHILE ( istp <= nitend .AND. nstop == 0 ) |
---|
73 | IF (jifile <= n_files + 1) THEN |
---|
74 | IF ( MOD(istp, nn_off_freq) == nit000 ) THEN |
---|
75 | !! Read next model counterpart |
---|
76 | CALL off_rea_dri(jifile) |
---|
77 | jifile = jifile + 1 |
---|
78 | ENDIF |
---|
79 | !! Interpolate single time step |
---|
80 | CALL dia_obs(istp) |
---|
81 | ENDIF |
---|
82 | !! Increment model step |
---|
83 | istp = istp + 1 |
---|
84 | END DO |
---|
85 | END SUBROUTINE off_oper_interp |
---|
86 | |
---|
87 | SUBROUTINE off_oper_stop |
---|
88 | !!---------------------------------------------------------------------- |
---|
89 | !! *** SUBROUTINE off_oper_stop *** |
---|
90 | !! |
---|
91 | !! ** Purpose : To finalise the model as if it were running online. |
---|
92 | !! |
---|
93 | !!---------------------------------------------------------------------- |
---|
94 | IMPLICIT NONE |
---|
95 | IF(lk_mpp) CALL mppstop ! end mpp communications |
---|
96 | END SUBROUTINE off_oper_stop |
---|
97 | |
---|
98 | END MODULE off_oper |
---|