1 |
mlosch |
1.9 |
C $Header: /u/gcmpack/MITgcm/model/src/do_statevars_diags.F,v 1.8 2006/01/17 16:08:24 molod Exp $ |
2 |
jmc |
1.1 |
C $Name: $ |
3 |
|
|
|
4 |
|
|
#include "PACKAGES_CONFIG.h" |
5 |
|
|
#include "CPP_OPTIONS.h" |
6 |
|
|
|
7 |
|
|
|
8 |
|
|
CBOP |
9 |
|
|
C !ROUTINE: DO_STATEVARS_DIAGS |
10 |
|
|
C !INTERFACE: |
11 |
jmc |
1.5 |
SUBROUTINE DO_STATEVARS_DIAGS( myTime, seqFlag, myIter, myThid ) |
12 |
jmc |
1.1 |
C !DESCRIPTION: \bv |
13 |
|
|
C *==========================================================* |
14 |
|
|
C | SUBROUTINE DO_STATEVARS_DIAGS |
15 |
|
|
C | o Controlling routine for state variables diagnostics |
16 |
|
|
C *==========================================================* |
17 |
jmc |
1.5 |
C | Computing diagnostics of the model state (state-variables) |
18 |
|
|
C | is done at this level ; |
19 |
|
|
C | by contrast, other diagnostics (fluxes, tendencies) |
20 |
|
|
C | remain within the computation sequence. |
21 |
jmc |
1.1 |
C *==========================================================* |
22 |
|
|
C \ev |
23 |
|
|
|
24 |
|
|
C !USES: |
25 |
|
|
IMPLICIT NONE |
26 |
|
|
C == Global variables === |
27 |
|
|
#include "SIZE.h" |
28 |
|
|
#include "EEPARAMS.h" |
29 |
|
|
#include "PARAMS.h" |
30 |
|
|
|
31 |
|
|
C !INPUT/OUTPUT PARAMETERS: |
32 |
|
|
C == Routine arguments == |
33 |
jmc |
1.5 |
C myTime :: Current time of simulation ( s ) |
34 |
|
|
C seqFlag :: flag that indicate where this S/R is called from: |
35 |
|
|
C :: =0 called from the beginning of forward_step |
36 |
|
|
C :: =1 called from the middle of forward_step |
37 |
molod |
1.8 |
C :: =2 called from the end of forward_step |
38 |
jmc |
1.5 |
C myIter :: Iteration number |
39 |
|
|
C myThid :: Thread number for this instance of the routine. |
40 |
jmc |
1.1 |
_RL myTime |
41 |
jmc |
1.5 |
INTEGER seqFlag |
42 |
jmc |
1.1 |
INTEGER myIter |
43 |
|
|
INTEGER myThid |
44 |
|
|
CEOP |
45 |
|
|
|
46 |
jmc |
1.5 |
#ifdef ALLOW_DIAGNOSTICS |
47 |
jmc |
1.1 |
C !LOCAL VARIABLES: |
48 |
jmc |
1.5 |
C == Local variables == |
49 |
|
|
C selectVars :: select which group of dianostics variables to fill-in |
50 |
|
|
C = 1 :: fill-in diagnostics for tracer variables only |
51 |
|
|
C = 2 :: fill-in diagnostics for momentum variables only |
52 |
|
|
C = 3 :: fill-in diagnostics for momentum & tracer variables |
53 |
molod |
1.8 |
C = 4 :: fill-in state variable tendency diagnostics the second time |
54 |
jmc |
1.6 |
C bi,bj :: tile indices |
55 |
jmc |
1.5 |
INTEGER selectVars |
56 |
jmc |
1.6 |
INTEGER bi, bj |
57 |
jmc |
1.1 |
|
58 |
jmc |
1.5 |
C-- Fill-in Diagnostics pkg storage array (for state-variables) |
59 |
|
|
IF ( usediagnostics ) THEN |
60 |
jmc |
1.1 |
|
61 |
jmc |
1.5 |
C- select which group of state-var diagnostics to fill-in, |
62 |
|
|
C depending on: where this S/R is called from (seqFlag) |
63 |
|
|
C and stagger/synchronous TimeStep |
64 |
|
|
selectVars = 0 |
65 |
|
|
IF ( staggerTimeStep ) THEN |
66 |
|
|
IF ( seqFlag.EQ.0 ) selectVars = 2 |
67 |
|
|
IF ( seqFlag.EQ.1 ) selectVars = 1 |
68 |
|
|
ELSE |
69 |
|
|
IF ( seqFlag.EQ.0 ) selectVars = 3 |
70 |
|
|
ENDIF |
71 |
molod |
1.8 |
IF ( seqFlag.EQ.2 ) selectVars = 4 |
72 |
jmc |
1.5 |
CALL DIAGNOSTICS_FILL_STATE(selectVars, myThid) |
73 |
jmc |
1.1 |
|
74 |
jmc |
1.5 |
#ifdef ALLOW_PTRACERS |
75 |
|
|
IF ( (selectVars.EQ.1 .OR. selectVars.EQ.3) |
76 |
|
|
& .AND. usePTRACERS ) THEN |
77 |
|
|
CALL PTRACERS_DIAGNOSTICS_FILL(myThid) |
78 |
jmc |
1.1 |
ENDIF |
79 |
jmc |
1.5 |
#endif |
80 |
jmc |
1.1 |
|
81 |
mlosch |
1.9 |
#ifdef ALLOW_SEAICE |
82 |
|
|
IF ( seqFlag.EQ.0 .AND. useSEAICE ) THEN |
83 |
|
|
CALL SEAICE_DIAGNOSTICS_FILL( myTime, myIter, myThid ) |
84 |
|
|
ENDIF |
85 |
|
|
#endif /* ALLOW_SEAICE */ |
86 |
|
|
|
87 |
jmc |
1.6 |
#ifdef ALLOW_THSICE |
88 |
|
|
IF ( seqFlag.EQ.0 .AND. useThSIce ) THEN |
89 |
|
|
DO bj=myByLo(myThid),myByHi(myThid) |
90 |
|
|
DO bi=myBxLo(myThid),myBxHi(myThid) |
91 |
|
|
CALL THSICE_DIAGNOSTICS_FILL( myTime,myIter, bi,bj, myThid ) |
92 |
|
|
ENDDO |
93 |
|
|
ENDDO |
94 |
|
|
ENDIF |
95 |
|
|
#endif /* ALLOW_THSICE */ |
96 |
|
|
|
97 |
jmc |
1.7 |
#ifdef ALLOW_LAND |
98 |
|
|
IF ( seqFlag.EQ.0 .AND. useLand ) THEN |
99 |
|
|
DO bj=myByLo(myThid),myByHi(myThid) |
100 |
|
|
DO bi=myBxLo(myThid),myBxHi(myThid) |
101 |
|
|
CALL LAND_DIAGNOSTICS_FILL( myTime,myIter, bi,bj, myThid ) |
102 |
|
|
ENDDO |
103 |
|
|
ENDDO |
104 |
|
|
ENDIF |
105 |
|
|
#endif /* ALLOW_LAND */ |
106 |
|
|
|
107 |
jmc |
1.1 |
ENDIf |
108 |
|
|
#endif /* ALLOW_DIAGNOSTICS */ |
109 |
|
|
|
110 |
|
|
RETURN |
111 |
|
|
END |