/[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.15 - (hide annotations) (download)
Thu Sep 29 12:19:52 2005 UTC (18 years, 8 months ago) by edhill
Branch: MAIN
CVS Tags: checkpoint58b_post, checkpoint57y_post, checkpoint58, checkpoint58f_post, checkpoint58d_post, checkpoint58a_post, checkpoint57z_post, checkpoint58m_post, checkpoint57t_post, checkpoint57v_post, checkpoint57y_pre, checkpoint58o_post, checkpoint58p_post, checkpoint58q_post, checkpoint58e_post, checkpoint58n_post, checkpint57u_post, checkpoint58k_post, checkpoint58l_post, checkpoint58g_post, checkpoint58h_post, checkpoint58j_post, checkpoint57w_post, checkpoint58i_post, checkpoint57x_post, checkpoint58c_post
Changes since 1.14: +9 -2 lines
 o make mnc honor the writeBinaryPrec flag for all the non-pickup and
   non-diagnostics output types

1 edhill 1.15 C $Header: /u/gcmpack/MITgcm/pkg/ptracers/ptracers_write_state.F,v 1.14 2005/08/24 23:23:34 jmc 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 mlosch 1.8 SUBROUTINE PTRACERS_WRITE_STATE(
11     I myIter, myTime, myThid )
12 adcroft 1.1
13 edhill 1.4 C !DESCRIPTION:
14     C Calculates tendancy for passive tracers and integrates forward in
15     C time.
16 adcroft 1.1
17 edhill 1.4 C !USES:
18 adcroft 1.1 IMPLICIT NONE
19     #include "SIZE.h"
20     #include "EEPARAMS.h"
21 edhill 1.4 #include "PARAMS.h"
22 jmc 1.3 #include "PTRACERS_SIZE.h"
23 adcroft 1.1 #include "PTRACERS.h"
24    
25 edhill 1.4 C !INPUT PARAMETERS:
26     C myIter :: time-step number
27     C myTime :: model time
28     C myThid :: thread number
29 adcroft 1.1 INTEGER myIter
30     _RL myTime
31     INTEGER myThid
32 edhill 1.4 CEOP
33 adcroft 1.1
34     #ifdef ALLOW_PTRACERS
35    
36 edhill 1.4 C !LOCAL VARIABLES:
37     C iTracer :: loop indices
38     C suff :: character buffer for creating suffix in filename
39     C iRec :: record number
40 adcroft 1.1 INTEGER iTracer
41     CHARACTER*(MAX_LEN_MBUF) suff
42     INTEGER iRec
43 edhill 1.15 CHARACTER*(1) pf
44 mlosch 1.8
45 jmc 1.11 LOGICAL DIFFERENT_MULTIPLE
46     EXTERNAL DIFFERENT_MULTIPLE
47 mlosch 1.8 INTEGER IO_ERRCOUNT
48     EXTERNAL IO_ERRCOUNT
49    
50 jmc 1.11 IF ( DIFFERENT_MULTIPLE( PTRACERS_dumpFreq, myTime, deltaTClock )
51 jmc 1.14 & .OR. dumpInitAndLast.AND.( myTime.EQ.endTime .OR.
52     & myTime.EQ.startTime )
53 jmc 1.11 & ) THEN
54 mlosch 1.8
55 edhill 1.15 IF ( writeBinaryPrec .EQ. precFloat64 ) THEN
56     pf(1:1) = 'D'
57     ELSE
58     pf(1:1) = 'R'
59     ENDIF
60    
61 mlosch 1.8 C Write to files
62     _BARRIER
63     _BEGIN_MASTER( myThid )
64    
65 edhill 1.4 #ifdef ALLOW_MNC
66 edhill 1.13 IF ( PTRACERS_snapshot_mnc ) THEN
67 edhill 1.4 CALL MNC_CW_SET_UDIM('ptracers', -1, myThid)
68 edhill 1.12 CALL MNC_CW_RL_W_S('D','ptracers',0,0,'T',myTime,myThid)
69 edhill 1.4 CALL MNC_CW_SET_UDIM('ptracers', 0, myThid)
70 edhill 1.12 CALL MNC_CW_I_W_S('I','ptracers',0,0,'iter',myIter,myThid)
71 mlosch 1.8 DO iTracer = 1,PTRACERS_numInUse
72 edhill 1.15 CALL MNC_CW_RL_W(pf,'ptracers',0,0,PTRACERS_names(iTracer),
73 mlosch 1.8 & pTracer(1-OLx,1-OLy,1,1,1,iTracer),myThid)
74 edhill 1.4 ENDDO
75 mlosch 1.8 ENDIF
76 edhill 1.4 #endif /* ALLOW_MNC */
77    
78 edhill 1.13 IF ( PTRACERS_snapshot_mdsio ) THEN
79 adcroft 1.1
80 edhill 1.4 C Loop over tracers
81     DO iTracer=1,PTRACERS_numInUse
82 adcroft 1.1
83     #ifdef MULTIPLE_RECORD_STATE_FILES
84 mlosch 1.8 C Write each snap-shot as a record in a time-history file
85     IF (PTRACERS_useRecords) THEN
86     C Write each passive tracer as a record
87     WRITE(suff,'(A)') 'PTRACERS'
88     iRec = int ( (myCurrentTime-startTime)
89     & / PTRACERS_dumpFreq + 1.5 )
90     iRec = (iRec-1)*PTRACERS_num + iTracer + 1
91     ELSE
92     C Write each passive tracer in its own file
93     WRITE(pref,'(A7,I2.2)') 'PTRACER',iTracer
94     iRec = int ( (myCurrentTime-startTime)
95     & / PTRACERS_dumpFreq + 1.5 )
96     ENDIF
97     #else
98 edhill 1.4 C Write each snap-shot as a new file with a 10-digit suffix to
99 mlosch 1.8 C indicate time-step number
100     IF (PTRACERS_useRecords) THEN
101     C Write each passive tracer as a record
102     WRITE(suff,'(A,I10.10)') 'PTRACERS',myIter
103     iRec=iTracer
104     ELSE
105     C Write each passive tracer in its own file
106     WRITE(suff,'(A7,I2.2,A1,I10.10)')
107     & 'PTRACER',iTracer,'.',myIter
108     iRec=1
109     ENDIF
110 adcroft 1.1 #endif /* MULTIPLE_RECORD_STATE_FILES */
111 mlosch 1.8
112     CALL WRITE_REC_XYZ_RL(suff,
113     & pTracer(1-Olx,1-Oly,1,1,1,iTracer),iRec,myIter,myThid)
114    
115     C End of tracer loop
116 edhill 1.4 ENDDO
117    
118 mlosch 1.8 ENDIF
119    
120     _END_MASTER( myThid )
121     _BARRIER
122 edhill 1.4 ENDIF
123 mlosch 1.8
124 adcroft 1.1 #endif /* ALLOW_PTRACERS */
125    
126     RETURN
127     END

  ViewVC Help
Powered by ViewVC 1.1.22