11 |
SUBROUTINE DO_STATEVARS_DIAGS( myTime, seqFlag, myIter, myThid ) |
SUBROUTINE DO_STATEVARS_DIAGS( myTime, seqFlag, myIter, myThid ) |
12 |
C !DESCRIPTION: \bv |
C !DESCRIPTION: \bv |
13 |
C *==========================================================* |
C *==========================================================* |
14 |
C | SUBROUTINE DO_STATEVARS_DIAGS |
C | SUBROUTINE DO_STATEVARS_DIAGS |
15 |
C | o Controlling routine for state variables diagnostics |
C | o Controlling routine for state variables diagnostics |
16 |
C *==========================================================* |
C *==========================================================* |
17 |
C | Computing diagnostics of the model state (state-variables) |
C | Computing diagnostics of the model state (state-variables) |
18 |
C | is done at this level ; |
C | is done at this level ; |
19 |
C | by contrast, other diagnostics (fluxes, tendencies) |
C | by contrast, other diagnostics (fluxes, tendencies) |
20 |
C | remain within the computation sequence. |
C | remain within the computation sequence. |
21 |
C *==========================================================* |
C *==========================================================* |
22 |
C \ev |
C \ev |
23 |
|
|
34 |
C seqFlag :: flag that indicate where this S/R is called from: |
C seqFlag :: flag that indicate where this S/R is called from: |
35 |
C :: =0 called from the beginning of forward_step |
C :: =0 called from the beginning of forward_step |
36 |
C :: =1 called from the middle of forward_step |
C :: =1 called from the middle of forward_step |
37 |
|
C :: =2 called from the end of forward_step |
38 |
C myIter :: Iteration number |
C myIter :: Iteration number |
39 |
C myThid :: Thread number for this instance of the routine. |
C myThid :: Thread number for this instance of the routine. |
40 |
_RL myTime |
_RL myTime |
50 |
C = 1 :: fill-in diagnostics for tracer variables only |
C = 1 :: fill-in diagnostics for tracer variables only |
51 |
C = 2 :: fill-in diagnostics for momentum variables only |
C = 2 :: fill-in diagnostics for momentum variables only |
52 |
C = 3 :: fill-in diagnostics for momentum & tracer variables |
C = 3 :: fill-in diagnostics for momentum & tracer variables |
53 |
|
C = 4 :: fill-in state variable tendency diagnostics the second time |
54 |
C bi,bj :: tile indices |
C bi,bj :: tile indices |
55 |
INTEGER selectVars |
INTEGER selectVars |
56 |
|
#if defined(ALLOW_THSICE) || defined(ALLOW_LAND) |
57 |
INTEGER bi, bj |
INTEGER bi, bj |
58 |
|
#endif |
59 |
|
|
60 |
C-- Fill-in Diagnostics pkg storage array (for state-variables) |
C-- Fill-in Diagnostics pkg storage array (for state-variables) |
61 |
IF ( usediagnostics ) THEN |
IF ( usediagnostics ) THEN |
62 |
|
|
63 |
C- select which group of state-var diagnostics to fill-in, |
C- select which group of state-var diagnostics to fill-in, |
64 |
C depending on: where this S/R is called from (seqFlag) |
C depending on: where this S/R is called from (seqFlag) |
65 |
C and stagger/synchronous TimeStep |
C and stagger/synchronous TimeStep |
66 |
selectVars = 0 |
selectVars = 0 |
67 |
IF ( staggerTimeStep ) THEN |
IF ( staggerTimeStep ) THEN |
68 |
IF ( seqFlag.EQ.0 ) selectVars = 2 |
IF ( seqFlag.EQ.0 ) selectVars = 2 |
69 |
IF ( seqFlag.EQ.1 ) selectVars = 1 |
IF ( seqFlag.EQ.1 ) selectVars = 1 |
70 |
ELSE |
ELSE |
71 |
IF ( seqFlag.EQ.0 ) selectVars = 3 |
IF ( seqFlag.EQ.0 ) selectVars = 3 |
72 |
ENDIF |
ENDIF |
73 |
|
IF ( seqFlag.EQ.2 ) selectVars = 4 |
74 |
CALL DIAGNOSTICS_FILL_STATE(selectVars, myThid) |
CALL DIAGNOSTICS_FILL_STATE(selectVars, myThid) |
75 |
|
|
76 |
|
#ifdef ALLOW_GENERIC_ADVDIFF |
77 |
|
IF ( seqFlag.EQ.0 .AND. useGAD ) THEN |
78 |
|
CALL GAD_DIAGNOSTICS_STATE( myTime, myIter, myThid ) |
79 |
|
ENDIF |
80 |
|
#endif /* ALLOW_GENERIC_ADVDIFF */ |
81 |
|
|
82 |
#ifdef ALLOW_PTRACERS |
#ifdef ALLOW_PTRACERS |
83 |
IF ( (selectVars.EQ.1 .OR. selectVars.EQ.3) |
IF ( (selectVars.EQ.1 .OR. selectVars.EQ.3) |
84 |
& .AND. usePTRACERS ) THEN |
& .AND. usePTRACERS ) THEN |
85 |
CALL PTRACERS_DIAGNOSTICS_FILL(myThid) |
CALL PTRACERS_DIAGNOSTICS_STATE( myThid ) |
86 |
ENDIF |
ENDIF |
87 |
#endif |
#endif |
88 |
|
|
89 |
|
#ifdef ALLOW_SEAICE |
90 |
|
IF ( seqFlag.EQ.0 .AND. useSEAICE ) THEN |
91 |
|
CALL SEAICE_DIAGNOSTICS_STATE( myTime, myIter, myThid ) |
92 |
|
ENDIF |
93 |
|
#endif /* ALLOW_SEAICE */ |
94 |
|
|
95 |
#ifdef ALLOW_THSICE |
#ifdef ALLOW_THSICE |
96 |
IF ( seqFlag.EQ.0 .AND. useThSIce ) THEN |
IF ( seqFlag.EQ.0 .AND. useThSIce ) THEN |
97 |
DO bj=myByLo(myThid),myByHi(myThid) |
DO bj=myByLo(myThid),myByHi(myThid) |
98 |
DO bi=myBxLo(myThid),myBxHi(myThid) |
DO bi=myBxLo(myThid),myBxHi(myThid) |
99 |
CALL THSICE_DIAGNOSTICS_FILL( myTime,myIter, bi,bj, myThid ) |
CALL THSICE_DIAGNOSTICS_STATE( myTime,myIter,bi,bj,myThid ) |
100 |
ENDDO |
ENDDO |
101 |
ENDDO |
ENDDO |
102 |
ENDIF |
ENDIF |
106 |
IF ( seqFlag.EQ.0 .AND. useLand ) THEN |
IF ( seqFlag.EQ.0 .AND. useLand ) THEN |
107 |
DO bj=myByLo(myThid),myByHi(myThid) |
DO bj=myByLo(myThid),myByHi(myThid) |
108 |
DO bi=myBxLo(myThid),myBxHi(myThid) |
DO bi=myBxLo(myThid),myBxHi(myThid) |
109 |
CALL LAND_DIAGNOSTICS_FILL( myTime,myIter, bi,bj, myThid ) |
CALL LAND_DIAGNOSTICS_STATE( myTime,myIter, bi,bj, myThid ) |
110 |
ENDDO |
ENDDO |
111 |
ENDDO |
ENDDO |
112 |
ENDIF |
ENDIF |
113 |
#endif /* ALLOW_LAND */ |
#endif /* ALLOW_LAND */ |
114 |
|
|
115 |
|
#ifdef ALLOW_MYPACKAGE |
116 |
|
IF ( seqFlag.EQ.0 .AND. useMYPACKAGE ) THEN |
117 |
|
CALL MYPACKAGE_DIAGNOSTICS_STATE( myTime, myIter, myThid ) |
118 |
|
ENDIF |
119 |
|
#endif /* ALLOW_MYPACKAGE */ |
120 |
|
|
121 |
ENDIf |
ENDIf |
122 |
#endif /* ALLOW_DIAGNOSTICS */ |
#endif /* ALLOW_DIAGNOSTICS */ |
123 |
|
|