/[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.5 - (hide 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 edhill 1.5 C $Header: /u/gcmpack/MITgcm/pkg/ptracers/ptracers_write_state.F,v 1.4 2004/09/03 20:10:47 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 edhill 1.5 #ifdef ALLOW_MNC
22     #include "MNC_PARAMS.h"
23     #endif
24 jmc 1.3 #include "PTRACERS_SIZE.h"
25 adcroft 1.1 #include "PTRACERS.h"
26    
27 edhill 1.4 C !INPUT PARAMETERS:
28     C myIter :: time-step number
29     C myTime :: model time
30     C myThid :: thread number
31 adcroft 1.1 INTEGER myIter
32     _RL myTime
33     INTEGER myThid
34 edhill 1.4 CEOP
35 adcroft 1.1
36     #ifdef ALLOW_PTRACERS
37    
38 edhill 1.4 C !LOCAL VARIABLES:
39     C iTracer :: loop indices
40     C suff :: character buffer for creating suffix in filename
41     C iRec :: record number
42 adcroft 1.1 INTEGER iTracer
43     CHARACTER*(MAX_LEN_MBUF) suff
44     INTEGER iRec
45 edhill 1.4 #ifdef ALLOW_MNC
46     INTEGER ii
47    
48 edhill 1.5 IF (useMNC .AND. PTRACERS_write_mnc) THEN
49 edhill 1.4 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 edhill 1.5 IF (PTRACERS_write_mdsio) THEN
60 adcroft 1.1
61 edhill 1.4 C Loop over tracers
62     DO iTracer=1,PTRACERS_numInUse
63 adcroft 1.1
64     #ifdef MULTIPLE_RECORD_STATE_FILES
65 edhill 1.4 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 adcroft 1.1 #else
77 edhill 1.4 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 adcroft 1.1 #endif /* MULTIPLE_RECORD_STATE_FILES */
90    
91 edhill 1.4 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 adcroft 1.1 #endif /* ALLOW_PTRACERS */
99    
100     RETURN
101     END

  ViewVC Help
Powered by ViewVC 1.1.22