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

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

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


Revision 1.15 - (show 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 C $Header: /u/gcmpack/MITgcm/pkg/ptracers/ptracers_write_state.F,v 1.14 2005/08/24 23:23:34 jmc Exp $
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(
11 I myIter, myTime, myThid )
12
13 C !DESCRIPTION:
14 C Calculates tendancy for passive tracers and integrates forward in
15 C time.
16
17 C !USES:
18 IMPLICIT NONE
19 #include "SIZE.h"
20 #include "EEPARAMS.h"
21 #include "PARAMS.h"
22 #include "PTRACERS_SIZE.h"
23 #include "PTRACERS.h"
24
25 C !INPUT PARAMETERS:
26 C myIter :: time-step number
27 C myTime :: model time
28 C myThid :: thread number
29 INTEGER myIter
30 _RL myTime
31 INTEGER myThid
32 CEOP
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 CHARACTER*(1) pf
44
45 LOGICAL DIFFERENT_MULTIPLE
46 EXTERNAL DIFFERENT_MULTIPLE
47 INTEGER IO_ERRCOUNT
48 EXTERNAL IO_ERRCOUNT
49
50 IF ( DIFFERENT_MULTIPLE( PTRACERS_dumpFreq, myTime, deltaTClock )
51 & .OR. dumpInitAndLast.AND.( myTime.EQ.endTime .OR.
52 & myTime.EQ.startTime )
53 & ) THEN
54
55 IF ( writeBinaryPrec .EQ. precFloat64 ) THEN
56 pf(1:1) = 'D'
57 ELSE
58 pf(1:1) = 'R'
59 ENDIF
60
61 C Write to files
62 _BARRIER
63 _BEGIN_MASTER( myThid )
64
65 #ifdef ALLOW_MNC
66 IF ( PTRACERS_snapshot_mnc ) THEN
67 CALL MNC_CW_SET_UDIM('ptracers', -1, myThid)
68 CALL MNC_CW_RL_W_S('D','ptracers',0,0,'T',myTime,myThid)
69 CALL MNC_CW_SET_UDIM('ptracers', 0, myThid)
70 CALL MNC_CW_I_W_S('I','ptracers',0,0,'iter',myIter,myThid)
71 DO iTracer = 1,PTRACERS_numInUse
72 CALL MNC_CW_RL_W(pf,'ptracers',0,0,PTRACERS_names(iTracer),
73 & pTracer(1-OLx,1-OLy,1,1,1,iTracer),myThid)
74 ENDDO
75 ENDIF
76 #endif /* ALLOW_MNC */
77
78 IF ( PTRACERS_snapshot_mdsio ) THEN
79
80 C Loop over tracers
81 DO iTracer=1,PTRACERS_numInUse
82
83 #ifdef MULTIPLE_RECORD_STATE_FILES
84 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 C Write each snap-shot as a new file with a 10-digit suffix to
99 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 #endif /* MULTIPLE_RECORD_STATE_FILES */
111
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 ENDDO
117
118 ENDIF
119
120 _END_MASTER( myThid )
121 _BARRIER
122 ENDIF
123
124 #endif /* ALLOW_PTRACERS */
125
126 RETURN
127 END

  ViewVC Help
Powered by ViewVC 1.1.22