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

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

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


Revision 1.3 - (hide annotations) (download)
Thu Oct 26 00:29:33 2006 UTC (17 years, 7 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint58u_post, checkpoint58w_post, checkpoint58r_post, checkpoint58x_post, checkpoint58t_post, checkpoint59e, checkpoint59d, checkpoint59g, checkpoint59f, checkpoint59a, checkpoint59c, checkpoint59b, checkpoint59i, checkpoint59h, checkpoint59, checkpoint58y_post, checkpoint58v_post, checkpoint58s_post
Changes since 1.2: +4 -8 lines
- call pkg/rw S/R (rather than directly MDSIO)
- all threads call I/0 S/R (needed for singleCPUIO to work in multi-threaded)

1 jmc 1.3 C $Header: /u/gcmpack/MITgcm/pkg/ptracers/ptracers_init_varia.F,v 1.2 2006/10/25 20:41:21 jmc Exp $
2 jmc 1.1 C $Name: $
3    
4     #include "PTRACERS_OPTIONS.h"
5    
6     C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
7     CBOP
8     C !ROUTINE: PTRACERS_INIT_VARIA
9    
10     C !INTERFACE:
11     SUBROUTINE PTRACERS_INIT_VARIA( myThid )
12    
13     C !DESCRIPTION:
14     C Initialize PTRACERS data structures
15    
16     C !USES:
17     IMPLICIT NONE
18     #include "SIZE.h"
19     #include "EEPARAMS.h"
20     #include "PARAMS.h"
21     #include "GRID.h"
22     #include "PTRACERS_SIZE.h"
23     #include "PTRACERS.h"
24    
25     C !INPUT PARAMETERS:
26     C myThid :: thread number
27     INTEGER myThid
28    
29     #ifdef ALLOW_PTRACERS
30    
31     C !LOCAL VARIABLES:
32     C i,j,k,bi,bj,iTracer :: loop indices
33     INTEGER i,j,k,bi,bj,iTracer
34     CHARACTER*(10) suff
35     CEOP
36    
37     C Loop over tracers
38     DO iTracer = 1, PTRACERS_num
39    
40     C Loop over tiles
41     DO bj = myByLo(myThid), myByHi(myThid)
42     DO bi = myBxLo(myThid), myBxHi(myThid)
43    
44     C Initialize arrays in common blocks :
45     DO k=1,Nr
46     DO j=1-Oly,sNy+OLy
47     DO i=1-Olx,sNx+Olx
48     pTracer(i,j,k,bi,bj,iTracer) = PTRACERS_ref(k,iTracer)
49     gPtr(i,j,k,bi,bj,iTracer) = 0. _d 0
50     gPtrNM1(i,j,k,bi,bj,iTracer) = 0. _d 0
51     ENDDO
52     ENDDO
53     ENDDO
54     DO j=1-Oly,sNy+OLy
55     DO i=1-Olx,sNx+Olx
56     surfaceForcingPtr(i,j,bi,bj,iTracer) = 0. _d 0
57     ENDDO
58     ENDDO
59    
60     C end bi,bj loops
61     ENDDO
62     ENDDO
63    
64     C end of Tracer loop
65     ENDDO
66    
67     _BARRIER
68    
69     C Now read initial conditions and always exchange
70     IF (nIter0.EQ.PTRACERS_Iter0) THEN
71     DO iTracer = 1, PTRACERS_numInUse
72     IF ( PTRACERS_initialFile(iTracer) .NE. ' ' ) THEN
73     CALL READ_FLD_XYZ_RL(PTRACERS_initialFile(iTracer),' ',
74     & pTracer(1-Olx,1-Oly,1,1,1,iTracer),0,myThid)
75     _EXCH_XYZ_R8(pTracer(1-Olx,1-Oly,1,1,1,iTracer),myThid)
76     ENDIF
77     ENDDO
78     ENDIF
79    
80     C Apply mask
81     DO iTracer = 1, PTRACERS_numInUse
82     DO bj = myByLo(myThid), myByHi(myThid)
83     DO bi = myBxLo(myThid), myBxHi(myThid)
84     DO k=1,Nr
85 jmc 1.3 DO j=1-Oly,sNy+OLy
86     DO i=1-Olx,sNx+Olx
87 jmc 1.1 IF (maskC(i,j,k,bi,bj).EQ.0.)
88     & pTracer(i,j,k,bi,bj,iTracer)=0. _d 0
89     ENDDO
90     ENDDO
91     ENDDO
92     ENDDO
93     ENDDO
94     ENDDO
95    
96     C Read from a pickup file if needed
97     IF (nIter0.GT.PTRACERS_Iter0) THEN
98     C Suffix for pickup files
99     IF (pickupSuff.EQ.' ') THEN
100     WRITE(suff,'(I10.10)') nIter0
101     ELSE
102     WRITE(suff,'(A10)') pickupSuff
103     ENDIF
104 jmc 1.3 CALL PTRACERS_READ_PICKUP( nIter0, myThid )
105 jmc 1.1 ENDIF
106    
107     #endif /* ALLOW_PTRACERS */
108    
109     RETURN
110     END

  ViewVC Help
Powered by ViewVC 1.1.22