1 |
C $Header: /u/gcmpack/MITgcm/model/src/ini_parms.F,v 1.210 2008/04/05 18:14:50 jmc Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
c #include "PACKAGES_CONFIG.h" |
5 |
#include "CPP_OPTIONS.h" |
6 |
|
7 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
8 |
CBOP |
9 |
C !ROUTINE: INI_PARMS |
10 |
C !INTERFACE: |
11 |
SUBROUTINE INI_PARMS( myThid ) |
12 |
|
13 |
C !DESCRIPTION: |
14 |
C Routine to load model "parameters" from parameter file "data" |
15 |
|
16 |
C !USES: |
17 |
IMPLICIT NONE |
18 |
#include "SIZE.h" |
19 |
#include "EEPARAMS.h" |
20 |
#include "PARAMS.h" |
21 |
c#include "GRID.h" |
22 |
#include "EOS.h" |
23 |
|
24 |
C !INPUT/OUTPUT PARAMETERS: |
25 |
C myThid :: Number of this instance of INI_PARMS |
26 |
INTEGER myThid |
27 |
|
28 |
C !LOCAL VARIABLES: |
29 |
C dxSpacing, dySpacing :: Default spacing in X and Y. |
30 |
C :: Units are that of coordinate system |
31 |
C :: i.e. cartesian => metres |
32 |
C :: s. polar => degrees |
33 |
C SadournyCoriolis :: for backward compatibility |
34 |
C deltaTtracer :: Timestep for tracer equations ( s ) |
35 |
C forcing_In_AB :: flag to put all forcings (Temp,Salt,Tracers,Momentum) |
36 |
C :: contribution in (or out of) Adams-Bashforth time stepping. |
37 |
C goptCount :: Used to count the nuber of grid options (only one is allowed!) |
38 |
C msgBuf :: Informational/error meesage buffer |
39 |
C errIO :: IO error flag |
40 |
C iUnit :: Work variable for IO unit number |
41 |
C record :: Work variable for IO buffer |
42 |
C K, I, J :: Loop counters |
43 |
C xxxDefault :: Default value for variable xxx |
44 |
_RL dxSpacing |
45 |
_RL dySpacing |
46 |
_RL deltaTtracer |
47 |
CHARACTER*(MAX_LEN_MBUF) msgBuf |
48 |
CHARACTER*(MAX_LEN_PREC) record |
49 |
LOGICAL SadournyCoriolis |
50 |
LOGICAL forcing_In_AB |
51 |
INTEGER goptCount |
52 |
INTEGER K, i, j, IL, iUnit |
53 |
INTEGER errIO |
54 |
INTEGER IFNBLNK |
55 |
EXTERNAL IFNBLNK |
56 |
INTEGER ILNBLNK |
57 |
EXTERNAL ILNBLNK |
58 |
C Default values for variables which have vertical coordinate system |
59 |
C dependency. |
60 |
_RL viscArDefault |
61 |
_RL diffKrTDefault |
62 |
_RL diffKrSDefault |
63 |
_RL hFacMinDrDefault |
64 |
_RL delRDefault(Nr) |
65 |
_RS rkFacDefault |
66 |
C zCoordInputData :: Variables used to select between different coordinate systems. |
67 |
C pCoordInputData :: The vertical coordinate system in the rest of the model is |
68 |
C rCoordInputData :: written in terms of r. In the model "data" file input data |
69 |
C coordsSet :: can be interms of z, p or r. |
70 |
C :: e.g. delZ or delP or delR for the vertical grid spacing. |
71 |
C :: The following rules apply: |
72 |
C :: All parameters must use the same vertical coordinate system. |
73 |
C :: e.g. delZ and viscAz is legal but |
74 |
C :: delZ and viscAr is an error. |
75 |
C :: Similarly specifying delZ and delP is an error. |
76 |
C :: zCoord..., pCoord..., rCoord... are used to flag when |
77 |
C :: z, p or r are used. |
78 |
C :: coordsSet counts how many vertical coordinate systems have |
79 |
C :: been used to specify variables. coordsSet > 1 is an error. |
80 |
C |
81 |
|
82 |
LOGICAL zCoordInputData |
83 |
LOGICAL pCoordInputData |
84 |
LOGICAL rCoordInputData |
85 |
INTEGER coordsSet |
86 |
LOGICAL diffKrSet |
87 |
|
88 |
C Variables which have vertical coordinate system dependency. |
89 |
C delZ :: Vertical grid spacing ( m ). |
90 |
C delP :: Vertical grid spacing ( Pa ). |
91 |
C viscAz :: Eddy viscosity coeff. for mixing of momentum vertically ( m^2/s ) |
92 |
C viscAp :: Eddy viscosity coeff. for mixing of momentum vertically ( Pa^2/s ) |
93 |
C diffKzT :: Laplacian diffusion coeff. for mixing of heat vertically ( m^2/s ) |
94 |
C diffKpT :: Laplacian diffusion coeff. for mixing of heat vertically ( Pa^2/s ) |
95 |
C diffKzS :: Laplacian diffusion coeff. for mixing of salt vertically ( m^2/s ) |
96 |
C diffKpS :: Laplacian diffusion coeff. for mixing of salt vertically ( Pa^2/s ) |
97 |
_RL delZ(Nr) |
98 |
_RL delP(Nr) |
99 |
_RL viscAz |
100 |
_RL viscAp |
101 |
_RL diffKzT |
102 |
_RL diffKpT |
103 |
_RL diffKrT |
104 |
_RL diffKzS |
105 |
_RL diffKpS |
106 |
_RL diffKrS |
107 |
|
108 |
C Retired main data file parameters. Kept here to trap use of old data files. |
109 |
C Namelist PARM01: |
110 |
C tracerAdvScheme :: tracer advection scheme (old passive tracer code) |
111 |
C trac_EvPrRn :: tracer conc. in Rain & Evap (old passive tracer code) |
112 |
C saltDiffusion :: diffusion of salinity on/off (flag not used) |
113 |
C tempDiffusion :: diffusion of temperature on/off (flag not used) |
114 |
C zonal_filt_lat :: Moved to package "zonal_filt" |
115 |
C gravitySign :: direction of gravity relative to R direction |
116 |
C :: (removed from namelist and set according to z/p coordinate) |
117 |
C viscAstrain :: replaced by standard viscosity coeff & useStrainTensionVisc |
118 |
C viscAtension :: replaced by standard viscosity coeff & useStrainTensionVisc |
119 |
C useAnisotropicViscAgridMax :: Changed to be default behavior. Can |
120 |
C use old method by setting useAreaViscLength=.true. |
121 |
C usePickupBeforeC35 :: to restart from old-pickup files (generated with code |
122 |
C from before checkpoint-35, Feb 08, 2001): disabled (Jan 2007) |
123 |
C Namelist PARM03: |
124 |
C tauThetaClimRelax3Dim :: replaced by pkg/rbcs (3.D Relaxation B.Cs) |
125 |
C tauSaltClimRelax3Dim :: replaced by pkg/rbcs (3.D Relaxation B.Cs) |
126 |
C calendarDumps :: moved to package "cal" (calendar) |
127 |
C Namelist PARM04: |
128 |
C groundAtK1 :: put the surface(k=1) at the ground (replaced by usingPCoords) |
129 |
C rkFac :: removed from namelist ; replaced by -rkSign |
130 |
C nRetired :: Counter used to trap gracefully namelists containing "retired" |
131 |
C :: parameters. These are parameters that are either no-longer used |
132 |
C or that have moved to a different input file and/or namelist. |
133 |
LOGICAL tempDiffusion, saltDiffusion |
134 |
INTEGER tracerAdvScheme |
135 |
_RL trac_EvPrRn |
136 |
_RL zonal_filt_lat, gravitySign |
137 |
_RL viscAstrain, viscAtension |
138 |
LOGICAL useAnisotropicViscAgridMax |
139 |
LOGICAL usePickupBeforeC35 |
140 |
C- |
141 |
_RL tauThetaClimRelax3Dim, tauSaltClimRelax3Dim |
142 |
LOGICAL calendarDumps |
143 |
C- |
144 |
LOGICAL groundAtK1 |
145 |
_RL rkFac |
146 |
INTEGER nRetired |
147 |
|
148 |
C-- Continuous equation parameters |
149 |
NAMELIST /PARM01/ |
150 |
& gravitySign, nh_Am2, |
151 |
& gravity, gBaro, rhonil, tAlpha, sBeta, |
152 |
& f0, beta, omega, rotationPeriod, |
153 |
& viscAh, viscAhW, viscAhMax, |
154 |
& viscAhGrid, viscAhGridMax, viscAhGridMin, |
155 |
& viscC2leith, viscC4leith, |
156 |
& useFullLeith, useAnisotropicViscAgridMax, useStrainTensionVisc, |
157 |
& useAreaViscLength, |
158 |
& viscC2leithD, viscC4leithD, viscC2smag, viscC4smag, |
159 |
& viscAhD, viscAhZ, viscA4D, viscA4Z, |
160 |
& viscA4, viscA4W, |
161 |
& viscA4Max, viscA4Grid, viscA4GridMax, viscA4GridMin, |
162 |
& viscA4ReMax, viscAhReMax, |
163 |
& viscAz, cosPower, viscAstrain, viscAtension, |
164 |
& diffKhT, diffKzT, diffK4T, |
165 |
& diffKhS, diffKzS, diffK4S, |
166 |
& tRef, sRef, tRefFile, sRefFile, rhoRefFile, |
167 |
& eosType, integr_GeoPot, selectFindRoSurf, |
168 |
& atm_Cp, atm_Rd, atm_Rq, |
169 |
& no_slip_sides, sideDragFactor, |
170 |
& no_slip_bottom, bottomDragLinear, bottomDragQuadratic, |
171 |
& momViscosity, momAdvection, momForcing, useCoriolis, |
172 |
& useConstantF, useBetaPlaneF, useSphereF, use3dCoriolis, |
173 |
& momPressureForcing, metricTerms, vectorInvariantMomentum, |
174 |
& tempDiffusion, tempAdvection, tempForcing, |
175 |
& saltDiffusion, saltAdvection, saltForcing, |
176 |
& implicSurfPress, implicDiv2DFlow, |
177 |
& implicitFreeSurface, rigidLid, freeSurfFac, hFacMin, hFacMinDz, |
178 |
& exactConserv, linFSConserveTr, uniformLin_PhiSurf, |
179 |
& nonlinFreeSurf, hFacInf, hFacSup, select_rStar, |
180 |
& implicitIntGravWave, staggerTimeStep, |
181 |
& tempStepping, saltStepping, momStepping, |
182 |
& implicitDiffusion, implicitViscosity, |
183 |
& tempImplVertAdv, saltImplVertAdv, momImplVertAdv, |
184 |
& viscAr, diffKrT, diffKrS, diffKrNrT, diffKrNrS, hFacMinDr, |
185 |
& viscAp, diffKpT, diffKpS, hFacMinDp, |
186 |
& diffKrBL79surf, diffKrBL79deep, diffKrBL79scl, diffKrBL79Ho, |
187 |
& BL79LatVary, |
188 |
& diffKrBLEQsurf, diffKrBLEQdeep, diffKrBLEQscl, diffKrBLEQHo, |
189 |
& rhoConst, rhoConstFresh, buoyancyRelation, HeatCapacity_Cp, |
190 |
& writeBinaryPrec, readBinaryPrec, writeStatePrec, |
191 |
& nonHydrostatic, quasiHydrostatic, globalFiles, useSingleCpuIO, |
192 |
& allowFreezing, useOldFreezing, ivdc_kappa, hMixCriteria, |
193 |
& usePickupBeforeC35, usePickupBeforeC54, debugMode, debugLevel, |
194 |
& tempAdvScheme, tempVertAdvScheme, |
195 |
& saltAdvScheme, saltVertAdvScheme, tracerAdvScheme, |
196 |
& multiDimAdvection, useEnergyConservingCoriolis, |
197 |
& useCDscheme, useJamartWetPoints, useJamartMomAdv, useNHMTerms, |
198 |
& selectVortScheme, upwindVorticity, highOrderVorticity, |
199 |
& SadournyCoriolis, useAbsVorticity, upwindShear, selectKEscheme, |
200 |
& useRealFreshWaterFlux, convertFW2Salt, |
201 |
& temp_EvPrRn, salt_EvPrRn, trac_EvPrRn, |
202 |
& zonal_filt_lat, |
203 |
& inAdExact, smoothAbsFuncRange, |
204 |
& balanceEmPmR, balanceQnet, balancePrintMean |
205 |
|
206 |
C-- Elliptic solver parameters |
207 |
NAMELIST /PARM02/ |
208 |
& cg2dMaxIters, cg2dChkResFreq, cg2dTargetResidual, |
209 |
& cg2dTargetResWunit, cg2dpcOffDFac, cg2dPreCondFreq, |
210 |
& cg3dMaxIters, cg3dChkResFreq, cg3dTargetResidual |
211 |
|
212 |
C-- Time stepping parammeters |
213 |
NAMELIST /PARM03/ |
214 |
& nIter0, nTimeSteps, nEndIter, |
215 |
& baseTime, startTime, endTime, |
216 |
& deltaT, deltaTClock, deltaTmom, |
217 |
& deltaTtracer, dTtracerLev, deltaTfreesurf, |
218 |
& forcing_In_AB, momForcingOutAB, tracForcingOutAB, |
219 |
& momDissip_In_AB, doAB_onGtGs, |
220 |
& abEps, alph_AB, beta_AB, startFromPickupAB2, |
221 |
& tauCD, rCD, cAdjFreq, |
222 |
& chkPtFreq, pChkPtFreq, pickupSuff, pickupStrictlyMatch, |
223 |
& writePickupAtEnd, |
224 |
& dumpFreq, dumpInitAndLast, adjDumpFreq, taveFreq, tave_lastIter, |
225 |
& diagFreq, monitorFreq, adjMonitorFreq, monitorSelect, |
226 |
& outputTypesInclusive, |
227 |
& tauThetaClimRelax, tauSaltClimRelax, latBandClimRelax, |
228 |
& tauThetaClimRelax3Dim, tauSaltClimRelax3Dim, |
229 |
& periodicExternalForcing, externForcingPeriod, externForcingCycle, |
230 |
& calendarDumps |
231 |
|
232 |
C-- Gridding parameters |
233 |
NAMELIST /PARM04/ |
234 |
& usingCartesianGrid, usingCylindricalGrid, |
235 |
& dxSpacing, dySpacing, delX, delY, delXFile, delYFile, |
236 |
& usingSphericalPolarGrid, phiMin, thetaMin, rSphere, |
237 |
& usingCurvilinearGrid, horizGridFile, deepAtmosphere, |
238 |
& Ro_SeaLevel, delZ, delP, delR, delRc, delRFile, delRcFile, |
239 |
& rkFac, groundAtK1, |
240 |
& phiEuler, thetaEuler, psiEuler |
241 |
|
242 |
C-- Input files |
243 |
NAMELIST /PARM05/ |
244 |
& bathyFile, topoFile, shelfIceFile, |
245 |
& hydrogThetaFile, hydrogSaltFile, diffKrFile, |
246 |
& zonalWindFile, meridWindFile, |
247 |
& thetaClimFile, saltClimFile, |
248 |
& surfQfile, surfQnetFile, surfQswFile, EmPmRfile, saltFluxFile, |
249 |
& lambdaThetaFile, lambdaSaltFile, |
250 |
& uVelInitFile, vVelInitFile, pSurfInitFile, |
251 |
& dQdTFile, ploadFile,tCylIn,tCylOut, |
252 |
& eddyTauxFile, eddyTauyFile, |
253 |
& mdsioLocalDir, |
254 |
& the_run_name |
255 |
CEOP |
256 |
|
257 |
C |
258 |
_BEGIN_MASTER(myThid) |
259 |
|
260 |
C Defaults values for input parameters |
261 |
CALL SET_DEFAULTS( |
262 |
O viscArDefault, diffKrTDefault, diffKrSDefault, |
263 |
O hFacMinDrDefault, delRDefault, rkFacDefault, |
264 |
I myThid ) |
265 |
SadournyCoriolis = .FALSE. |
266 |
|
267 |
C-- Initialise "which vertical coordinate system used" flags. |
268 |
zCoordInputData = .FALSE. |
269 |
pCoordInputData = .FALSE. |
270 |
rCoordInputData = .FALSE. |
271 |
coordsSet = 0 |
272 |
|
273 |
C-- Initialise retired parameters to unlikely value |
274 |
nRetired = 0 |
275 |
tempDiffusion = .TRUE. |
276 |
saltDiffusion = .TRUE. |
277 |
tracerAdvScheme = UNSET_I |
278 |
trac_EvPrRn = UNSET_RL |
279 |
zonal_filt_lat = UNSET_RL |
280 |
gravitySign = UNSET_RL |
281 |
viscAstrain = UNSET_RL |
282 |
viscAtension = UNSET_RL |
283 |
useAnisotropicViscAgridMax=.TRUE. |
284 |
usePickupBeforeC35 = .FALSE. |
285 |
tauThetaClimRelax3Dim = UNSET_RL |
286 |
tauSaltClimRelax3Dim = UNSET_RL |
287 |
calendarDumps = .FALSE. |
288 |
rkFac = UNSET_RL |
289 |
groundAtK1 = .FALSE. |
290 |
|
291 |
C-- Open the parameter file |
292 |
#if defined (TARGET_BGL) || defined (TARGET_CRAYXT) |
293 |
OPEN(UNIT=scrUnit1,FILE='scratch1',STATUS='UNKNOWN') |
294 |
OPEN(UNIT=scrUnit2,FILE='scratch2',STATUS='UNKNOWN') |
295 |
#else |
296 |
OPEN(UNIT=scrUnit1,STATUS='SCRATCH') |
297 |
OPEN(UNIT=scrUnit2,STATUS='SCRATCH') |
298 |
#endif |
299 |
OPEN(UNIT=modelDataUnit,FILE='data',STATUS='OLD', |
300 |
& IOSTAT=errIO) |
301 |
IF ( errIO .LT. 0 ) THEN |
302 |
WRITE(msgBuf,'(A)') |
303 |
& 'S/R INI_PARMS' |
304 |
CALL PRINT_ERROR( msgBuf, myThid ) |
305 |
WRITE(msgBuf,'(A)') |
306 |
& 'Unable to open model parameter' |
307 |
CALL PRINT_ERROR( msgBuf, myThid ) |
308 |
WRITE(msgBuf,'(A)') |
309 |
& 'file "data"' |
310 |
CALL PRINT_ERROR( msgBuf, myThid ) |
311 |
CALL MODELDATA_EXAMPLE( myThid ) |
312 |
STOP 'ABNORMAL END: S/R INI_PARMS' |
313 |
ENDIF |
314 |
|
315 |
DO WHILE ( .TRUE. ) |
316 |
READ(modelDataUnit,FMT='(A)',END=1001) RECORD |
317 |
IL = MAX(ILNBLNK(RECORD),1) |
318 |
IF ( RECORD(1:1) .NE. commentCharacter ) THEN |
319 |
CALL NML_SET_TERMINATOR( RECORD ) |
320 |
WRITE(UNIT=scrUnit1,FMT='(A)') RECORD(:IL) |
321 |
ENDIF |
322 |
WRITE(UNIT=scrUnit2,FMT='(A)') RECORD(:IL) |
323 |
ENDDO |
324 |
1001 CONTINUE |
325 |
CLOSE(modelDataUnit) |
326 |
|
327 |
C-- Report contents of model parameter file |
328 |
WRITE(msgBuf,'(A)') |
329 |
&'// =======================================================' |
330 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
331 |
& SQUEEZE_RIGHT, myThid ) |
332 |
WRITE(msgBuf,'(A)') '// Model parameter file "data"' |
333 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
334 |
& SQUEEZE_RIGHT, myThid ) |
335 |
WRITE(msgBuf,'(A)') |
336 |
&'// =======================================================' |
337 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
338 |
& SQUEEZE_RIGHT, myThid ) |
339 |
iUnit = scrUnit2 |
340 |
REWIND(iUnit) |
341 |
DO WHILE ( .TRUE. ) |
342 |
READ(UNIT=iUnit,FMT='(A)',END=2001) RECORD |
343 |
IL = MAX(ILNBLNK(RECORD),1) |
344 |
WRITE(msgBuf,'(A,A)') '>',RECORD(:IL) |
345 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
346 |
& SQUEEZE_RIGHT, myThid ) |
347 |
ENDDO |
348 |
2001 CONTINUE |
349 |
CLOSE(iUnit) |
350 |
WRITE(msgBuf,'(A)') ' ' |
351 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
352 |
& SQUEEZE_RIGHT, myThid ) |
353 |
|
354 |
|
355 |
C-- Read settings from model parameter file "data". |
356 |
iUnit = scrUnit1 |
357 |
REWIND(iUnit) |
358 |
|
359 |
C-- Set default "physical" parameters |
360 |
viscAhW = UNSET_RL |
361 |
viscA4W = UNSET_RL |
362 |
viscAhD = UNSET_RL |
363 |
viscAhZ = UNSET_RL |
364 |
viscA4D = UNSET_RL |
365 |
viscA4Z = UNSET_RL |
366 |
viscAz = UNSET_RL |
367 |
viscAr = UNSET_RL |
368 |
viscAp = UNSET_RL |
369 |
diffKzT = UNSET_RL |
370 |
diffKpT = UNSET_RL |
371 |
diffKrT = UNSET_RL |
372 |
diffKzS = UNSET_RL |
373 |
diffKpS = UNSET_RL |
374 |
diffKrS = UNSET_RL |
375 |
DO k=1,Nr |
376 |
diffKrNrT(k) = UNSET_RL |
377 |
diffKrNrS(k) = UNSET_RL |
378 |
tRef(k) = UNSET_RL |
379 |
sRef(k) = UNSET_RL |
380 |
ENDDO |
381 |
gBaro = UNSET_RL |
382 |
rhoConst = UNSET_RL |
383 |
omega = UNSET_RL |
384 |
hFacMinDr = UNSET_RL |
385 |
hFacMinDz = UNSET_RL |
386 |
hFacMinDp = UNSET_RL |
387 |
rhoConstFresh = UNSET_RL |
388 |
convertFW2Salt = UNSET_RL |
389 |
tAlpha = UNSET_RL |
390 |
sBeta = UNSET_RL |
391 |
tempVertAdvScheme = 0 |
392 |
saltVertAdvScheme = 0 |
393 |
C-- z,p,r coord input switching. |
394 |
WRITE(msgBuf,'(A)') 'S/R INI_PARMS ; starts to read PARM01' |
395 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
396 |
& SQUEEZE_RIGHT, myThid ) |
397 |
READ(UNIT=iUnit,NML=PARM01) !,IOSTAT=errIO) |
398 |
IF ( errIO .LT. 0 ) THEN |
399 |
WRITE(msgBuf,'(A)') |
400 |
& 'S/R INI_PARMS' |
401 |
CALL PRINT_ERROR( msgBuf, myThid ) |
402 |
WRITE(msgBuf,'(A)') |
403 |
& 'Error reading numerical model ' |
404 |
CALL PRINT_ERROR( msgBuf, myThid ) |
405 |
WRITE(msgBuf,'(A)') |
406 |
& 'parameter file "data"' |
407 |
CALL PRINT_ERROR( msgBuf, myThid ) |
408 |
WRITE(msgBuf,'(A)') |
409 |
& 'Problem in namelist PARM01' |
410 |
CALL PRINT_ERROR( msgBuf, myThid ) |
411 |
CALL MODELDATA_EXAMPLE( myThid ) |
412 |
STOP 'ABNORMAL END: S/R INI_PARMS' |
413 |
ELSE |
414 |
WRITE(msgBuf,'(A)') 'S/R INI_PARMS ; read PARM01 : OK' |
415 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
416 |
& SQUEEZE_RIGHT, myThid ) |
417 |
ENDIF |
418 |
|
419 |
C- set the type of vertical coordinate and type of fluid |
420 |
C according to buoyancyRelation |
421 |
usingPCoords = .FALSE. |
422 |
usingZCoords = .FALSE. |
423 |
fluidIsAir = .FALSE. |
424 |
fluidIsWater = .FALSE. |
425 |
IF ( buoyancyRelation.EQ.'ATMOSPHERIC' ) THEN |
426 |
usingPCoords = .TRUE. |
427 |
fluidIsAir = .TRUE. |
428 |
ELSEIF ( buoyancyRelation.EQ.'OCEANICP') THEN |
429 |
usingPCoords = .TRUE. |
430 |
fluidIsWater = .TRUE. |
431 |
ELSEIF ( buoyancyRelation.EQ.'OCEANIC' ) THEN |
432 |
usingZCoords = .TRUE. |
433 |
fluidIsWater = .TRUE. |
434 |
ELSE |
435 |
WRITE(msgBuf,'(2A)') 'S/R INI_PARMS:', |
436 |
& ' Bad value of buoyancyRelation ' |
437 |
CALL PRINT_ERROR( msgBuf, myThid ) |
438 |
STOP 'ABNORMAL END: S/R INI_PARMS' |
439 |
ENDIF |
440 |
|
441 |
IF ( .NOT.rigidLid .AND. |
442 |
& .NOT.implicitFreeSurface ) THEN |
443 |
C- No barotropic solver selected => use implicitFreeSurface as default |
444 |
WRITE(msgBuf,'(A)') |
445 |
& 'S/R INI_PARMS: No request for barotropic solver' |
446 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
447 |
& SQUEEZE_RIGHT, myThid ) |
448 |
WRITE(msgBuf,'(A)') |
449 |
& 'S/R INI_PARMS: => Use implicitFreeSurface as default' |
450 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
451 |
& SQUEEZE_RIGHT, myThid ) |
452 |
implicitFreeSurface = .TRUE. |
453 |
ENDIF |
454 |
IF ( implicitFreeSurface ) freeSurfFac = 1.D0 |
455 |
IF ( rigidLid ) freeSurfFac = 0.D0 |
456 |
IF ( gBaro .EQ. UNSET_RL ) gBaro=gravity |
457 |
IF ( rhoConst .EQ. UNSET_RL ) rhoConst=rhoNil |
458 |
IF ( rhoConstFresh .EQ. UNSET_RL ) rhoConstFresh=rhoConst |
459 |
IF ( omega .EQ. UNSET_RL ) THEN |
460 |
omega = 0. _d 0 |
461 |
IF ( rotationPeriod .NE. 0. _d 0 ) |
462 |
& omega = 2.D0 * PI / rotationPeriod |
463 |
ELSEIF ( omega .EQ. 0. _d 0 ) THEN |
464 |
rotationPeriod = 0. _d 0 |
465 |
ELSE |
466 |
rotationPeriod = 2.D0 * PI / omega |
467 |
ENDIF |
468 |
IF (atm_Rd .EQ. UNSET_RL) THEN |
469 |
atm_Rd = atm_Cp * atm_kappa |
470 |
ELSE |
471 |
atm_kappa = atm_Rd / atm_Cp |
472 |
ENDIF |
473 |
C-- Non-hydrostatic/quasi-hydrostatic |
474 |
IF (nonHydrostatic.AND.quasiHydrostatic) THEN |
475 |
WRITE(msgBuf,'(A)') |
476 |
& 'Illegal: both nonHydrostatic = quasiHydrostatic = TRUE' |
477 |
CALL PRINT_ERROR( msgBuf, myThid ) |
478 |
STOP 'ABNORMAL END: S/R INI_PARMS' |
479 |
ENDIF |
480 |
C-- Advection and Forcing for Temp and salt |
481 |
IF (tempVertAdvScheme.EQ.0) tempVertAdvScheme = tempAdvScheme |
482 |
IF (saltVertAdvScheme.EQ.0) saltVertAdvScheme = saltAdvScheme |
483 |
C-- horizontal viscosity for vertical moments |
484 |
IF ( viscAhW .EQ. UNSET_RL ) viscAhW = viscAh |
485 |
IF ( viscA4W .EQ. UNSET_RL ) viscA4W = viscA4 |
486 |
C-- horizontal viscosity (acting on Divergence or Vorticity) |
487 |
IF ( viscAhD .EQ. UNSET_RL ) viscAhD = viscAh |
488 |
IF ( viscAhZ .EQ. UNSET_RL ) viscAhZ = viscAh |
489 |
IF ( viscA4D .EQ. UNSET_RL ) viscA4D = viscA4 |
490 |
IF ( viscA4Z .EQ. UNSET_RL ) viscA4Z = viscA4 |
491 |
C-- z,p,r coord input switching. |
492 |
IF ( viscAz .NE. UNSET_RL ) zCoordInputData = .TRUE. |
493 |
IF ( viscAp .NE. UNSET_RL ) pCoordInputData = .TRUE. |
494 |
IF ( viscAr .NE. UNSET_RL ) rCoordInputData = .TRUE. |
495 |
IF ( viscAr .EQ. UNSET_RL ) viscAr = viscAz |
496 |
IF ( viscAr .EQ. UNSET_RL ) viscAr = viscAp |
497 |
IF ( viscAr .EQ. UNSET_RL ) viscAr = viscArDefault |
498 |
|
499 |
IF ( diffKzT .NE. UNSET_RL ) zCoordInputData = .TRUE. |
500 |
IF ( diffKpT .NE. UNSET_RL ) pCoordInputData = .TRUE. |
501 |
IF ( diffKrT .NE. UNSET_RL ) rCoordInputData = .TRUE. |
502 |
IF ( diffKrT .EQ. UNSET_RL ) diffKrT = diffKzT |
503 |
IF ( diffKrT .EQ. UNSET_RL ) diffKrT = diffKpT |
504 |
IF ( diffKrT .EQ. UNSET_RL ) diffKrT = diffKrTDefault |
505 |
diffKrSet = .TRUE. |
506 |
DO k=1,Nr |
507 |
IF ( diffKrNrT(k).EQ. UNSET_RL ) diffKrSet = .FALSE. |
508 |
ENDDO |
509 |
IF ( .NOT.diffKrSet ) THEN |
510 |
DO k=1,Nr |
511 |
diffKrNrT(k) = diffKrT |
512 |
ENDDO |
513 |
ELSEIF ( diffKrT.NE.diffKrTDefault ) THEN |
514 |
WRITE(msgBuf,'(2A)') 'S/R INI_PARMS: Cannot set both ', |
515 |
& 'diffKrNrT and diffKrT (or Kp,Kz) in input file data' |
516 |
CALL PRINT_ERROR( msgBuf, myThid ) |
517 |
STOP 'ABNORMAL END: S/R INI_PARMS' |
518 |
ENDIF |
519 |
|
520 |
IF ( diffKzS .NE. UNSET_RL ) zCoordInputData = .TRUE. |
521 |
IF ( diffKpS .NE. UNSET_RL ) pCoordInputData = .TRUE. |
522 |
IF ( diffKrS .NE. UNSET_RL ) rCoordInputData = .TRUE. |
523 |
IF ( diffKrS .EQ. UNSET_RL ) diffKrS = diffKzS |
524 |
IF ( diffKrS .EQ. UNSET_RL ) diffKrS = diffKpS |
525 |
IF ( diffKrS .EQ. UNSET_RL ) diffKrS = diffKrSDefault |
526 |
diffKrSet = .TRUE. |
527 |
DO k=1,Nr |
528 |
IF ( diffKrNrS(k).EQ. UNSET_RL ) diffKrSet = .FALSE. |
529 |
ENDDO |
530 |
IF ( .NOT.diffKrSet ) THEN |
531 |
DO k=1,Nr |
532 |
diffKrNrS(k) = diffKrS |
533 |
ENDDO |
534 |
ELSEIF ( diffKrS.NE.diffKrSDefault ) THEN |
535 |
WRITE(msgBuf,'(2A)') 'S/R INI_PARMS: Cannot set both ', |
536 |
& 'diffKrNrS and diffKrS (or Kp,Kz) in input file data' |
537 |
CALL PRINT_ERROR( msgBuf, myThid ) |
538 |
STOP 'ABNORMAL END: S/R INI_PARMS' |
539 |
ENDIF |
540 |
|
541 |
IF (diffKrBLEQsurf .EQ. UNSET_RL) diffKrBLEQsurf = diffKrBL79surf |
542 |
IF (diffKrBLEQdeep .EQ. UNSET_RL) diffKrBLEQdeep = diffKrBL79deep |
543 |
IF (diffKrBLEQscl .EQ. UNSET_RL) diffKrBLEQscl = diffKrBL79scl |
544 |
IF (diffKrBLEQHo .EQ. UNSET_RL) diffKrBLEQHo = diffKrBL79Ho |
545 |
|
546 |
IF ( hFacMinDz .NE. UNSET_RL ) zCoordInputData = .TRUE. |
547 |
IF ( hFacMinDp .NE. UNSET_RL ) pCoordInputData = .TRUE. |
548 |
IF ( hFacMinDr .NE. UNSET_RL ) rCoordInputData = .TRUE. |
549 |
IF ( hFacMinDr .EQ. UNSET_RL ) hFacMinDr = hFacMinDz |
550 |
IF ( hFacMinDr .EQ. UNSET_RL ) hFacMinDr = hFacMinDp |
551 |
IF ( hFacMinDr .EQ. UNSET_RL ) hFacMinDr = hFacMinDrDefault |
552 |
|
553 |
IF (convertFW2Salt.EQ.UNSET_RL) THEN |
554 |
convertFW2Salt = 35. |
555 |
IF (useRealFreshWaterFlux) convertFW2Salt=-1 |
556 |
ENDIF |
557 |
|
558 |
IF ( SadournyCoriolis ) THEN |
559 |
C-- for backward compatibility : |
560 |
IF ( selectVortScheme.EQ.UNSET_I ) selectVortScheme = 2 |
561 |
IF ( selectVortScheme.NE.2 ) THEN |
562 |
WRITE(msgBuf,'(A,I5,A)') |
563 |
& 'S/R INI_PARMS: selectVortScheme=', selectVortScheme, |
564 |
& ' conflicts with "SadournyCoriolis"' |
565 |
CALL PRINT_ERROR( msgBuf, myThid ) |
566 |
STOP 'ABNORMAL END: S/R INI_PARMS' |
567 |
ENDIF |
568 |
ENDIF |
569 |
|
570 |
IF ( ivdc_kappa .NE. 0. .AND. .NOT. implicitDiffusion ) THEN |
571 |
WRITE(msgBuf,'(A,A)') |
572 |
& 'S/R INI_PARMS: To use ivdc_kappa you must enable implicit', |
573 |
& ' vertical diffusion.' |
574 |
CALL PRINT_ERROR( msgBuf, myThid ) |
575 |
STOP 'ABNORMAL END: S/R INI_PARMS' |
576 |
ENDIF |
577 |
|
578 |
coordsSet = 0 |
579 |
IF ( zCoordInputData ) coordsSet = coordsSet + 1 |
580 |
IF ( pCoordInputData ) coordsSet = coordsSet + 1 |
581 |
IF ( rCoordInputData ) coordsSet = coordsSet + 1 |
582 |
IF ( coordsSet .GT. 1 ) THEN |
583 |
WRITE(msgBuf,'(A)') |
584 |
& 'S/R INI_PARMS: Cannot mix z, p and r in the input data.' |
585 |
CALL PRINT_ERROR( msgBuf, myThid ) |
586 |
STOP 'ABNORMAL END: S/R INI_PARMS' |
587 |
ENDIF |
588 |
IF ( rhoConst .LE. 0. ) THEN |
589 |
WRITE(msgBuf,'(A)') |
590 |
& 'S/R INI_PARMS: rhoConst must be greater than 0.' |
591 |
CALL PRINT_ERROR( msgBuf, myThid ) |
592 |
STOP 'ABNORMAL END: S/R INI_PARMS' |
593 |
ELSE |
594 |
recip_rhoConst = 1.D0 / rhoConst |
595 |
ENDIF |
596 |
IF ( rhoNil .LE. 0. ) THEN |
597 |
WRITE(msgBuf,'(A)') |
598 |
& 'S/R INI_PARMS: rhoNil must be greater than 0.' |
599 |
CALL PRINT_ERROR( msgBuf, myThid ) |
600 |
STOP 'ABNORMAL END: S/R INI_PARMS' |
601 |
ELSE |
602 |
recip_rhoNil = 1.D0 / rhoNil |
603 |
ENDIF |
604 |
IF ( HeatCapacity_Cp .LE. 0. ) THEN |
605 |
WRITE(msgBuf,'(A)') |
606 |
& 'S/R INI_PARMS: HeatCapacity_Cp must be greater than 0.' |
607 |
CALL PRINT_ERROR( msgBuf, myThid ) |
608 |
STOP 'ABNORMAL END: S/R INI_PARMS' |
609 |
ELSE |
610 |
recip_Cp = 1.D0 / HeatCapacity_Cp |
611 |
ENDIF |
612 |
IF ( gravity .LE. 0. ) THEN |
613 |
WRITE(msgBuf,'(A)') |
614 |
& 'S/R INI_PARMS: gravity must be greater than 0.' |
615 |
CALL PRINT_ERROR( msgBuf, myThid ) |
616 |
STOP 'ABNORMAL END: S/R INI_PARMS' |
617 |
ELSE |
618 |
recip_gravity = 1.D0 / gravity |
619 |
ENDIF |
620 |
C This flags are now passed to RW and MDSIO packages in ini_model_io.F |
621 |
C Set globalFiles flag for READ_WRITE_FLD package |
622 |
c CALL SET_WRITE_GLOBAL_FLD( globalFiles ) |
623 |
C Set globalFiles flag for READ_WRITE_REC package |
624 |
c CALL SET_WRITE_GLOBAL_REC( globalFiles ) |
625 |
C Set globalFiles flag for READ_WRITE_REC package |
626 |
c CALL SET_WRITE_GLOBAL_PICKUP( globalFiles ) |
627 |
|
628 |
C Check for retired parameters still being used |
629 |
nRetired = 0 |
630 |
IF ( zonal_filt_lat .NE. UNSET_RL ) THEN |
631 |
nRetired = nRetired+1 |
632 |
WRITE(msgBuf,'(A,A)') |
633 |
& 'S/R INI_PARMS: Paramater "zonal_filt_lat" is', |
634 |
& ' no longer allowed in file "data".' |
635 |
CALL PRINT_ERROR( msgBuf, myThid ) |
636 |
WRITE(msgBuf,'(A,A)') |
637 |
& 'S/R INI_PARMS: Paramater "zonal_filt_lat" is', |
638 |
& ' now read from file "data.zonfilt".' |
639 |
CALL PRINT_ERROR( msgBuf, myThid ) |
640 |
ENDIF |
641 |
IF ( gravitySign .NE. UNSET_RL ) THEN |
642 |
nRetired = nRetired+1 |
643 |
WRITE(msgBuf,'(A,A)') |
644 |
& 'S/R INI_PARMS: "gravitySign" is set according to vertical ', |
645 |
& ' coordinate and is no longer allowed in file "data".' |
646 |
CALL PRINT_ERROR( msgBuf, myThid ) |
647 |
ENDIF |
648 |
IF ( tracerAdvScheme .NE. UNSET_I ) THEN |
649 |
nRetired = nRetired+1 |
650 |
WRITE(msgBuf,'(A,A)') 'S/R INI_PARMS: "tracerAdvScheme" ', |
651 |
& '(old passive tracer code) is no longer allowed in file "data"' |
652 |
CALL PRINT_ERROR( msgBuf, myThid ) |
653 |
ENDIF |
654 |
IF ( trac_EvPrRn .NE. UNSET_RL ) THEN |
655 |
nRetired = nRetired+1 |
656 |
WRITE(msgBuf,'(A,A)') 'S/R INI_PARMS: "trac_EvPrRn" ', |
657 |
& '(old passive tracer code) is no longer allowed in file "data"' |
658 |
CALL PRINT_ERROR( msgBuf, myThid ) |
659 |
ENDIF |
660 |
IF ( .NOT. tempDiffusion ) THEN |
661 |
nRetired = nRetired+1 |
662 |
WRITE(msgBuf,'(A,A)') 'S/R INI_PARMS: "tempDiffusion" ', |
663 |
& 'is no longer allowed in file "data"' |
664 |
CALL PRINT_ERROR( msgBuf, myThid ) |
665 |
WRITE(msgBuf,'(A,A)') 'S/R INI_PARMS: to turn off diffusion', |
666 |
& ' => set diffusivity to zero' |
667 |
CALL PRINT_ERROR( msgBuf, myThid ) |
668 |
ENDIF |
669 |
IF ( .NOT. saltDiffusion ) THEN |
670 |
nRetired = nRetired+1 |
671 |
WRITE(msgBuf,'(A,A)') 'S/R INI_PARMS: "saltDiffusion" ', |
672 |
& 'is no longer allowed in file "data"' |
673 |
CALL PRINT_ERROR( msgBuf, myThid ) |
674 |
WRITE(msgBuf,'(A,A)') 'S/R INI_PARMS: to turn off diffusion', |
675 |
& ' => set diffusivity to zero' |
676 |
CALL PRINT_ERROR( msgBuf, myThid ) |
677 |
ENDIF |
678 |
IF ( viscAstrain .NE. UNSET_RL ) THEN |
679 |
nRetired = nRetired+1 |
680 |
WRITE(msgBuf,'(A,A)') |
681 |
& 'S/R INI_PARMS: "viscAstrain" ', |
682 |
& 'is no longer allowed in file "data"' |
683 |
CALL PRINT_ERROR( msgBuf, myThid ) |
684 |
WRITE(msgBuf,'(A,A)') 'S/R INI_PARMS: to use Strain & Tension', |
685 |
& ' formulation => set useStrainTensionVisc to TRUE' |
686 |
CALL PRINT_ERROR( msgBuf, myThid ) |
687 |
ENDIF |
688 |
IF ( viscAtension .NE. UNSET_RL ) THEN |
689 |
nRetired = nRetired+1 |
690 |
WRITE(msgBuf,'(A,A)') |
691 |
& 'S/R INI_PARMS: "viscAtension" ', |
692 |
& 'is no longer allowed in file "data"' |
693 |
CALL PRINT_ERROR( msgBuf, myThid ) |
694 |
WRITE(msgBuf,'(A,A)') 'S/R INI_PARMS: to use Strain & Tension', |
695 |
& ' formulation => set useStrainTensionVisc to TRUE' |
696 |
CALL PRINT_ERROR( msgBuf, myThid ) |
697 |
ENDIF |
698 |
IF ( .NOT.useAnisotropicViscAgridMax ) THEN |
699 |
nRetired = nRetired+1 |
700 |
WRITE(msgBuf,'(A,A)') |
701 |
& 'S/R INI_PARMS: "useAnisotropicViscAgridMax" ', |
702 |
& 'is not allowed in "data" substitute useAreaViscLength=true' |
703 |
CALL PRINT_ERROR( msgBuf, myThid ) |
704 |
ENDIF |
705 |
IF ( usePickupBeforeC35 ) THEN |
706 |
nRetired = nRetired+1 |
707 |
WRITE(msgBuf,'(A,A)') |
708 |
& 'S/R INI_PARMS: "usePickupBeforeC35" ', |
709 |
& 'is no longer supported & not longer allowed in file "data"' |
710 |
CALL PRINT_ERROR( msgBuf, myThid ) |
711 |
ENDIF |
712 |
|
713 |
C-- Elliptic solver parameters |
714 |
WRITE(msgBuf,'(A)') 'S/R INI_PARMS ; starts to read PARM02' |
715 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
716 |
& SQUEEZE_RIGHT, myThid ) |
717 |
READ(UNIT=iUnit,NML=PARM02) !,IOSTAT=errIO) |
718 |
IF ( errIO .LT. 0 ) THEN |
719 |
WRITE(msgBuf,'(A)') |
720 |
& 'S/R INI_PARMS' |
721 |
CALL PRINT_ERROR( msgBuf, myThid ) |
722 |
WRITE(msgBuf,'(A)') |
723 |
& 'Error reading numerical model ' |
724 |
CALL PRINT_ERROR( msgBuf, myThid ) |
725 |
WRITE(msgBuf,'(A)') |
726 |
& 'parameter file "data".' |
727 |
CALL PRINT_ERROR( msgBuf, myThid ) |
728 |
WRITE(msgBuf,'(A)') |
729 |
& 'Problem in namelist PARM02' |
730 |
CALL PRINT_ERROR( msgBuf, myThid ) |
731 |
CALL MODELDATA_EXAMPLE( myThid ) |
732 |
STOP 'ABNORMAL END: S/R INI_PARMS' |
733 |
ELSE |
734 |
WRITE(msgBuf,'(A)') 'S/R INI_PARMS ; read PARM02 : OK' |
735 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
736 |
& SQUEEZE_RIGHT, myThid ) |
737 |
ENDIF |
738 |
|
739 |
C-- Time stepping parameters |
740 |
rCD = -1.D0 |
741 |
latBandClimRelax = UNSET_RL |
742 |
deltaTtracer = 0. _d 0 |
743 |
forcing_In_AB = .TRUE. |
744 |
WRITE(msgBuf,'(A)') 'S/R INI_PARMS ; starts to read PARM03' |
745 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
746 |
& SQUEEZE_RIGHT, myThid ) |
747 |
READ(UNIT=iUnit,NML=PARM03) !,IOSTAT=errIO) |
748 |
IF ( errIO .LT. 0 ) THEN |
749 |
WRITE(msgBuf,'(A)') |
750 |
& 'S/R INI_PARMS' |
751 |
CALL PRINT_ERROR( msgBuf, myThid ) |
752 |
WRITE(msgBuf,'(A)') |
753 |
& 'Error reading numerical model ' |
754 |
CALL PRINT_ERROR( msgBuf, myThid ) |
755 |
WRITE(msgBuf,'(A)') |
756 |
& 'parameter file "data"' |
757 |
CALL PRINT_ERROR( msgBuf, myThid ) |
758 |
WRITE(msgBuf,'(A)') |
759 |
& 'Problem in namelist PARM03' |
760 |
CALL PRINT_ERROR( msgBuf, myThid ) |
761 |
CALL MODELDATA_EXAMPLE( myThid ) |
762 |
STOP 'ABNORMAL END: S/R INI_PARMS' |
763 |
ELSE |
764 |
WRITE(msgBuf,'(A)') 'S/R INI_PARMS ; read PARM03 : OK' |
765 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
766 |
& SQUEEZE_RIGHT, myThid ) |
767 |
ENDIF |
768 |
C Check for retired parameters still being used |
769 |
IF ( tauThetaClimRelax3Dim .NE. UNSET_RL ) THEN |
770 |
nRetired = nRetired+1 |
771 |
WRITE(msgBuf,'(A,A)') 'S/R INI_PARMS: "tauThetaClimRelax3Dim" ', |
772 |
& 'is no longer allowed in file "data"' |
773 |
CALL PRINT_ERROR( msgBuf, myThid ) |
774 |
WRITE(msgBuf,'(A,A)') 'S/R INI_PARMS: 3-dim. relaxation code', |
775 |
& ' has moved to separate pkg/rbcs.' |
776 |
CALL PRINT_ERROR( msgBuf, myThid ) |
777 |
ENDIF |
778 |
IF ( tauSaltClimRelax3Dim .NE. UNSET_RL ) THEN |
779 |
nRetired = nRetired+1 |
780 |
WRITE(msgBuf,'(A,A)') 'S/R INI_PARMS: "tauSaltClimRelax3Dim" ', |
781 |
& 'is no longer allowed in file "data"' |
782 |
CALL PRINT_ERROR( msgBuf, myThid ) |
783 |
WRITE(msgBuf,'(A,A)') 'S/R INI_PARMS: 3-dim. relaxation code', |
784 |
& ' has moved to separate pkg/rbcs.' |
785 |
CALL PRINT_ERROR( msgBuf, myThid ) |
786 |
ENDIF |
787 |
IF ( calendarDumps ) THEN |
788 |
nRetired = nRetired+1 |
789 |
WRITE(msgBuf,'(A,A)') 'S/R INI_PARMS: "calendarDumps" ', |
790 |
& 'is no longer allowed in file "data"' |
791 |
CALL PRINT_ERROR( msgBuf, myThid ) |
792 |
WRITE(msgBuf,'(A,A)') 'S/R INI_PARMS: calendarDumps', |
793 |
& ' has moved to "data.cal"' |
794 |
CALL PRINT_ERROR( msgBuf, myThid ) |
795 |
ENDIF |
796 |
|
797 |
C Process "timestepping" params |
798 |
C o Time step size |
799 |
IF ( deltaTtracer .NE. dTtracerLev(1) .AND. |
800 |
& deltaTtracer .NE. 0. .AND. dTtracerLev(1) .NE. 0. ) THEN |
801 |
WRITE(msgBuf,'(A)') |
802 |
& 'S/R INI_PARMS: deltaTtracer & dTtracerLev(1) not equal' |
803 |
CALL PRINT_ERROR( msgBuf, myThid ) |
804 |
STOP 'ABNORMAL END: S/R INI_PARMS' |
805 |
ELSEIF ( dTtracerLev(1) .NE. 0. ) THEN |
806 |
deltaTtracer = dTtracerLev(1) |
807 |
ENDIF |
808 |
IF ( deltaT .EQ. 0. ) deltaT = deltaTClock |
809 |
IF ( deltaT .EQ. 0. ) deltaT = deltaTtracer |
810 |
IF ( deltaT .EQ. 0. ) deltaT = deltaTmom |
811 |
IF ( deltaT .EQ. 0. ) deltaT = deltaTfreesurf |
812 |
IF ( deltaTmom .EQ. 0. ) deltaTmom = deltaT |
813 |
IF ( deltaTtracer .EQ. 0. ) deltaTtracer = deltaT |
814 |
IF ( deltaTClock .EQ. 0. ) deltaTClock = deltaT |
815 |
DO k=1,Nr |
816 |
IF (dTtracerLev(k).EQ.0.) dTtracerLev(k)= deltaTtracer |
817 |
ENDDO |
818 |
C Note that this line should set deltaFreesurf=deltaTtracer |
819 |
C but this would change a lot of existing set-ups so we are |
820 |
C obliged to set the default inappropriately. |
821 |
C Be advised that when using asynchronous time stepping |
822 |
C it is better to set deltaTreesurf=deltaTtracer |
823 |
IF ( deltaTfreesurf .EQ. 0. ) deltaTfreesurf = deltaTmom |
824 |
IF ( periodicExternalForcing ) THEN |
825 |
IF ( externForcingCycle*externForcingPeriod .EQ. 0. ) THEN |
826 |
WRITE(msgBuf,'(A)') |
827 |
& 'S/R INI_PARMS: externForcingCycle,externForcingPeriod =0' |
828 |
CALL PRINT_ERROR( msgBuf, myThid ) |
829 |
STOP 'ABNORMAL END: S/R INI_PARMS' |
830 |
ENDIF |
831 |
IF ( INT(externForcingCycle/externForcingPeriod) .NE. |
832 |
& externForcingCycle/externForcingPeriod ) THEN |
833 |
WRITE(msgBuf,'(A)') |
834 |
& 'S/R INI_PARMS: externForcingCycle <> N*externForcingPeriod' |
835 |
CALL PRINT_ERROR( msgBuf, myThid ) |
836 |
STOP 'ABNORMAL END: S/R INI_PARMS' |
837 |
ENDIF |
838 |
IF ( externForcingCycle.lt.externForcingPeriod ) THEN |
839 |
WRITE(msgBuf,'(A)') |
840 |
& 'S/R INI_PARMS: externForcingCycle < externForcingPeriod' |
841 |
CALL PRINT_ERROR( msgBuf, myThid ) |
842 |
STOP 'ABNORMAL END: S/R INI_PARMS' |
843 |
ENDIF |
844 |
IF ( externForcingPeriod.lt.deltaTclock ) THEN |
845 |
WRITE(msgBuf,'(A)') |
846 |
& 'S/R INI_PARMS: externForcingPeriod < deltaTclock' |
847 |
CALL PRINT_ERROR( msgBuf, myThid ) |
848 |
STOP 'ABNORMAL END: S/R INI_PARMS' |
849 |
ENDIF |
850 |
ENDIF |
851 |
C o Adams-Bashforth time stepping: |
852 |
IF ( momForcingOutAB .EQ. UNSET_I ) THEN |
853 |
momForcingOutAB = 1 |
854 |
IF ( forcing_In_AB ) momForcingOutAB = 0 |
855 |
ENDIF |
856 |
IF ( tracForcingOutAB .EQ. UNSET_I ) THEN |
857 |
tracForcingOutAB = 1 |
858 |
IF ( forcing_In_AB ) tracForcingOutAB = 0 |
859 |
ENDIF |
860 |
C o Convection frequency |
861 |
IF ( cAdjFreq .LT. 0. ) THEN |
862 |
cAdjFreq = deltaTClock |
863 |
ENDIF |
864 |
IF ( ivdc_kappa .NE. 0. .AND. cAdjFreq .NE. 0. ) THEN |
865 |
WRITE(msgBuf,'(A,A)') |
866 |
& 'S/R INI_PARMS: You have enabled both ivdc_kappa and', |
867 |
& ' convective adjustment.' |
868 |
CALL PRINT_ERROR( msgBuf, myThid ) |
869 |
STOP 'ABNORMAL END: S/R INI_PARMS' |
870 |
ENDIF |
871 |
IF (useCDscheme) THEN |
872 |
C o CD coupling (CD scheme): |
873 |
IF ( tauCD .EQ. 0.D0 ) tauCD = deltaTmom |
874 |
IF ( rCD .LT. 0. ) rCD = 1. _d 0 - deltaTMom/tauCD |
875 |
ENDIF |
876 |
C o Temperature climatology relaxation time scale |
877 |
IF ( tauThetaClimRelax .EQ. 0.D0 ) THEN |
878 |
doThetaClimRelax = .FALSE. |
879 |
ELSE |
880 |
doThetaClimRelax = .TRUE. |
881 |
ENDIF |
882 |
C o Salinity climatology relaxation time scale |
883 |
IF ( tauSaltClimRelax .EQ. 0.D0 ) THEN |
884 |
doSaltClimRelax = .FALSE. |
885 |
ELSE |
886 |
doSaltClimRelax = .TRUE. |
887 |
ENDIF |
888 |
|
889 |
C o Base time |
890 |
IF ( nIter0.NE.0 .AND. startTime.NE.0. .AND. baseTime.EQ.0. ) |
891 |
& baseTime = startTime - deltaTClock*float(nIter0) |
892 |
C o Start time |
893 |
IF ( nIter0 .NE. 0 .AND. startTime .EQ. 0. ) |
894 |
& startTime = baseTime + deltaTClock*float(nIter0) |
895 |
C o nIter0 |
896 |
IF ( nIter0 .EQ. 0 .AND. startTime .NE. baseTime ) |
897 |
& nIter0 = NINT( (startTime-baseTime)/deltaTClock ) |
898 |
|
899 |
C o nTimeSteps 1 |
900 |
IF ( nTimeSteps .EQ. 0 .AND. nEndIter .NE. 0 ) |
901 |
& nTimeSteps = nEndIter-nIter0 |
902 |
C o nTimeSteps 2 |
903 |
IF ( nTimeSteps .EQ. 0 .AND. endTime .NE. 0. ) |
904 |
& nTimeSteps = NINT((endTime-startTime)/deltaTclock) |
905 |
C o nEndIter 1 |
906 |
IF ( nEndIter .EQ. 0 .AND. nTimeSteps .NE. 0 ) |
907 |
& nEndIter = nIter0+nTimeSteps |
908 |
C o nEndIter 2 |
909 |
IF ( nEndIter .EQ. 0 .AND. endTime .NE. 0. ) |
910 |
& nEndIter = NINT((endTime-baseTime)/deltaTclock) |
911 |
C o End Time 1 |
912 |
IF ( endTime .EQ. 0. .AND. nTimeSteps .NE. 0 ) |
913 |
& endTime = startTime + deltaTClock*float(nTimeSteps) |
914 |
C o End Time 2 |
915 |
IF ( endTime .EQ. 0. .AND. nEndIter .NE. 0 ) |
916 |
& endTime = baseTime + deltaTClock*float(nEndIter) |
917 |
|
918 |
C o Consistent? |
919 |
IF ( startTime .NE. baseTime+deltaTClock*float(nIter0) ) THEN |
920 |
WRITE(msgBuf,'(A)') |
921 |
& 'S/R INI_PARMS: startTime, baseTime and nIter0 are inconsistent' |
922 |
CALL PRINT_ERROR( msgBuf, myThid ) |
923 |
WRITE(msgBuf,'(A)') |
924 |
& 'S/R INI_PARMS: Perhaps more than two were set at once' |
925 |
CALL PRINT_ERROR( msgBuf, myThid ) |
926 |
STOP 'ABNORMAL END: S/R INI_PARMS' |
927 |
ENDIF |
928 |
IF ( nEndIter .NE. nIter0+nTimeSteps ) THEN |
929 |
WRITE(msgBuf,'(A)') |
930 |
& 'S/R INI_PARMS: nIter0, nTimeSteps and nEndIter are inconsistent' |
931 |
CALL PRINT_ERROR( msgBuf, myThid ) |
932 |
WRITE(msgBuf,'(A)') |
933 |
& 'S/R INI_PARMS: Perhaps more than two were set at once' |
934 |
CALL PRINT_ERROR( msgBuf, myThid ) |
935 |
STOP 'ABNORMAL END: S/R INI_PARMS' |
936 |
ENDIF |
937 |
IF ( nTimeSteps .NE. NINT((endTime-startTime)/deltaTClock) |
938 |
& ) THEN |
939 |
WRITE(msgBuf,'(A)') |
940 |
& 'S/R INI_PARMS: both endTime and nTimeSteps have been set' |
941 |
CALL PRINT_ERROR( msgBuf, myThid ) |
942 |
WRITE(msgBuf,'(A)') |
943 |
& 'S/R INI_PARMS: but are inconsistent' |
944 |
CALL PRINT_ERROR( msgBuf, myThid ) |
945 |
STOP 'ABNORMAL END: S/R INI_PARMS' |
946 |
ENDIF |
947 |
|
948 |
C o Monitor (should also add CPP flag for monitor?) |
949 |
IF (monitorFreq.LT.0.) THEN |
950 |
monitorFreq=0. |
951 |
IF (dumpFreq.NE.0.) monitorFreq=dumpFreq |
952 |
IF (diagFreq.NE.0..AND.diagFreq.LT.monitorFreq) |
953 |
& monitorFreq=diagFreq |
954 |
IF (taveFreq.NE.0..AND.taveFreq.LT.monitorFreq) |
955 |
& monitorFreq=taveFreq |
956 |
IF (chkPtFreq.NE.0..AND.chkPtFreq.LT.monitorFreq) |
957 |
& monitorFreq=chkPtFreq |
958 |
IF (pChkPtFreq.NE.0..AND.pChkPtFreq.LT.monitorFreq) |
959 |
& monitorFreq=pChkPtFreq |
960 |
IF (monitorFreq.EQ.0.) monitorFreq=deltaTclock |
961 |
ENDIF |
962 |
IF ( monitorSelect.EQ.UNSET_I ) THEN |
963 |
monitorSelect = 2 |
964 |
IF ( fluidIsWater ) monitorSelect = 3 |
965 |
ENDIF |
966 |
|
967 |
C-- Grid parameters |
968 |
C In cartesian coords distances are in metres |
969 |
DO K =1,Nr |
970 |
delZ(K) = UNSET_RL |
971 |
delP(K) = UNSET_RL |
972 |
delR(K) = UNSET_RL |
973 |
ENDDO |
974 |
C In spherical polar distances are in degrees |
975 |
dxSpacing = UNSET_RL |
976 |
dySpacing = UNSET_RL |
977 |
WRITE(msgBuf,'(A)') 'S/R INI_PARMS ; starts to read PARM04' |
978 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
979 |
& SQUEEZE_RIGHT, myThid ) |
980 |
READ(UNIT=iUnit,NML=PARM04,IOSTAT=errIO) |
981 |
IF ( errIO .LT. 0 ) THEN |
982 |
WRITE(msgBuf,'(A)') |
983 |
& 'S/R INI_PARMS' |
984 |
CALL PRINT_ERROR( msgBuf, myThid ) |
985 |
WRITE(msgBuf,'(A)') |
986 |
& 'Error reading numerical model ' |
987 |
CALL PRINT_ERROR( msgBuf, myThid ) |
988 |
WRITE(msgBuf,'(A)') |
989 |
& 'parameter file "data"' |
990 |
CALL PRINT_ERROR( msgBuf, myThid ) |
991 |
WRITE(msgBuf,'(A)') |
992 |
& 'Problem in namelist PARM04' |
993 |
CALL PRINT_ERROR( msgBuf, myThid ) |
994 |
CALL MODELDATA_EXAMPLE( myThid ) |
995 |
STOP 'ABNORMAL END: S/R INI_PARMS' |
996 |
ELSE |
997 |
WRITE(msgBuf,'(A)') 'S/R INI_PARMS ; read PARM04 : OK' |
998 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
999 |
& SQUEEZE_RIGHT, myThid ) |
1000 |
ENDIF |
1001 |
|
1002 |
C Check for retired parameters still being used |
1003 |
IF ( rkFac .NE. UNSET_RL ) THEN |
1004 |
nRetired = nRetired+1 |
1005 |
WRITE(msgBuf,'(A,A)') |
1006 |
& 'S/R INI_PARMS: "rkFac" has been replaced by -rkSign ', |
1007 |
& ' and is no longer allowed in file "data".' |
1008 |
CALL PRINT_ERROR( msgBuf, myThid ) |
1009 |
ENDIF |
1010 |
IF ( groundAtK1 ) THEN |
1011 |
c nRetired = nRetired+1 |
1012 |
WRITE(msgBuf,'(A,A)') |
1013 |
& 'S/R INI_PARMS: "groundAtK1" is set according to vertical ', |
1014 |
& ' coordinate and is no longer allowed in file "data".' |
1015 |
CALL PRINT_ERROR( msgBuf, myThid ) |
1016 |
ENDIF |
1017 |
|
1018 |
C X coordinate : Check for multiple definitions |
1019 |
goptCount = 0 |
1020 |
IF ( delX(1) .NE. UNSET_RL ) goptCount = goptCount + 1 |
1021 |
IF ( dxSpacing .NE. UNSET_RL ) goptCount = goptCount + 1 |
1022 |
IF ( delXFile .NE. ' ' ) goptCount = goptCount + 1 |
1023 |
IF ( goptCount.GT.1 ) THEN |
1024 |
WRITE(msgBuf,'(A,A)') 'Too many specifications for delX:', |
1025 |
& 'Specify only one of delX, dxSpacing or delXfile' |
1026 |
CALL PRINT_ERROR( msgBuf, myThid ) |
1027 |
STOP 'ABNORMAL END: S/R INI_PARMS' |
1028 |
ENDIF |
1029 |
IF ( dxSpacing .NE. UNSET_RL ) THEN |
1030 |
DO i=1,Nx |
1031 |
delX(i) = dxSpacing |
1032 |
ENDDO |
1033 |
ENDIF |
1034 |
C Y coordinate : Check for multiple definitions |
1035 |
goptCount = 0 |
1036 |
IF ( delY(1) .NE. UNSET_RL ) goptCount = goptCount + 1 |
1037 |
IF ( dySpacing .NE. UNSET_RL ) goptCount = goptCount + 1 |
1038 |
IF ( delYFile .NE. ' ' ) goptCount = goptCount + 1 |
1039 |
IF ( goptCount.GT.1 ) THEN |
1040 |
WRITE(msgBuf,'(A,A)') 'Too many specifications for delY:', |
1041 |
& 'Specify only one of delY, dySpacing or delYfile' |
1042 |
CALL PRINT_ERROR( msgBuf, myThid ) |
1043 |
STOP 'ABNORMAL END: S/R INI_PARMS' |
1044 |
ENDIF |
1045 |
IF ( dySpacing .NE. UNSET_RL ) THEN |
1046 |
DO j=1,Ny |
1047 |
delY(j) = dySpacing |
1048 |
ENDDO |
1049 |
ENDIF |
1050 |
C |
1051 |
IF ( rSphere .NE. 0. ) THEN |
1052 |
recip_rSphere = 1. _d 0/rSphere |
1053 |
ELSE |
1054 |
recip_rSphere = 0. |
1055 |
ENDIF |
1056 |
C-- Check for conflicting grid definitions. |
1057 |
goptCount = 0 |
1058 |
IF ( usingCartesianGrid ) goptCount = goptCount+1 |
1059 |
IF ( usingSphericalPolarGrid ) goptCount = goptCount+1 |
1060 |
IF ( usingCurvilinearGrid ) goptCount = goptCount+1 |
1061 |
IF ( usingCylindricalGrid ) goptCount = goptCount+1 |
1062 |
IF ( goptCount .GT. 1 ) THEN |
1063 |
WRITE(msgBuf,'(A)') |
1064 |
& 'S/R INI_PARMS: More than one coordinate system requested' |
1065 |
CALL PRINT_ERROR( msgBuf, myThid ) |
1066 |
STOP 'ABNORMAL END: S/R INI_PARMS' |
1067 |
ENDIF |
1068 |
IF ( goptCount .LT. 1 ) THEN |
1069 |
C- No horizontal grid is specified => use Cartesian grid as default: |
1070 |
WRITE(msgBuf,'(A)') |
1071 |
& 'S/R INI_PARMS: No horizontal grid requested' |
1072 |
CALL PRINT_MESSAGE( msgBuf, errorMessageUnit, |
1073 |
& SQUEEZE_RIGHT, myThid ) |
1074 |
WRITE(msgBuf,'(A)') |
1075 |
& 'S/R INI_PARMS: => Use Cartesian Grid as default' |
1076 |
CALL PRINT_MESSAGE( msgBuf, errorMessageUnit, |
1077 |
& SQUEEZE_RIGHT, myThid ) |
1078 |
usingCartesianGrid = .TRUE. |
1079 |
ENDIF |
1080 |
C-- Make metric term & Coriolis settings consistent with underlying grid. |
1081 |
IF ( usingCartesianGrid ) THEN |
1082 |
metricTerms = .FALSE. |
1083 |
useNHMTerms = .FALSE. |
1084 |
useBetaPlaneF = .TRUE. |
1085 |
ENDIF |
1086 |
IF ( usingCylindricalGrid ) THEN |
1087 |
useNHMTerms = .FALSE. |
1088 |
useBetaPlaneF = .TRUE. |
1089 |
WRITE(msgBuf,'(A)') 'S/R INI_PARMS ; Cylinder OK' |
1090 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
1091 |
& SQUEEZE_RIGHT, myThid ) |
1092 |
ENDIF |
1093 |
IF ( usingCurvilinearGrid ) THEN |
1094 |
metricTerms = .FALSE. |
1095 |
ENDIF |
1096 |
IF ( useConstantF ) useBetaPlaneF = .FALSE. |
1097 |
IF ( useConstantF ) useSphereF = .FALSE. |
1098 |
IF ( useBetaPlaneF ) useSphereF = .FALSE. |
1099 |
IF ( usingCartesianGrid .OR. usingCylindricalGrid |
1100 |
& .OR. .NOT.(nonHydrostatic.OR.quasiHydrostatic) ) |
1101 |
& use3dCoriolis = .FALSE. |
1102 |
|
1103 |
C-- Grid rotation |
1104 |
IF ( phiEuler .NE. 0. _d 0 .OR. thetaEuler .NE. 0. _d 0 |
1105 |
& .OR. psiEuler .NE. 0. _d 0 ) rotateGrid = .TRUE. |
1106 |
|
1107 |
C-- Set default for latitude-band where relaxation to climatology applies |
1108 |
C note: done later (once domain size is known) if using CartesianGrid |
1109 |
IF ( latBandClimRelax .EQ. UNSET_RL) THEN |
1110 |
IF ( usingSphericalPolarGrid ) latBandClimRelax= 180. _d 0 |
1111 |
IF ( usingCurvilinearGrid ) latBandClimRelax= 180. _d 0 |
1112 |
ENDIF |
1113 |
C-- set cell Center depth and put Interface at the middle between 2 C |
1114 |
setCenterDr = .FALSE. |
1115 |
DO K=1,Nr+1 |
1116 |
IF ( delRc(K).EQ.UNSET_RL ) THEN |
1117 |
IF ( setCenterDr ) THEN |
1118 |
WRITE(msgBuf,'(A,I4)') |
1119 |
& 'S/R INI_PARMS: No value for delRc at K =', K |
1120 |
CALL PRINT_ERROR( msgBuf, myThid ) |
1121 |
STOP 'ABNORMAL END: S/R INI_PARMS' |
1122 |
ENDIF |
1123 |
ELSE |
1124 |
IF ( k.EQ.1 ) setCenterDr = .TRUE. |
1125 |
IF ( .NOT.setCenterDr ) THEN |
1126 |
WRITE(msgBuf,'(A,I4)') |
1127 |
& 'S/R INI_PARMS: No value for delRc at K <', K |
1128 |
CALL PRINT_ERROR( msgBuf, myThid ) |
1129 |
STOP 'ABNORMAL END: S/R INI_PARMS' |
1130 |
ENDIF |
1131 |
ENDIF |
1132 |
ENDDO |
1133 |
IF ( setCenterDr ) rCoordInputData = .TRUE. |
1134 |
C-- p, z, r coord parameters |
1135 |
setInterFDr = .FALSE. |
1136 |
DO K = 1, Nr |
1137 |
IF ( delZ(K) .NE. UNSET_RL ) zCoordInputData = .TRUE. |
1138 |
IF ( delP(K) .NE. UNSET_RL ) pCoordInputData = .TRUE. |
1139 |
IF ( delR(K) .NE. UNSET_RL ) rCoordInputData = .TRUE. |
1140 |
IF ( delR(K) .EQ. UNSET_RL ) delR(K) = delZ(K) |
1141 |
IF ( delR(K) .EQ. UNSET_RL ) delR(K) = delP(K) |
1142 |
IF ( delR(K) .EQ. UNSET_RL ) THEN |
1143 |
IF ( setInterFDr ) THEN |
1144 |
WRITE(msgBuf,'(A,I4)') |
1145 |
& 'S/R INI_PARMS: No value for delZ/delP/delR at K =', K |
1146 |
CALL PRINT_ERROR( msgBuf, myThid ) |
1147 |
STOP 'ABNORMAL END: S/R INI_PARMS' |
1148 |
ENDIF |
1149 |
ELSE |
1150 |
IF ( k.EQ.1 ) setInterFDr = .TRUE. |
1151 |
IF ( .NOT.setInterFDr ) THEN |
1152 |
WRITE(msgBuf,'(A,I4)') |
1153 |
& 'S/R INI_PARMS: No value for delZ/delP/delR at K <', K |
1154 |
CALL PRINT_ERROR( msgBuf, myThid ) |
1155 |
STOP 'ABNORMAL END: S/R INI_PARMS' |
1156 |
ENDIF |
1157 |
ENDIF |
1158 |
ENDDO |
1159 |
C Check for multiple coordinate systems |
1160 |
coordsSet = 0 |
1161 |
IF ( zCoordInputData ) coordsSet = coordsSet + 1 |
1162 |
IF ( pCoordInputData ) coordsSet = coordsSet + 1 |
1163 |
IF ( rCoordInputData ) coordsSet = coordsSet + 1 |
1164 |
IF ( coordsSet .GT. 1 ) THEN |
1165 |
WRITE(msgBuf,'(A)') |
1166 |
& 'S/R INI_PARMS: Cannot mix z, p and r in the input data.' |
1167 |
CALL PRINT_ERROR( msgBuf, myThid ) |
1168 |
STOP 'ABNORMAL END: S/R INI_PARMS' |
1169 |
ENDIF |
1170 |
C- Check for double definition (file & namelist) |
1171 |
IF ( delRcFile.NE.' ' ) THEN |
1172 |
IF ( setCenterDr ) THEN |
1173 |
WRITE(msgBuf,'(A)') |
1174 |
& 'S/R INI_PARMS: Cannot set both delRc and delRcFile' |
1175 |
CALL PRINT_ERROR( msgBuf, myThid ) |
1176 |
STOP 'ABNORMAL END: S/R INI_PARMS' |
1177 |
ENDIF |
1178 |
setCenterDr = .TRUE. |
1179 |
ENDIF |
1180 |
IF ( delRFile.NE.' ' ) THEN |
1181 |
IF ( setInterFDr ) THEN |
1182 |
WRITE(msgBuf,'(A)') |
1183 |
& 'S/R INI_PARMS: Cannot set both delR and delRFile' |
1184 |
CALL PRINT_ERROR( msgBuf, myThid ) |
1185 |
STOP 'ABNORMAL END: S/R INI_PARMS' |
1186 |
ENDIF |
1187 |
setInterFDr = .TRUE. |
1188 |
ENDIF |
1189 |
c IF ( setInterFDr .AND. setCenterDr ) THEN |
1190 |
c WRITE(msgBuf,'(2A)') 'S/R INI_PARMS:', |
1191 |
c & ' Cannot specify both delRc and delZ/delP/delR' |
1192 |
c CALL PRINT_ERROR( msgBuf, myThid ) |
1193 |
c STOP 'ABNORMAL END: S/R INI_PARMS' |
1194 |
c ENDIF |
1195 |
|
1196 |
C-- Input files |
1197 |
WRITE(msgBuf,'(A)') 'S/R INI_PARMS ; starts to read PARM05' |
1198 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
1199 |
& SQUEEZE_RIGHT, myThid ) |
1200 |
READ(UNIT=iUnit,NML=PARM05) !,IOSTAT=errIO) |
1201 |
IF ( errIO .LT. 0 ) THEN |
1202 |
WRITE(msgBuf,'(A)') |
1203 |
& 'Error reading numerical model ' |
1204 |
CALL PRINT_ERROR( msgBuf, myThid ) |
1205 |
WRITE(msgBuf,'(A)') |
1206 |
& 'parameter file "data"' |
1207 |
CALL PRINT_ERROR( msgBuf, myThid ) |
1208 |
WRITE(msgBuf,'(A)') |
1209 |
& 'Problem in namelist PARM05' |
1210 |
CALL PRINT_ERROR( msgBuf, myThid ) |
1211 |
CALL MODELDATA_EXAMPLE( myThid ) |
1212 |
STOP 'ABNORMAL END: S/R INI_PARMS' |
1213 |
ELSE |
1214 |
WRITE(msgBuf,'(A)') 'S/R INI_PARMS ; read PARM05 : OK' |
1215 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
1216 |
& SQUEEZE_RIGHT, myThid ) |
1217 |
ENDIF |
1218 |
|
1219 |
C-- Set Units conversion factor required to incorporate |
1220 |
C surface forcing into z-p isomorphic equations: |
1221 |
C mass2rUnit: from mass per unit area [kg/m2] to r-coordinate (z:=1/rho;p:=g) |
1222 |
C rUnit2mass: from r-coordinate to mass per unit area [kg/m2] (z:=rho;p:=1/g) |
1223 |
IF ( usingPCoords ) THEN |
1224 |
mass2rUnit = gravity |
1225 |
rUnit2mass = recip_gravity |
1226 |
ELSE |
1227 |
mass2rUnit = recip_rhoConst |
1228 |
rUnit2mass = rhoConst |
1229 |
ENDIF |
1230 |
|
1231 |
c-- gradually replacing debugMode by debugLevel |
1232 |
IF ( debugMode ) debugLevel = debLevB |
1233 |
IF ( debugLevel .GE. debLevB ) debugMode = .TRUE. |
1234 |
|
1235 |
c-- flag for approximate adjoint |
1236 |
IF ( inAdExact ) THEN |
1237 |
inAdTrue = .FALSE. |
1238 |
inAdFALSE = .FALSE. |
1239 |
ELSE |
1240 |
inAdTrue = .TRUE. |
1241 |
inAdFALSE = .FALSE. |
1242 |
ENDIF |
1243 |
C |
1244 |
CLOSE(iUnit) |
1245 |
|
1246 |
C-- Check whether any retired parameters were found. |
1247 |
C-- Stop if they were |
1248 |
IF ( nRetired .GT. 0 ) THEN |
1249 |
WRITE(msgBuf,'(A)') |
1250 |
& 'Error reading parameter file "data"' |
1251 |
CALL PRINT_ERROR( msgBuf, myThid ) |
1252 |
WRITE(msgBuf,'(A)') |
1253 |
& 'some out of date parameters were found in the namelist' |
1254 |
CALL PRINT_ERROR( msgBuf, myThid ) |
1255 |
STOP 'ABNORMAL END: S/R INI_PARMS' |
1256 |
ENDIF |
1257 |
|
1258 |
_END_MASTER(myThid) |
1259 |
|
1260 |
C-- Everyone else must wait for the parameters to be loaded |
1261 |
_BARRIER |
1262 |
C |
1263 |
RETURN |
1264 |
END |