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

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

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


Revision 1.4 - (hide annotations) (download)
Sun Apr 6 20:54:09 2008 UTC (16 years, 1 month ago) by jmc
Branch: MAIN
Changes since 1.3: +17 -9 lines
add description

1 jmc 1.4 C $Header: /u/gcmpack/MITgcm/pkg/dic/dic_write_pickup.F,v 1.3 2008/04/06 03:26:01 jmc Exp $
2 dfer 1.1 C $Name: $
3    
4     #include "GCHEM_OPTIONS.h"
5     #include "DIC_OPTIONS.h"
6    
7 jmc 1.4 CBOP
8     C !ROUTINE: DIC_WRITE_PICKUP
9 dfer 1.1
10 jmc 1.4 C !INTERFACE: ==========================================================
11     SUBROUTINE DIC_WRITE_PICKUP( permPickup,
12     I suff, myTime, myIter, myThid )
13    
14     C !DESCRIPTION:
15     C Writes DIC arrays (needed for a restart) to a pickup file
16    
17     C !USES: ===============================================================
18 dfer 1.1 IMPLICIT NONE
19     C === Global variables ===
20     #include "SIZE.h"
21     #include "EEPARAMS.h"
22     #include "PARAMS.h"
23 dfer 1.2 #include "DIC_VARS.h"
24 dfer 1.1
25 jmc 1.4 C !INPUT PARAMETERS: ===================================================
26 dfer 1.1 C permPickup :: write a permanent pickup
27 jmc 1.4 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 dfer 1.1 LOGICAL permPickup
32     CHARACTER*(*) suff
33     _RL myTime
34     INTEGER myIter
35     INTEGER myThid
36 jmc 1.4 CEOP
37 dfer 1.1
38     #ifdef ALLOW_DIC
39     #ifdef DIC_BIOTIC
40    
41     C !LOCAL VARIABLES:
42     C == Local variables ==
43     CHARACTER*(MAX_LEN_FNAM) fn
44 jmc 1.3 LOGICAL glf
45     INTEGER prec, j, nj
46     INTEGER listDim, nWrFlds
47     PARAMETER( listDim = 2 )
48     CHARACTER*(8) wrFldList(listDim)
49     CHARACTER*(MAX_LEN_MBUF) msgBuf
50 dfer 1.1
51 jmc 1.3 c IF ( DIC_pickup_write_mdsio ) THEN
52     prec = precFloat64
53     WRITE(fn,'(A,A)') 'pickup_dic.',suff
54     j = 0
55    
56     C Firstly, write 3-D fields as consecutive records,
57    
58     C- switch to 2-D fields:
59     nj = -j*Nr
60    
61     C record number < 0 : a hack not to write meta files now:
62     j = j + 1
63     nj = nj-1
64     CALL WRITE_REC_3D_RL( fn, prec, 1, pH, nj, myIter, myThid )
65     IF (j.LE.listDim) wrFldList(j) = 'DIC_pH2d'
66    
67     C--------------------------
68     nWrFlds = j
69     IF ( nWrFlds.GT.listDim ) THEN
70     WRITE(msgBuf,'(2A,I5,A)') 'DIC_WRITE_PICKUP: ',
71     & 'trying to write ',nWrFlds,' fields'
72     CALL PRINT_ERROR( msgBuf, myThid )
73     WRITE(msgBuf,'(2A,I5,A)') 'DIC_WRITE_PICKUP: ',
74     & 'field-list dimension (listDim=',listDim,') too small'
75     CALL PRINT_ERROR( msgBuf, myThid )
76     STOP 'ABNORMAL END: S/R DIC_WRITE_PICKUP (list-size Pb)'
77     ENDIF
78    
79     #ifdef ALLOW_MDSIO
80     C uses this specific S/R to write (with more informations) only meta
81     C files
82     j = 1
83     nj = ABS(nj)
84     IF ( nWrFlds*Nr .EQ. nj ) THEN
85     j = Nr
86     nj = nWrFlds
87     ENDIF
88     glf = globalFiles
89     CALL MDS_WR_METAFILES( fn, prec, glf, .FALSE.,
90     & 0, 0, j, ' ',
91     & nWrFlds, wrFldList,
92     & 1, myTime,
93     & nj, myIter, myThid )
94     #endif /* ALLOW_MDSIO */
95     C--------------------------
96 dfer 1.1
97 jmc 1.3 c ENDIF /* DIC_pickup_write_mdsio */
98 dfer 1.1
99     #endif /* DIC_BIOTIC */
100     #endif /* ALLOW_DIC */
101    
102     RETURN
103     END

  ViewVC Help
Powered by ViewVC 1.1.22