/[MITgcm]/MITgcm/pkg/sbo/sbo_writevector.F
ViewVC logotype

Contents of /MITgcm/pkg/sbo/sbo_writevector.F

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


Revision 1.4 - (show annotations) (download)
Thu Oct 9 04:19:20 2003 UTC (20 years, 7 months ago) by edhill
Branch: MAIN
CVS Tags: checkpoint51k_post, checkpoint53b_pre, checkpoint51l_post, checkpoint52l_pre, checkpoint52e_pre, hrcube4, checkpoint52n_post, checkpoint52j_post, checkpoint51o_pre, checkpoint52e_post, checkpoint51n_pre, checkpoint52d_pre, checkpoint53c_post, checkpoint53d_post, checkpoint51q_post, checkpoint52j_pre, branch-netcdf, checkpoint52l_post, checkpoint51r_post, checkpoint52k_post, checkpoint52b_pre, checkpoint51i_post, checkpoint51l_pre, checkpoint52m_post, checkpoint53a_post, checkpoint51o_post, checkpoint51p_post, checkpoint53, checkpoint52, checkpoint52d_post, checkpoint52a_post, checkpoint52b_post, checkpoint52f_post, checkpoint52c_post, ecco_c52_e35, hrcube5, checkpoint53b_post, checkpoint52a_pre, checkpoint52i_post, checkpoint51m_post, checkpoint51t_post, checkpoint53d_pre, checkpoint51n_post, checkpoint52i_pre, checkpoint51u_post, checkpoint52h_pre, checkpoint52f_pre, hrcube_1, hrcube_2, hrcube_3, checkpoint51s_post
Branch point for: branch-nonh, netcdf-sm0, tg2-branch, checkpoint51n_branch
Changes since 1.3: +2 -1 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/pkg/sbo/sbo_writevector.F,v 1.2.4.1 2003/10/02 18:18:33 adcroft Exp $
2 C $Name: $
3
4 #include "SBO_OPTIONS.h"
5
6 #undef SAFE_IO
7
8 #ifdef SAFE_IO
9 #define _NEW_STATUS 'new'
10 #else
11 #define _NEW_STATUS 'unknown'
12 #endif
13
14 #ifdef ALLOW_AUTODIFF_TAMC
15 #define _OLD_STATUS 'unknown'
16 #else
17 #define _OLD_STATUS 'old'
18 #endif
19
20 SUBROUTINE SBO_WRITEVECTOR(
21 I fName,
22 I narr,
23 I arr,
24 I irecord,
25 I myIter,
26 I myThid )
27 C /==========================================================\
28 C | SUBROUTINE SBO_WRITEVECTOR |
29 C | o Routine to write a vector to a direct access file. |
30 C |==========================================================|
31 C | This is a rewrite of MDSWRITEVECTOR that outputs a |
32 C | single Real*8 vector from the master process and thread. |
33 C \==========================================================/
34 IMPLICIT NONE
35
36 C === Global variables ===
37 #include "SIZE.h"
38 #include "EEPARAMS.h"
39 #include "PARAMS.h"
40
41 C == Routine arguments ==
42 C
43 C fName string base name for file to written
44 C narr integer size of vector dimension
45 C arr Real array to write, arr(narr)
46 C irecord integer record number to read
47 C myIter integer time step number
48 C myThid integer thread identifier
49
50 C Routine arguments
51 character*(*) fName
52 integer narr
53 Real*8 arr(narr)
54 integer irecord
55 integer myIter
56 integer myThid
57
58 #ifdef ALLOW_SBO
59
60 C Functions
61 integer ILNBLNK
62 integer MDS_RECLEN
63
64 C Local variables
65 C filePrec integer number of bits per word in file (64)
66 integer filePrec / 64 /
67 character*(80) dataFName,metaFName
68 integer dUnit,IL
69 logical fileIsOpen
70 integer dimList(3,3),ndims
71 integer length_of_rec
72 character*(max_len_mbuf) msgbuf
73
74 C Only do I/O if I am the master process
75 IF( myProcId .EQ. 0 ) THEN
76
77 C Only do I/O if I am the master thread
78 _BEGIN_MASTER( myThid )
79
80 C Record number must be >= 1
81 if (irecord .LT. 1) then
82 write(msgbuf,'(a,i9.8)')
83 & ' SBO_WRITEVECTOR: argument irecord = ',irecord
84 call print_message( msgbuf, standardmessageunit,
85 & SQUEEZE_RIGHT , mythid)
86 write(msgbuf,'(a)')
87 & ' SBO_WRITEVECTOR: invalid value for irecord'
88 call print_error( msgbuf, mythid )
89 stop 'ABNORMAL END: S/R SBO_WRITEVECTOR'
90 endif
91
92 C Assume nothing
93 fileIsOpen = .FALSE.
94 IL=ILNBLNK( fName )
95
96 C Assign a free unit number as the I/O channel for this routine
97 call MDSFINDUNIT( dUnit, mythid )
98
99 C Open file
100 write(dataFname(1:80),'(2a)') fName(1:IL),'.data'
101 if (irecord .EQ. 1) then
102 length_of_rec = MDS_RECLEN( filePrec, narr, mythid )
103 open( dUnit, file=dataFName, status=_NEW_STATUS,
104 & access='direct', recl=length_of_rec )
105 fileIsOpen=.TRUE.
106 else
107 length_of_rec = MDS_RECLEN( filePrec, narr, mythid )
108 open( dUnit, file=dataFName, status=_OLD_STATUS,
109 & access='direct', recl=length_of_rec )
110 fileIsOpen=.TRUE.
111 endif
112
113 C Write record
114 if (fileIsOpen) then
115 write(msgbuf,'(a,i9.8,2x,i9.8)')
116 & ' SBO_WRITEVECTOR: irec = ',irecord,narr
117 call print_message( msgbuf, standardmessageunit,
118 & SQUEEZE_RIGHT , mythid)
119 write(dUnit,rec=irecord) arr
120 else
121 write(msgbuf,'(a)')
122 & ' SBO_WRITEVECTOR: I should never get to this point'
123 call print_error( msgbuf, mythid )
124 stop 'ABNORMAL END: S/R SBO_WRITEVECTOR'
125 endif
126
127 C Close file
128 if (fileIsOpen) then
129 close( dUnit )
130 fileIsOpen = .FALSE.
131 endif
132
133 C Create meta-file
134 write(metaFName(1:80),'(2a)') fName(1:IL),'.meta'
135 dimList(1,1) = narr
136 dimList(2,1) = 1
137 dimList(3,1) = narr
138 dimList(1,2) = 1
139 dimList(2,2) = 1
140 dimList(3,2) = 1
141 dimList(1,3) = 1
142 dimList(2,3) = 1
143 dimList(3,3) = 1
144 ndims=1
145 call MDSWRITEMETA( metaFName, dataFName,
146 & filePrec, ndims, dimList, irecord, myIter, mythid )
147
148 _END_MASTER( myThid )
149
150 ENDIF
151
152 #endif /* ALLOW_SBO */
153
154 return
155 end

  ViewVC Help
Powered by ViewVC 1.1.22