1 |
C $Header: $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "BLING_OPTIONS.h" |
5 |
|
6 |
CBOP |
7 |
subroutine BLING_WRITE_PICKUP( permPickup, |
8 |
I suff, myTime, myIter, myThid ) |
9 |
|
10 |
C ================================================================= |
11 |
C | subroutine bling_write_pickup |
12 |
C | o Writes BLING arrays (needed for a restart) to a pickup file |
13 |
C ================================================================= |
14 |
|
15 |
implicit none |
16 |
|
17 |
C === Global variables === |
18 |
#include "SIZE.h" |
19 |
#include "EEPARAMS.h" |
20 |
#include "PARAMS.h" |
21 |
#include "BLING_VARS.h" |
22 |
|
23 |
C === Routine arguments === |
24 |
C permPickup :: write a permanent pickup |
25 |
C suff :: suffix for pickup file (eg. ckptA or 0000000010) |
26 |
C myTime :: Current time in simulation |
27 |
C myIter :: Current iteration number in simulation |
28 |
C myThid :: My Thread Id number |
29 |
LOGICAL permPickup |
30 |
CHARACTER*(*) suff |
31 |
_RL myTime |
32 |
INTEGER myIter |
33 |
INTEGER myThid |
34 |
CEOP |
35 |
|
36 |
#ifdef ALLOW_BLING |
37 |
|
38 |
C == Local variables == |
39 |
CHARACTER*(MAX_LEN_FNAM) fn |
40 |
INTEGER prec |
41 |
#ifndef USE_ATMOSCO2 |
42 |
INTEGER ioUnit |
43 |
_RL tmpFld(2) |
44 |
_RS dummyRS(1) |
45 |
#endif |
46 |
LOGICAL glf |
47 |
_RL timList(1) |
48 |
INTEGER j, nj |
49 |
INTEGER listDim, nWrFlds |
50 |
PARAMETER( listDim = 2 ) |
51 |
CHARACTER*(8) wrFldList(listDim) |
52 |
CHARACTER*(MAX_LEN_MBUF) msgBuf |
53 |
|
54 |
prec = precFloat64 |
55 |
|
56 |
WRITE(fn,'(A,A)') 'pickup_BLING.',suff |
57 |
j = 0 |
58 |
|
59 |
C Firstly, write 3-D fields as consecutive records, |
60 |
|
61 |
C- switch to 2-D fields: |
62 |
nj = -j*Nr |
63 |
|
64 |
C record number < 0 : a hack not to write meta files now: |
65 |
j = j + 1 |
66 |
nj = nj-1 |
67 |
CALL WRITE_REC_3D_RL( fn, prec, 1, pH, nj, myIter, myThid ) |
68 |
IF (j.LE.listDim) wrFldList(j) = 'BLING_pH2d' |
69 |
|
70 |
C-------------------------- |
71 |
nWrFlds = j |
72 |
IF ( nWrFlds.GT.listDim ) THEN |
73 |
WRITE(msgBuf,'(2A,I5,A)') 'BLING_WRITE_PICKUP: ', |
74 |
& 'trying to write ',nWrFlds,' fields' |
75 |
CALL PRINT_ERROR( msgBuf, myThid ) |
76 |
WRITE(msgBuf,'(2A,I5,A)') 'BLING_WRITE_PICKUP: ', |
77 |
& 'field-list dimension (listDim=',listDim,') too small' |
78 |
CALL PRINT_ERROR( msgBuf, myThid ) |
79 |
STOP 'ABNORMAL END: S/R BLING_WRITE_PICKUP (list-size Pb)' |
80 |
ENDIF |
81 |
|
82 |
#ifdef ALLOW_MDSIO |
83 |
C uses this specific S/R to write (with more informations) only meta |
84 |
C files |
85 |
j = 1 |
86 |
nj = ABS(nj) |
87 |
IF ( nWrFlds*Nr .EQ. nj ) THEN |
88 |
j = Nr |
89 |
nj = nWrFlds |
90 |
ENDIF |
91 |
glf = globalFiles |
92 |
timList(1) = myTime |
93 |
CALL MDS_WR_METAFILES( fn, prec, glf, .FALSE., |
94 |
& 0, 0, j, ' ', |
95 |
& nWrFlds, wrFldList, |
96 |
& 1, timList, |
97 |
& nj, myIter, myThid ) |
98 |
#endif /* ALLOW_MDSIO */ |
99 |
C-------------------------- |
100 |
|
101 |
#endif /* ALLOW_BLING */ |
102 |
|
103 |
RETURN |
104 |
END |