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

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

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


Revision 1.17 - (show annotations) (download)
Wed May 5 18:32:35 1999 UTC (25 years, 2 months ago) by adcroft
Branch: MAIN
CVS Tags: checkpoint21, checkpoint22, checkpoint23, checkpoint24, checkpoint25, checkpoint27, checkpoint26
Changes since 1.16: +2 -1527 lines
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 CStartofinterface
5 SUBROUTINE WRITE_1D_I( fld, lFld, index_type, head, comment )
6 C /==========================================================\
7 C | o SUBROUTINE WRITE_1D_I |
8 C | Controls formatted, tabular I/O for a one-dimensional |
9 C | INTEGER field. |
10 C |==========================================================|
11 C | This routine produces a standard format for list |
12 C | one-dimensional INTEGER data in textual form. The format |
13 C | is designed to be readily parsed by a post-processing |
14 C | uFIELD. |
15 C \==========================================================/
16 IMPLICIT NONE
17
18 C == Global data ==
19 #include "SIZE.h"
20 #include "EEPARAMS.h"
21
22 C == Routine arguments ==
23 C fld - Field to be printed
24 C lFld - Number of elements in field fld.
25 C index_type - Type of index labelling (I=,J=,...) to use
26 C head - Statement start e.g. phi =
27 C comment - Descriptive comment for field
28 INTEGER lFld
29 INTEGER fld(lFld)
30 INTEGER index_type
31 CHARACTER*(*) head
32 CHARACTER*(*) comment
33 CEndofinterface
34
35 C == Local variables ==
36 CHARACTER*(MAX_LEN_MBUF) msgBuf
37
38 WRITE(msgBuf,'(A,A)') head, comment
39 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
40 & SQUEEZE_RIGHT , 1)
41 CALL PRINT_LIST_I( fld, lFld, index_type, .FALSE.,
42 & .TRUE., standardMessageUnit )
43 WRITE(msgBuf,'(A)') ' ; '
44 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
45 & SQUEEZE_RIGHT , 1)
46 C
47 RETURN
48 END
49
50 CStartofinterface
51 SUBROUTINE WRITE_1D_L( fld, lFld, index_type, head, comment )
52 C /==========================================================\
53 C | o SUBROUTINE WRITE_1D_L |
54 C | Controls formatted, tabular I/O for a one-dimensional |
55 C | LOGICAL field. |
56 C |==========================================================|
57 C | This routine produces a standard format for list |
58 C | one-dimensional LOGICAL data in textual form. The format |
59 C | is designed to be readily parsed by a post-processing |
60 C | utility. |
61 C \==========================================================/
62 IMPLICIT NONE
63
64 C == Global data ==
65 #include "SIZE.h"
66 #include "EEPARAMS.h"
67
68 C == Routine arguments ==
69 C fld - Field to be printed
70 C lFld - Number of elements in field fld.
71 C index_type - Type of index labelling (I=,J=,...) to use
72 C head - Statement start e.g. phi =
73 C comment - Descriptive comment for field
74 INTEGER lFld
75 LOGICAL fld(lFld)
76 INTEGER index_type
77 CHARACTER*(*) head
78 CHARACTER*(*) comment
79 CEndofinterface
80
81 C == Local variables ==
82 CHARACTER*(MAX_LEN_MBUF) msgBuf
83
84 WRITE(msgBuf,'(A,A)') head, comment
85 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
86 & SQUEEZE_RIGHT , 1)
87 CALL PRINT_LIST_L( fld, lFld, index_type, .FALSE.,
88 & .TRUE., standardMessageUnit )
89 WRITE(msgBuf,'(A)') ' ; '
90 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
91 & SQUEEZE_RIGHT , 1)
92 C
93 RETURN
94 END
95
96 CStartofinterface
97 SUBROUTINE WRITE_1D_R8( fld, lFld, index_type, head, comment )
98 C /==========================================================\
99 C | o SUBROUTINE WRITE_1D_R8 |
100 C | Controls formatted, tabular I/O for a one-dimensional |
101 C | real*8 field. |
102 C |==========================================================|
103 C | This routine produces a standard format for list |
104 C | one-dimensional real*8 data in textual form. The format |
105 C | is designed to be readilya parsed by a post-processing |
106 C | utility. |
107 C \==========================================================/
108 IMPLICIT NONE
109
110 C == Global data ==
111 #include "SIZE.h"
112 #include "EEPARAMS.h"
113
114 C == Routine arguments ==
115 C fld - Field to be printed
116 C lFld - Number of elements in field fld.
117 C index_type - Type of index labelling (I=,J=,...) to use
118 C head - Statement start e.g. phi =
119 C comment - Descriptive comment for field
120 INTEGER lFld
121 Real*8 fld(lFld)
122 INTEGER index_type
123 CHARACTER*(*) head
124 CHARACTER*(*) comment
125 CEndofinterface
126
127 C == Local variables ==
128 CHARACTER*(MAX_LEN_MBUF) msgBuf
129
130 WRITE(msgBuf,'(A,A)') head, comment
131 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
132 & SQUEEZE_RIGHT , 1)
133 CALL PRINT_LIST_R8( fld, lFld, index_type, .FALSE.,
134 & .TRUE., standardMessageUnit )
135 WRITE(msgBuf,'(A)') ' ; '
136 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
137 & SQUEEZE_RIGHT , 1)
138 C
139 RETURN
140 END

  ViewVC Help
Powered by ViewVC 1.1.22