1 |
C $Header$ |
C $Header$ |
2 |
C $Name$ |
C $Name$ |
3 |
|
|
4 |
|
#include "PACKAGES_CONFIG.h" |
5 |
#include "CPP_OPTIONS.h" |
#include "CPP_OPTIONS.h" |
6 |
|
|
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 |
36 |
#include "EEPARAMS.h" |
#include "EEPARAMS.h" |
37 |
#include "PARAMS.h" |
#include "PARAMS.h" |
38 |
#include "DYNVARS.h" |
#include "DYNVARS.h" |
|
cswdblk --- add --- |
|
|
#ifdef ALLOW_BULK_FORCE |
|
|
#include "BULKF.h" |
|
|
#include "FFIELDS.h" |
|
|
#endif |
|
|
cswdblk -- end add --- |
|
|
cswdice -- add --- |
|
|
#ifdef ALLOW_THERM_SEAICE |
|
|
#include "ICE.h" |
|
|
#include "ICE_DIAGS.h" |
|
|
#endif |
|
|
cswdice -- end add --- |
|
|
|
|
39 |
|
|
40 |
|
|
41 |
LOGICAL DIFFERENT_MULTIPLE |
LOGICAL DIFFERENT_MULTIPLE |
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 |
|
|
70 |
CALL PLOT_FIELD_XYRL( etaN , 'Current etaN ' , |
CALL PLOT_FIELD_XYRL( etaN , 'Current etaN ' , |
71 |
& myIter, myThid ) |
& myIter, myThid ) |
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 |
IF (taveFreq.GT.0.) THEN |
IF (taveFreq.GT.0. .AND. myIter.NE.nIter0 ) THEN |
82 |
CALL TIMEAVE_STATV_WRITE( myCurrentTime, myIter, myThid ) |
CALL TIMEAVE_STATV_WRITE( myTime, myIter, myThid ) |
83 |
|
#ifdef ALLOW_PTRACERS |
84 |
|
IF ( usePTRACERS ) |
85 |
|
& CALL PTRACERS_STATV_WRITE( myTime, myIter, myThid ) |
86 |
|
#endif |
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 ) |
93 |
& CALL AIM_WRITE_TAVE( myCurrentTime, myIter, myThid ) |
& CALL AIM_WRITE_TAVE( myTime, myIter, myThid ) |
94 |
#endif |
#endif |
95 |
|
#ifdef ALLOW_LAND |
96 |
|
C-- Do LAND time averages |
97 |
|
IF ( useLAND ) |
98 |
|
& CALL LAND_WRITE_TAVE( myTime, myIter, myThid ) |
99 |
|
#endif |
100 |
|
|
101 |
|
#ifdef ALLOW_OBCS |
102 |
|
IF (useOBCS .AND. myIter.NE.nIter0 ) |
103 |
|
& CALL OBCS_DIAGS( myTime, myIter, myThid ) |
104 |
|
#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 |
|
|
|
cswdblk --- add --- |
|
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 |
|
cswdblk -- end add --- |
|
131 |
|
|
132 |
cswdice --- add --- |
#ifdef ALLOW_THSICE |
|
#ifdef ALLOW_THERM_SEAICE |
|
133 |
C-- Do seaice diagnostics. |
C-- Do seaice diagnostics. |
134 |
IF (useThermSeaice) |
IF (useThSIce) |
135 |
& CALL ICE_DIAGS( myCurrentTime, myIter, myThid ) |
& CALL THSICE_DIAGS( myTime, myIter, myThid ) |
136 |
|
#endif |
137 |
|
|
138 |
|
cswdptr --- add --- |
139 |
|
#ifdef ALLOW_GCHEM |
140 |
|
ceh3 ??? why is one package depending upon another here? |
141 |
|
C-- Do ptracer diagnostics. |
142 |
|
IF (usePTRACERS) |
143 |
|
& CALL GCHEM_DIAGS( myTime, myIter, myThid ) |
144 |
|
#endif |
145 |
|
cswdptr -- end add --- |
146 |
|
|
147 |
|
#ifdef COMPONENT_MODULE |
148 |
|
IF ( useCoupler ) |
149 |
|
& CALL CPL_WRITE_DIAGS( myTime, myIter, myThid ) |
150 |
#endif |
#endif |
|
cswdice -- end add --- |
|
151 |
|
|
152 |
RETURN |
RETURN |
153 |
END |
END |
|
|
|