/[MITgcm]/MITgcm/model/src/do_the_model_io.F
ViewVC logotype

Contents of /MITgcm/model/src/do_the_model_io.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.34 - (show annotations) (download)
Thu Nov 20 03:50:22 2003 UTC (20 years, 7 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint52b_pre
Changes since 1.33: +31 -36 lines
also called just before starting to dump initial state (main + pkgs).

1 C $Header: /u/gcmpack/MITgcm/model/src/do_the_model_io.F,v 1.33 2003/11/12 21:52:57 jmc Exp $
2 C $Name: $
3
4 #include "PACKAGES_CONFIG.h"
5 #include "CPP_OPTIONS.h"
6
7 CBOP
8 C !ROUTINE: DO_THE_MODEL_IO
9 C !INTERFACE:
10 SUBROUTINE DO_THE_MODEL_IO( myTime, myIter, myThid )
11 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 IMPLICIT NONE
34 C == Global variables ===
35 #include "SIZE.h"
36 #include "EEPARAMS.h"
37 #include "PARAMS.h"
38 #include "DYNVARS.h"
39
40
41 LOGICAL DIFFERENT_MULTIPLE
42 EXTERNAL DIFFERENT_MULTIPLE
43
44 C !INPUT/OUTPUT PARAMETERS:
45 C == Routine arguments ==
46 C myThid - Thread number for this instance of the routine.
47 C myIter - Iteration number
48 C myTime - Current time of simulation ( s )
49 INTEGER myThid
50 INTEGER myIter
51 _RL myTime
52
53 CEOP
54
55 C-- Generaly only thread 1 does IO here. It can not start until
56 C-- all threads fields are ready.
57 IF (debugMode) THEN
58 IF ( DIFFERENT_MULTIPLE(dumpFreq,myTime, myTime-deltaTClock)
59 & ) THEN
60
61 _BARRIER
62
63 C-- Write "text-plots" of certain fields
64 CALL PLOT_FIELD_XYZRL( uVel , 'Current uVel ' ,
65 & Nr, myIter, myThid )
66 CALL PLOT_FIELD_XYZRL( vVel , 'Current vVel ' ,
67 & Nr, myIter, myThid )
68 CALL PLOT_FIELD_XYZRL( theta, 'Current theta ' ,
69 & Nr, myIter, myThid )
70 CALL PLOT_FIELD_XYRL( etaN , 'Current etaN ' ,
71 & myIter, myThid )
72
73 ENDIF
74 ENDIF
75
76 C-- Write model state to binary file
77 CALL WRITE_STATE( myTime, myIter, myThid )
78
79 #ifdef ALLOW_TIMEAVE
80 C-- Do time averages
81 IF (taveFreq.GT.0. .AND. myIter.NE.nIter0 ) THEN
82 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
88 #endif
89
90 #ifdef ALLOW_AIM
91 C-- Do AIM time averages
92 IF (useAIM .AND. myIter.NE.nIter0 )
93 & CALL AIM_WRITE_TAVE( myTime, myIter, myThid )
94 #endif
95 #ifdef ALLOW_LAND
96 C-- Do LAND time averages
97 IF (useLAND .AND. myIter.NE.nIter0 )
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
107 C-- Do KPP diagnostics.
108 IF (useGMRedi .AND. myIter.NE.nIter0 )
109 & CALL GMREDI_DIAGS( myTime, myIter, myThid )
110 #endif
111
112 #ifdef ALLOW_KPP
113 C-- Do KPP diagnostics.
114 IF (useKPP .AND. myIter.NE.nIter0 )
115 & CALL KPP_DO_DIAGS( myTime, myIter, myThid )
116 #endif
117
118 #ifdef ALLOW_SBO
119 C-- Do SBO diagnostics.
120 IF (useSBO .AND. myIter.NE.nIter0 ) THEN
121 CALL SBO_CALC ( myTime, myIter, myThid )
122 CALL SBO_DIAGS( myTime, myIter, myThid )
123 ENDIF
124 #endif
125
126 #ifdef ALLOW_BULK_FORCE
127 C-- Do bulkf diagnostics.
128 IF (useBulkforce .AND. myIter.NE.nIter0 )
129 & CALL BULKF_DIAGS( myTime, myIter, myThid )
130 #endif
131
132 #ifdef ALLOW_THERM_SEAICE
133 C-- Do seaice diagnostics.
134 IF (useThermSeaice)
135 & CALL ICE_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 RETURN
148 END

  ViewVC Help
Powered by ViewVC 1.1.22