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