/[MITgcm]/MITgcm_contrib/torge/itd/code/seaice_read_pickup.F
ViewVC logotype

Annotation of /MITgcm_contrib/torge/itd/code/seaice_read_pickup.F

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


Revision 1.1 - (hide annotations) (download)
Fri Apr 27 22:22:17 2012 UTC (13 years, 3 months ago) by dimitri
Branch: MAIN
check-in original code, before itd modifications
seaice_advdiff.F,v 1.60 2012/02/16 01:22:02
seaice_check_pickup.F,v 1.7 2012/03/05 15:21:44
seaice_diagnostics_init.F,v 1.33 2012/02/16 01:22:02
seaice_growth.F,v 1.162 2012/03/15 03:07:31
seaice_init_fixed.F,v 1.19 2012/03/11 13:41:38
seaice_init_varia.F,v 1.72 2012/03/14 22:55:53
seaice_readparms.F,v 1.120 2012/03/14 22:55:53
seaice_write_pickup.F,v 1.14 2012/03/05 15:21:45
seaice_read_pickup.F,v 1.16 2012/03/05 15:21:44
seaice_model.F,v 1.100 2012/03/02 18:56:06
SEAICE.h,v 1.62 2012/03/06 16:51:21
SEAICE_OPTIONS.h,v 1.63 2012/03/08 01:15:02
SEAICE_PARAMS.h,v 1.91 2012/03/11 13:41:38
SEAICE_SIZE.h,v 1.5 2012/03/06 16:51:21
SIZE.h,v 1.28 2009/05/17 21:15:07

1 dimitri 1.1 C $Header: /u/gcmpack/MITgcm/pkg/seaice/seaice_read_pickup.F,v 1.16 2012/03/05 15:21:44 gforget Exp $
2     C $Name: $
3    
4     #include "SEAICE_OPTIONS.h"
5    
6     CBOP
7     C !ROUTINE: SEAICE_READ_PICKUP
8     C !INTERFACE:
9     SUBROUTINE SEAICE_READ_PICKUP ( myThid )
10    
11     C !DESCRIPTION: \bv
12     C *==========================================================*
13     C | SUBROUTINE SEAICE_READ_PICKUP
14     C | o Read in sea ice pickup file for restarting.
15     C *==========================================================*
16     C \ev
17    
18     C !USES:
19     IMPLICIT NONE
20    
21     C == Global variables ===
22     #include "SIZE.h"
23     #include "EEPARAMS.h"
24     #include "PARAMS.h"
25     #include "SEAICE_SIZE.h"
26     #include "SEAICE_PARAMS.h"
27     #include "SEAICE.h"
28     #include "SEAICE_TRACER.h"
29    
30     C !INPUT/OUTPUT PARAMETERS:
31     C == Routine arguments ==
32     C myThid :: My Thread Id. number
33     INTEGER myThid
34    
35     C !LOCAL VARIABLES:
36     C == Local variables ==
37     C fp :: pickup-file precision
38     C fn :: Temp. for building file name.
39     C filePrec :: pickup-file precision (read from meta file)
40     C nbFields :: number of fields in pickup file (read from meta file)
41     C missFldList :: List of missing fields (attempted to read but not found)
42     C missFldDim :: Dimension of missing fields list array: missFldList
43     C nMissing :: Number of missing fields (attempted to read but not found)
44     C nj :: record & field number
45     C ioUnit :: temp for writing msg unit
46     C msgBuf :: Informational/error message buffer
47     C i,j,k :: loop indices
48     C bi,bj :: tile indices
49     INTEGER fp
50     CHARACTER*(MAX_LEN_FNAM) fn
51     INTEGER filePrec, nbFields
52     INTEGER missFldDim, nMissing
53     PARAMETER( missFldDim = 20 )
54     CHARACTER*(8) missFldList(missFldDim)
55     INTEGER nj, ioUnit
56     CHARACTER*(MAX_LEN_MBUF) msgBuf
57     INTEGER i,j,k,bi,bj
58     #ifdef ALLOW_SITRACER
59     CHARACTER*(8) fldName
60     INTEGER iTrac
61     #endif
62     CEOP
63    
64     C--
65     IF (pickupSuff .EQ. ' ') THEN
66     WRITE(fn,'(A,I10.10)') 'pickup_seaice.',nIter0
67     ELSE
68     WRITE(fn,'(A,A10)') 'pickup_seaice.',pickupSuff
69     ENDIF
70     fp = precFloat64
71    
72     C Going to really do some IO. Make everyone except master thread wait.
73     _BARRIER
74    
75     c IF ( seaice_pickup_read_mdsio ) THEN
76    
77     C-- Read meta file (if exist) and prepare for reading Multi-Fields file
78     CALL READ_MFLDS_SET(
79     I fn,
80     O nbFields, filePrec,
81     I MULTDIM, nIter0, myThid )
82    
83     _BEGIN_MASTER( myThid )
84     IF ( nbFields.GE.0 .AND. filePrec.NE.fp ) THEN
85     WRITE(msgBuf,'(2A,I4)') 'SEAICE_READ_PICKUP: ',
86     & 'pickup-file binary precision do not match !'
87     CALL PRINT_ERROR( msgBuf, myThid )
88     WRITE(msgBuf,'(A,2(A,I4))') 'SEAICE_READ_PICKUP: ',
89     & 'file prec.=', filePrec, ' but expecting prec.=', fp
90     CALL PRINT_ERROR( msgBuf, myThid )
91     STOP 'ABNORMAL END: S/R SEAICE_READ_PICKUP (data-prec Pb)'
92     ENDIF
93     _END_MASTER( myThid )
94    
95     C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
96    
97     IF ( nbFields.LE.0 ) THEN
98     C- No meta-file or old meta-file without List of Fields
99     ioUnit = errorMessageUnit
100     IF ( pickupStrictlyMatch ) THEN
101     WRITE(msgBuf,'(4A)') 'SEAICE_READ_PICKUP: ',
102     & 'no field-list found in meta-file',
103     & ' => cannot check for strict-matching'
104     CALL PRINT_ERROR( msgBuf, myThid )
105     WRITE(msgBuf,'(4A)') 'SEAICE_READ_PICKUP: ',
106     & 'try with " pickupStrictlyMatch=.FALSE.,"',
107     & ' in file: "data", NameList: "PARM03"'
108     CALL PRINT_MESSAGE( msgBuf, ioUnit, SQUEEZE_RIGHT, myThid )
109     STOP 'ABNORMAL END: S/R SEAICE_READ_PICKUP'
110     ELSE
111     WRITE(msgBuf,'(4A)') 'WARNING >> SEAICE_READ_PICKUP: ',
112     & ' no field-list found'
113     CALL PRINT_MESSAGE( msgBuf, ioUnit, SQUEEZE_RIGHT, myThid )
114     IF ( nbFields.EQ.-1 ) THEN
115     C- No meta-file
116     WRITE(msgBuf,'(4A)') 'WARNING >> ',
117     & ' try to read pickup as currently written'
118     CALL PRINT_MESSAGE( msgBuf, ioUnit, SQUEEZE_RIGHT, myThid )
119     ELSE
120     C- Old meta-file without List of Fields
121     WRITE(msgBuf,'(4A)') 'WARNING >> ',
122     & ' try to read pickup as it used to be written'
123     CALL PRINT_MESSAGE( msgBuf, ioUnit, SQUEEZE_RIGHT, myThid )
124     WRITE(msgBuf,'(4A)') 'WARNING >> ',
125     & ' until checkpoint59j (2007 Nov 25)'
126     CALL PRINT_MESSAGE( msgBuf, ioUnit, SQUEEZE_RIGHT, myThid )
127     ENDIF
128     ENDIF
129     ENDIF
130    
131     C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
132    
133     C--- Old way to read seaice fields:
134     IF ( nbFields.EQ.0 ) THEN
135    
136     C-- Read ice model fields
137     nj = 1
138     IF (SEAICE_multDim.GT.1) THEN
139     CALL READ_REC_3D_RL(fn,fp,MULTDIM,TICES,nj,nIter0,myThid)
140     nj = nj + MULTDIM
141     ELSE
142     CALL READ_REC_3D_RL(fn,fp,1,TICE,nj,nIter0,myThid)
143     nj = nj + 1
144     ENDIF
145     c CALL READ_REC_3D_RL( fn, fp, 1, YNEG , nj, nIter0, myThid )
146     nj = nj + 1
147     CALL READ_REC_3D_RL( fn, fp, 1, HSNOW , nj, nIter0, myThid )
148     nj = nj + 1
149     CALL READ_REC_3D_RL( fn, fp, 1, UICE , nj, nIter0, myThid )
150     nj = nj + 3
151     CALL READ_REC_3D_RL( fn, fp, 1, VICE , nj, nIter0, myThid )
152     nj = nj + 3
153     CALL READ_REC_3D_RL( fn, fp, 1, HEFF , nj, nIter0, myThid )
154     nj = nj + 3
155     CALL READ_REC_3D_RL( fn, fp, 1, AREA , nj, nIter0, myThid )
156     nj = nj + 3
157     #if (defined(SEAICE_CGRID) && defined(SEAICE_ALLOW_EVP))
158     IF ( SEAICEuseEVP .AND. SEAICEuseEVPpickup ) THEN
159     CALL READ_REC_3D_RL(fn,fp,1,seaice_sigma1,nj, nIter0, myThid )
160     nj = nj + 1
161     CALL READ_REC_3D_RL(fn,fp,1,seaice_sigma2,nj, nIter0, myThid )
162     nj = nj + 1
163     CALL READ_REC_3D_RL(fn,fp,1,seaice_sigma12,nj,nIter0, myThid )
164     nj = nj + 1
165     ENDIF
166     #endif /* SEAICE_ALLOW_EVP */
167     #ifdef SEAICE_VARIABLE_SALINITY
168     CALL READ_REC_3D_RL( fn, fp, 1, HSALT , nj, nIter0, myThid )
169     nj = nj + 1
170     #endif
171    
172     ELSE
173     C--- New way to read model fields:
174     nj = 0
175     C-- read Sea-Ice Thermodynamics State variables, starting with 3-D fields:
176     IF ( .NOT.useThSIce ) THEN
177     IF (SEAICE_multDim.GT.1) THEN
178     CALL READ_MFLDS_3D_RL( 'siTICES ', TICES,
179     & nj, fp, MULTDIM, nIter0, myThid )
180     nj = nj*MULTDIM
181     IF ( nj.EQ.0 ) THEN
182     CALL READ_MFLDS_3D_RL( 'siTICE ', TICE,
183     & nj, fp, 1, nIter0, myThid )
184     ENDIF
185     ELSE
186     CALL READ_MFLDS_3D_RL( 'siTICE ', TICE,
187     & nj, fp, 1, nIter0, myThid )
188     C map to TICES(1)
189     DO bj=myByLo(myThid),myByHi(myThid)
190     DO bi=myBxLo(myThid),myBxHi(myThid)
191     DO k=1,MULTDIM
192     DO j=1-OLy,sNy+OLy
193     DO i=1-OLx,sNx+OLx
194     TICES(i,j,k,bi,bj) = TICE(i,j,bi,bj)
195     ENDDO
196     ENDDO
197     ENDDO
198     ENDDO
199     ENDDO
200    
201     IF ( nj.EQ.0 ) THEN
202     CALL READ_MFLDS_3D_RL( 'siTICES ', TICE,
203     & nj, fp, 1, nIter0, myThid )
204     ENDIF
205     ENDIF
206     C-- continue with 2-D fields:
207     CALL READ_MFLDS_3D_RL( 'siAREA ', AREA,
208     & nj, fp, 1, nIter0, myThid )
209     CALL READ_MFLDS_3D_RL( 'siHEFF ', HEFF,
210     & nj, fp, 1, nIter0, myThid )
211     CALL READ_MFLDS_3D_RL( 'siHSNOW ', HSNOW,
212     & nj, fp, 1, nIter0, myThid )
213     #ifdef SEAICE_VARIABLE_SALINITY
214     CALL READ_MFLDS_3D_RL( 'siHSALT ', HSALT,
215     & nj, fp, 1, nIter0, myThid )
216     #endif
217     #ifdef ALLOW_SITRACER
218     DO iTrac = 1, SItrNumInUse
219     WRITE(fldName,'(A6,I2.2)') 'siTrac', iTrac
220     CALL READ_MFLDS_3D_RL( fldName,
221     & SItracer(1-OLx,1-OLy,1,1,iTrac),
222     & nj, fp, 1, nIter0, myThid )
223     _EXCH_XY_RL(SItracer(1-OLx,1-OLy,1,1,iTrac),myThid)
224     ENDDO
225     #endif /* ALLOW_SITRACER */
226    
227     ENDIF
228    
229     C-- read Sea-Ice Dynamics variables (all 2-D fields):
230     CALL READ_MFLDS_3D_RL( 'siUICE ', UICE,
231     & nj, fp, 1, nIter0, myThid )
232     CALL READ_MFLDS_3D_RL( 'siVICE ', VICE,
233     & nj, fp, 1, nIter0, myThid )
234     #if (defined(SEAICE_CGRID) && defined(SEAICE_ALLOW_EVP))
235     IF ( SEAICEuseEVP ) THEN
236     CALL READ_MFLDS_3D_RL( 'siSigm1 ', seaice_sigma1,
237     & nj, fp, 1, nIter0, myThid )
238     CALL READ_MFLDS_3D_RL( 'siSigm2 ', seaice_sigma2,
239     & nj, fp, 1, nIter0, myThid )
240     CALL READ_MFLDS_3D_RL( 'siSigm12', seaice_sigma12,
241     & nj, fp, 1, nIter0, myThid )
242     ENDIF
243     #endif /* SEAICE_CGRID & SEAICE_ALLOW_EVP */
244    
245     C--- end: new way to read pickup file
246     ENDIF
247    
248     C-- Check for missing fields:
249     nMissing = missFldDim
250     CALL READ_MFLDS_CHECK(
251     O missFldList,
252     U nMissing,
253     I nIter0, myThid )
254     IF ( nMissing.GT.missFldDim ) THEN
255     WRITE(msgBuf,'(2A,I4)') 'SEAICE_READ_PICKUP: ',
256     & 'missing fields list has been truncated to', missFldDim
257     CALL PRINT_ERROR( msgBuf, myThid )
258     STOP 'ABNORMAL END: S/R SEAICE_READ_PICKUP (list-size Pb)'
259     ENDIF
260     CALL SEAICE_CHECK_PICKUP(
261     I missFldList,
262     I nMissing, nbFields,
263     I nIter0, myThid )
264    
265     C-- end: seaice_pickup_read_mdsio
266     c ENDIF
267    
268     C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
269    
270     C-- Update overlap regions
271     CALL EXCH_UV_XY_RL( uIce, vIce,.TRUE.,myThid)
272     _EXCH_XY_RL( HEFF, myThid )
273     _EXCH_XY_RL( AREA, myThid )
274     CALL EXCH_3D_RL ( TICES, MULTDIM, myThid )
275     _EXCH_XY_RL(TICE , myThid )
276     c _EXCH_XY_RL(YNEG , myThid )
277     _EXCH_XY_RL(HSNOW, myThid )
278     #if (defined(SEAICE_CGRID) && defined(SEAICE_ALLOW_EVP))
279     IF ( SEAICEuseEVP ) THEN
280     _EXCH_XY_RL(seaice_sigma1 , myThid )
281     _EXCH_XY_RL(seaice_sigma2 , myThid )
282     _EXCH_XY_RL(seaice_sigma12, myThid )
283     ENDIF
284     #endif /* SEAICE_CGRID SEAICE_ALLOW_EVP */
285     #ifdef SEAICE_VARIABLE_SALINITY
286     _EXCH_XY_RL(HSALT, myThid )
287     #endif
288    
289     RETURN
290     END

  ViewVC Help
Powered by ViewVC 1.1.22