1 |
dimitri |
1.2 |
C $Header: /u/gcmpack/MITgcm/pkg/ptracers/ptracers_write_state.F,v 1.1 2002/03/04 19:01:29 adcroft Exp $ |
2 |
|
|
C $Name: $ |
3 |
adcroft |
1.1 |
|
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 |
|
|
|
22 |
|
|
C !INPUT PARAMETERS: =================================================== |
23 |
|
|
C myIter :: time-step number |
24 |
|
|
C myTime :: model time |
25 |
|
|
C myThid :: thread number |
26 |
|
|
INTEGER myIter |
27 |
|
|
_RL myTime |
28 |
|
|
INTEGER myThid |
29 |
|
|
|
30 |
|
|
C !OUTPUT PARAMETERS: ================================================== |
31 |
|
|
C none |
32 |
|
|
|
33 |
|
|
#ifdef ALLOW_PTRACERS |
34 |
|
|
|
35 |
|
|
C !LOCAL VARIABLES: ==================================================== |
36 |
|
|
C iTracer :: loop indices |
37 |
|
|
C suff :: character buffer for creating suffix in filename |
38 |
|
|
C iRec :: record number |
39 |
|
|
INTEGER iTracer |
40 |
|
|
CHARACTER*(MAX_LEN_MBUF) suff |
41 |
|
|
INTEGER iRec |
42 |
|
|
CEOP |
43 |
|
|
|
44 |
|
|
C Loop over tracers |
45 |
|
|
DO iTracer=1,PTRACERS_numInUse |
46 |
|
|
|
47 |
|
|
#ifdef MULTIPLE_RECORD_STATE_FILES |
48 |
|
|
C Write each snap-shot as a record in a time-history file |
49 |
|
|
IF (PTRACERS_useRecords) THEN |
50 |
|
|
C Write each passive tracer as a record |
51 |
|
|
WRITE(suff,'(A)') 'PTRACERS' |
52 |
|
|
iRec = int ( (myCurrentTime-startTime) / dumpFreq +1.5 ) |
53 |
|
|
iRec = (iRec-1)*PTRACERS_num + iTracer + 1 |
54 |
|
|
ELSE |
55 |
|
|
C Write each passive tracer in its own file |
56 |
|
|
WRITE(pref,'(A7,I2.2)') 'PTRACER',iTracer |
57 |
|
|
iRec = int ( (myCurrentTime-startTime) / dumpFreq +1.5 ) |
58 |
|
|
ENDIF |
59 |
|
|
#else |
60 |
|
|
C Write each snap-shot as a new file with a 10-digit suffix to |
61 |
|
|
C indicate time-step number |
62 |
|
|
IF (PTRACERS_useRecords) THEN |
63 |
|
|
C Write each passive tracer as a record |
64 |
|
|
WRITE(suff,'(A,I10.10)') 'PTRACERS',myIter |
65 |
|
|
iRec=iTracer |
66 |
|
|
ELSE |
67 |
|
|
C Write each passive tracer in its own file |
68 |
|
|
WRITE(suff,'(A7,I2.2,A1,I10.10)') 'PTRACER',iTracer,'.',myIter |
69 |
|
|
iRec=1 |
70 |
|
|
ENDIF |
71 |
|
|
#endif /* MULTIPLE_RECORD_STATE_FILES */ |
72 |
|
|
|
73 |
|
|
CALL WRITE_REC_XYZ_RL(suff, |
74 |
|
|
& pTracer(1-Olx,1-Oly,1,1,1,iTracer),iRec,myIter,myThid) |
75 |
|
|
|
76 |
|
|
C End of tracer loop |
77 |
|
|
ENDDO |
78 |
|
|
|
79 |
|
|
#endif /* ALLOW_PTRACERS */ |
80 |
|
|
|
81 |
|
|
RETURN |
82 |
|
|
END |