/[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.5 - (show annotations) (download)
Fri Sep 10 12:19:31 2004 UTC (19 years, 8 months ago) by edhill
Branch: MAIN
CVS Tags: checkpoint55, checkpoint54f_post, checkpoint55c_post, checkpoint55b_post, checkpoint55a_post
Changes since 1.4: +6 -8 lines
 o overhaul of IO so that we now have flags for MDSIO and/or MNC
   - all verification tests compile and run with linux_ia32_g77
   - defaults are compatible with current input files--nothing
     should change if you were not previously using MNC
   - MNC output has been added in numerous places (eg. timeave)
     but there are still a few writes not yet do-able with MNC
     (this is in progress)
   - flags now allow for either/or/both use of MDSIO and MNC and
     documentation will soon follow
   - numerous small formatting cleanups for ProTeX

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

  ViewVC Help
Powered by ViewVC 1.1.22