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