1 |
C $Header$ |
C $Header$ |
2 |
|
C $Name$ |
3 |
|
|
4 |
#include "CPP_EEOPTIONS.h" |
#include "PACKAGES_CONFIG.h" |
5 |
|
#include "CPP_OPTIONS.h" |
6 |
|
|
7 |
SUBROUTINE DO_THE_MODEL_IO(myIter, myThid) |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
8 |
C /==========================================================\ |
CBOP |
9 |
C | SUBROUTINE DO_THE_MODEL_IO | |
C !ROUTINE: DO_THE_MODEL_IO |
10 |
C | o Controlling routine for IO in model main time-stepping | |
|
11 |
C | loop. | |
C !INTERFACE: |
12 |
C |==========================================================| |
SUBROUTINE DO_THE_MODEL_IO( |
13 |
C | Many systems do not have thread safe IO so it is easier | |
I myTime, |
14 |
C | to lump everything together and do dumping of fields | |
I myIter, |
15 |
C | and updating of forcing terms in a single place. | |
I myThid ) |
16 |
C | The approach to IO used here is that writes are only | |
|
17 |
C | performed by thread 1 and that a process only writes out | |
C !DESCRIPTION: |
18 |
C | its data ( since it doen't know about anyone elses data!)| |
C This is the controlling routine for IO in the model main |
19 |
C | Reading on the other hand is assumed to be from a file | |
C time--stepping loop. Many systems do not have thread safe IO so it |
20 |
C | containing all the data for all the processes. Only the | |
C is easier to lump everything together and do dumping of fields and |
21 |
C | portion of data of interest to this process is actually | |
C updating of forcing terms in a single place. The approach to IO |
22 |
C | loaded. To work well this assumes the existence of some | |
C used here is that writes are only performed by thread 1 and that a |
23 |
C | reliable tool to join datasets together at the end of a | |
C process only writes out its data (it does not know about anyone |
24 |
C | run. | |
C elses data!) Reading on the other hand is assumed to be from a |
25 |
C | Notes | |
C file containing all the data for all the processes. Only the |
26 |
C | ===== | |
C portion of data of interest to this process is actually loaded. To |
27 |
C | We allow thread 2-nThreads to continue whilst thread 1 | |
C work well this assumes the existence of some reliable tool to join |
28 |
C | does IO. The assumption is that the other threads won't | |
C datasets together at the end of a run -- see joinds. |
|
C | do anything to update their interior regions before | |
|
|
C | thread 1 has finished writing them out. | |
|
|
C \==========================================================/ |
|
29 |
|
|
30 |
C == Global variables === |
C !USES: |
31 |
|
IMPLICIT NONE |
32 |
#include "SIZE.h" |
#include "SIZE.h" |
33 |
#include "EEPARAMS.h" |
#include "EEPARAMS.h" |
34 |
#include "PARAMS.h" |
#include "PARAMS.h" |
35 |
#include "DYNVARS.h" |
#include "DYNVARS.h" |
36 |
#include "CG2D.h" |
LOGICAL DIFFERENT_MULTIPLE |
37 |
|
EXTERNAL DIFFERENT_MULTIPLE |
38 |
|
|
39 |
C == Routine arguments == |
C !INPUT/OUTPUT PARAMETERS: |
40 |
C myThid - Thread number for this instance of the routine. |
C myThid - Thread number for this instance of the routine. |
41 |
C myIter - Iteration number |
C myIter - Iteration number |
42 |
|
C myTime - Current time of simulation ( s ) |
43 |
INTEGER myThid |
INTEGER myThid |
44 |
INTEGER myIter |
INTEGER myIter |
45 |
|
_RL myTime |
46 |
|
CEOP |
47 |
|
|
|
C == Local variables == |
|
48 |
|
|
49 |
C-- Generaly only thread 1 does IO here. It can't start until everyone's |
C Generaly only thread 1 does IO here. It can not start until |
50 |
C-- fields are ready. |
C all threads fields are ready. |
51 |
IF ( MOD(myIter,10) .NE. 0 ) RETURN |
IF (debugMode) THEN |
52 |
_BARRIER |
IF ( DIFFERENT_MULTIPLE(dumpFreq,myTime, myTime-deltaTClock) |
53 |
|
& ) THEN |
54 |
C-- Write "text-plots" of certain fields |
|
55 |
CALL PLOT_FIELD_XYZR8( uVel , 'uVel ' , Nz, myIter, myThid ) |
_BARRIER |
56 |
CALL PLOT_FIELD_XYZR8( vVel , 'vVel ' , Nz, myIter, myThid ) |
|
57 |
CALL PLOT_FIELD_XYZR8( theta, 'Theta ' , Nz, myIter, myThid ) |
C Write "text-plots" of certain fields |
58 |
CALL PLOT_FIELD_XYZR8( rho, 'rho ' , Nz, myIter, myThid ) |
CALL PLOT_FIELD_XYZRL( uVel , 'Current uVel ' , |
59 |
CALL PLOT_FIELD_XYR8( cg2d_x, 'cg2d_x ' , myIter, myThid ) |
& Nr, myIter, myThid ) |
60 |
_BARRIER |
CALL PLOT_FIELD_XYZRL( vVel , 'Current vVel ' , |
61 |
C |
& Nr, myIter, myThid ) |
62 |
|
CALL PLOT_FIELD_XYZRL( theta, 'Current theta ' , |
63 |
|
& Nr, myIter, myThid ) |
64 |
|
CALL PLOT_FIELD_XYRL( etaN , 'Current etaN ' , |
65 |
|
& myIter, myThid ) |
66 |
|
|
67 |
|
ENDIF |
68 |
|
ENDIF |
69 |
|
|
70 |
|
C Write model state to binary file |
71 |
|
CALL WRITE_STATE( myTime, myIter, myThid ) |
72 |
|
|
73 |
|
#ifdef ALLOW_TIMEAVE |
74 |
|
C Do time averages |
75 |
|
IF (taveFreq.GT.0. .AND. myIter.NE.nIter0 ) THEN |
76 |
|
CALL TIMEAVE_STATV_WRITE( myTime, myIter, myThid ) |
77 |
|
#ifdef ALLOW_PTRACERS |
78 |
|
IF ( usePTRACERS ) |
79 |
|
& CALL PTRACERS_STATV_WRITE( myTime, myIter, myThid ) |
80 |
|
#endif |
81 |
|
ENDIF |
82 |
|
#endif |
83 |
|
|
84 |
|
#ifdef ALLOW_FIZHI |
85 |
|
if(useFIZHI) call fizhi_write_state( myTime, myIter, myThid ) |
86 |
|
#endif |
87 |
|
|
88 |
|
#ifdef ALLOW_AIM |
89 |
|
C Do AIM time averages |
90 |
|
IF ( useAIM ) |
91 |
|
& CALL AIM_WRITE_TAVE( myTime, myIter, myThid ) |
92 |
|
#endif |
93 |
|
#ifdef ALLOW_LAND |
94 |
|
C Do LAND time averages |
95 |
|
IF ( useLAND ) |
96 |
|
& CALL LAND_WRITE_DIAGS( myTime, myIter, myThid ) |
97 |
|
#endif |
98 |
|
|
99 |
|
#ifdef ALLOW_OBCS |
100 |
|
IF (useOBCS .AND. myIter.NE.nIter0 ) |
101 |
|
& CALL OBCS_DIAGS( myTime, myIter, myThid ) |
102 |
|
#endif |
103 |
|
|
104 |
|
#ifdef ALLOW_GMREDI |
105 |
|
C Do KPP diagnostics. |
106 |
|
IF (useGMRedi .AND. myIter.NE.nIter0 ) |
107 |
|
& CALL GMREDI_DIAGS( myTime, myIter, myThid ) |
108 |
|
#endif |
109 |
|
|
110 |
|
#ifdef ALLOW_KPP |
111 |
|
C Do KPP diagnostics. |
112 |
|
IF (useKPP .AND. myIter.NE.nIter0 ) |
113 |
|
& CALL KPP_DO_DIAGS( myTime, myIter, myThid ) |
114 |
|
#endif |
115 |
|
|
116 |
|
#ifdef ALLOW_PP81 |
117 |
|
C Do PP81 diagnostics. |
118 |
|
IF (usePP81 .AND. myIter.NE.nIter0 ) |
119 |
|
& CALL PP81_DO_DIAGS( myTime, myIter, myThid ) |
120 |
|
#endif |
121 |
|
|
122 |
|
#ifdef ALLOW_MY82 |
123 |
|
C Do MY82 diagnostics. |
124 |
|
IF (useMY82 .AND. myIter.NE.nIter0 ) |
125 |
|
& CALL MY82_DO_DIAGS( myTime, myIter, myThid ) |
126 |
|
#endif |
127 |
|
|
128 |
|
#ifdef ALLOW_OPPS |
129 |
|
C-- Do OPPS diagnostics. |
130 |
|
IF (useOPPS .AND. myIter.NE.nIter0 ) |
131 |
|
& CALL OPPS_DO_DIAGS( myTime, myIter, myThid ) |
132 |
|
#endif |
133 |
|
|
134 |
|
#ifdef ALLOW_GGL90 |
135 |
|
C-- Do GGL90 diagnostics. |
136 |
|
IF (useGGL90 .AND. myIter.NE.nIter0 ) |
137 |
|
& CALL GGL90_DO_DIAGS( myTime, myIter, myThid ) |
138 |
|
#endif |
139 |
|
|
140 |
|
#ifdef ALLOW_SBO |
141 |
|
C Do SBO diagnostics. |
142 |
|
IF (useSBO .AND. myIter.NE.nIter0 ) THEN |
143 |
|
CALL SBO_CALC ( myTime, myIter, myThid ) |
144 |
|
CALL SBO_DIAGS( myTime, myIter, myThid ) |
145 |
|
ENDIF |
146 |
|
#endif |
147 |
|
|
148 |
|
#ifdef ALLOW_SEAICE |
149 |
|
IF ( useSEAICE ) THEN |
150 |
|
CALL SEAICE_DO_DIAGS( myTime, myIter, myThid ) |
151 |
|
ENDIF |
152 |
|
#endif /* ALLOW_SEAICE */ |
153 |
|
|
154 |
|
#ifdef ALLOW_BULK_FORCE |
155 |
|
C Do bulkf diagnostics. |
156 |
|
IF (useBulkForce .AND. myIter.NE.nIter0 ) |
157 |
|
& CALL BULKF_DIAGS( myTime, myIter, myThid ) |
158 |
|
#endif |
159 |
|
|
160 |
|
#ifdef ALLOW_THSICE |
161 |
|
C Do seaice diagnostics. |
162 |
|
IF (useThSIce) |
163 |
|
& CALL THSICE_DIAGS( myTime, myIter, myThid ) |
164 |
|
#endif |
165 |
|
|
166 |
|
cswdptr --- add --- |
167 |
|
#ifdef ALLOW_GCHEM |
168 |
|
ceh3 ??? why is one package depending upon another here? |
169 |
|
C-- Do ptracer diagnostics. |
170 |
|
IF (usePTRACERS) |
171 |
|
& CALL GCHEM_DIAGS( myTime, myIter, myThid ) |
172 |
|
#endif |
173 |
|
cswdptr -- end add --- |
174 |
|
|
175 |
|
#ifdef COMPONENT_MODULE |
176 |
|
IF ( useCoupler ) |
177 |
|
& CALL CPL_WRITE_DIAGS( myTime, myIter, myThid ) |
178 |
|
#endif |
179 |
|
|
180 |
|
#ifdef ALLOW_DIAGNOSTICS |
181 |
|
IF ( usediagnostics ) call diagnostics_write (myThid, myIter) |
182 |
|
#endif |
183 |
|
|
184 |
RETURN |
RETURN |
185 |
END |
END |
|
|
|