7 |
CBOP |
CBOP |
8 |
C !ROUTINE: DO_THE_MODEL_IO |
C !ROUTINE: DO_THE_MODEL_IO |
9 |
C !INTERFACE: |
C !INTERFACE: |
10 |
SUBROUTINE DO_THE_MODEL_IO(myCurrentTime, myIter, myThid) |
SUBROUTINE DO_THE_MODEL_IO( myTime, myIter, myThid ) |
11 |
C !DESCRIPTION: \bv |
C !DESCRIPTION: \bv |
12 |
C *==========================================================* |
C *==========================================================* |
13 |
C | SUBROUTINE DO_THE_MODEL_IO |
C | SUBROUTINE DO_THE_MODEL_IO |
45 |
C == Routine arguments == |
C == Routine arguments == |
46 |
C myThid - Thread number for this instance of the routine. |
C myThid - Thread number for this instance of the routine. |
47 |
C myIter - Iteration number |
C myIter - Iteration number |
48 |
C myCurrentTime - Current time of simulation ( s ) |
C myTime - Current time of simulation ( s ) |
49 |
INTEGER myThid |
INTEGER myThid |
50 |
INTEGER myIter |
INTEGER myIter |
51 |
_RL myCurrentTime |
_RL myTime |
52 |
|
|
53 |
CEOP |
CEOP |
54 |
|
|
55 |
C-- Generaly only thread 1 does IO here. It can not start until |
C-- Generaly only thread 1 does IO here. It can not start until |
56 |
C-- all threads fields are ready. |
C-- all threads fields are ready. |
57 |
IF ( |
IF (debugMode) THEN |
58 |
& DIFFERENT_MULTIPLE(dumpFreq,myCurrentTime, |
IF ( DIFFERENT_MULTIPLE(dumpFreq,myTime, myTime-deltaTClock) |
59 |
& myCurrentTime-deltaTClock) |
& ) THEN |
|
& ) THEN |
|
60 |
|
|
61 |
_BARRIER |
_BARRIER |
62 |
|
|
|
IF (debugMode) THEN |
|
63 |
C-- Write "text-plots" of certain fields |
C-- Write "text-plots" of certain fields |
64 |
CALL PLOT_FIELD_XYZRL( uVel , 'Current uVel ' , |
CALL PLOT_FIELD_XYZRL( uVel , 'Current uVel ' , |
65 |
& Nr, myIter, myThid ) |
& Nr, myIter, myThid ) |
69 |
& Nr, myIter, myThid ) |
& Nr, myIter, myThid ) |
70 |
CALL PLOT_FIELD_XYRL( etaN , 'Current etaN ' , |
CALL PLOT_FIELD_XYRL( etaN , 'Current etaN ' , |
71 |
& myIter, myThid ) |
& myIter, myThid ) |
|
ENDIF |
|
72 |
|
|
73 |
|
ENDIF |
74 |
ENDIF |
ENDIF |
75 |
|
|
76 |
C-- Write model state to binary file |
C-- Write model state to binary file |
77 |
CALL WRITE_STATE( myCurrentTime, myIter, myThid ) |
CALL WRITE_STATE( myTime, myIter, myThid ) |
78 |
|
|
79 |
#ifdef ALLOW_TIMEAVE |
#ifdef ALLOW_TIMEAVE |
80 |
C-- Do time averages |
C-- Do time averages |
81 |
ceh3 should this have an IF ( useTIMEAVE ) THEN |
IF (taveFreq.GT.0. .AND. myIter.NE.nIter0 ) THEN |
82 |
IF (taveFreq.GT.0.) THEN |
CALL TIMEAVE_STATV_WRITE( myTime, myIter, myThid ) |
|
CALL TIMEAVE_STATV_WRITE( myCurrentTime, myIter, myThid ) |
|
|
cswdptr -- add --- |
|
83 |
#ifdef ALLOW_PTRACERS |
#ifdef ALLOW_PTRACERS |
84 |
ceh3 this needs an IF ( usePTRACERS ) THEN |
IF ( usePTRACERS ) |
85 |
CALL PTRACERS_STATV_WRITE( myCurrentTime, myIter, myThid ) |
& CALL PTRACERS_STATV_WRITE( myTime, myIter, myThid ) |
86 |
#endif |
#endif |
|
cswdptr -- end add --- |
|
87 |
ENDIF |
ENDIF |
88 |
#endif |
#endif |
89 |
|
|
90 |
#ifdef ALLOW_AIM |
#ifdef ALLOW_AIM |
91 |
C-- Do AIM time averages |
C-- Do AIM time averages |
92 |
IF (useAIM) |
IF (useAIM .AND. myIter.NE.nIter0 ) |
93 |
& CALL AIM_WRITE_TAVE( myCurrentTime, myIter, myThid ) |
& CALL AIM_WRITE_TAVE( myTime, myIter, myThid ) |
94 |
#endif |
#endif |
95 |
#ifdef ALLOW_LAND |
#ifdef ALLOW_LAND |
96 |
C-- Do LAND time averages |
C-- Do LAND time averages |
97 |
IF (useLAND) |
IF (useLAND .AND. myIter.NE.nIter0 ) |
98 |
& CALL LAND_WRITE_TAVE( myCurrentTime, myIter, myThid ) |
& CALL LAND_WRITE_TAVE( myTime, myIter, myThid ) |
99 |
#endif |
#endif |
100 |
|
|
101 |
#ifdef ALLOW_OBCS |
#ifdef ALLOW_OBCS |
102 |
IF (useOBCS) |
IF (useOBCS .AND. myIter.NE.nIter0 ) |
103 |
& CALL OBCS_DIAGS( myCurrentTime, myIter, myThid ) |
& CALL OBCS_DIAGS( myTime, myIter, myThid ) |
104 |
#endif |
#endif |
105 |
|
|
106 |
#ifdef ALLOW_GMREDI |
#ifdef ALLOW_GMREDI |
107 |
C-- Do KPP diagnostics. |
C-- Do KPP diagnostics. |
108 |
IF (useGMRedi) |
IF (useGMRedi .AND. myIter.NE.nIter0 ) |
109 |
& CALL GMREDI_DIAGS( myCurrentTime, myIter, myThid ) |
& CALL GMREDI_DIAGS( myTime, myIter, myThid ) |
110 |
#endif |
#endif |
111 |
|
|
112 |
#ifdef ALLOW_KPP |
#ifdef ALLOW_KPP |
113 |
C-- Do KPP diagnostics. |
C-- Do KPP diagnostics. |
114 |
IF (useKPP) |
IF (useKPP .AND. myIter.NE.nIter0 ) |
115 |
& CALL KPP_DO_DIAGS( myCurrentTime, myIter, myThid ) |
& CALL KPP_DO_DIAGS( myTime, myIter, myThid ) |
116 |
#endif |
#endif |
117 |
|
|
118 |
#ifdef ALLOW_SBO |
#ifdef ALLOW_SBO |
119 |
C-- Do SBO diagnostics. |
C-- Do SBO diagnostics. |
120 |
IF (useSBO) THEN |
IF (useSBO .AND. myIter.NE.nIter0 ) THEN |
121 |
CALL SBO_CALC ( myCurrentTime, myIter, myThid ) |
CALL SBO_CALC ( myTime, myIter, myThid ) |
122 |
CALL SBO_DIAGS( myCurrentTime, myIter, myThid ) |
CALL SBO_DIAGS( myTime, myIter, myThid ) |
123 |
ENDIF |
ENDIF |
124 |
#endif |
#endif |
125 |
|
|
126 |
#ifdef ALLOW_BULK_FORCE |
#ifdef ALLOW_BULK_FORCE |
127 |
C-- Do bulkf diagnostics. |
C-- Do bulkf diagnostics. |
128 |
IF (useBulkforce) |
IF (useBulkforce .AND. myIter.NE.nIter0 ) |
129 |
& CALL BULKF_DIAGS( myCurrentTime, myIter, myThid ) |
& CALL BULKF_DIAGS( myTime, myIter, myThid ) |
130 |
#endif |
#endif |
131 |
|
|
132 |
#ifdef ALLOW_THERM_SEAICE |
#ifdef ALLOW_THERM_SEAICE |
133 |
C-- Do seaice diagnostics. |
C-- Do seaice diagnostics. |
134 |
IF (useThermSeaice) |
IF (useThermSeaice) |
135 |
& CALL ICE_DIAGS( myCurrentTime, myIter, myThid ) |
& CALL ICE_DIAGS( myTime, myIter, myThid ) |
136 |
#endif |
#endif |
137 |
|
|
138 |
cswdptr --- add --- |
cswdptr --- add --- |
140 |
ceh3 ??? why is one package depending upon another here? |
ceh3 ??? why is one package depending upon another here? |
141 |
C-- Do ptracer diagnostics. |
C-- Do ptracer diagnostics. |
142 |
IF (usePTRACERS) |
IF (usePTRACERS) |
143 |
& CALL GCHEM_DIAGS( myCurrentTime, myIter, myThid ) |
& CALL GCHEM_DIAGS( myTime, myIter, myThid ) |
144 |
#endif |
#endif |
145 |
cswdptr -- end add --- |
cswdptr -- end add --- |
146 |
|
|
147 |
RETURN |
RETURN |
148 |
END |
END |
|
|
|