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

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

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


Revision 1.19 - (hide annotations) (download)
Wed May 5 18:32:34 1999 UTC (25 years, 1 month ago) by adcroft
Branch: MAIN
CVS Tags: checkpoint21, checkpoint22, checkpoint23, checkpoint24, checkpoint25
Changes since 1.18: +10 -2 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 adcroft 1.19 C $Header: /u/gcmpack/models/MITgcmUV/model/src/ini_depths.F,v 1.18 1998/12/15 00:20:34 adcroft Exp $
2 cnh 1.1
3 cnh 1.16 #include "CPP_OPTIONS.h"
4 cnh 1.1
5     CStartOfInterface
6     SUBROUTINE INI_DEPTHS( myThid )
7     C /==========================================================\
8     C | SUBROUTINE INI_DEPTHS |
9     C | o Initialise map of model depths |
10     C |==========================================================|
11     C | The depths of the bottom of the model is specified in |
12     C | terms of an XY map with one depth for each column of |
13     C | grid cells. Depths do not have to coincide with the |
14 cnh 1.15 C | model levels. The model lopping algorithm makes it |
15 cnh 1.1 C | possible to represent arbitrary depths. |
16     C | The mode depths map also influences the models topology |
17     C | By default the model domain wraps around in X and Y. |
18     C | This default doubly periodic topology is "supressed" |
19     C | if a depth map is defined which closes off all wrap |
20     C | around flow. |
21     C \==========================================================/
22 adcroft 1.17 IMPLICIT NONE
23 cnh 1.1
24     C === Global variables ===
25     #include "SIZE.h"
26     #include "EEPARAMS.h"
27     #include "PARAMS.h"
28     #include "GRID.h"
29    
30     C == Routine arguments ==
31     C myThid - Number of this instance of INI_DEPTHS
32     INTEGER myThid
33     CEndOfInterface
34    
35     C == Local variables ==
36     C iG, jG - Global coordinate index
37     C bi,bj - Loop counters
38     C I,J,K
39 adcroft 1.9 C phi - total depth of model
40 cnh 1.13 C oldPrec - Temporary used in controlling binary input dataset precision
41 cnh 1.1 INTEGER iG, jG
42     INTEGER bi, bj
43     INTEGER I, J, K
44 adcroft 1.9 _RL phi
45 cnh 1.1
46     _BARRIER
47 cnh 1.4 IF ( bathyFile .EQ. ' ' ) THEN
48     C Set up a flat bottom box with doubly periodic topology.
49     C H is the basic variable from which other terms are derived. It
50     C is the term that would be set from an external file for a
51     C realistic problem.
52 cnh 1.12 phi = rF(Nr+1)
53 cnh 1.4 DO bj = myByLo(myThid), myByHi(myThid)
54     DO bi = myBxLo(myThid), myBxHi(myThid)
55     DO j=1,sNy
56     DO i=1,sNx
57     iG = myXGlobalLo-1+(bi-1)*sNx+I
58     jG = myYGlobalLo-1+(bj-1)*sNy+J
59     C Default depth of full domain
60     H(i,j,bi,bj) = phi
61     C Test for eastern edge
62 adcroft 1.18 C IF ( iG .EQ. nX ) H(i,j,bi,bj) = 0.
63 cnh 1.4 C Test for northern edge
64 adcroft 1.18 C IF ( jG .EQ. nY ) H(i,j,bi,bj) = 0.
65 cnh 1.4 ENDDO
66 cnh 1.1 ENDDO
67     ENDDO
68     ENDDO
69 cnh 1.4 ELSE
70     _BEGIN_MASTER( myThid )
71 adcroft 1.19 C Read the bathymetry using the mid-level I/O pacakage read_write_rec
72     C The 0 is the "iteration" argument. The 1 is the record number.
73     CALL READ_REC_XY_RS( bathyFile, H, 1, 0, myThid )
74     C Read the bathymetry using the mid-level I/O pacakage read_write_fld
75     C The 0 is the "iteration" argument. The ' ' is an empty suffix
76     C CALL READ_FLD_XY_RS( bathyFile, ' ', H, 0, myThid )
77     C Read the bathymetry using the low-level I/O package
78     C CALL MDSREADFIELD( bathyFile, readBinaryPrec,
79     C & 'RS', 1, H, 1, myThid )
80 cnh 1.4 _END_MASTER(myThid)
81     ENDIF
82 cnh 1.14
83 cnh 1.4 _EXCH_XY_R4( H, myThid )
84 cnh 1.5 C
85 cnh 1.7 CALL PLOT_FIELD_XYRS( H, 'Model depths' , 1, myThid )
86 cnh 1.1 C
87     RETURN
88     END

  ViewVC Help
Powered by ViewVC 1.1.22