1 |
C $Header: /u/gcmpack/MITgcm/pkg/ptracers/ptracers_check.F,v 1.3 2014/08/05 01:51:29 jmc Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "PTRACERS_OPTIONS.h" |
5 |
c#include "GAD_OPTIONS.h" |
6 |
|
7 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
8 |
CBOP |
9 |
C !ROUTINE: PTRACERS_CHECK |
10 |
|
11 |
C !INTERFACE: |
12 |
SUBROUTINE PTRACERS_CHECK( myThid ) |
13 |
|
14 |
C !DESCRIPTION: |
15 |
C Print summary of PTRACERS setting and Check dependances |
16 |
C with main model and other packages |
17 |
|
18 |
C !USES: |
19 |
IMPLICIT NONE |
20 |
#include "SIZE.h" |
21 |
#include "EEPARAMS.h" |
22 |
#include "PARAMS.h" |
23 |
#include "PTRACERS_SIZE.h" |
24 |
#include "PTRACERS_PARAMS.h" |
25 |
#include "GAD.h" |
26 |
|
27 |
C !INPUT PARAMETERS: |
28 |
INTEGER myThid |
29 |
CEOP |
30 |
|
31 |
#ifdef ALLOW_PTRACERS |
32 |
C !LOCAL VARIABLES: |
33 |
C iTracer :: tracer index |
34 |
C iUnit :: unit number for I/O |
35 |
C msgBuf :: Informational/error message buffer |
36 |
INTEGER iTracer |
37 |
INTEGER iUnit |
38 |
CHARACTER*(MAX_LEN_MBUF) msgBuf |
39 |
|
40 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
41 |
|
42 |
_BEGIN_MASTER(myThid) |
43 |
|
44 |
WRITE(msgBuf,'(A)') 'PTRACERS_CHECK: #define ALLOW_PTRACERS' |
45 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
46 |
& SQUEEZE_RIGHT, myThid ) |
47 |
|
48 |
C-- Print a summary of pTracer parameter values: |
49 |
iUnit = standardMessageUnit |
50 |
WRITE(msgBuf,'(A)') '// ===================================' |
51 |
CALL PRINT_MESSAGE( msgBuf, iUnit, SQUEEZE_RIGHT , myThid ) |
52 |
WRITE(msgBuf,'(A)') '// PTRACERS parameters ' |
53 |
CALL PRINT_MESSAGE( msgBuf, iUnit, SQUEEZE_RIGHT , myThid ) |
54 |
WRITE(msgBuf,'(A)') '// ===================================' |
55 |
CALL PRINT_MESSAGE( msgBuf, iUnit, SQUEEZE_RIGHT , myThid ) |
56 |
CALL WRITE_0D_I( PTRACERS_numInUse, INDEX_NONE, |
57 |
& 'PTRACERS_numInUse =', |
58 |
& ' /* number of tracers */') |
59 |
CALL WRITE_0D_I( PTRACERS_Iter0, INDEX_NONE, |
60 |
& 'PTRACERS_Iter0 =', |
61 |
& ' /* timestep number when tracers are initialized */') |
62 |
CALL WRITE_0D_L( PTRACERS_startAllTrc, INDEX_NONE, |
63 |
& 'PTRACERS_startAllTrc =','/* all tracers start @ startTime */') |
64 |
CALL WRITE_0D_L( PTRACERS_doAB_onGpTr, INDEX_NONE, |
65 |
& 'PTRACERS_doAB_onGpTr =', |
66 |
& '/* apply AB on Tendencies (rather than on Tracers) */') |
67 |
CALL WRITE_0D_L( PTRACERS_addSrelax2EmP, INDEX_NONE, |
68 |
& 'PTRACERS_addSrelax2EmP =','/* add Salt relaxation to EmP */') |
69 |
CALL WRITE_1D_RL( PTRACERS_dTLev, Nr, INDEX_K, |
70 |
& 'PTRACERS_dTLev =', |
71 |
&' /* Ptracer timestep ( s ) */') |
72 |
CALL WRITE_0D_RL(PTRACERS_monitorFreq, INDEX_NONE, |
73 |
& 'PTRACERS_monitorFreq =', |
74 |
& ' /* Frequency^-1 for monitor output (s) */') |
75 |
CALL WRITE_0D_RL(PTRACERS_dumpFreq, INDEX_NONE, |
76 |
& 'PTRACERS_dumpFreq =', |
77 |
& ' /* Frequency^-1 for snapshot output (s) */') |
78 |
CALL WRITE_0D_RL(PTRACERS_taveFreq, INDEX_NONE, |
79 |
& 'PTRACERS_taveFreq =', |
80 |
& ' /* Frequency^-1 for time-Aver. output (s) */') |
81 |
CALL WRITE_0D_L( PTRACERS_useRecords, INDEX_NONE, |
82 |
& 'PTRACERS_useRecords =', ' /* all tracers in 1 file */') |
83 |
|
84 |
CALL WRITE_0D_L( PTRACERS_timeave_mnc, INDEX_NONE, |
85 |
& 'PTRACERS_timeave_mnc =', |
86 |
& ' /* use MNC for Tave output */') |
87 |
CALL WRITE_0D_L( PTRACERS_snapshot_mnc, INDEX_NONE, |
88 |
& 'PTRACERS_snapshot_mnc =', |
89 |
& ' /* use MNC for snapshot output */') |
90 |
CALL WRITE_0D_L( PTRACERS_pickup_write_mnc, INDEX_NONE, |
91 |
& 'PTRACERS_pickup_write_mnc =', |
92 |
& ' /* use MNC for writing pickups */') |
93 |
CALL WRITE_0D_L( PTRACERS_pickup_read_mnc, INDEX_NONE, |
94 |
& 'PTRACERS_pickup_read_mnc =', |
95 |
& ' /* use MNC for reading pickups */') |
96 |
|
97 |
DO iTracer=1,PTRACERS_numInUse |
98 |
WRITE(msgBuf,'(A)') ' -----------------------------------' |
99 |
CALL PRINT_MESSAGE( msgBuf, iUnit, SQUEEZE_RIGHT, myThid ) |
100 |
WRITE(msgBuf,'(A,I4)') ' tracer number : ',iTracer |
101 |
CALL PRINT_MESSAGE( msgBuf, iUnit, SQUEEZE_RIGHT, myThid ) |
102 |
CALL WRITE_0D_C( PTRACERS_names(iTracer), -1, INDEX_NONE, |
103 |
& 'PTRACERS_names =', ' /* Tracer short name */') |
104 |
CALL WRITE_0D_C( PTRACERS_long_names(iTracer), -1, INDEX_NONE, |
105 |
& 'PTRACERS_long_names =', ' /* Tracer long name */') |
106 |
CALL WRITE_0D_C( PTRACERS_ioLabel(iTracer), 0, INDEX_NONE, |
107 |
& 'PTRACERS_ioLabel =', ' /* tracer IO Label */') |
108 |
IF ( .NOT.PTRACERS_startAllTrc ) |
109 |
& CALL WRITE_0D_RL( PTRACERS_startStepFwd(iTracer), INDEX_NONE, |
110 |
& 'PTRACERS_startStepFwd =', ' /* tracer starting time */') |
111 |
CALL WRITE_0D_I( PTRACERS_advScheme(iTracer), INDEX_NONE, |
112 |
& 'PTRACERS_advScheme =', ' /* Advection Scheme */') |
113 |
CALL WRITE_0D_L( PTRACERS_SOM_Advection(iTracer), INDEX_NONE, |
114 |
& 'PTRACERS_SOM_Advection =', |
115 |
& ' /* tracer uses SOM advection scheme */') |
116 |
CALL WRITE_0D_L( PTRACERS_ImplVertAdv(iTracer), INDEX_NONE, |
117 |
& 'PTRACERS_ImplVertAdv =', |
118 |
& ' /* implicit vert. advection flag */') |
119 |
CALL WRITE_0D_L( PTRACERS_MultiDimAdv(iTracer), INDEX_NONE, |
120 |
& 'PTRACERS_MultiDimAdv =', |
121 |
& ' /* tracer uses Multi-Dim advection */') |
122 |
CALL WRITE_0D_L( PTRACERS_AdamsBashGtr(iTracer), INDEX_NONE, |
123 |
& 'PTRACERS_AdamsBashGtr =', |
124 |
& ' /* apply AB on tracer tendency */') |
125 |
CALL WRITE_0D_L( PTRACERS_AdamsBash_Tr(iTracer), INDEX_NONE, |
126 |
& 'PTRACERS_AdamsBash_Tr =', |
127 |
& ' /* apply AB on passive tracer */') |
128 |
CALL WRITE_0D_RL( PTRACERS_diffKh(iTracer), INDEX_NONE, |
129 |
& 'PTRACERS_diffKh =', ' /* Laplacian Diffusivity */') |
130 |
CALL WRITE_0D_RL( PTRACERS_diffK4(iTracer), INDEX_NONE, |
131 |
& 'PTRACERS_diffK4 =', ' /* Biharmonic Diffusivity */') |
132 |
CALL WRITE_1D_RL( PTRACERS_diffKrNr(1,iTracer), Nr, INDEX_K, |
133 |
& 'PTRACERS_diffKrNr =', ' /* Vertical Diffusivity */') |
134 |
CALL WRITE_0D_L( PTRACERS_useGMRedi(iTracer), INDEX_NONE, |
135 |
& 'PTRACERS_useGMRedi =', ' /* apply GM-Redi */') |
136 |
CALL WRITE_0D_L( PTRACERS_useDWNSLP(iTracer), INDEX_NONE, |
137 |
& 'PTRACERS_useDWNSLP =', ' /* apply DOWN-SLOPE Flow */') |
138 |
CALL WRITE_0D_L( PTRACERS_useKPP(iTracer), INDEX_NONE, |
139 |
& 'PTRACERS_useKPP =', ' /* apply KPP scheme */') |
140 |
CALL WRITE_1D_RL( PTRACERS_ref(1,iTracer), Nr, INDEX_K, |
141 |
& 'PTRACERS_ref =', ' /* Reference vertical profile */') |
142 |
CALL WRITE_0D_RL( PTRACERS_EvPrRn(iTracer), INDEX_NONE, |
143 |
& 'PTRACERS_EvPrRn =', '/* tracer conc. in Evap. & Rain */') |
144 |
|
145 |
ENDDO |
146 |
WRITE(msgBuf,'(A)') ' -----------------------------------' |
147 |
CALL PRINT_MESSAGE( msgBuf, iUnit, SQUEEZE_RIGHT, myThid ) |
148 |
|
149 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
150 |
|
151 |
IF ( PTRACERS_Iter0.GE.nEndIter ) THEN |
152 |
WRITE(msgBuf,'(2A)') '** WARNING ** PTRACERS_CHECK:', |
153 |
& ' PTRACERS_Iter0 beyond run-end (=nEndIter)' |
154 |
CALL PRINT_MESSAGE( msgBuf, errorMessageUnit, |
155 |
& SQUEEZE_RIGHT, myThid ) |
156 |
WRITE(msgBuf,'(2A)') '** WARNING ** PTRACERS_CHECK:', |
157 |
& ' ==> do not load initial conditions nor pickup file' |
158 |
CALL PRINT_MESSAGE( msgBuf, errorMessageUnit, |
159 |
& SQUEEZE_RIGHT, myThid ) |
160 |
ELSEIF ( PTRACERS_Iter0.GT.nIter0 ) THEN |
161 |
WRITE(msgBuf,'(2A,I3,A)') 'PTRACERS_CHECK:', |
162 |
& ' wrong setting of PTRACERS_Iter0 :' |
163 |
CALL PRINT_ERROR( msgBuf, myThid ) |
164 |
WRITE(msgBuf,'(2A,I3,A)') 'PTRACERS_CHECK:', |
165 |
& ' nIter0 < PTRACERS_Iter0 < nEndIter not supported' |
166 |
CALL PRINT_ERROR( msgBuf, myThid ) |
167 |
STOP 'ABNORMAL END: S/R PTRACERS_CHECK' |
168 |
ENDIF |
169 |
|
170 |
#ifndef INCLUDE_IMPLVERTADV_CODE |
171 |
DO iTracer=1,PTRACERS_numInUse |
172 |
IF ( PTRACERS_ImplVertAdv(iTracer) ) THEN |
173 |
WRITE(msgBuf,'(A)') |
174 |
& 'PTRACERS_CHECK: #undef INCLUDE_IMPLVERTADV_CODE' |
175 |
CALL PRINT_ERROR( msgBuf, myThid ) |
176 |
WRITE(msgBuf,'(2A,I3,A)') 'PTRACERS_CHECK:', |
177 |
& ' but pTracers_ImplVertAdv(',iTracer,' ) is TRUE' |
178 |
CALL PRINT_ERROR( msgBuf, myThid ) |
179 |
STOP 'ABNORMAL END: S/R PTRACERS_CHECK' |
180 |
ENDIF |
181 |
ENDDO |
182 |
IF ( PTRACERS_dTLev(1).NE.PTRACERS_dTLev(Nr) |
183 |
& .AND. implicitDiffusion ) THEN |
184 |
WRITE(msgBuf,'(A)') |
185 |
& 'PTRACERS_CHECK: #undef INCLUDE_IMPLVERTADV_CODE' |
186 |
CALL PRINT_ERROR( msgBuf , myThid) |
187 |
WRITE(msgBuf,'(2A)') 'PTRACERS_CHECK: ', |
188 |
& 'but implicitDiffusion=T with non-uniform PTRACERS_dTLev' |
189 |
CALL PRINT_ERROR( msgBuf , myThid) |
190 |
STOP 'ABNORMAL END: S/R PTRACERS_CHECK' |
191 |
ENDIF |
192 |
#endif |
193 |
DO iTracer=1,PTRACERS_numInUse |
194 |
IF ( PTRACERS_useGMRedi(iTracer) .AND. .NOT.useGMRedi ) THEN |
195 |
WRITE(msgBuf,'(2A,I3,A)') 'PTRACERS_CHECK:', |
196 |
& ' pTracers_useGMRedi(',iTracer,' ) is TRUE' |
197 |
CALL PRINT_ERROR( msgBuf, myThid ) |
198 |
WRITE(msgBuf,'(A,L5,A)') |
199 |
& 'PTRACERS_CHECK: But not useGMRedi (=',useGMRedi,')' |
200 |
CALL PRINT_ERROR( msgBuf, myThid ) |
201 |
STOP 'ABNORMAL END: S/R PTRACERS_CHECK' |
202 |
ENDIF |
203 |
IF ( PTRACERS_useDWNSLP(iTracer) .AND. .NOT.useDOWN_SLOPE ) THEN |
204 |
WRITE(msgBuf,'(2A,I3,A)') 'PTRACERS_CHECK:', |
205 |
& ' pTracers_useDWNSLP(',iTracer,' ) is TRUE' |
206 |
CALL PRINT_ERROR( msgBuf, myThid ) |
207 |
WRITE(msgBuf,'(2A,L5,A)') 'PTRACERS_CHECK:', |
208 |
& ' But not useDOWN_SLOPE (=', useDOWN_SLOPE, ')' |
209 |
CALL PRINT_ERROR( msgBuf, myThid ) |
210 |
STOP 'ABNORMAL END: S/R PTRACERS_CHECK' |
211 |
ENDIF |
212 |
IF ( PTRACERS_useKPP(iTracer) .AND. .NOT.useKPP ) THEN |
213 |
WRITE(msgBuf,'(2A,I3,A)') 'PTRACERS_CHECK:', |
214 |
& ' pTracers_useKPP(',iTracer,' ) is TRUE' |
215 |
CALL PRINT_ERROR( msgBuf, myThid ) |
216 |
WRITE(msgBuf,'(A,L5,A)') |
217 |
& 'PTRACERS_CHECK: But not useKPP (=',useKPP,')' |
218 |
CALL PRINT_ERROR( msgBuf, myThid ) |
219 |
STOP 'ABNORMAL END: S/R PTRACERS_CHECK' |
220 |
ENDIF |
221 |
ENDDO |
222 |
|
223 |
_END_MASTER(myThid) |
224 |
C Everyone else must wait for the parameters to be loaded |
225 |
_BARRIER |
226 |
|
227 |
#endif /* ALLOW_PTRACERS */ |
228 |
|
229 |
RETURN |
230 |
END |