1 |
adcroft |
1.1 |
C $Header: $ |
2 |
|
|
C $Name: $ |
3 |
|
|
|
4 |
|
|
#include "PTRACERS_OPTIONS.h" |
5 |
|
|
|
6 |
|
|
CBOP |
7 |
|
|
C !ROUTINE: PTRACERS_WRITE_STATE |
8 |
|
|
|
9 |
|
|
C !INTERFACE: ========================================================== |
10 |
|
|
SUBROUTINE PTRACERS_WRITE_STATE( myIter,myTime,myThid ) |
11 |
|
|
|
12 |
|
|
C !DESCRIPTION: |
13 |
|
|
C Calculates tendancy for passive tracers and integrates forward |
14 |
|
|
C in time. |
15 |
|
|
|
16 |
|
|
C !USES: =============================================================== |
17 |
|
|
IMPLICIT NONE |
18 |
|
|
#include "SIZE.h" |
19 |
|
|
#include "EEPARAMS.h" |
20 |
|
|
#include "PTRACERS.h" |
21 |
|
|
#include "GAD.h" |
22 |
|
|
|
23 |
|
|
C !INPUT PARAMETERS: =================================================== |
24 |
|
|
C myIter :: time-step number |
25 |
|
|
C myTime :: model time |
26 |
|
|
C myThid :: thread number |
27 |
|
|
INTEGER myIter |
28 |
|
|
_RL myTime |
29 |
|
|
INTEGER myThid |
30 |
|
|
|
31 |
|
|
C !OUTPUT PARAMETERS: ================================================== |
32 |
|
|
C none |
33 |
|
|
|
34 |
|
|
#ifdef ALLOW_PTRACERS |
35 |
|
|
|
36 |
|
|
C !LOCAL VARIABLES: ==================================================== |
37 |
|
|
C iTracer :: loop indices |
38 |
|
|
C suff :: character buffer for creating suffix in filename |
39 |
|
|
C iRec :: record number |
40 |
|
|
INTEGER iTracer |
41 |
|
|
CHARACTER*(MAX_LEN_MBUF) suff |
42 |
|
|
INTEGER iRec |
43 |
|
|
CEOP |
44 |
|
|
|
45 |
|
|
C Loop over tracers |
46 |
|
|
DO iTracer=1,PTRACERS_numInUse |
47 |
|
|
|
48 |
|
|
#ifdef MULTIPLE_RECORD_STATE_FILES |
49 |
|
|
C Write each snap-shot as a record in a time-history file |
50 |
|
|
IF (PTRACERS_useRecords) THEN |
51 |
|
|
C Write each passive tracer as a record |
52 |
|
|
WRITE(suff,'(A)') 'PTRACERS' |
53 |
|
|
iRec = int ( (myCurrentTime-startTime) / dumpFreq +1.5 ) |
54 |
|
|
iRec = (iRec-1)*PTRACERS_num + iTracer + 1 |
55 |
|
|
ELSE |
56 |
|
|
C Write each passive tracer in its own file |
57 |
|
|
WRITE(pref,'(A7,I2.2)') 'PTRACER',iTracer |
58 |
|
|
iRec = int ( (myCurrentTime-startTime) / dumpFreq +1.5 ) |
59 |
|
|
ENDIF |
60 |
|
|
#else |
61 |
|
|
C Write each snap-shot as a new file with a 10-digit suffix to |
62 |
|
|
C indicate time-step number |
63 |
|
|
IF (PTRACERS_useRecords) THEN |
64 |
|
|
C Write each passive tracer as a record |
65 |
|
|
WRITE(suff,'(A,I10.10)') 'PTRACERS',myIter |
66 |
|
|
iRec=iTracer |
67 |
|
|
ELSE |
68 |
|
|
C Write each passive tracer in its own file |
69 |
|
|
WRITE(suff,'(A7,I2.2,A1,I10.10)') 'PTRACER',iTracer,'.',myIter |
70 |
|
|
iRec=1 |
71 |
|
|
ENDIF |
72 |
|
|
#endif /* MULTIPLE_RECORD_STATE_FILES */ |
73 |
|
|
|
74 |
|
|
CALL WRITE_REC_XYZ_RL(suff, |
75 |
|
|
& pTracer(1-Olx,1-Oly,1,1,1,iTracer),iRec,myIter,myThid) |
76 |
|
|
|
77 |
|
|
C End of tracer loop |
78 |
|
|
ENDDO |
79 |
|
|
|
80 |
|
|
#endif /* ALLOW_PTRACERS */ |
81 |
|
|
|
82 |
|
|
RETURN |
83 |
|
|
END |