8 |
CBOP |
CBOP |
9 |
C !ROUTINE: DO_STATEVARS_DIAGS |
C !ROUTINE: DO_STATEVARS_DIAGS |
10 |
C !INTERFACE: |
C !INTERFACE: |
11 |
SUBROUTINE DO_STATEVARS_DIAGS( myTime, 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 statistics of the model state (state-variables) |
C | Computing diagnostics of the model state (state-variables) |
18 |
C | is done at this level (after updating the halo region), |
C | is done at this level ; |
19 |
C | as opposed to other diagnostic calls (fluxes, tendencies) |
C | by contrast, other diagnostics (fluxes, tendencies) |
20 |
C | that remain within the computation sequence. |
C | remain within the computation sequence. |
|
C | Note: IO are not supposed to be done at this level |
|
|
C | but later (in DO_THE_MODEL_IO) |
|
21 |
C *==========================================================* |
C *==========================================================* |
22 |
C \ev |
C \ev |
23 |
|
|
30 |
|
|
31 |
C !INPUT/OUTPUT PARAMETERS: |
C !INPUT/OUTPUT PARAMETERS: |
32 |
C == Routine arguments == |
C == Routine arguments == |
33 |
C myTime - Current time of simulation ( s ) |
C myTime :: Current time of simulation ( s ) |
34 |
C myIter - Iteration number |
C seqFlag :: flag that indicate where this S/R is called from: |
35 |
C myThid - Thread number for this instance of the routine. |
C :: =0 called from the beginning of forward_step |
36 |
|
C :: =1 called from the middle of forward_step |
37 |
|
C myIter :: Iteration number |
38 |
|
C myThid :: Thread number for this instance of the routine. |
39 |
_RL myTime |
_RL myTime |
40 |
|
INTEGER seqFlag |
41 |
INTEGER myIter |
INTEGER myIter |
42 |
INTEGER myThid |
INTEGER myThid |
|
|
|
43 |
CEOP |
CEOP |
44 |
|
|
45 |
|
#ifdef ALLOW_DIAGNOSTICS |
46 |
C !LOCAL VARIABLES: |
C !LOCAL VARIABLES: |
47 |
C == Local variables |
C == Local variables == |
48 |
INTEGER bi,bj |
C selectVars :: select which group of dianostics variables to fill-in |
49 |
|
C = 1 :: fill-in diagnostics for tracer variables only |
50 |
#ifdef ALLOW_TIMEAVE |
C = 2 :: fill-in diagnostics for momentum variables only |
51 |
C-- Fill-in TimeAve pkg diagnostics (for state-variables) |
C = 3 :: fill-in diagnostics for momentum & tracer variables |
52 |
|
INTEGER selectVars |
53 |
|
|
54 |
DO bj=myByLo(myThid),myByHi(myThid) |
C-- Fill-in Diagnostics pkg storage array (for state-variables) |
55 |
DO bi=myBxLo(myThid),myBxHi(myThid) |
IF ( usediagnostics ) THEN |
56 |
|
|
57 |
IF ( taveFreq.GT.0. ) THEN |
C- select which group of state-var diagnostics to fill-in, |
58 |
CALL TIMEAVE_STATVARS(myTime, myIter, bi, bj, myThid) |
C depending on: where this S/R is called from (seqFlag) |
59 |
# ifdef ALLOW_PTRACERS |
C and stagger/synchronous TimeStep |
60 |
IF ( usePTRACERS ) THEN |
selectVars = 0 |
61 |
CALL PTRACERS_STATVARS(myTime, myIter, bi, bj, myThid) |
IF ( staggerTimeStep ) THEN |
62 |
ENDIF |
IF ( seqFlag.EQ.0 ) selectVars = 2 |
63 |
# endif /* ALLOW_PTRACERS */ |
IF ( seqFlag.EQ.1 ) selectVars = 1 |
64 |
|
ELSE |
65 |
|
IF ( seqFlag.EQ.0 ) selectVars = 3 |
66 |
ENDIF |
ENDIF |
67 |
|
CALL DIAGNOSTICS_FILL_STATE(selectVars, myThid) |
68 |
|
|
69 |
C-- End of bi,bj loop |
#ifdef ALLOW_PTRACERS |
70 |
ENDDO |
IF ( (selectVars.EQ.1 .OR. selectVars.EQ.3) |
71 |
ENDDO |
& .AND. usePTRACERS ) THEN |
72 |
#endif /* ALLOW_TIMEAVE */ |
CALL PTRACERS_DIAGNOSTICS_FILL(myThid) |
73 |
|
ENDIF |
74 |
#ifdef ALLOW_DIAGNOSTICS |
#endif |
|
C-- Fill-in Diagnostics pkg storage array (for state-variables) |
|
75 |
|
|
|
IF ( usediagnostics ) THEN |
|
|
CALL DIAGNOSTICS_FILL_STATE(myThid) |
|
|
# ifdef ALLOW_PTRACERS |
|
|
IF (usePTRACERS) THEN |
|
|
CALL PTRACERS_DIAGNOSTICS_FILL(myThid) |
|
|
ENDIF |
|
|
# endif |
|
76 |
ENDIf |
ENDIf |
|
|
|
77 |
#endif /* ALLOW_DIAGNOSTICS */ |
#endif /* ALLOW_DIAGNOSTICS */ |
78 |
|
|
79 |
RETURN |
RETURN |