/[MITgcm]/MITgcm_contrib/darwin2/pkg/darwin/darwin_read_pickup.F
ViewVC logotype

Contents of /MITgcm_contrib/darwin2/pkg/darwin/darwin_read_pickup.F

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


Revision 1.2 - (show annotations) (download)
Wed May 15 14:42:54 2013 UTC (12 years, 2 months ago) by jahn
Branch: MAIN
CVS Tags: ctrb_darwin2_ckpt64k_20130723, ctrb_darwin2_ckpt65w_20160512, ctrb_darwin2_ckpt65j_20150225, ctrb_darwin2_ckpt66g_20170424, ctrb_darwin2_ckpt64h_20130528, ctrb_darwin2_ckpt66k_20171025, ctrb_darwin2_ckpt66n_20180118, ctrb_darwin2_ckpt65v_20160409, ctrb_darwin2_ckpt65s_20160114, ctrb_darwin2_ckpt65_20140718, ctrb_darwin2_ckpt64m_20130820, ctrb_darwin2_ckpt66d_20170214, ctrb_darwin2_ckpt64r_20131210, ctrb_darwin2_ckpt65m_20150615, ctrb_darwin2_ckpt65q_20151118, ctrb_darwin2_ckpt65o_20150914, ctrb_darwin2_ckpt65p_20151023, ctrb_darwin2_ckpt64n_20130826, ctrb_darwin2_ckpt65e_20140929, ctrb_darwin2_ckpt64o_20131024, ctrb_darwin2_ckpt64v_20140411, ctrb_darwin2_ckpt64z_20140711, ctrb_darwin2_ckpt65l_20150504, ctrb_darwin2_ckpt65z_20160929, ctrb_darwin2_ckpt65n_20150729, ctrb_darwin2_ckpt64y_20140622, ctrb_darwin2_ckpt65d_20140915, ctrb_darwin2_ckpt64t_20140202, ctrb_darwin2_ckpt66h_20170602, ctrb_darwin2_ckpt64i_20130622, ctrb_darwin2_ckpt64s_20140105, ctrb_darwin2_ckpt64x_20140524, ctrb_darwin2_ckpt65x_20160612, ctrb_darwin2_ckpt66f_20170407, ctrb_darwin2_ckpt65g_20141120, ctrb_darwin2_ckpt65k_20150402, ctrb_darwin2_ckpt64w_20140502, ctrb_darwin2_ckpt66a_20161020, ctrb_darwin2_ckpt64l_20130806, ctrb_darwin2_ckpt65f_20141014, ctrb_darwin2_ckpt66b_20161219, ctrb_darwin2_ckpt64u_20140308, ctrb_darwin2_ckpt64j_20130704, ctrb_darwin2_ckpt65i_20150123, ctrb_darwin2_ckpt66j_20170815, ctrb_darwin2_ckpt65y_20160801, ctrb_darwin2_ckpt66c_20170121, ctrb_darwin2_ckpt65a_20140728, ctrb_darwin2_ckpt65b_20140812, ctrb_darwin2_ckpt65t_20160221, ctrb_darwin2_ckpt64p_20131118, ctrb_darwin2_ckpt66o_20180209, ctrb_darwin2_ckpt66e_20170314, ctrb_darwin2_ckpt64q_20131118, ctrb_darwin2_ckpt64p_20131024, ctrb_darwin2_ckpt65u_20160315, ctrb_darwin2_ckpt65r_20151221, ctrb_darwin2_ckpt66i_20170718, ctrb_darwin2_ckpt65c_20140830, ctrb_darwin2_ckpt66l_20171025, ctrb_darwin2_ckpt65h_20141217, ctrb_darwin2_ckpt66m_20171213, HEAD
Changes since 1.1: +23 -4 lines
write non-dynamic chlorophyll to pickup

1 C $Header: /u/gcmpack/MITgcm_contrib/darwin2/pkg/darwin/darwin_read_pickup.F,v 1.1 2011/04/13 18:56:24 jahn Exp $
2 C $Name: $
3
4 #include "DARWIN_OPTIONS.h"
5
6 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
7 CBOP
8 C !ROUTINE: DARWIN_READ_PICKUP
9
10 C !INTERFACE:
11 SUBROUTINE DARWIN_READ_PICKUP( myIter, myThid )
12
13 C !DESCRIPTION:
14 C Reads current state of DARWIN from a pickup file
15
16 C !USES:
17 IMPLICIT NONE
18 #include "SIZE.h"
19 #include "EEPARAMS.h"
20 #include "PARAMS.h"
21 #include "PTRACERS_SIZE.h"
22 #include "PTRACERS_PARAMS.h"
23 #include "DARWIN_SIZE.h"
24 #include "DARWIN_IO.h"
25 #ifdef ALLOW_MONOD
26 #include "MONOD_FIELDS.h"
27 #endif
28
29 C !INPUT PARAMETERS:
30 C myIter :: time-step number
31 C myThid :: thread number
32 INTEGER myIter
33 INTEGER myThid
34
35 #ifdef ALLOW_DARWIN
36 C add more ALLOWs here for other fields in pickup
37 #if defined(ALLOW_MONOD) && defined(ALLOW_PAR_DAY) || (defined(GEIDER) && !defined(DYNAMIC_CHL))
38
39 C !LOCAL VARIABLES:
40 C fn :: character buffer for creating filename
41 C fp :: precision of pickup files
42 C filePrec :: pickup-file precision (read from meta file)
43 C nbFields :: number of fields in pickup file (read from meta file)
44 C missFldList :: List of missing fields (attempted to read but not found)
45 C missFldDim :: Dimension of missing fields list array: missFldList
46 C nMissing :: Number of missing fields (attempted to read but not found)
47 C j :: loop index
48 C nj :: record number
49 C ioUnit :: temp for writing msg unit
50 C msgBuf :: Informational/error message buffer
51 INTEGER fp
52 INTEGER filePrec, nbFields
53 INTEGER missFldDim, nMissing
54 INTEGER j, nj, ioUnit, np
55 PARAMETER( missFldDim = 12 )
56 CHARACTER*(MAX_LEN_FNAM) fn
57 CHARACTER*(8) fldName
58 CHARACTER*(8) missFldList(missFldDim)
59 CHARACTER*(MAX_LEN_MBUF) msgBuf
60 CEOP
61
62 _BARRIER
63
64 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
65
66 IF ( pickupSuff.EQ.' ' ) THEN
67 WRITE(fn,'(A,I10.10)') 'pickup_darwin.',myIter
68 ELSE
69 WRITE(fn,'(A,A10)') 'pickup_darwin.',pickupSuff
70 ENDIF
71 fp = precFloat64
72
73 CALL READ_MFLDS_SET(
74 I fn,
75 O nbFields, filePrec,
76 I Nr, myIter, myThid )
77 _BEGIN_MASTER( myThid )
78 IF ( nbFields.GE.0 .AND. filePrec.NE.fp ) THEN
79 WRITE(msgBuf,'(2A,I4)') 'DARWIN_READ_PICKUP: ',
80 & 'pickup-file binary precision do not match !'
81 CALL PRINT_ERROR( msgBuf, myThid )
82 WRITE(msgBuf,'(A,2(A,I4))') 'DARWIN_READ_PICKUP: ',
83 & 'file prec.=', filePrec, ' but expecting prec.=', fp
84 CALL PRINT_ERROR( msgBuf, myThid )
85 STOP 'ABNORMAL END: S/R DARWIN_READ_PICKUP (data-prec Pb)'
86 ENDIF
87 _END_MASTER( myThid )
88
89 IF ( nbFields.LE.0 ) THEN
90 C- No meta-file or old meta-file without List of Fields
91 ioUnit = errorMessageUnit
92 IF ( pickupStrictlyMatch ) THEN
93 WRITE(msgBuf,'(4A)') 'DARWIN_READ_PICKUP: ',
94 & 'no field-list found in meta-file',
95 & ' => cannot check for strick-matching'
96 CALL PRINT_ERROR( msgBuf, myThid )
97 WRITE(msgBuf,'(4A)') 'DARWIN_READ_PICKUP: ',
98 & 'try with " pickupStrictlyMatch=.FALSE.,"',
99 & ' in file: "data", NameList: "PARM03"'
100 CALL PRINT_MESSAGE( msgBuf, ioUnit, SQUEEZE_RIGHT, myThid )
101 STOP 'ABNORMAL END: S/R DARWIN_READ_PICKUP'
102 ELSE
103 WRITE(msgBuf,'(4A)') 'WARNING >> DARWIN_READ_PICKUP: ',
104 & ' no field-list found'
105 CALL PRINT_MESSAGE( msgBuf, ioUnit, SQUEEZE_RIGHT, myThid )
106 IF ( nbFields.EQ.-1 ) THEN
107 C- No meta-file
108 WRITE(msgBuf,'(4A)') 'WARNING >> ',
109 & ' try to read pickup as currently written'
110 CALL PRINT_MESSAGE( msgBuf, ioUnit, SQUEEZE_RIGHT, myThid )
111 ELSE
112 WRITE(msgBuf,'(4A)') 'DARWIN_READ_PICKUP: ',
113 & 'no field-list found in meta-file'
114 CALL PRINT_ERROR( msgBuf, myThid )
115 STOP 'ABNORMAL END: S/R DARWIN_READ_PICKUP'
116 ENDIF
117 ENDIF
118 ENDIF
119
120 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
121
122 IF ( nbFields.EQ.0 ) THEN
123 C--- Old way to read pickup not supported
124 WRITE(msgBuf,'(2A)') 'DARWIN_READ_PICKUP: ',
125 & 'please provide a meta file with a field list'
126 STOP 'ABNORMAL END: S/R DARWIN_READ_PICKUP'
127 ELSE
128 C--- New way to read DARWIN pickup:
129 nj = 0
130 C--- read DARWIN 3-D fields for restart
131 #ifdef ALLOW_PAR_DAY
132 CALL READ_MFLDS_3D_RL( 'PARday1 ', PARday(1-OLx,1-OLy,1,1,1,1),
133 & nj, fp, Nr, myIter, myThid )
134 CALL READ_MFLDS_3D_RL( 'PARday2 ', PARday(1-OLx,1-OLy,1,1,1,2),
135 & nj, fp, Nr, myIter, myThid )
136 #endif /* ALLOW_PAR_DAY */
137 #if defined(ALLOW_MONOD) && defined(GEIDER) && !defined(DYNAMIC_CHL)
138 DO np = 1, npmax
139 fldName(1:6) = 'ChlPhy'
140 fldName(7:8) = PTRACERS_ioLabel(np)
141 CALL READ_MFLDS_3D_RL( fldName, Chl_phy(1-OLx,1-OLy,1,1,1,np),
142 & nj, fp, Nr, myIter, myThid )
143 ENDDO
144 #endif
145 C-- end: new way to read pickup file
146 ENDIF
147
148 C-- Check for missing fields:
149 nMissing = missFldDim
150 CALL READ_MFLDS_CHECK(
151 O missFldList,
152 U nMissing,
153 I myIter, myThid )
154 IF ( nMissing.GT.missFldDim ) THEN
155 WRITE(msgBuf,'(2A,I4)') 'DARWIN_READ_PICKUP: ',
156 & 'missing fields list has been truncated to', missFldDim
157 CALL PRINT_ERROR( msgBuf, myThid )
158 STOP 'ABNORMAL END: S/R DARWIN_READ_PICKUP (list-size Pb)'
159 ENDIF
160 IF ( nMissing.GE.1 ) THEN
161 ioUnit = errorMessageUnit
162 DO j=1,nMissing
163 WRITE(msgBuf,'(4A)') 'DARWIN_READ_PICKUP: ',
164 & 'cannot restart without field "',missFldList(nj),'"'
165 CALL PRINT_ERROR( msgBuf, myThid )
166 ENDDO
167 STOP 'ABNORMAL END: S/R DARWIN_READ_PICKUP'
168 ENDIF
169
170 C-- Update overlap regions:
171 #ifdef ALLOW_PAR_DAY
172 CALL EXCH_3D_RL( PARday(1-OLx,1-OLy,1,1,1,1), Nr, myThid )
173 CALL EXCH_3D_RL( PARday(1-OLx,1-OLy,1,1,1,2), Nr, myThid )
174 #endif /* ALLOW_PAR_DAY */
175 #if defined(ALLOW_MONOD) && defined(GEIDER) && !defined(DYNAMIC_CHL)
176 DO np = 1, npmax
177 CALL EXCH_3D_RL( Chl_phy(1-OLx,1-OLy,1,1,1,np), Nr, myThid )
178 ENDDO
179 #endif
180
181 #endif /* ALLOW_PAR_DAY */
182 #endif /* ALLOW_DARWIN */
183
184 RETURN
185 END

  ViewVC Help
Powered by ViewVC 1.1.22