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