1 |
jmc |
1.33 |
C $Header: /u/gcmpack/MITgcm/model/src/do_the_model_io.F,v 1.32 2003/10/09 04:19:18 edhill Exp $ |
2 |
adcroft |
1.21 |
C $Name: $ |
3 |
cnh |
1.1 |
|
4 |
edhill |
1.32 |
#include "PACKAGES_CONFIG.h" |
5 |
cnh |
1.11 |
#include "CPP_OPTIONS.h" |
6 |
cnh |
1.1 |
|
7 |
cnh |
1.22 |
CBOP |
8 |
|
|
C !ROUTINE: DO_THE_MODEL_IO |
9 |
|
|
C !INTERFACE: |
10 |
heimbach |
1.20 |
SUBROUTINE DO_THE_MODEL_IO(myCurrentTime, myIter, myThid) |
11 |
cnh |
1.22 |
C !DESCRIPTION: \bv |
12 |
|
|
C *==========================================================* |
13 |
|
|
C | SUBROUTINE DO_THE_MODEL_IO |
14 |
|
|
C | o Controlling routine for IO in model main time-stepping |
15 |
|
|
C | loop. |
16 |
|
|
C *==========================================================* |
17 |
|
|
C | Many systems do not have thread safe IO so it is easier |
18 |
|
|
C | to lump everything together and do dumping of fields |
19 |
|
|
C | and updating of forcing terms in a single place. |
20 |
|
|
C | The approach to IO used here is that writes are only |
21 |
|
|
C | performed by thread 1 and that a process only writes out |
22 |
|
|
C | its data ( it does not know about anyone elses data!) |
23 |
|
|
C | Reading on the other hand is assumed to be from a file |
24 |
|
|
C | containing all the data for all the processes. Only the |
25 |
|
|
C | portion of data of interest to this process is actually |
26 |
|
|
C | loaded. To work well this assumes the existence of some |
27 |
|
|
C | reliable tool to join datasets together at the end of a |
28 |
|
|
C | run - see joinds.p |
29 |
|
|
C *==========================================================* |
30 |
|
|
C \ev |
31 |
|
|
|
32 |
|
|
C !USES: |
33 |
adcroft |
1.12 |
IMPLICIT NONE |
34 |
cnh |
1.1 |
C == Global variables === |
35 |
|
|
#include "SIZE.h" |
36 |
|
|
#include "EEPARAMS.h" |
37 |
|
|
#include "PARAMS.h" |
38 |
|
|
#include "DYNVARS.h" |
39 |
cheisey |
1.23 |
|
40 |
|
|
|
41 |
cnh |
1.3 |
LOGICAL DIFFERENT_MULTIPLE |
42 |
|
|
EXTERNAL DIFFERENT_MULTIPLE |
43 |
|
|
|
44 |
cnh |
1.22 |
C !INPUT/OUTPUT PARAMETERS: |
45 |
cnh |
1.1 |
C == Routine arguments == |
46 |
|
|
C myThid - Thread number for this instance of the routine. |
47 |
|
|
C myIter - Iteration number |
48 |
cnh |
1.3 |
C myCurrentTime - Current time of simulation ( s ) |
49 |
cnh |
1.1 |
INTEGER myThid |
50 |
|
|
INTEGER myIter |
51 |
adcroft |
1.13 |
_RL myCurrentTime |
52 |
cnh |
1.1 |
|
53 |
cnh |
1.22 |
CEOP |
54 |
cnh |
1.1 |
|
55 |
cnh |
1.10 |
C-- Generaly only thread 1 does IO here. It can not start until |
56 |
|
|
C-- all threads fields are ready. |
57 |
cnh |
1.6 |
IF ( |
58 |
cnh |
1.10 |
& DIFFERENT_MULTIPLE(dumpFreq,myCurrentTime, |
59 |
|
|
& myCurrentTime-deltaTClock) |
60 |
cnh |
1.6 |
& ) THEN |
61 |
|
|
|
62 |
cnh |
1.3 |
_BARRIER |
63 |
cnh |
1.1 |
|
64 |
jmc |
1.28 |
IF (debugMode) THEN |
65 |
cnh |
1.3 |
C-- Write "text-plots" of certain fields |
66 |
cnh |
1.10 |
CALL PLOT_FIELD_XYZRL( uVel , 'Current uVel ' , |
67 |
|
|
& Nr, myIter, myThid ) |
68 |
|
|
CALL PLOT_FIELD_XYZRL( vVel , 'Current vVel ' , |
69 |
|
|
& Nr, myIter, myThid ) |
70 |
|
|
CALL PLOT_FIELD_XYZRL( theta, 'Current theta ' , |
71 |
|
|
& Nr, myIter, myThid ) |
72 |
jmc |
1.19 |
CALL PLOT_FIELD_XYRL( etaN , 'Current etaN ' , |
73 |
cnh |
1.10 |
& myIter, myThid ) |
74 |
jmc |
1.28 |
ENDIF |
75 |
adcroft |
1.13 |
|
76 |
cnh |
1.3 |
ENDIF |
77 |
|
|
|
78 |
|
|
C-- Write model state to binary file |
79 |
heimbach |
1.20 |
CALL WRITE_STATE( myCurrentTime, myIter, myThid ) |
80 |
cnh |
1.5 |
|
81 |
jmc |
1.19 |
#ifdef ALLOW_TIMEAVE |
82 |
adcroft |
1.16 |
C-- Do time averages |
83 |
edhill |
1.32 |
ceh3 should this have an IF ( useTIMEAVE ) THEN |
84 |
adcroft |
1.16 |
IF (taveFreq.GT.0.) THEN |
85 |
jmc |
1.19 |
CALL TIMEAVE_STATV_WRITE( myCurrentTime, myIter, myThid ) |
86 |
stephd |
1.30 |
cswdptr -- add --- |
87 |
|
|
#ifdef ALLOW_PTRACERS |
88 |
edhill |
1.32 |
ceh3 this needs an IF ( usePTRACERS ) THEN |
89 |
stephd |
1.30 |
CALL PTRACERS_STATV_WRITE( myCurrentTime, myIter, myThid ) |
90 |
|
|
#endif |
91 |
|
|
cswdptr -- end add --- |
92 |
jmc |
1.26 |
ENDIF |
93 |
|
|
#endif |
94 |
adcroft |
1.21 |
#ifdef ALLOW_AIM |
95 |
jmc |
1.26 |
C-- Do AIM time averages |
96 |
|
|
IF (useAIM) |
97 |
jmc |
1.25 |
& CALL AIM_WRITE_TAVE( myCurrentTime, myIter, myThid ) |
98 |
jmc |
1.28 |
#endif |
99 |
|
|
#ifdef ALLOW_LAND |
100 |
|
|
C-- Do LAND time averages |
101 |
|
|
IF (useLAND) |
102 |
|
|
& CALL LAND_WRITE_TAVE( myCurrentTime, myIter, myThid ) |
103 |
adcroft |
1.21 |
#endif |
104 |
heimbach |
1.29 |
|
105 |
|
|
#ifdef ALLOW_OBCS |
106 |
|
|
IF (useOBCS) |
107 |
|
|
& CALL OBCS_DIAGS( myCurrentTime, myIter, myThid ) |
108 |
|
|
#endif |
109 |
adcroft |
1.16 |
|
110 |
|
|
#ifdef ALLOW_GMREDI |
111 |
|
|
C-- Do KPP diagnostics. |
112 |
heimbach |
1.17 |
IF (useGMRedi) |
113 |
adcroft |
1.16 |
& CALL GMREDI_DIAGS( myCurrentTime, myIter, myThid ) |
114 |
|
|
#endif |
115 |
|
|
|
116 |
|
|
#ifdef ALLOW_KPP |
117 |
|
|
C-- Do KPP diagnostics. |
118 |
heimbach |
1.17 |
IF (useKPP) |
119 |
adcroft |
1.16 |
& CALL KPP_DO_DIAGS( myCurrentTime, myIter, myThid ) |
120 |
|
|
#endif |
121 |
cheisey |
1.23 |
|
122 |
dimitri |
1.27 |
#ifdef ALLOW_SBO |
123 |
|
|
C-- Do SBO diagnostics. |
124 |
|
|
IF (useSBO) THEN |
125 |
|
|
CALL SBO_CALC ( myCurrentTime, myIter, myThid ) |
126 |
|
|
CALL SBO_DIAGS( myCurrentTime, myIter, myThid ) |
127 |
|
|
ENDIF |
128 |
|
|
#endif |
129 |
|
|
|
130 |
cheisey |
1.24 |
#ifdef ALLOW_BULK_FORCE |
131 |
cheisey |
1.23 |
C-- Do bulkf diagnostics. |
132 |
cheisey |
1.24 |
IF (useBulkforce) |
133 |
cheisey |
1.23 |
& CALL BULKF_DIAGS( myCurrentTime, myIter, myThid ) |
134 |
|
|
#endif |
135 |
|
|
|
136 |
cheisey |
1.24 |
#ifdef ALLOW_THERM_SEAICE |
137 |
cheisey |
1.23 |
C-- Do seaice diagnostics. |
138 |
cheisey |
1.24 |
IF (useThermSeaice) |
139 |
cheisey |
1.23 |
& CALL ICE_DIAGS( myCurrentTime, myIter, myThid ) |
140 |
|
|
#endif |
141 |
stephd |
1.30 |
|
142 |
|
|
cswdptr --- add --- |
143 |
heimbach |
1.31 |
#ifdef ALLOW_GCHEM |
144 |
edhill |
1.32 |
ceh3 ??? why is one package depending upon another here? |
145 |
stephd |
1.30 |
C-- Do ptracer diagnostics. |
146 |
|
|
IF (usePTRACERS) |
147 |
|
|
& CALL GCHEM_DIAGS( myCurrentTime, myIter, myThid ) |
148 |
|
|
#endif |
149 |
|
|
cswdptr -- end add --- |
150 |
adcroft |
1.16 |
|
151 |
cnh |
1.1 |
RETURN |
152 |
|
|
END |
153 |
|
|
|