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

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

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


Revision 1.30 - (hide annotations) (download)
Wed Jun 25 21:06:35 2003 UTC (21 years ago) by stephd
Branch: MAIN
CVS Tags: checkpoint51b_pre, checkpoint51a_post
Changes since 1.29: +15 -1 lines
additions for biogeochemistry packages

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

  ViewVC Help
Powered by ViewVC 1.1.22