20 |
#include "PTRACERS_SIZE.h" |
#include "PTRACERS_SIZE.h" |
21 |
#include "PTRACERS.h" |
#include "PTRACERS.h" |
22 |
#include "PARAMS.h" |
#include "PARAMS.h" |
23 |
|
|
24 |
C !INPUT PARAMETERS: |
C !INPUT PARAMETERS: |
25 |
INTEGER myThid |
INTEGER myThid |
26 |
CEOP |
CEOP |
28 |
#ifdef ALLOW_PTRACERS |
#ifdef ALLOW_PTRACERS |
29 |
|
|
30 |
C !LOCAL VARIABLES: |
C !LOCAL VARIABLES: |
31 |
C iTracer :: loop indices |
C k,iTracer :: loop indices |
32 |
C iUnit :: unit number for I/O |
C iUnit :: unit number for I/O |
33 |
C msgBuf :: message buffer |
C msgBuf :: message buffer |
34 |
INTEGER iTracer |
INTEGER k, iTracer |
35 |
INTEGER iUnit |
INTEGER iUnit |
36 |
INTEGER ic |
INTEGER ic |
37 |
CHARACTER*(MAX_LEN_MBUF) msgBuf |
CHARACTER*(MAX_LEN_MBUF) msgBuf |
38 |
|
_RL PTRACERS_diffKr(PTRACERS_num) |
39 |
|
|
40 |
C PTRACERS_taveFreq :: Frequency with which time-averaged PTRACERS |
C PTRACERS_taveFreq :: Frequency with which time-averaged PTRACERS |
41 |
C are written to post-processing files. |
C are written to post-processing files. |
42 |
NAMELIST /PTRACERS_PARM01/ |
NAMELIST /PTRACERS_PARM01/ |
43 |
|
& PTRACERS_dumpFreq, |
44 |
& PTRACERS_taveFreq, |
& PTRACERS_taveFreq, |
45 |
|
& PTRACERS_monitorFreq, |
46 |
& PTRACERS_advScheme, |
& PTRACERS_advScheme, |
47 |
|
& PTRACERS_ImplVertAdv, |
48 |
& PTRACERS_diffKh, |
& PTRACERS_diffKh, |
49 |
& PTRACERS_diffK4, |
& PTRACERS_diffK4, |
50 |
& PTRACERS_diffKr, |
& PTRACERS_diffKr, |
51 |
|
& PTRACERS_diffKrNr, |
52 |
& PTRACERS_useGMRedi, |
& PTRACERS_useGMRedi, |
53 |
& PTRACERS_useKPP, |
& PTRACERS_useKPP, |
54 |
& PTRACERS_numInUse, |
& PTRACERS_numInUse, |
57 |
& PTRACERS_names, |
& PTRACERS_names, |
58 |
& PTRACERS_long_names, |
& PTRACERS_long_names, |
59 |
& PTRACERS_units, |
& PTRACERS_units, |
60 |
& PTRACERS_mnc_read, |
& PTRACERS_write_mnc |
|
& PTRACERS_mnc_write, |
|
|
& PTRACERS_iotypes |
|
61 |
|
|
62 |
C This routine has been called by the main model so we set our |
C This routine has been called by the main model so we set our |
63 |
C internal flag to indicate we are in business |
C internal flag to indicate we are in business |
64 |
PTRACERSisON=.TRUE. |
PTRACERSisON=.TRUE. |
65 |
|
|
66 |
C Set defaults values for parameters in PTRACERS.h |
C Set defaults values for parameters in PTRACERS.h |
67 |
PTRACERS_taveFreq=taveFreq |
PTRACERS_dumpFreq = dumpFreq |
68 |
|
PTRACERS_taveFreq = taveFreq |
69 |
|
PTRACERS_monitorFreq = monitorFreq |
70 |
PTRACERS_numInUse=-1 |
PTRACERS_numInUse=-1 |
71 |
DO iTracer=1,PTRACERS_num |
DO iTracer=1,PTRACERS_num |
72 |
PTRACERS_advScheme(iTracer)=saltAdvScheme |
PTRACERS_advScheme(iTracer)=saltAdvScheme |
73 |
|
PTRACERS_ImplVertAdv(iTracer) = .FALSE. |
74 |
PTRACERS_diffKh(iTracer)=diffKhS |
PTRACERS_diffKh(iTracer)=diffKhS |
75 |
PTRACERS_diffK4(iTracer)=diffK4S |
PTRACERS_diffK4(iTracer)=diffK4S |
76 |
PTRACERS_diffKr(iTracer)=diffKrS |
PTRACERS_diffKr(iTracer)=UNSET_RL |
77 |
|
DO k=1,Nr |
78 |
|
PTRACERS_diffKrNr(k,iTracer)=diffKrNrS(k) |
79 |
|
ENDDO |
80 |
PTRACERS_useGMRedi(iTracer)=useGMRedi |
PTRACERS_useGMRedi(iTracer)=useGMRedi |
81 |
PTRACERS_useKPP(iTracer)=useKPP |
PTRACERS_useKPP(iTracer)=useKPP |
82 |
PTRACERS_initialFile(iTracer)=' ' |
PTRACERS_initialFile(iTracer)=' ' |
86 |
PTRACERS_units(iTracer)(ic:ic) = ' ' |
PTRACERS_units(iTracer)(ic:ic) = ' ' |
87 |
ENDDO |
ENDDO |
88 |
ENDDO |
ENDDO |
89 |
PTRACERS_useRecords=.FALSE. |
PTRACERS_useRecords = .FALSE. |
90 |
PTRACERS_iotypes = -1 |
PTRACERS_write_mdsio = .TRUE. |
91 |
PTRACERS_mnc_read = .true. |
PTRACERS_write_mnc = .FALSE. |
|
PTRACERS_mnc_write = .true. |
|
92 |
|
|
93 |
C Open and read the data.ptracers file |
C Open and read the data.ptracers file |
94 |
_BEGIN_MASTER(myThid) |
_BEGIN_MASTER(myThid) |
140 |
STOP 'ABNORMAL END: S/R PTRACERS_READPARMS' |
STOP 'ABNORMAL END: S/R PTRACERS_READPARMS' |
141 |
ENDIF |
ENDIF |
142 |
ENDDO |
ENDDO |
143 |
|
#ifndef INCLUDE_IMPLVERTADV_CODE |
144 |
C Set the default I/O Types |
DO iTracer=1,PTRACERS_numInUse |
145 |
IF (PTRACERS_iotypes .EQ. -1) THEN |
IF ( PTRACERS_ImplVertAdv(iTracer) ) THEN |
146 |
PTRACERS_iotypes = 1 |
WRITE(msgBuf,'(A)') |
147 |
ENDIF |
& 'PTRACERS_READPARMS: #undef INCLUDE_IMPLVERTADV_CODE' |
148 |
|
CALL PRINT_ERROR( msgBuf , myThid) |
149 |
|
WRITE(msgBuf,'(2A,I2,A)') 'PTRACERS_READPARMS:', |
150 |
|
& ' but pTracers_ImplVertAdv(',iTracer,' ) is TRUE' |
151 |
|
CALL PRINT_ERROR( msgBuf , myThid) |
152 |
|
STOP 'ABNORMAL END: S/R PTRACERS_READPARMS' |
153 |
|
ENDIF |
154 |
|
ENDDO |
155 |
|
#endif |
156 |
|
DO iTracer=1,PTRACERS_numInUse |
157 |
|
PTRACERS_useGMRedi(iTracer) = PTRACERS_useGMRedi(iTracer) |
158 |
|
& .AND.useGMRedi |
159 |
|
PTRACERS_useKPP(iTracer) = PTRACERS_useKPP(iTracer) |
160 |
|
& .AND.useKPP |
161 |
|
IF ( PTRACERS_diffKr(iTracer).NE.UNSET_RL ) THEN |
162 |
|
DO k=1,Nr |
163 |
|
PTRACERS_diffKrNr(k,iTracer)=PTRACERS_diffKr(iTracer) |
164 |
|
ENDDO |
165 |
|
ENDIF |
166 |
|
ENDDO |
167 |
|
|
168 |
#ifdef ALLOW_MNC |
#ifdef ALLOW_MNC |
|
C Initialize the MNC variable types for PTRACERS |
|
169 |
IF (useMNC) THEN |
IF (useMNC) THEN |
170 |
|
C Set the default I/O Types |
171 |
|
IF ( (.NOT. outputTypesInclusive) |
172 |
|
& .AND. PTRACERS_write_mnc ) PTRACERS_write_mdsio = .FALSE. |
173 |
|
|
174 |
|
C Initialize the MNC variable types for PTRACERS |
175 |
CALL PTRACERS_MNC_INIT( myThid ) |
CALL PTRACERS_MNC_INIT( myThid ) |
176 |
ENDIF |
ENDIF |
177 |
#endif /* ALLOW_MNC */ |
#endif /* ALLOW_MNC */ |
178 |
|
|
179 |
|
C-- Print a summary of pTracer parameter values: |
180 |
|
iUnit = standardMessageUnit |
181 |
|
WRITE(msgBuf,'(A)') '// ===================================' |
182 |
|
CALL PRINT_MESSAGE( msgBuf, iUnit, SQUEEZE_RIGHT , 1) |
183 |
|
WRITE(msgBuf,'(A)') '// PTRACERS parameters ' |
184 |
|
CALL PRINT_MESSAGE( msgBuf, iUnit, SQUEEZE_RIGHT , 1) |
185 |
|
WRITE(msgBuf,'(A)') '// ===================================' |
186 |
|
CALL PRINT_MESSAGE( msgBuf, iUnit, SQUEEZE_RIGHT , 1) |
187 |
|
CALL WRITE_0D_I( PTRACERS_numInUse, INDEX_NONE, |
188 |
|
& 'PTRACERS_numInUse =', |
189 |
|
& ' /* number of tracers */') |
190 |
|
CALL WRITE_0D_R8(PTRACERS_dumpFreq, INDEX_NONE, |
191 |
|
& 'PTRACERS_dumpFreq =', |
192 |
|
& ' /* Frequency^-1 for snapshot output (s) */') |
193 |
|
CALL WRITE_0D_R8(PTRACERS_taveFreq, INDEX_NONE, |
194 |
|
& 'PTRACERS_taveFreq =', |
195 |
|
& ' /* Frequency^-1 for time-Aver. output (s) */') |
196 |
|
CALL WRITE_0D_L( PTRACERS_useRecords, INDEX_NONE, |
197 |
|
& 'PTRACERS_useRecords =', ' /* all tracers in 1 file */') |
198 |
|
CALL WRITE_0D_L( PTRACERS_write_mdsio, INDEX_NONE, |
199 |
|
& 'PTRACERS_write_mdsio =', ' /* write mdsio files */') |
200 |
|
CALL WRITE_0D_L( PTRACERS_write_mnc, INDEX_NONE, |
201 |
|
& 'PTRACERS_write_mnc =', ' /* write mnc files */') |
202 |
|
|
203 |
|
DO iTracer=1,PTRACERS_numInUse |
204 |
|
WRITE(msgBuf,'(A)') ' -----------------------------------' |
205 |
|
CALL PRINT_MESSAGE( msgBuf, iUnit, SQUEEZE_RIGHT , 1) |
206 |
|
WRITE(msgBuf,'(A,I4)') ' tracer number : ',iTracer |
207 |
|
CALL PRINT_MESSAGE( msgBuf, iUnit, SQUEEZE_RIGHT , 1) |
208 |
|
CALL WRITE_0D_I( PTRACERS_advScheme(iTracer), INDEX_NONE, |
209 |
|
& 'PTRACERS_advScheme =', ' /* Advection Scheme */') |
210 |
|
CALL WRITE_0D_L( PTRACERS_ImplVertAdv(iTracer), INDEX_NONE, |
211 |
|
& 'PTRACERS_ImplVertAdv =', |
212 |
|
& ' /* implicit vert. advection flag */') |
213 |
|
CALL WRITE_0D_R8( PTRACERS_diffKh(iTracer), INDEX_NONE, |
214 |
|
& 'PTRACERS_diffKh =', ' /* Laplacian Diffusivity */') |
215 |
|
CALL WRITE_0D_R8( PTRACERS_diffK4(iTracer), INDEX_NONE, |
216 |
|
& 'PTRACERS_diffK4 =', ' /* Biharmonic Diffusivity */') |
217 |
|
CALL WRITE_1D_R8( PTRACERS_diffKrNr(1,iTracer), Nr, INDEX_K, |
218 |
|
& 'PTRACERS_diffKrNr =', ' /* Vertical Diffusivity */') |
219 |
|
CALL WRITE_0D_L( PTRACERS_useGMRedi(iTracer), INDEX_NONE, |
220 |
|
& 'PTRACERS_useGMRedi =', ' /* apply GM-Redi */') |
221 |
|
CALL WRITE_0D_L( PTRACERS_useKPP(iTracer), INDEX_NONE, |
222 |
|
& 'PTRACERS_useKPP =', ' /* apply KPP scheme */') |
223 |
|
|
224 |
|
ENDDO |
225 |
|
WRITE(msgBuf,'(A)') ' -----------------------------------' |
226 |
|
CALL PRINT_MESSAGE( msgBuf, iUnit, SQUEEZE_RIGHT , 1) |
227 |
#endif /* ALLOW_PTRACERS */ |
#endif /* ALLOW_PTRACERS */ |
228 |
|
|
229 |
RETURN |
RETURN |