/[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.1 - (show annotations) (download)
Wed May 5 18:32:35 1999 UTC (25 years, 1 month ago) by adcroft
Branch: MAIN
CVS Tags: checkpoint21, checkpoint22, checkpoint23
Implemented new I/O package (mdsio.F). This package does parallel
I/O in much the same way as dfile.F used to except it uses "direct
access" rather than (f77) unformatted sequential access.

Problems with dfile.F package included:
  o unnecessary memory use (each process had two global sized buffers)
  o inability to read the files it had written without post-processing
  o "tiled" files were tiled by process/thread rather than actual tiles
  o created huge numbers of files with no alternatives

Features of the mdsio.F package:
  o direct-access binary writes
  o no excessive memory use
  o ability to read/write from multiple record files
  o "tiled" files are based on "WRAPPER" tiles so that the number
    and content of files is independent of the number of threads
    and/or processes
  o option to create single "global" files rather than "tiled" files
  o ability to read both "global" and "tiled" files
    [Caveat: the tiling of files must match the model tiles]
  o checkpoints now use a single file per model section
    ie.  one file for the hydrostatic model core, one file
    for the non-hydrostatic extensions and one file for the C-D
    extensions
  o the mid-level I/O routines now is broken into more source files
    read_write_fld.F supplies basic I/O routines with the same interface
                     as the original I/O package
    read_write_rec.F supplies I/O routines which allow multiple records
    write_state.F    writes the model state
    checkpoint.F     supplies the read/write checkpoint routines

All the example input data has had to be modified to be direct-access.
Otherwise only routines that used I/O have been affected and not
all of those have been due to the continuity of arguments in
the read_write_fld.F routines.

What needs to be done?  We have to create a suite of conversion
utilities for users with old-style data. Also supply the option
for using old-style I/O, not just for die-hards but for reading
data too extensive to be converted. And more...

1 C $Header: /u/gcmpack/models/MITgcmUV/model/src/read_write.F,v 1.16 1999/03/22 15:54:04 adcroft Exp $
2 #include "CPP_OPTIONS.h"
3
4 C-- File read_write.F: Routines to handle mid-level I/O interface.
5 C-- Contents
6 C-- o WRITE_STATE - Write out model state.
7
8 CStartofinterface
9 SUBROUTINE WRITE_STATE ( forceOutput, myCurrentTime,
10 & myIter, myThid )
11 C /==========================================================\
12 C | SUBROUTINE WRITE_STATE |
13 C | o Controlling routine for IO to dump model state. |
14 C |==========================================================|
15 C | Write model state files for post-processing. This file |
16 C | includes code for diagnosing W and RHO for output. |
17 C \==========================================================/
18 IMPLICIT NONE
19
20 C == Global variables ===
21 #include "SIZE.h"
22 #include "EEPARAMS.h"
23 #include "PARAMS.h"
24 #include "DYNVARS.h"
25 #include "CG2D.h"
26 #ifdef ALLOW_NONHYDROSTATIC
27 #include "CG3D.h"
28 #include "GW.h"
29 #endif
30
31 LOGICAL DIFFERENT_MULTIPLE
32 EXTERNAL DIFFERENT_MULTIPLE
33 INTEGER IO_ERRCOUNT
34 EXTERNAL IO_ERRCOUNT
35
36 C == Routine arguments ==
37 C myThid - Thread number for this instance of the routine.
38 C myIter - Iteration number
39 C myCurrentTime - Current time of simulation ( s )
40 LOGICAL forceOutput
41 REAL myCurrentTime
42 INTEGER myThid
43 INTEGER myIter
44 CEndofinterface
45
46 C == Local variables ==
47 C suff - Hold suffix part of a filename
48 C beginIOErrCount - Begin and end IO error counts
49 C endIOErrCount
50 C msgBuf - Error message buffer
51 INTEGER beginIOErrCount
52 INTEGER endIOErrCount
53 CHARACTER*(MAX_LEN_MBUF) msgBuf
54 CHARACTER*(MAX_LEN_MBUF) suff
55 CHARACTER*(80) fName
56
57 IF (
58 & ( DIFFERENT_MULTIPLE(dumpFreq,myCurrentTime,
59 & myCurrentTime-deltaTClock) .AND. myCurrentTime.NE.startTime )
60 & .OR. forceOutput
61 & ) THEN
62
63 C-- Going to really do some IO. Make everyone except master thread wait.
64 _BARRIER
65 _BEGIN_MASTER( myThid )
66
67 WRITE(suff,'(I10.10)') myIter
68
69 C-- Write model fields
70 CALL WRITE_FLD_XYZ_RL( 'U.',suff,uVel,myIter,myThid)
71 CALL WRITE_FLD_XYZ_RL( 'V.',suff,vVel,myIter,myThid)
72 CALL WRITE_FLD_XYZ_RL( 'T.',suff,theta,myIter,myThid)
73 CALL WRITE_FLD_XYZ_RL( 'S.',suff,salt,myIter,myThid)
74 CALL WRITE_FLD_XY_RL( 'PS.',suff,cg2d_x,myIter,myThid)
75
76 #ifdef ALLOW_NONHYDROSTATIC
77 IF (nonHydroStatic) THEN
78 CALL WRITE_FLD_XYZ_RL( 'PNH.',suff,cg3d_x,myIter,myThid)
79 ENDIF
80 CALL WRITE_FLD_XYZ_RL( 'W.',suff,wVel,myIter,myThid)
81 #endif
82
83 _END_MASTER( myThid )
84 _BARRIER
85
86 ENDIF
87
88 RETURN
89 END

  ViewVC Help
Powered by ViewVC 1.1.22