/[MITgcm]/MITgcm_contrib/ocean_inversion_project/code/ptracers_init.F.test
ViewVC logotype

Annotation of /MITgcm_contrib/ocean_inversion_project/code/ptracers_init.F.test

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


Revision 1.1 - (hide annotations) (download)
Thu Sep 18 02:33:38 2003 UTC (21 years, 10 months ago) by dimitri
Branch: MAIN
Modifications and input files needed to compute tracer
Green's functions for Gruber's ocean inversion project.

1 dimitri 1.1 C $Header: /u/gcmpack/MITgcm/pkg/ptracers/ptracers_init.F,v 1.4 2003/07/09 20:00:58 stephd Exp $
2     C $Name: $
3    
4     #include "PTRACERS_OPTIONS.h"
5     #ifdef ALLOW_GCHEM
6     # include "GCHEM_OPTIONS.h"
7     #endif
8    
9     CBOP
10     C !ROUTINE: PTRACERS_INIT
11    
12     C !INTERFACE: ==========================================================
13     SUBROUTINE PTRACERS_INIT( myThid )
14    
15     C !DESCRIPTION:
16     C Initialize PTRACERS data structures
17     cdm This file is customized to compute CO2 perturbations from 30 ocean
18     cdm regions for Gruber's ocean inversion project.
19    
20     C !USES: ===============================================================
21     IMPLICIT NONE
22     #include "SIZE.h"
23     #include "EEPARAMS.h"
24     #include "PARAMS.h"
25     #include "GRID.h"
26     #include "PTRACERS.h"
27     cswdptr -- add ---
28     #ifdef ALLOW_GCHEM
29     # include "GCHEM.h"
30     #endif
31     cswdptr --- end add --
32    
33    
34     C !INPUT PARAMETERS: ===================================================
35     C myThid :: thread number
36     INTEGER myThid
37    
38     C !OUTPUT PARAMETERS: ==================================================
39     C none
40    
41     #ifdef ALLOW_PTRACERS
42    
43     C !LOCAL VARIABLES: ====================================================
44     C i,j,k,bi,bj,iTracer :: loop indices
45     INTEGER i,j,k,bi,bj,iTracer
46     CHARACTER*(10) suff
47     #ifndef ALLOW_GCHEM
48     INTEGER tIter0
49     PARAMETER ( tIter0 = 0 )
50     #endif
51     CEOP
52    
53     C Loop over tracers
54     DO iTracer = 1, PTRACERS_num
55    
56     C Loop over tiles
57     DO bj = myByLo(myThid), myByHi(myThid)
58     DO bi = myBxLo(myThid), myBxHi(myThid)
59    
60     C Initialize arrays in common blocks :
61     DO k=1,Nr
62     DO j=1-Oly,sNy+OLy
63     DO i=1-Olx,sNx+Olx
64     pTracer(i,j,k,bi,bj,iTracer) = 0. _d 0
65     gPtr(i,j,k,bi,bj,iTracer) = 0. _d 0
66     gPtrNM1(i,j,k,bi,bj,iTracer) = 0. _d 0
67     ENDDO
68     ENDDO
69     ENDDO
70    
71     #ifdef ALLOW_TIMEAVE
72     C Initialize averages to zero
73     c CALL TIMEAVE_RESET(GM_Kwx_T,Nr, bi,bj,myThid)
74     c CALL TIMEAVE_RESET(GM_Kwy_T,Nr, bi,bj,myThid)
75     c CALL TIMEAVE_RESET(GM_Kwz_T,Nr, bi,bj,myThid)
76     c DO k=1,Nr
77     c GM_TimeAve(k,bi,bj)=0.
78     c ENDDO
79     #endif /* ALLOW_TIMEAVE */
80    
81     C end bi,bj loops
82     ENDDO
83     ENDDO
84    
85     C end of Tracer loop
86     ENDDO
87    
88     C Now read initial conditions and always exchange
89     cswdptr IF (nIter0.EQ.0) THEN
90     cswdptr -- change ---
91     IF (nIter0.EQ.tIter0) THEN
92     cswdptr -- end change ---
93     DO iTracer = 1, PTRACERS_numInUse
94     IF ( PTRACERS_initialFile(iTracer) .NE. ' ' ) THEN
95     _BEGIN_MASTER( myThid )
96     CALL READ_FLD_XYZ_RL(PTRACERS_initialFile(iTracer),' ',
97     & pTracer(1-Olx,1-Oly,1,1,1,iTracer) ,0,myThid)
98     _END_MASTER(myThid)
99    
100     C Apply mask
101     DO bj = myByLo(myThid), myByHi(myThid)
102     DO bi = myBxLo(myThid), myBxHi(myThid)
103     DO K=1,Nr
104     DO J=1,sNy
105     DO I=1,sNx
106     IF(hFacC(I,J,K,bi,bj).EQ.0)
107     & pTracer(i,j,k,bi,bj,iTracer)=0.
108     ENDDO
109     ENDDO
110     ENDDO
111     ENDDO
112     ENDDO
113    
114     ELSE
115     cswdptr -- add ---
116     cswdptr -- end add ---
117     ENDIF
118     _EXCH_XYZ_R8(pTracer(1-Olx,1-Oly,1,1,1,iTracer),myThid)
119     ENDDO
120     ENDIF
121    
122     C Read from a pickup file if nIter0
123     cswdptr IF (nIter0.NE.0) THEN
124     cswdptr -- change --
125     IF (nIter0.GT.tIter0) THEN
126     C-- Suffix for pickup files
127     IF (pickupSuff.EQ.' ') THEN
128     WRITE(suff,'(I10.10)') nIter0
129     ELSE
130     WRITE(suff,'(A10)') pickupSuff
131     ENDIF
132     CALL PTRACERS_READ_CHECKPOINT( nIter0,myThid )
133     ENDIF
134    
135     cdm Initialize pTracerMasks
136     CALL PTRACERS_READ_MASK ( mythid )
137    
138     #endif /* ALLOW_PTRACERS */
139    
140     RETURN
141     END

  ViewVC Help
Powered by ViewVC 1.1.22