/[MITgcm]/MITgcm/pkg/diagnostics/diagnostics_read_pickup.F
ViewVC logotype

Contents of /MITgcm/pkg/diagnostics/diagnostics_read_pickup.F

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


Revision 1.6 - (show annotations) (download)
Thu Aug 27 18:00:01 2009 UTC (14 years, 9 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint64y, checkpoint64x, checkpoint64z, checkpoint64q, checkpoint64p, checkpoint64s, checkpoint64r, checkpoint64u, checkpoint64t, checkpoint64w, checkpoint64v, checkpoint64i, checkpoint64h, checkpoint64k, checkpoint64j, checkpoint64m, checkpoint64l, checkpoint64o, checkpoint64n, checkpoint64a, checkpoint64c, checkpoint64b, checkpoint64e, checkpoint64d, checkpoint64g, checkpoint64f, checkpoint63p, checkpoint63q, checkpoint63r, checkpoint63s, checkpoint63l, checkpoint63m, checkpoint63n, checkpoint63o, checkpoint63h, checkpoint63i, checkpoint63j, checkpoint63k, checkpoint63d, checkpoint63e, checkpoint63f, checkpoint63g, checkpoint63a, checkpoint63b, checkpoint63c, checkpoint64, checkpoint65, checkpoint62, checkpoint63, checkpoint66g, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint66i, checkpoint66h, checkpoint65z, checkpoint65x, checkpoint65y, checkpoint65r, checkpoint65s, checkpoint65p, checkpoint65q, checkpoint65v, checkpoint65w, checkpoint65t, checkpoint65u, checkpoint65j, checkpoint65k, checkpoint65h, checkpoint65i, checkpoint65n, checkpoint65o, checkpoint65l, checkpoint65m, checkpoint65b, checkpoint65c, checkpoint65a, checkpoint65f, checkpoint65g, checkpoint65d, checkpoint65e, checkpoint62c, checkpoint62b, checkpoint62a, checkpoint62g, checkpoint62f, checkpoint62e, checkpoint62d, checkpoint62k, checkpoint62j, checkpoint62i, checkpoint62h, checkpoint62o, checkpoint62n, checkpoint62m, checkpoint62l, checkpoint62s, checkpoint62r, checkpoint62q, checkpoint62p, checkpoint62w, checkpoint62v, checkpoint62u, checkpoint62t, checkpoint62z, checkpoint62y, checkpoint62x, checkpoint61v, checkpoint61w, checkpoint61z, checkpoint61x, checkpoint61y
Changes since 1.5: +23 -20 lines
use type specific (RL or RS) S/R from rw pkg instead of calling old S/R
 MDSREADFIELD,MDSWRITEFIELD from mdsio pkg.

1 C $Header: /u/gcmpack/MITgcm/pkg/diagnostics/diagnostics_read_pickup.F,v 1.5 2008/02/05 15:31:19 jmc Exp $
2 C $Name: $
3
4 #include "DIAG_OPTIONS.h"
5
6 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
7 CBOP
8 C !ROUTINE: DIAGNOSTICS_READ_PICKUP
9 C !INTERFACE:
10 SUBROUTINE DIAGNOSTICS_READ_PICKUP(
11 I myThid )
12
13 C !DESCRIPTION:
14 C Reads previously saved state for the diagnostics package.
15
16 C !USES:
17 IMPLICIT NONE
18
19 C == Global variables ===
20 #include "SIZE.h"
21 #include "EEPARAMS.h"
22 #include "PARAMS.h"
23 #include "DIAGNOSTICS_SIZE.h"
24 #include "DIAGNOSTICS.h"
25
26 C !INPUT/OUTPUT PARAMETERS:
27 C myThid :: Number of this instance
28 INTEGER myThid
29
30 #ifdef DIAGNOSTICS_HAS_PICKUP
31
32 C !LOCAL VARIABLES:
33 C fn :: character buffer for creating filename
34 C prec :: precision of pickup files
35 c INTEGER prec, iChar, lChar, k
36 INTEGER bi,bj
37 INTEGER prec, sn
38 CHARACTER*(MAX_LEN_FNAM) fn
39
40 INTEGER ILNBLNK
41 EXTERNAL ILNBLNK
42
43 INTEGER dUnit, n, m
44
45 #ifdef ALLOW_MNC
46 INTEGER i, ii
47 CHARACTER*(MAX_LEN_FNAM) diag_mnc_bn
48 INTEGER CW_DIMS, NLEN
49 PARAMETER ( CW_DIMS = 10 )
50 PARAMETER ( NLEN = 80 )
51 INTEGER dim(CW_DIMS), ib(CW_DIMS), ie(CW_DIMS)
52 CHARACTER*(NLEN) dn(CW_DIMS)
53 CHARACTER*(NLEN) d_cw_name
54 CHARACTER*(NLEN) dn_blnk
55 #endif /* ALLOW_MNC */
56
57
58 C Add pickup capability
59 IF (diag_pickup_read) THEN
60
61 #ifdef ALLOW_MNC
62 IF (diag_pickup_read_mnc) THEN
63 DO i = 1,NLEN
64 dn_blnk(i:i) = ' '
65 ENDDO
66 DO i = 1,MAX_LEN_FNAM
67 diag_mnc_bn(i:i) = ' '
68 ENDDO
69 WRITE(diag_mnc_bn,'(A)') 'pickup_diagnostics'
70
71 C Update the record dimension by writing the iteration number
72 CALL MNC_FILE_CLOSE_ALL_MATCHING(diag_mnc_bn, myThid)
73 CALL MNC_CW_SET_UDIM(diag_mnc_bn, 1, myThid)
74
75 C Read the qdiag() array
76 d_cw_name(1:NLEN) = dn_blnk(1:NLEN)
77 DO ii = 1,CW_DIMS
78 dn(ii)(1:NLEN) = dn_blnk(1:NLEN)
79 ENDDO
80 d_cw_name(1:10) = 'diag_state'
81 dn(1)(1:3) = 'Xp1'
82 dim(1) = sNx + 2*OLx
83 ib(1) = OLx + 1
84 ie(1) = OLx + sNx + 1
85 dn(2)(1:3) = 'Yp1'
86 dim(2) = sNy + 2*OLy
87 ib(2) = OLy + 1
88 ie(2) = OLy + sNy + 1
89 dn(3)(1:2) = 'Zd'
90 dim(3) = numDiags
91 ib(3) = 1
92 ie(3) = numDiags
93 dn(4)(1:1) = 'T'
94 dim(4) = -1
95 ib(4) = 1
96 ie(4) = 1
97 CALL MNC_CW_ADD_GNAME(d_cw_name, 4,
98 & dim, dn, ib, ie, myThid)
99 CALL MNC_CW_ADD_VNAME(d_cw_name, d_cw_name,
100 & 4,5, myThid)
101 CALL MNC_CW_RL_R('D',diag_mnc_bn,0,0,
102 & d_cw_name, qdiag, myThid)
103 CALL MNC_CW_DEL_VNAME(d_cw_name, myThid)
104 CALL MNC_CW_DEL_GNAME(d_cw_name, myThid)
105
106 C Read the ndiag() array
107 d_cw_name(1:NLEN) = dn_blnk(1:NLEN)
108 DO ii = 1,CW_DIMS
109 dn(ii)(1:NLEN) = dn_blnk(1:NLEN)
110 ENDDO
111 d_cw_name(1:10) = 'diag_count'
112 dn(1)(1:2) = 'Nd'
113 dim(1) = numDiags
114 ib(1) = 1
115 ie(1) = numDiags
116 dn(2)(1:1) = 'T'
117 dim(2) = -1
118 ib(2) = 1
119 ie(2) = 1
120 CALL MNC_CW_ADD_GNAME(d_cw_name, 2,
121 & dim, dn, ib, ie, myThid)
122 CALL MNC_CW_ADD_VNAME(d_cw_name, d_cw_name,
123 & 4,5, myThid)
124 CALL MNC_CW_ADD_VATTR_TEXT(d_cw_name,'description',
125 & 'diagnostics state',myThid)
126 C- jmc: get warnings when I compile this S/R because something is not right
127 C in the type or one or more arguments. commented out for now
128 c CALL MNC_CW_RL_R('I',diag_mnc_bn,0,0,
129 c & d_cw_name, ndiag, myThid)
130 CALL MNC_CW_DEL_VNAME(d_cw_name, myThid)
131 CALL MNC_CW_DEL_GNAME(d_cw_name, myThid)
132
133 ENDIF
134 #endif /* ALLOW_MNC */
135
136 IF (diag_pickup_read_mdsio) THEN
137
138 C Read qdiag()
139 prec = precFloat64
140 WRITE(fn,'(A,I10.10)') 'pickup_qdiag.', nIter0
141 CALL READ_REC_3D_RL( fn, prec,
142 & numDiags, qdiag, nIter0, myThid )
143
144 C Read ndiag()
145 _BARRIER
146 _BEGIN_MASTER(myThid)
147
148 C-- jmc: should really write 1 file per tile
149 WRITE(fn,'(A,I10.10)') 'pickup_ndiag.', nIter0
150 CALL MDSFINDUNIT( dUnit, myThid )
151 OPEN( dUnit, file=fn )
152 DO n = 1,nlists
153 DO m = 1,nfields(n)
154 READ(dUnit,'(I10)') ndiag(jdiag(m,n),1,1)
155 ENDDO
156 ENDDO
157 CLOSE( dUnit )
158 C- Need to fill-in ndiag for other tiles
159 DO bj=1,nSy
160 DO bi=1,nSx
161 DO n=1,ndiagt
162 ndiag(n,bi,bj) = ndiag(n,1,1)
163 ENDDO
164 ENDDO
165 ENDDO
166 _END_MASTER(myThid)
167 _BARRIER
168 ENDIF
169
170 ENDIF
171
172 #endif /* DIAGNOSTICS_HAS_PICKUP */
173
174 RETURN
175 END

  ViewVC Help
Powered by ViewVC 1.1.22