-
Notifications
You must be signed in to change notification settings - Fork 1
/
dic_write_pickup.F
106 lines (88 loc) · 3.02 KB
/
dic_write_pickup.F
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
#include "CPP_OPTIONS.h"
#include "PTRACERS_OPTIONS.h"
#include "DARWIN_OPTIONS.h"
#ifdef ALLOW_PTRACERS
#ifdef ALLOW_DARWIN
#ifdef ALLOW_CARBON
CBOP
C !ROUTINE: DIC_WRITE_PICKUP
C !INTERFACE: ==========================================================
SUBROUTINE DIC_WRITE_PICKUP( permPickup,
I suff, myTime, myIter, myThid )
C !DESCRIPTION:
C Writes DIC arrays (needed for a restart) to a pickup file
C !USES: ===============================================================
IMPLICIT NONE
C === Global variables ===
#include "SIZE.h"
#include "EEPARAMS.h"
#include "PARAMS.h"
#include "DARWIN_FLUX.h"
C !INPUT PARAMETERS: ===================================================
C permPickup :: write a permanent pickup
C suff :: suffix for pickup file (eg. ckptA or 0000000010)
C myTime :: Current time in simulation
C myIter :: Current iteration number in simulation
C myThid :: My Thread Id number
LOGICAL permPickup
CHARACTER*(*) suff
_RL myTime
INTEGER myIter
INTEGER myThid
CEOP
C !LOCAL VARIABLES:
C == Local variables ==
CHARACTER*(MAX_LEN_FNAM) fn
LOGICAL glf
INTEGER prec, j, nj
INTEGER listDim, nWrFlds
PARAMETER( listDim = 2 )
CHARACTER*(8) wrFldList(listDim)
CHARACTER*(MAX_LEN_MBUF) msgBuf
c IF ( DIC_pickup_write_mdsio ) THEN
prec = precFloat64
WRITE(fn,'(A,A)') 'pickup_dic.',suff
j = 0
C Firstly, write 3-D fields as consecutive records,
C- switch to 2-D fields:
nj = -j*Nr
C record number < 0 : a hack not to write meta files now:
j = j + 1
nj = nj-1
CALL WRITE_REC_3D_RL( fn, prec, 1, pH, nj, myIter, myThid )
IF (j.LE.listDim) wrFldList(j) = 'DIC_pH2d'
C--------------------------
nWrFlds = j
IF ( nWrFlds.GT.listDim ) THEN
WRITE(msgBuf,'(2A,I5,A)') 'DIC_WRITE_PICKUP: ',
& 'trying to write ',nWrFlds,' fields'
CALL PRINT_ERROR( msgBuf, myThid )
WRITE(msgBuf,'(2A,I5,A)') 'DIC_WRITE_PICKUP: ',
& 'field-list dimension (listDim=',listDim,') too small'
CALL PRINT_ERROR( msgBuf, myThid )
STOP 'ABNORMAL END: S/R DIC_WRITE_PICKUP (list-size Pb)'
ENDIF
#ifdef ALLOW_MDSIO
C uses this specific S/R to write (with more informations) only meta
C files
j = 1
nj = ABS(nj)
IF ( nWrFlds*Nr .EQ. nj ) THEN
j = Nr
nj = nWrFlds
ENDIF
glf = globalFiles
CALL MDS_WR_METAFILES( fn, prec, glf, .FALSE.,
& 0, 0, j, ' ',
& nWrFlds, wrFldList,
& 1, myTime,
& nj, myIter, myThid )
#endif /* ALLOW_MDSIO */
C--------------------------
c ENDIF /* DIC_pickup_write_mdsio */
RETURN
END
#endif /*ALLOW_CARBON*/
#endif /*DARWIN*/
#endif /*ALLOW_PTRACERS*/
c ==================================================================