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

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

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


Revision 1.25 - (show annotations) (download)
Thu Oct 9 04:19:18 2003 UTC (20 years, 8 months ago) by edhill
Branch: MAIN
CVS Tags: checkpoint51k_post, checkpoint52d_pre, checkpoint51o_pre, checkpoint51l_post, checkpoint52, checkpoint52f_post, checkpoint51t_post, checkpoint51n_post, hrcube_1, checkpoint51s_post, checkpoint52e_pre, checkpoint52e_post, checkpoint51n_pre, checkpoint52b_pre, checkpoint51l_pre, checkpoint51q_post, checkpoint52b_post, checkpoint52c_post, checkpoint52f_pre, checkpoint51r_post, checkpoint51i_post, checkpoint52d_post, checkpoint52a_pre, branch-netcdf, checkpoint51o_post, checkpoint52a_post, ecco_c52_e35, checkpoint51m_post, checkpoint51p_post, checkpoint51u_post
Branch point for: branch-nonh, tg2-branch, netcdf-sm0, checkpoint51n_branch
Changes since 1.24: +6 -2 lines
 o first check-in for the "branch-genmake2" merge
 o verification suite as run on shelley (gcc 3.2.2):

Wed Oct  8 23:42:29 EDT 2003
                T           S           U           V
G D M    c        m  s        m  s        m  s        m  s
E p a R  g  m  m  e  .  m  m  e  .  m  m  e  .  m  m  e  .
N n k u  2  i  a  a  d  i  a  a  d  i  a  a  d  i  a  a  d
2 d e n  d  n  x  n  .  n  x  n  .  n  x  n  .  n  x  n  .

OPTFILE=NONE

Y Y Y Y 13 16 16 16  0 16 16 16 16 16 16 16 16 13 12  0  0 pass  adjustment.128x64x1
Y Y Y Y 16 16 16 16  0 16 16 16 16 16 16  0  0 16 16  0  0 pass  adjustment.cs-32x32x1
Y Y Y Y 16 16 16 16  0 16 16 16 16 16 16 22  0 16 16 22  0 pass  adjust_nlfs.cs-32x32x1
Y Y Y Y -- 13 13 16 16 13 13 13 13 16 16 16 16 16 16 16 16 N/O   advect_cs
Y Y Y Y -- 22 16 16 16 16 16 16 13 16 16 16 16 16 16 16 16 N/O   advect_xy
Y Y Y Y -- 13 16 13 16 16 16 16 16 16 16 22 16 16 16 16 16 N/O   advect_xz
Y Y Y Y 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 pass  aim.5l_cs
Y Y Y Y 14 16 16 16 16 16 16 16 16 13 16 16 16 16 16 13 16 pass  aim.5l_Equatorial_Channel
Y Y Y Y 16 16 16 16 16 16 16 16 16 16 16 13 16 16 13 13 16 pass  aim.5l_LatLon
Y Y Y Y 13 16 16 16 16 16 16 16 16 16 13 12 13 13 16 13 16 pass  exp0
Y Y Y Y 14 16 16 16 16 16 16 16 22 16 16 16 13 16 16 22 16 pass  exp1
Y Y Y Y 13 13 16 13 16 16 16 16 16 13 13 16 16 13 13 13 13 pass  exp2
Y Y Y Y 16 16 16 16 16 16 16 16 22 16 16 16 16 16 16 16 16 pass  exp4
Y Y Y Y 16 16 16 16 16 16 16 16 16 16 16 22 16 16 16 22 16 pass  exp5
Y Y Y Y 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 pass  front_relax
Y Y Y Y 14 16 16 13 13 16 16 13 13 16 13 13 16 12 13 13 16 pass  global_ocean.90x40x15
Y Y Y Y 10 16 16 13 13 16 13 16 16 13 13 13 13 16 16 13 16 FAIL  global_ocean.cs32x15
Y Y Y Y  6 11 12 13 13 12 13 16 13  9  9  9  9 10  9  9 11 FAIL  global_ocean_pressure
Y Y Y Y 14 16 16 13 16 16 16 13 13 13 13 13 16 12 16 13 16 pass  global_with_exf
Y Y Y Y 14 16 16 16 16 16 16 16 16 11 13 22 13 16 16  9 16 pass  hs94.128x64x5
Y Y Y Y 13 16 16 16 16 16 16 16 16 11 16 16 16 13 16 22 13 pass  hs94.1x64x5
Y Y Y Y 14 16 16 16 16 16 16 16 16 13 16 13 13 16 16 22 13 pass  hs94.cs-32x32x5
Y Y Y Y 10 10 16 13 13 16 16 16 22 16 13 13 13 13 13 22 13 FAIL  ideal_2D_oce
Y Y Y Y  8 16 16 16 16 16 16 16 16 13 13  8 16 16 16 16 16 FAIL  internal_wave
Y Y Y Y 14 16 16 16 16 16 16 16 16 13 13 22 13 13 13 22 16 pass  inverted_barometer
Y Y Y Y 12 16 16 16 16 16 16 16 16 16 13 12 13 13 13 13 13 FAIL  lab_sea
Y Y Y Y 11 16 16 16 16 16 16 16 13 13 13 12 13 16 13 12 13 FAIL  natl_box
Y Y Y Y 16 16 16 16 16 16 16 16 22 16 16 16 16 16 16 16 16 pass  plume_on_slope
Y Y Y Y 13 16 16 16 16 13 16 16 16 16 16 16 16 13 16 16 16 pass  solid-body.cs-32x32x1

1 C $Header: /u/u3/gcmpack/MITgcm/model/src/write_state.F,v 1.24.2.1 2003/10/02 18:10:45 edhill Exp $
2 C $Name: $
3
4 #include "PACKAGES_CONFIG.h"
5 #include "CPP_OPTIONS.h"
6
7 #undef MULTIPLE_RECORD_STATE_FILES
8
9 CBOP
10 C !ROUTINE: WRITE_STATE
11 C !INTERFACE:
12 SUBROUTINE WRITE_STATE ( myTime, myIter, myThid )
13 C !DESCRIPTION: \bv
14 C *==========================================================*
15 C | SUBROUTINE WRITE_STATE
16 C | o Controlling routine for IO to dump model state.
17 C *==========================================================*
18 C | Write model state files for post-processing. This file
19 C | includes code for diagnosing W and RHO for output.
20 C | File write_state.F: Routines to handle mid-level I/O
21 C | interface.
22 C | o WRITE_STATE - Write out model state.
23 C | The following CPP flag (MULTIPLE_RECORD_STATE_FILES) is
24 C | #define/#undefed here since it is specific to this routine
25 C | and very user-preference specific.
26 C |
27 C | If #undefed (default) the state files are written as in all versions
28 C | prior to checkpoint32, where a file is created per variable, per time
29 C | and per tile. This *has* to be the default because most users use this
30 C | mode and all utilities and scripts (diagnostic) assume this form.
31 C | It is also robust, as explained below.
32 C |
33 C | If #defined, subsequent snap-shots are written as records in the
34 C | same file (no iteration number in filenames).
35 C | Advantages: - fewer files
36 C | - for small problems, is easy to copy the output around
37 C | Disadvantages:
38 C | - breaks a lot of diagnostic scripts
39 C | - for large or long problems this creates huge files
40 C | - is an unexpected, unsolicited change in behaviour which came
41 C | as a surprise (in c32) and inconvenience to several users
42 C | - can not accomodate changing the frequency of output
43 C | after a pickup (this is trivial in previous method
44 C | but needs new code and parameters in this new method)
45 C | Known Bugs:
46 C | - if the length of integration is not exactly an integer
47 C | times the output frequency then the last record written
48 C | (at end of integration) overwrites a previously written
49 C | record corresponding to an earier time. *BE WARNED*
50 C *==========================================================*
51 C \ev
52
53 C !USES:
54 IMPLICIT NONE
55 C == Global variables ===
56 #include "SIZE.h"
57 #include "EEPARAMS.h"
58 #include "PARAMS.h"
59 #include "DYNVARS.h"
60 #include "GRID.h"
61 #include "EOS.h"
62 #ifdef ALLOW_PASSIVE_TRACER
63 #include "TR1.h"
64 #endif
65 LOGICAL DIFFERENT_MULTIPLE
66 EXTERNAL DIFFERENT_MULTIPLE
67 INTEGER IO_ERRCOUNT
68 EXTERNAL IO_ERRCOUNT
69
70 C !INPUT/OUTPUT PARAMETERS:
71 C == Routine arguments ==
72 C myThid - Thread number for this instance of the routine.
73 C myIter - Iteration number
74 C myTime - Current time of simulation ( s )
75 _RL myTime
76 INTEGER myThid
77 INTEGER myIter
78
79 C !LOCAL VARIABLES:
80 C == Local variables ==
81 CHARACTER*(MAX_LEN_MBUF) suff
82 INTEGER iRec
83 CEOP
84
85 IF (
86 & DIFFERENT_MULTIPLE(dumpFreq,myTime,
87 & myTime-deltaTClock) .OR.
88 & myTime.EQ.endTime .OR.
89 & myTime.EQ.startTime
90 & ) THEN
91 IF ( dumpFreq .EQ. 0.0 ) THEN
92 iRec = 1
93 ELSE
94 iRec = int ( (myTime-startTime) / dumpFreq +1.5 )
95 ENDIF
96
97 C-- Going to really do some IO. Make everyone except master thread wait.
98 _BARRIER
99 _BEGIN_MASTER( myThid )
100
101 C-- Write model fields
102
103 #ifdef MULTIPLE_RECORD_STATE_FILES
104
105 C Write each snap-shot as a new record in one file per variable
106 C - creates relatively few files but these files can become huge
107 CALL WRITE_REC_XYZ_RL( 'U', uVel,iRec,myIter,myThid)
108 CALL WRITE_REC_XYZ_RL( 'V', vVel,iRec,myIter,myThid)
109 CALL WRITE_REC_XYZ_RL( 'T', theta,iRec,myIter,myThid)
110 CALL WRITE_REC_XYZ_RL( 'S', salt,iRec,myIter,myThid)
111 CALL WRITE_REC_XY_RL('Eta',etaN,iRec,myIter,myThid)
112 CALL WRITE_REC_XYZ_RL( 'W',wVel,iRec,myIter,myThid)
113 #ifdef ALLOW_PASSIVE_TRACER
114 ceh3 needs an IF ( usePASSIVE_TRACER ) THEN
115 CALL WRITE_REC_XYZ_RL( 'TR1',tr1,iRec,myIter,myThid)
116 #endif /* ALLOW_PASSIVE_TRACER */
117 #ifdef ALLOW_NONHYDROSTATIC
118 IF (nonHydroStatic) THEN
119 CALL WRITE_REC_XYZ_RL( 'PNH',phi_nh,iRec,myIter,myThid)
120 ENDIF
121 #endif /* ALLOW_NONHYDROSTATIC */
122 #ifdef NONLIN_FRSURF
123 c CALL WRITE_REC_XYZ_RS('hFacC.',hFacC,iRec,myIter,myThid)
124 c CALL WRITE_REC_XYZ_RS('hFacW.',hFacW,iRec,myIter,myThid)
125 c CALL WRITE_REC_XYZ_RS('hFacS.',hFacS,iRec,myIter,myThid)
126 #endif /* NONLIN_FRSURF */
127
128 #else /* MULTIPLE_RECORD_STATE_FILES */
129
130 C Write each snap-shot as a new file (original and default method)
131 C - creates many files but for large configurations is easier to
132 C transfer analyse a particular snap-shots
133 WRITE(suff,'(I10.10)') myIter
134 CALL WRITE_FLD_XYZ_RL( 'U.',suff,uVel,myIter,myThid)
135 CALL WRITE_FLD_XYZ_RL( 'V.',suff,vVel,myIter,myThid)
136 CALL WRITE_FLD_XYZ_RL( 'T.',suff,theta,myIter,myThid)
137 CALL WRITE_FLD_XYZ_RL( 'S.',suff,salt,myIter,myThid)
138 CALL WRITE_FLD_XY_RL('Eta.',suff,etaN,myIter,myThid)
139 CALL WRITE_FLD_XYZ_RL( 'W.',suff,wVel,myIter,myThid)
140 IF ( useDynP_inEos_Zc .OR. myIter.NE.nIter0 )
141 & CALL WRITE_FLD_XYZ_RL( 'PH.',suff,totPhiHyd,myIter,myThid)
142 IF (buoyancyRelation.NE.'ATMOSPHERIC' .AND. myIter.NE.nIter0)
143 & CALL WRITE_FLD_XY_RL('PHL.',suff,phiHydLow,myIter,myThid)
144 #ifdef ALLOW_PASSIVE_TRACER
145 ceh3 needs an IF ( usePASSIVE_TRACER ) THEN
146 CALL WRITE_FLD_XYZ_RL( 'TR1.',suff,tr1,myIter,myThid)
147 #endif
148 #ifdef ALLOW_NONHYDROSTATIC
149 IF (nonHydroStatic) THEN
150 CALL WRITE_FLD_XYZ_RL( 'PNH.',suff,phi_nh,myIter,myThid)
151 ENDIF
152 #endif /* ALLOW_NONHYDROSTATIC */
153 #ifdef NONLIN_FRSURF
154 c CALL WRITE_FLD_XYZ_RS('hFacC.',suff,hFacC,myIter,myThid)
155 c CALL WRITE_FLD_XYZ_RS('hFacW.',suff,hFacW,myIter,myThid)
156 c CALL WRITE_FLD_XYZ_RS('hFacS.',suff,hFacS,myIter,myThid)
157 #endif /* NONLIN_FRSURF */
158
159 #endif /* MULTIPLE_RECORD_STATE_FILES */
160
161 #ifdef ALLOW_PTRACERS
162 IF (usePTRACERS) CALL PTRACERS_WRITE_STATE(myIter,myTime,myThid)
163 #endif /* ALLOW_PTRACERS */
164 _END_MASTER( myThid )
165 _BARRIER
166
167 ENDIF
168
169 RETURN
170 END

  ViewVC Help
Powered by ViewVC 1.1.22