/[MITgcm]/MITgcm/pkg/dic/dic_write_pickup.F
ViewVC logotype

Contents of /MITgcm/pkg/dic/dic_write_pickup.F

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


Revision 1.9 - (show annotations) (download)
Tue Nov 5 22:19:10 2013 UTC (10 years, 6 months ago) by jahn
Branch: MAIN
CVS Tags: checkpoint64q
Changes since 1.8: +6 -5 lines
void temporary variable so routine can be ignored by adjoint

1 C $Header: /u/gcmpack/MITgcm/pkg/dic/dic_write_pickup.F,v 1.8 2013/01/13 22:46:38 jmc Exp $
2 C $Name: $
3
4 #include "DIC_OPTIONS.h"
5
6 CBOP
7 C !ROUTINE: DIC_WRITE_PICKUP
8
9 C !INTERFACE: ==========================================================
10 SUBROUTINE DIC_WRITE_PICKUP( permPickup,
11 I suff, myTime, myIter, myThid )
12
13 C !DESCRIPTION:
14 C Writes DIC arrays (needed for a restart) to a pickup file
15
16 C !USES: ===============================================================
17 IMPLICIT NONE
18 C === Global variables ===
19 #include "SIZE.h"
20 #include "EEPARAMS.h"
21 #include "PARAMS.h"
22 #include "DIC_VARS.h"
23 #include "DIC_ATMOS.h"
24
25 C !INPUT PARAMETERS: ===================================================
26 C permPickup :: write a permanent pickup
27 C suff :: suffix for pickup file (eg. ckptA or 0000000010)
28 C myTime :: Current time in simulation
29 C myIter :: Current iteration number in simulation
30 C myThid :: My Thread Id number
31 LOGICAL permPickup
32 CHARACTER*(*) suff
33 _RL myTime
34 INTEGER myIter
35 INTEGER myThid
36 CEOP
37
38 #ifdef ALLOW_DIC
39
40 C !LOCAL VARIABLES:
41 C == Local variables ==
42 CHARACTER*(MAX_LEN_FNAM) fn
43 INTEGER prec
44 #ifndef USE_ATMOSCO2
45 INTEGER ioUnit
46 _RS dummyRS(1)
47 #endif
48 #ifdef DIC_BIOTIC
49 LOGICAL glf
50 _RL timList(1)
51 INTEGER j, nj
52 INTEGER listDim, nWrFlds
53 PARAMETER( listDim = 2 )
54 CHARACTER*(8) wrFldList(listDim)
55 CHARACTER*(MAX_LEN_MBUF) msgBuf
56 #endif
57
58 c IF ( DIC_pickup_write_mdsio ) THEN
59 prec = precFloat64
60
61 #ifndef USE_ATMOSCO2
62 IF ( dic_int1.EQ.3 ) THEN
63 WRITE(fn,'(A,A)') 'pickup_dic_co2atm.',suff
64 ioUnit = 0
65 #ifdef ALLOW_MDSIO
66 CALL MDS_WRITEVEC_LOC(
67 I fn, prec, ioUnit,
68 I 'RL', 1, total_atmos_carbon, dummyRS,
69 I 0, 0, 1, myIter, myThid )
70 CALL MDS_WRITEVEC_LOC(
71 I fn, prec, ioUnit,
72 I 'RL', 1, atpco2, dummyRS,
73 I 0, 0, 2, myIter, myThid )
74 #endif
75 ENDIF
76 #endif /* ndef USE_ATMOSCO2 */
77
78 #ifdef DIC_BIOTIC
79 WRITE(fn,'(A,A)') 'pickup_dic.',suff
80 j = 0
81
82 C Firstly, write 3-D fields as consecutive records,
83
84 C- switch to 2-D fields:
85 nj = -j*Nr
86
87 C record number < 0 : a hack not to write meta files now:
88 j = j + 1
89 nj = nj-1
90 CALL WRITE_REC_3D_RL( fn, prec, 1, pH, nj, myIter, myThid )
91 IF (j.LE.listDim) wrFldList(j) = 'DIC_pH2d'
92
93 C--------------------------
94 nWrFlds = j
95 IF ( nWrFlds.GT.listDim ) THEN
96 WRITE(msgBuf,'(2A,I5,A)') 'DIC_WRITE_PICKUP: ',
97 & 'trying to write ',nWrFlds,' fields'
98 CALL PRINT_ERROR( msgBuf, myThid )
99 WRITE(msgBuf,'(2A,I5,A)') 'DIC_WRITE_PICKUP: ',
100 & 'field-list dimension (listDim=',listDim,') too small'
101 CALL PRINT_ERROR( msgBuf, myThid )
102 STOP 'ABNORMAL END: S/R DIC_WRITE_PICKUP (list-size Pb)'
103 ENDIF
104
105 #ifdef ALLOW_MDSIO
106 C uses this specific S/R to write (with more informations) only meta
107 C files
108 j = 1
109 nj = ABS(nj)
110 IF ( nWrFlds*Nr .EQ. nj ) THEN
111 j = Nr
112 nj = nWrFlds
113 ENDIF
114 glf = globalFiles
115 timList(1) = myTime
116 CALL MDS_WR_METAFILES( fn, prec, glf, .FALSE.,
117 & 0, 0, j, ' ',
118 & nWrFlds, wrFldList,
119 & 1, timList, oneRL,
120 & nj, myIter, myThid )
121 #endif /* ALLOW_MDSIO */
122 C--------------------------
123
124 #endif /* DIC_BIOTIC */
125
126 c ENDIF /* DIC_pickup_write_mdsio */
127
128 #endif /* ALLOW_DIC */
129
130 RETURN
131 END

  ViewVC Help
Powered by ViewVC 1.1.22