/[MITgcm]/MITgcm/pkg/ptracers/ptracers_write_state.F
ViewVC logotype

Annotation of /MITgcm/pkg/ptracers/ptracers_write_state.F

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


Revision 1.7 - (hide annotations) (download)
Sun Oct 10 06:08:50 2004 UTC (19 years, 7 months ago) by edhill
Branch: MAIN
CVS Tags: checkpoint56, checkpoint55i_post, checkpoint55g_post, checkpoint55j_post, checkpoint55h_post, checkpoint55f_post, checkpoint56a_post
Changes since 1.6: +1 -4 lines
 o move useMNC and related runtime switches to PARAMS.h

1 edhill 1.7 C $Header: /u/gcmpack/MITgcm/pkg/ptracers/ptracers_write_state.F,v 1.6 2004/10/07 01:48:08 edhill Exp $
2 dimitri 1.2 C $Name: $
3 adcroft 1.1
4     #include "PTRACERS_OPTIONS.h"
5    
6     CBOP
7 edhill 1.4 C !ROUTINE: PTRACERS_WRITE_STATE
8 adcroft 1.1
9 edhill 1.4 C !INTERFACE:
10 adcroft 1.1 SUBROUTINE PTRACERS_WRITE_STATE( myIter,myTime,myThid )
11    
12 edhill 1.4 C !DESCRIPTION:
13     C Calculates tendancy for passive tracers and integrates forward in
14     C time.
15 adcroft 1.1
16 edhill 1.4 C !USES:
17 adcroft 1.1 IMPLICIT NONE
18     #include "SIZE.h"
19     #include "EEPARAMS.h"
20 edhill 1.4 #include "PARAMS.h"
21 jmc 1.3 #include "PTRACERS_SIZE.h"
22 adcroft 1.1 #include "PTRACERS.h"
23    
24 edhill 1.4 C !INPUT PARAMETERS:
25     C myIter :: time-step number
26     C myTime :: model time
27     C myThid :: thread number
28 adcroft 1.1 INTEGER myIter
29     _RL myTime
30     INTEGER myThid
31 edhill 1.4 CEOP
32 adcroft 1.1
33     #ifdef ALLOW_PTRACERS
34    
35 edhill 1.4 C !LOCAL VARIABLES:
36     C iTracer :: loop indices
37     C suff :: character buffer for creating suffix in filename
38     C iRec :: record number
39 adcroft 1.1 INTEGER iTracer
40     CHARACTER*(MAX_LEN_MBUF) suff
41     INTEGER iRec
42 edhill 1.4 #ifdef ALLOW_MNC
43     INTEGER ii
44    
45 edhill 1.5 IF (useMNC .AND. PTRACERS_write_mnc) THEN
46 edhill 1.4 CALL MNC_CW_SET_UDIM('ptracers', -1, myThid)
47 edhill 1.6 CALL MNC_CW_I_W_S('I','ptracers',0,0,'iter',myIter,myThid)
48 edhill 1.4 CALL MNC_CW_SET_UDIM('ptracers', 0, myThid)
49     DO ii = 1,PTRACERS_numInUse
50     CALL MNC_CW_RL_W('D','ptracers',0,0,PTRACERS_names(ii),
51     & pTracer(1-OLx,1-OLy,1,1,1,ii),myThid)
52     ENDDO
53     ENDIF
54     #endif /* ALLOW_MNC */
55    
56 edhill 1.5 IF (PTRACERS_write_mdsio) THEN
57 adcroft 1.1
58 edhill 1.4 C Loop over tracers
59     DO iTracer=1,PTRACERS_numInUse
60 adcroft 1.1
61     #ifdef MULTIPLE_RECORD_STATE_FILES
62 edhill 1.4 C Write each snap-shot as a record in a time-history file
63     IF (PTRACERS_useRecords) THEN
64     C Write each passive tracer as a record
65     WRITE(suff,'(A)') 'PTRACERS'
66     iRec = int ( (myCurrentTime-startTime) / dumpFreq +1.5 )
67     iRec = (iRec-1)*PTRACERS_num + iTracer + 1
68     ELSE
69     C Write each passive tracer in its own file
70     WRITE(pref,'(A7,I2.2)') 'PTRACER',iTracer
71     iRec = int ( (myCurrentTime-startTime) / dumpFreq +1.5 )
72     ENDIF
73 adcroft 1.1 #else
74 edhill 1.4 C Write each snap-shot as a new file with a 10-digit suffix to
75     C indicate time-step number
76     IF (PTRACERS_useRecords) THEN
77     C Write each passive tracer as a record
78     WRITE(suff,'(A,I10.10)') 'PTRACERS',myIter
79     iRec=iTracer
80     ELSE
81     C Write each passive tracer in its own file
82     WRITE(suff,'(A7,I2.2,A1,I10.10)')
83     & 'PTRACER',iTracer,'.',myIter
84     iRec=1
85     ENDIF
86 adcroft 1.1 #endif /* MULTIPLE_RECORD_STATE_FILES */
87    
88 edhill 1.4 CALL WRITE_REC_XYZ_RL(suff,
89     & pTracer(1-Olx,1-Oly,1,1,1,iTracer),iRec,myIter,myThid)
90    
91     C End of tracer loop
92     ENDDO
93    
94     ENDIF
95 adcroft 1.1 #endif /* ALLOW_PTRACERS */
96    
97     RETURN
98     END

  ViewVC Help
Powered by ViewVC 1.1.22