1 |
C $Header: $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "PTRACERS_OPTIONS.h" |
5 |
|
6 |
CBOP |
7 |
C !ROUTINE: PTRACERS_WRITE_CHECKPOINT |
8 |
|
9 |
C !INTERFACE: ========================================================== |
10 |
SUBROUTINE PTRACERS_WRITE_CHECKPOINT( suff,myIter,myTime,myThid ) |
11 |
|
12 |
C !DESCRIPTION: |
13 |
C Writes current state of passive tracers to a pickup file |
14 |
|
15 |
C !USES: =============================================================== |
16 |
IMPLICIT NONE |
17 |
#include "SIZE.h" |
18 |
#include "EEPARAMS.h" |
19 |
#include "PARAMS.h" |
20 |
#include "PTRACERS.h" |
21 |
|
22 |
C !INPUT PARAMETERS: =================================================== |
23 |
C suff :: suffix for pickup file (eg. ckptA or 0000000010) |
24 |
C myIter :: time-step number |
25 |
C myTime :: model time |
26 |
C myThid :: thread number |
27 |
CHARACTER*(*) suff |
28 |
INTEGER myIter |
29 |
_RL myTime |
30 |
INTEGER myThid |
31 |
|
32 |
C !OUTPUT PARAMETERS: ================================================== |
33 |
C none |
34 |
|
35 |
#ifdef ALLOW_PTRACERS |
36 |
|
37 |
C !LOCAL VARIABLES: ==================================================== |
38 |
C iTracer :: loop indices |
39 |
C iRec :: record number |
40 |
C fn :: character buffer for creating filename |
41 |
C prec :: precision of pickup files |
42 |
C lgf :: flag to write "global" files |
43 |
INTEGER iTracer,prec,iRec |
44 |
CHARACTER*(MAX_LEN_MBUF) fn |
45 |
LOGICAL lgf |
46 |
CEOP |
47 |
|
48 |
WRITE(fn,'(A,A)') 'pickup_ptracers.',suff |
49 |
prec = precFloat64 |
50 |
lgf = globalFiles |
51 |
|
52 |
C Write fields as consecutive records |
53 |
DO iTracer=1,PTRACERS_num |
54 |
iRec = iTracer |
55 |
CALL MDSWRITEFIELD(fn,prec,lgf,'RL',Nr, |
56 |
& pTracer(1-Olx,1-Oly,1,1,1,iTracer),iRec,myIter,myThid) |
57 |
ENDDO |
58 |
|
59 |
C Write historical tendancies as consecutive records |
60 |
DO iTracer=1,PTRACERS_num |
61 |
iRec = iTracer + PTRACERS_num |
62 |
CALL MDSWRITEFIELD(fn,prec,lgf,'RL',Nr, |
63 |
& gPtr(1-Olx,1-Oly,1,1,1,iTracer),iRec,myIter,myThid) |
64 |
ENDDO |
65 |
DO iTracer=1,PTRACERS_num |
66 |
iRec = iTracer + PTRACERS_num*2 |
67 |
CALL MDSWRITEFIELD(fn,prec,lgf,'RL',Nr, |
68 |
& gPtrNm1(1-Olx,1-Oly,1,1,1,iTracer),iRec,myIter,myThid) |
69 |
ENDDO |
70 |
|
71 |
#endif /* ALLOW_PTRACERS */ |
72 |
|
73 |
RETURN |
74 |
END |