/[MITgcm]/MITgcm/model/inc/PARAMS.h
ViewVC logotype

Diff of /MITgcm/model/inc/PARAMS.h

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.3 by cnh, Sun Apr 26 23:41:54 1998 UTC revision 1.135 by jmc, Fri Oct 29 16:28:28 2004 UTC
# Line 1  Line 1 
1  C $Header$  C $Header$
2    C $Name$
3  C  C
4  C     /==========================================================\  
5  C     | PARAMS.h                                                 |  CBOP
6  C     | o Header file defining model "parameters".               |  C     !ROUTINE: PARAMS.h
7  C     |==========================================================|  C     !INTERFACE:
8  C     | The values from the model's standard input file are      |  C     #include PARAMS.h
9  C     | stored into the variables held here. Notes describing    |  
10  C     | the parameters can also be found here.                   |  C     !DESCRIPTION:
11  C     \==========================================================/  C     Header file defining model "parameters".  The values from the
12    C     model standard input file are stored into the variables held
13    C     here. Notes describing the parameters can also be found here.
14    
15    CEOP
16    
17    C     Macros for special grid options
18    #include "PARAMS_MACROS.h"
19    
20  C--   Contants  C--   Contants
 C     nOBands - No. of offline data time bands  
       INTEGER nOBands  
       PARAMETER ( nOBands = 12 )  
21  C     Useful physical values  C     Useful physical values
22        Real*8 PI        Real*8 PI
23        PARAMETER ( PI    = 3.14159265358979323844D0   )        PARAMETER ( PI    = 3.14159265358979323844D0   )
24        Real*8 deg2rad        Real*8 deg2rad
25        PARAMETER ( deg2rad = 2.D0*PI/360.D0           )        PARAMETER ( deg2rad = 2.D0*PI/360.D0           )
26    
27    C     Symbolic values
28    C     precXXXX :: Used to indicate what precision to use for
29    C                dumping model state.
30          INTEGER precFloat32
31          PARAMETER ( precFloat32 = 32 )
32          INTEGER precFloat64
33          PARAMETER ( precFloat64 = 64 )
34    C     UNSET_xxx :: Used to indicate variables that have not been given a value
35          Real*8 UNSET_FLOAT8
36          PARAMETER ( UNSET_FLOAT8 = 1.234567D5 )
37          Real*4 UNSET_FLOAT4
38          PARAMETER ( UNSET_FLOAT4 = 1.234567E5 )
39          _RL    UNSET_RL    
40          PARAMETER ( UNSET_RL     = 1.234567D5 )
41          _RS    UNSET_RS    
42          PARAMETER ( UNSET_RS     = 1.234567E5 )
43          INTEGER UNSET_I
44          PARAMETER ( UNSET_I      = 123456789  )
45    
46    C     Checkpoint data
47          INTEGER maxNoChkptLev
48          PARAMETER ( maxNoChkptLev = 2 )
49    
50  C--   COMMON /PARM_C/ Character valued parameters used by the model.  C--   COMMON /PARM_C/ Character valued parameters used by the model.
51  C     oBandId  - Offline dataset identifiers for different periods.  C     checkPtSuff :: List of checkpoint file suffices
52        COMMON /PARM_C/ oBandId  C     bathyFile   :: File containing bathymetry. If not defined bathymetry
53        CHARACTER*3 oBandId(nOBands)  C                   is taken from inline function.
54    C     topoFile    :: File containing the topography of the surface (unit=m)
55    C                   (mainly used for the atmosphere = ground height).
56    C     hydrogThetaFile :: File containing initial hydrographic data for potential
57    C                       temperature.
58    C     hydrogSaltFile  :: File containing initial hydrographic data for salinity.
59    C     zonalWindFile   :: File containing zonal wind data
60    C     meridWindFile   :: File containing meridional wind data
61    C     thetaClimFile   :: File containing theta climataology used
62    C                       in relaxation term -lambda(theta-theta*)
63    C     saltClimFile    :: File containing salt climataology used
64    C                       in relaxation term -lambda(salt-salt*)
65    C     surfQfile       :: File containing surface heat flux, excluding SW
66    C                        (old version, kept for backward compatibility)
67    C     surfQnetFile    :: File containing surface net heat flux
68    C     surfQswFile     :: File containing surface shortwave radiation
69    C     dQdTfile        :: File containing thermal relaxation coefficient
70    C     EmPmRfile       :: File containing surface fresh water flux
71    C     pLoadFile       :: File containing pressure loading
72    C     buoyancyRelation :: Flag used to indicate which relation to use to
73    C                        get buoyancy.
74    C     eosType         :: choose the equation of state:
75    C                        LINEAR, POLY3, UNESCO, JMD95Z, JMD95P, MDJWF, IDEALGAS
76    C     the_run_name    :: string identifying the name of the model "run"
77          COMMON /PARM_C/ checkPtSuff,
78         &                bathyFile, topoFile,
79         &                hydrogThetaFile, hydrogSaltFile,
80         &                zonalWindFile, meridWindFile, thetaClimFile,
81         &                saltClimFile, buoyancyRelation,
82         &                EmPmRfile, surfQfile, surfQnetFile, surfQswFile,
83         &                uVelInitFile, vVelInitFile, pSurfInitFile,
84         &                dQdTfile, ploadFile,
85         &                eosType, pickupSuff,
86         &                mdsioLocalDir,
87         &                the_run_name
88          CHARACTER*(5) checkPtSuff(maxNoChkptLev)
89          CHARACTER*(MAX_LEN_FNAM) bathyFile, topoFile
90          CHARACTER*(MAX_LEN_FNAM) hydrogThetaFile
91          CHARACTER*(MAX_LEN_FNAM) hydrogSaltFile
92          CHARACTER*(MAX_LEN_FNAM) zonalWindFile
93          CHARACTER*(MAX_LEN_FNAM) meridWindFile
94          CHARACTER*(MAX_LEN_FNAM) thetaClimFile
95          CHARACTER*(MAX_LEN_FNAM) saltClimFile
96          CHARACTER*(MAX_LEN_FNAM) surfQfile
97          CHARACTER*(MAX_LEN_FNAM) surfQnetFile
98          CHARACTER*(MAX_LEN_FNAM) surfQswFile
99          CHARACTER*(MAX_LEN_FNAM) EmPmRfile
100          CHARACTER*(MAX_LEN_FNAM) buoyancyRelation
101          CHARACTER*(MAX_LEN_FNAM) uVelInitFile
102          CHARACTER*(MAX_LEN_FNAM) vVelInitFile
103          CHARACTER*(MAX_LEN_FNAM) pSurfInitFile
104          CHARACTER*(MAX_LEN_FNAM) dQdTfile
105          CHARACTER*(MAX_LEN_FNAM) ploadFile
106          CHARACTER*(MAX_LEN_FNAM) mdsioLocalDir
107          CHARACTER*(MAX_LEN_FNAM) the_run_name
108          CHARACTER*(6) eosType
109          CHARACTER*(10) pickupSuff
110    
111  C--   COMMON /PARM_I/ Integer valued parameters used by the model.  C--   COMMON /PARM_I/ Integer valued parameters used by the model.
112  C     cg2dMaxIters        - Maximum number of iterations in the  C     cg2dMaxIters        :: Maximum number of iterations in the
113  C                           two-dimensional con. grad solver.  C                           two-dimensional con. grad solver.
114  C     cg2dChkResFreq      - Frequency with which to check residual  C     cg2dChkResFreq      :: Frequency with which to check residual
115    C                           in con. grad solver.
116    C     cg2dPreCondFreq     :: Frequency for updating cg2d preconditioner
117    C                            (non-linear free-surf.)
118    C     cg3dMaxIters        :: Maximum number of iterations in the
119    C                           three-dimensional con. grad solver.
120    C     cg3dChkResFreq      :: Frequency with which to check residual
121  C                           in con. grad solver.  C                           in con. grad solver.
122  C     nIter0              - Start time-step number of for this run  C     nIter0              :: Start time-step number of for this run
123  C     nTimeSteps          - Number of timesteps to execute  C     nTimeSteps          :: Number of timesteps to execute
124  C     numStepsPerPickup   - For offline setup. Frequency of pickup  C     numStepsPerPickup   :: For offline setup. Frequency of pickup
125  C                           of flow fields.  C                           of flow fields.
126    C     writeStatePrec      :: Precision used for writing model state.
127    C     writeBinaryPrec     :: Precision used for writing binary files
128    C     readBinaryPrec      :: Precision used for reading binary files
129    C     nCheckLev           :: Holds current checkpoint level
130    C     nonlinFreeSurf      :: option related to non-linear free surface
131    C                           =0 Linear free surface ; >0 Non-linear
132    C     select_rStar        :: option related to r* vertical coordinate
133    C                           =0 (default) use r coord. ; > 0 use r*
134    C     tempAdvScheme       :: Temp. Horiz.Advection scheme selector
135    C     tempVertAdvScheme   :: Temp. Vert. Advection scheme selector
136    C     saltAdvScheme       :: Salt. Horiz.advection scheme selector
137    C     saltVertAdvScheme   :: Salt. Vert. Advection scheme selector
138    C     debugLevel          :: debug level selector: higher -> more writing
139    
140        COMMON /PARM_I/        COMMON /PARM_I/
141       &        cg2dMaxIters,       &        cg2dMaxIters,
142       &        cg2dChkResFreq,       &        cg2dChkResFreq, cg2dPreCondFreq,
143       &        nIter0, nTimeSteps,       &        cg3dMaxIters,
144       &        numStepsPerPickup       &        cg3dChkResFreq,
145         &        nIter0, nTimeSteps, nEndIter,
146         &        numStepsPerPickup,
147         &        writeStatePrec, nCheckLev,
148         &        writeBinaryPrec, readBinaryPrec,
149         &        nonlinFreeSurf, select_rStar,
150         &        tempAdvScheme, tempVertAdvScheme,
151         &        saltAdvScheme, saltVertAdvScheme,
152         &        tracerAdvScheme,
153         &        debugLevel
154        INTEGER cg2dMaxIters        INTEGER cg2dMaxIters
155        INTEGER cg2dChkResFreq        INTEGER cg2dChkResFreq
156          INTEGER cg2dPreCondFreq
157          INTEGER cg3dMaxIters
158          INTEGER cg3dChkResFreq
159        INTEGER nIter0        INTEGER nIter0
160        INTEGER nTimeSteps        INTEGER nTimeSteps
161          INTEGER nEndIter
162        INTEGER numStepsPerPickup        INTEGER numStepsPerPickup
163          INTEGER writeStatePrec
164          INTEGER writeBinaryPrec
165          INTEGER readBinaryPrec
166          INTEGER nCheckLev
167          INTEGER nonlinFreeSurf
168          INTEGER select_rStar
169          INTEGER tempAdvScheme, tempVertAdvScheme
170          INTEGER saltAdvScheme, saltVertAdvScheme
171          INTEGER tracerAdvScheme
172          INTEGER debugLevel
173    
174    C
175          INTEGER debLevZero
176          PARAMETER(debLevZero=0)
177          INTEGER debLevA
178          PARAMETER(debLevA=1)
179          INTEGER debLevB
180          PARAMETER(debLevB=2)
181    
182  C--   COMMON /PARM_L/ Logical valued parameters used by the model.  C--   COMMON /PARM_L/ Logical valued parameters used by the model.
183  C     usingCartesianGrid - If TRUE grid generation will be in a cartesian  C     usingCartesianGrid :: If TRUE grid generation will be in a cartesian
184  C                          coordinate frame.  C                          coordinate frame.
185  C     usingSphericalPolarGrid - If TRUE grid generation will be in a  C     usingSphericalPolarGrid :: If TRUE grid generation will be in a
186  C                               spherical polar frame.  C                               spherical polar frame.
187  C     momViscosity  - Flag which turns momentum friction terms on and off.  C     usingCylindricalGrid :: If TRUE grid generation will be Cylindrical
188  C     momAdvection  - Flag which turns advection of momentum on and off.  C     no_slip_sides :: Impose "no-slip" at lateral boundaries.
189  C     momForcing    - Flag which turns external forcing of momentum on  C     no_slip_bottom :: Impose "no-slip" at bottom boundary.
190    C     staggerTimeStep :: enable a Stagger time stepping T,S Rho then U,V
191    C     momViscosity  :: Flag which turns momentum friction terms on and off.
192    C     momAdvection  :: Flag which turns advection of momentum on and off.
193    C     momForcing    :: Flag which turns external forcing of momentum on
194  C                     and off.  C                     and off.
195  C     useCoriolis   - Flag which turns the coriolis terms on and off.  C     momPressureForcing :: Flag which turns pressure term in momentum equation
196  C     tempDiffusion - Flag which turns diffusion of temperature on  C                          on and off.
197    C     metricTerms   :: Flag which turns metric terms on or off.
198    C     usingSphericalPolarMTerms :: If TRUE use spherical polar metric terms.
199    C     useNHMTerms :: If TRUE use non-hydrostatic metric terms.
200    C     useCoriolis   :: Flag which turns the coriolis terms on and off.
201    C     tempDiffusion :: Flag which turns diffusion of temperature on
202  C                     and off.  C                     and off.
203  C     tempAdvection - Flag which turns advection of temperature on  C     tempAdvection :: Flag which turns advection of temperature on
204  C                     and off.  C                     and off.
205  C     tempForcing   - Flag which turns external forcing of temperature on  C     tempForcing   :: Flag which turns external forcing of temperature on
206  C                     and off.  C                     and off.
207  C     saltDiffusion - Flag which turns diffusion of salinit on  C     saltDiffusion :: Flag which turns diffusion of salinity on
208  C                     and off.  C                     and off.
209  C     saltAdvection - Flag which turns advection of salinit on  C     saltAdvection :: Flag which turns advection of salinity on
210  C                     and off.  C                     and off.
211  C     saltForcing   - Flag which turns external forcing of salinit on  C     saltForcing   :: Flag which turns external forcing of salinity on
212  C                     and off.  C                     and off.
213    C     useRealFreshWaterFlux :: if True (=Natural BCS), treats P+R-E flux
214    C                         as a real Fresh Water (=> changes the Sea Level)
215    C                         if F, converts P+R-E to salt flux (no SL effect)
216    C     rigidLid            :: Set to true to use rigid lid
217    C     implicitFreeSurface :: Set to true to use implcit free surface
218    C     exactConserv        :: Set to true to conserve exactly the total Volume
219    C     uniformLin_PhiSurf  :: Set to true to use a uniform Bo_surf in the
220    C                           linear relation Phi_surf = Bo_surf*eta
221    C     momStepping   :: Turns momentum equation time-stepping off
222    C     tempStepping  :: Turns temperature equation time-stepping off
223    C     saltStepping  :: Turns salinity equation time-stepping off
224    C     useConstantF  :: Coriolis parameter set to f0
225    C     useBetaPlaneF :: Coriolis parameter set to f0 + beta.y
226    C     useSphereF    :: Coriolis parameter set to 2.omega.sin(phi)
227    C     useCDscheme   :: use CD-scheme to calculate Coriolis terms.
228    C     useJamartWetPoints :: Use wet-point method for Coriolis (Jamart and Ozer, 1986)
229    C     useJamartMomAdv :: Use wet-point method for V.I. non-linear term
230    C     SadournyCoriolis :: use the enstrophy conserving scheme by Sadourny
231    C     upwindVorticity :: bias interpolation of vorticity in the Coriolis term
232    C     highOrderVorticity :: use 3rd/4th order interp. of vorticity in Coriolis
233    C     useAbsVorticity :: work with f+zeta in Coriolis terms
234    C     implicitDiffusion :: Turns implicit vertical diffusion on
235    C     implicitViscosity :: Turns implicit vertical viscosity on
236    C     tempImplVertAdv :: Turns on implicit vertical advection for Temperature
237    C     saltImplVertAdv :: Turns on implicit vertical advection for Salinity
238    C     momImplVertAdv  :: Turns on implicit vertical advection for Momentum
239    C     multiDimAdvection :: Flag that enable multi-dimension advection
240    C     useMultiDimAdvec  :: True if multi-dim advection is used at least once
241    C     forcing_In_AB :: if False, put forcing (Temp,Salt,Tracers) contribution
242    C                      out off Adams-Bashforth time stepping.
243    C     doThetaClimRelax :: Set true if relaxation to temperature
244    C                        climatology is required.
245    C     doSaltClimRelax  :: Set true if relaxation to salinity
246    C                        climatology is required.
247    C     periodicExternalForcing :: Set true if forcing is time-dependant
248    C     usingPCoords     :: Set to indicate that we are working in a pressure
249    C                        type coordinate (p or p*).
250    C     usingZCoords     :: Set to indicate that we are working in a height
251    C                        type coordinate (z or z*)
252    C     fluidIsAir       :: Set to indicate that the fluid major constituent
253    C                        is air
254    C     fluidIsWater     :: Set to indicate that the fluid major constituent
255    C                        is water
256    C     useDynP_inEos_Zc :: use the dynamical pressure in EOS (with Z-coord.)
257    C                         this requires specific code for restart & exchange
258    C     setCenterDr    :: set cell Center depth and put Interface at the middle
259    C     nonHydrostatic :: Using non-hydrostatic terms
260    C     quasiHydrostatic :: Using non-hydrostatic terms in hydrostatic algorithm
261    C     globalFiles    :: Selects between "global" and "tiled" files
262    C     useSingleCpuIO :: On SGI platforms, option globalFiles is either
263    C                       slow (f77) or does not work (f90).  When
264    C                       useSingleCpuIO is set, mdsio_writefield.F
265    C                       outputs from master mpi process only.
266    C     allowFreezing  :: Allows surface water to freeze and form ice
267    C     useOldFreezing :: use the old version (before checkpoint52a_pre, 2003-11-12)
268    C     groundAtK1  :: put the surface(k=1) at the Lower Boundary (=ground)
269    C     pickup_write_mdsio :: use mdsio to write pickups
270    C     pickup_read_mdsio  :: use mdsio to read  pickups
271    C     pickup_write_immed :: echo the pickup immediately (for conversion)
272    C     timeave_mdsio      :: use mdsio for timeave output
273    C     snapshot_mdsio     :: use mdsio for "snapshot" (dumpfreq/diagfreq) output
274    C     monitor_stdio      :: use stdio for monitor output
275        COMMON /PARM_L/ usingCartesianGrid, usingSphericalPolarGrid,        COMMON /PARM_L/ usingCartesianGrid, usingSphericalPolarGrid,
276       & momViscosity, momAdvection, momForcing, useCoriolis,       & usingCurvilinearGrid, usingCylindricalGrid,
277         & no_slip_sides,no_slip_bottom,
278         & staggerTimeStep,
279         & momViscosity, momAdvection, momForcing, useCoriolis,
280         & momPressureForcing, vectorInvariantMomentum,
281       & tempDiffusion, tempAdvection, tempForcing,       & tempDiffusion, tempAdvection, tempForcing,
282       & saltDiffusion, saltAdvection, saltForcing       & saltDiffusion, saltAdvection, saltForcing,
283         & useRealFreshWaterFlux,
284         & rigidLid, implicitFreeSurface, exactConserv, uniformLin_PhiSurf,
285         & momStepping, tempStepping, saltStepping,
286         & metricTerms, usingSphericalPolarMTerms, useNHMTerms,
287         & useConstantF, useBetaPlaneF, useSphereF,
288         & useCDscheme,
289         & useEnergyConservingCoriolis, useJamartWetPoints, useJamartMomAdv,
290         & SadournyCoriolis, upwindVorticity, highOrderVorticity,
291         & useAbsVorticity,
292         & implicitDiffusion, implicitViscosity,
293         & tempImplVertAdv, saltImplVertAdv, momImplVertAdv,
294         & multiDimAdvection, useMultiDimAdvec, forcing_In_AB,
295         & doThetaClimRelax, doSaltClimRelax, doTr1ClimRelax,
296         & periodicExternalForcing,
297         & fluidIsAir, fluidIsWater,
298         & usingPCoords, usingZCoords, useDynP_inEos_Zc, setCenterDr,
299         & nonHydrostatic, quasiHydrostatic, globalFiles, useSingleCpuIO,
300         & allowFreezing, useOldFreezing, groundAtK1,
301         & usePickupBeforeC35, usePickupBeforeC54, debugMode,
302         & readPickupWithTracer, writePickupWithTracer,
303         & pickup_read_mdsio, pickup_write_mdsio, pickup_write_immed,
304         & timeave_mdsio, snapshot_mdsio, monitor_stdio,
305         & outputTypesInclusive
306    
307        LOGICAL usingCartesianGrid        LOGICAL usingCartesianGrid
308        LOGICAL usingSphericalPolarGrid        LOGICAL usingSphericalPolarGrid
309          LOGICAL usingCylindricalGrid
310          LOGICAL usingCurvilinearGrid
311          LOGICAL usingSphericalPolarMTerms
312          LOGICAL useNHMTerms
313          LOGICAL no_slip_sides
314          LOGICAL no_slip_bottom
315          LOGICAL staggerTimeStep
316        LOGICAL momViscosity        LOGICAL momViscosity
317        LOGICAL momAdvection        LOGICAL momAdvection
318        LOGICAL momForcing        LOGICAL momForcing
319          LOGICAL momPressureForcing
320        LOGICAL useCoriolis        LOGICAL useCoriolis
321          LOGICAL vectorInvariantMomentum
322        LOGICAL tempDiffusion        LOGICAL tempDiffusion
323        LOGICAL tempAdvection        LOGICAL tempAdvection
324        LOGICAL tempForcing        LOGICAL tempForcing
325        LOGICAL saltDiffusion        LOGICAL saltDiffusion
326        LOGICAL saltAdvection        LOGICAL saltAdvection
327        LOGICAL saltForcing        LOGICAL saltForcing
328          LOGICAL useRealFreshWaterFlux
329          LOGICAL rigidLid
330          LOGICAL implicitFreeSurface
331          LOGICAL exactConserv
332          LOGICAL uniformLin_PhiSurf
333          LOGICAL momStepping
334          LOGICAL tempStepping
335          LOGICAL saltStepping
336          LOGICAL metricTerms
337          LOGICAL useConstantF
338          LOGICAL useBetaPlaneF
339          LOGICAL useSphereF
340          LOGICAL useCDscheme
341          LOGICAL useEnergyConservingCoriolis
342          LOGICAL useJamartWetPoints
343          LOGICAL useJamartMomAdv
344          LOGICAL SadournyCoriolis
345          LOGICAL upwindVorticity
346          LOGICAL highOrderVorticity
347          LOGICAL useAbsVorticity
348          LOGICAL implicitDiffusion
349          LOGICAL implicitViscosity
350          LOGICAL tempImplVertAdv
351          LOGICAL saltImplVertAdv
352          LOGICAL momImplVertAdv
353          LOGICAL multiDimAdvection
354          LOGICAL useMultiDimAdvec
355          LOGICAL forcing_In_AB
356          LOGICAL doThetaClimRelax
357          LOGICAL doSaltClimRelax
358          LOGICAL doTr1ClimRelax
359          LOGICAL periodicExternalForcing
360          LOGICAL fluidIsAir
361          LOGICAL fluidIsWater
362          LOGICAL usingPCoords
363          LOGICAL usingZCoords
364          LOGICAL useDynP_inEos_Zc
365          LOGICAL setCenterDr
366          LOGICAL nonHydrostatic
367          LOGICAL quasiHydrostatic
368          LOGICAL globalFiles
369          LOGICAL useSingleCpuIO
370          LOGICAL allowFreezing
371          LOGICAL useOldFreezing
372          LOGICAL groundAtK1
373          LOGICAL usePickupBeforeC35
374          LOGICAL usePickupBeforeC54
375          LOGICAL debugMode
376          LOGICAL readPickupWithTracer
377          LOGICAL writePickupWithTracer
378          LOGICAL pickup_read_mdsio, pickup_write_mdsio
379          LOGICAL pickup_write_immed
380          LOGICAL timeave_mdsio, snapshot_mdsio, monitor_stdio
381          LOGICAL outputTypesInclusive
382    
383  C--   COMMON /PARM_R/ "Real" valued parameters used by the model.  C--   COMMON /PARM_R/ "Real" valued parameters used by the model.
384  C     cg2dTargetResidual  C     cg2dTargetResidual
385  C               - Target residual for cg2d solver.  C          :: Target residual for cg2d solver; no unit (RHS normalisation)
386  C     delZ      - Vertical grid spacing ( m ) - delZ is the distance  C     cg2dTargetResWunit
387  C                 between "w" surfaces.  C          :: Target residual for cg2d solver; W unit (No RHS normalisation)
388  C     delX      - Separation between cell faces (m) or (deg), depending  C     cg3dTargetResidual
389    C               :: Target residual for cg3d solver.
390    C     cg2dpcOffDFac :: Averaging weight for preconditioner off-diagonal.
391    C     Note. 20th May 1998
392    C           I made a weird discovery! In the model paper we argue
393    C           for the form of the preconditioner used here ( see
394    C           A Finite-volume, Incompressible Navier-Stokes Model
395    C           ...., Marshall et. al ). The algebra gives a simple
396    C           0.5 factor for the averaging of ac and aCw to get a
397    C           symmettric pre-conditioner. By using a factor of 0.51
398    C           i.e. scaling the off-diagonal terms in the
399    C           preconditioner down slightly I managed to get the
400    C           number of iterations for convergence in a test case to
401    C           drop form 192 -> 134! Need to investigate this further!
402    C           For now I have introduced a parameter cg2dpcOffDFac which
403    C           defaults to 0.51 but can be set at runtime.
404    C     delR      :: Vertical grid spacing ( units of r ).
405    C     delRc     :: Vertical grid spacing between cell centers (r unit).
406    C     delX      :: Separation between cell faces (m) or (deg), depending
407  C     delY        on input flags.  C     delY        on input flags.
408  C     gravity   - Accel. due to gravity ( m/s^2 )  C     gravity   :: Accel. due to gravity ( m/s^2 )
409  C     ronil     - Reference density  C     recip_gravity and its inverse
410  C     startTime - Start time for model ( s )  C     gBaro     :: Accel. due to gravity used in barotropic equation ( m/s^2 )
411  C     phiMin    - Latitude of southern most cell face.  C     rhoNil    :: Reference density for the linear equation of state
412  C     thetaMin  - Longitude of western most cell face (this  C     rhoConst  :: Vertically constant reference density
413    C     rhoConstFresh :: Constant reference density for fresh water (rain)
414    C     tRef      :: reference vertical profile for potential temperature
415    C     sRef      :: reference vertical profile for salinity/specific humidity
416    C     startTime :: Start time for model ( s )
417    C     phiMin    :: Latitude of southern most cell face.
418    C     thetaMin  :: Longitude of western most cell face (this
419  C                 is an "inert" parameter but it is included  C                 is an "inert" parameter but it is included
420  C                 to make geographical references simple.)  C                 to make geographical references simple.)
421  C     rSphere   - Radius of sphere for a spherical polar grid ( m ).  C     rSphere   :: Radius of sphere for a spherical polar grid ( m ).
422  C     f0        - Reference coriolis parameter ( 1/s )  C     recip_RSphere  :: Reciprocal radius of sphere ( m ).
423    C     f0        :: Reference coriolis parameter ( 1/s )
424  C                 ( Southern edge f for beta plane )  C                 ( Southern edge f for beta plane )
425  C     beta      - df/dy ( s^-1.m^-1 )  C     beta      :: df/dy ( s^-1.m^-1 )
426  C     viscAh    - Eddy viscosity coeff. for mixing of  C     omega     :: Angular velocity ( rad/s )
427    C     rotationPeriod :: Rotation period (s) (= 2.pi/omega)
428    C     viscAh    :: Eddy viscosity coeff. for mixing of
429  C                 momentum laterally ( m^2/s )  C                 momentum laterally ( m^2/s )
430  C     viscAz    - Eddy viscosity coeff. for mixing of  C     viscAhW   :: Eddy viscosity coeff. for mixing of vertical
431  C                 momentum vertically ( m^2/s )  C                 momentum laterally, no effect for hydrostatic
432  C     viscA4    - Biharmonic viscosity coeff. for mixing of  C                 model, defaults to viscAh if unset ( m^2/s )
433    C     viscAr    :: Eddy viscosity coeff. for mixing of
434    C                 momentum vertically ( units of r^2/s )
435    C     viscA4    :: Biharmonic viscosity coeff. for mixing of
436  C                 momentum laterally ( m^4/s )  C                 momentum laterally ( m^4/s )
437  C     diffKhT   - Laplacian diffusion coeff. for mixing of  C     viscAhD   :: Eddy viscosity coeff. for mixing of momentum laterally
438    C                  (act on Divergence part) ( m^2/s )
439    C     viscAhZ   :: Eddy viscosity coeff. for mixing of momentum laterally
440    C                  (act on Vorticity  part) ( m^2/s )
441    C     viscA4D   :: Biharmonic viscosity coeff. for mixing of momentum laterally
442    C                  (act on Divergence part) ( m^4/s )
443    C     viscA4Z   :: Biharmonic viscosity coeff. for mixing of momentum laterally
444    C                  (act on Vorticity  part) ( m^4/s )
445    C     viscC2leith :: Leith non-dimensional viscosity factor
446    C     viscAhMax :: Maximum eddy viscosity coeff. for mixing of
447    C                 momentum laterally ( m^2/s )
448    C     viscA4Max :: Maximum biharmonic viscosity coeff. for mixing of
449    C                 momentum laterally ( m^4/s )
450    C     viscAhGrid:: non-dimensional grid-size dependent viscosity
451    C     viscA4Grid:: non-dimensional grid-size dependent bi-harmonic viscosity
452    C     viscC4leith :: Leith non-dimensional viscosity factor
453    C     diffKhT   :: Laplacian diffusion coeff. for mixing of
454  C                 heat laterally ( m^2/s )  C                 heat laterally ( m^2/s )
455  C     diffKzT   - Laplacian diffusion coeff. for mixing of  C     diffKrNrT :: vertical profile of Laplacian diffusion coeff.
456  C                 heat vertically ( m^2/s )  C                 for mixing of heat vertically ( units of r^2/s )
457  C     diffK4T   - Biharmonic diffusion coeff. for mixing of  C     diffK4T   :: Biharmonic diffusion coeff. for mixing of
458  C                 heat laterally ( m^4/s )  C                 heat laterally ( m^4/s )
459  C     diffKhS  -  Laplacian diffusion coeff. for mixing of  C     diffKhS  ::  Laplacian diffusion coeff. for mixing of
460  C                 salt laterally ( m^2/s )  C                 salt laterally ( m^2/s )
461  C     diffKzS   - Laplacian diffusion coeff. for mixing of  C     diffKrNrS :: vertical profile of Laplacian diffusion coeff.
462  C                 salt vertically ( m^2/s )  C                 for mixing of salt vertically ( units of r^2/s ),
463  C     diffK4S   - Biharmonic diffusion coeff. for mixing of  C     diffK4S   :: Biharmonic diffusion coeff. for mixing of
464  C                 salt laterally ( m^4/s )  C                 salt laterally ( m^4/s )
465  C     deltaT    - Default timestep ( s )  C     diffKrBL79surf :: T/S surface diffusivity (m^2/s) Bryan and Lewis, 1979
466  C     deltaTMom    - Timestep for momemtum equations ( s )  C     diffKrBL79deep :: T/S deep diffusivity (m^2/s) Bryan and Lewis, 1979
467  C     deltaTtracer - Timestep for tracer equations ( s )  C     diffKrBL79scl  :: depth scale for arctan fn (m) Bryan and Lewis, 1979
468  C     tauCD     - CD scheme coupling timescale ( 1/s )  C     diffKrBL79Ho   :: depth offset for arctan fn (m) Bryan and Lewis, 1979
469  C     rCD       - CD scheme normalised coupling parameter ( 0-1 )  C     deltaT    :: Default timestep ( s )
470  C     startTime - Starting time for this integration ( s ).  C     deltaTClock  :: Timestep used as model "clock". This determines the
471  C     endTime   - Ending time for this integration ( s ).  C                    IO frequencies and is used in tagging output. It can
472  C     chkPtFreq - Frequency of check pointing ( s ).  C                    be totally different to the dynamical time. Typically
473  C     dumpFreq  - Frequency with which model state is written to  C                    it will be the deep-water timestep for accelerated runs.
474  C                 post-processing files ( s ).  C                    Frequency of checkpointing and dumping of the model state
475        COMMON /PARM_R/ cg2dTargetResidual, delZ, delX, delY, deltaT,  C                    are referenced to this clock. ( s )
476       & deltaTmom, deltaTtracer, abeps, startTime, phiMin, thetaMin,  C     deltaTMom    :: Timestep for momemtum equations ( s )
477       & rSphere, f0, fCori, beta, viscAh, viscAz, viscA4, diffKhT, diffKzT,  C     deltaTtracer :: Timestep for tracer equations ( s )
478       & diffK4T, diffKhS, diffKzS, diffK4S, delT, tauCD, rCD,  C     deltaTfreesurf :: Timestep for free-surface equation ( s )
479       & tAlpha, sBeta, gravity, rhonil, tRef, sRef,  C     freesurfFac  :: Parameter to turn implicit free surface term on or off
480       & endTime, chkPtFreq, dumpFreq  C                    freesurfac = 1. uses implicit free surface
481        REAL cg2dTargetResidual  C                    freesurfac = 0. uses rigid lid
482        REAL delZ(Nz)  C     implicSurfPress :: parameter of the Crank-Nickelson time stepping :
483        REAL delX(Nx)  C                     Implicit part of Surface Pressure Gradient ( 0-1 )
484        REAL delY(Ny)  C     implicDiv2Dflow :: parameter of the Crank-Nickelson time stepping :
485        REAL deltaT  C                     Implicit part of barotropic flow Divergence ( 0-1 )
486        REAL deltaTmom  C     hFacMin      :: Minimum fraction size of a cell (affects hFacC etc...)
487        REAL deltaTtracer  C     hFacMinDz    :: Minimum dimesional size of a cell (affects hFacC etc..., m)
488        REAL abeps  C     hFacMinDp    :: Minimum dimesional size of a cell (affects hFacC etc..., Pa)
489        REAL phiMin  C     hFacMinDr    :: Minimum dimesional size of a cell (affects hFacC etc..., units of r)
490        REAL thetaMin  C     hFacInf      :: Threshold (inf and sup) for fraction size of surface cell
491        REAL rSphere  C     hFacSup        that control vanishing and creating levels
492        REAL f0  C     tauCD        :: CD scheme coupling timescale ( 1/s )
493        _RL  beta  C     rCD          :: CD scheme normalised coupling parameter ( 0-1 )
494        REAL viscAh  C     startTime     :: Starting time for this integration ( s ).
495        REAL viscAz  C     endTime       :: Ending time for this integration ( s ).
496        REAL viscA4  C     chkPtFreq     :: Frequency of rolling check pointing ( s ).
497        REAL diffKhT  C     pChkPtFreq    :: Frequency of permanent check pointing ( s ).
498        REAL diffKzT  C     dumpFreq      :: Frequency with which model state is written to
499        REAL diffK4T  C                     post-processing files ( s ).
500        REAL diffKhS  C     diagFreq      :: Frequency with which model writes diagnostic output
501        REAL diffKzS  C                     of intermediate quantities.
502        REAL diffK4S  C     afFacMom      :: Advection of momentum term tracer parameter
503        REAL delt  C     vfFacMom      :: Momentum viscosity tracer parameter
504        REAL tauCD  C     pfFacMom      :: Momentum pressure forcing tracer parameter
505        REAL rCD  C     cfFacMom      :: Coriolis term tracer parameter
506        REAL tAlpha  C     foFacMom      :: Momentum forcing tracer parameter
507        REAL sBeta  C     mtFacMom      :: Metric terms tracer parameter
508        REAL gravity  C     cosPower      :: Power of cosine of latitude to multiply viscosity
509        REAL rhonil  C     cAdjFreq      :: Frequency of convective adjustment
510        REAL tRef(Nz)  C
511        REAL sRef(Nz)  C     taveFreq      :: Frequency with which time-averaged model state
512        real Fcori(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)  C                      is written to post-processing files ( s ).
513        REAL startTime  C     tave_lastIter :: (for state variable only) fraction of the last time
514        REAL endTime  C                      step (of each taveFreq period) put in the time average.
515        REAL chkPtFreq  C                      (fraction for 1rst iter = 1 - tave_lastIter)
516        REAL dumpFreq  C     tauThetaClimRelax :: Relaxation to climatology time scale ( s ).
517        COMMON /PARM_A/ HeatCapacity_Cp,  C     lambdaThetaClimRelax :: Inverse time scale for relaxation ( 1/s ).
518       &                Lamba_theta  C     tauSaltClimRelax :: Relaxation to climatology time scale ( s ).
519        REAL HeatCapacity_Cp  C     lambdaSaltClimRelax :: Inverse time scale for relaxation ( 1/s ).
520        REAL Lamba_theta  C     latBandClimRelax :: latitude band where Relaxation to Clim. is applied,
521    C                         i.e. where |yC| <= latBandClimRelax
522    C     externForcingPeriod :: Is the period of which forcing varies (eg. 1 month)
523    C     externForcingCycle :: Is the repeat time of the forcing (eg. 1 year)
524    C                          (note: externForcingCycle must be an integer
525    C                           number times externForcingPeriod)
526    C     convertFW2Salt :: salinity, used to convert Fresh-Water Flux to Salt Flux
527    C                       (use model surface (local) value if set to -1)
528    C     temp_EvPrRn :: temperature of Rain & Evap.
529    C     salt_EvPrRn :: salinity of Rain & Evap.
530    C     trac_EvPrRn :: tracer concentration in Rain & Evap.
531    C        (notes: a) tracer content of Rain/Evap only used if both
532    C                     NonLin_FrSurf & useRealFreshWater are set.
533    C                b) use model surface (local) value if set to UNSET_RL)
534    C     horiVertRatio      :: Ratio on units in vertical to units in horizontal.
535    C     recip_horiVertRatio  ( 1 if horiz in m and vertical in m ).
536    C                          ( g*rho if horiz in m and vertical in Pa ).
537    C     Ro_SeaLevel        :: standard position of Sea-Level in "R" coordinate, used as
538    C                          starting value (k=1) for vertical coordinate (rf(1)=Ro_SeaLevel)
539    C     bottomDragLinear   :: Drag coefficient built in to core dynamics
540    C      --"-"--  Quadratic  ( linear: 1/s, quadratic: 1/m )
541          COMMON /PARM_R/ cg2dTargetResidual, cg2dTargetResWunit,
542         & cg2dpcOffDFac, cg3dTargetResidual,
543         & delR, delRc, delX, delY,
544         & deltaT, deltaTmom, deltaTtracer, deltaTfreesurf, deltaTClock,
545         & abeps, startTime,
546         & phiMin, thetaMin, rSphere, recip_RSphere, f0, beta,
547         & fCori, fCoriG, fCoriCos,
548         & viscAh, viscAhW, viscAhMax, viscAhGrid, viscC2leith,
549         & viscAhD, viscAhZ, viscA4D, viscA4Z,
550         & viscA4,  viscA4Max, viscA4Grid, viscC4leith,
551         & viscAr, viscAstrain, viscAtension,
552         & diffKhT, diffK4T, diffKrNrT,
553         & diffKhS, diffK4S, diffKrNrS,
554         & diffKrBL79surf, diffKrBL79deep, diffKrBL79scl, diffKrBL79Ho,
555         & delT, tauCD, rCD, freeSurfFac, implicSurfPress, implicDiv2Dflow,
556         & hFacMin, hFacMinDz, hFacInf, hFacSup,
557         & gravity, recip_Gravity, gBaro, rhonil, recip_rhonil,
558         & recip_rhoConst, rhoConst,
559         & rhoConstFresh, convertEmP2rUnit, tRef, sRef,
560         & endTime, chkPtFreq, pchkPtFreq, dumpFreq, adjDumpFreq,
561         & diagFreq, taveFreq, tave_lastIter, monitorFreq,
562         & afFacMom, vfFacMom, pfFacMom, cfFacMom, foFacMom, mtFacMom,
563         & cosPower, cAdjFreq, omega, rotationPeriod,
564         & tauThetaClimRelax, lambdaThetaClimRelax,
565         & tauSaltClimRelax, lambdaSaltClimRelax,
566         & tauTr1ClimRelax, lambdaTr1ClimRelax, latBandClimRelax,
567         & externForcingCycle, externForcingPeriod,
568         & convertFW2Salt, temp_EvPrRn, salt_EvPrRn, trac_EvPrRn,
569         & hFacMinDr, hFacMinDp,
570         & horiVertRatio, recip_horiVertRatio,
571         & ivdc_kappa, Ro_SeaLevel,
572         & bottomDragLinear,bottomDragQuadratic,
573         & tCyl
574    
575          _RL cg2dTargetResidual
576          _RL cg2dTargetResWunit
577          _RL cg3dTargetResidual
578          _RL cg2dpcOffDFac
579          _RL delR(Nr)
580          _RL delRc(Nr+1)
581          _RL delX(Nx)
582          _RL delY(Ny)
583          _RL deltaT
584          _RL deltaTClock
585          _RL deltaTmom
586          _RL deltaTtracer
587          _RL deltaTfreesurf
588          _RL abeps
589          _RL phiMin
590          _RL thetaMin
591          _RL rSphere
592          _RL recip_RSphere
593          _RL f0
594          _RL freeSurfFac
595          _RL implicSurfPress
596          _RL implicDiv2Dflow
597          _RL hFacMin
598          _RL hFacMinDz
599          _RL hFacMinDp
600          _RL hFacMinDr
601          _RL hFacInf
602          _RL hFacSup
603          _RL beta
604          _RL viscAh
605          _RL viscAhW
606          _RL viscAhD
607          _RL viscAhZ
608          _RL viscAhMax
609          _RL viscAhGrid
610          _RL viscC2leith
611          _RL viscAstrain
612          _RL viscAtension
613          _RL viscAr
614          _RL viscA4
615          _RL viscA4D
616          _RL viscA4Z
617          _RL viscA4Max
618          _RL viscA4Grid
619          _RL viscC4leith
620          _RL diffKhT
621          _RL diffKrNrT(Nr)
622          _RL diffK4T
623          _RL diffKhS
624          _RL diffKrNrS(Nr)
625          _RL diffK4S
626          _RL diffKrBL79surf
627          _RL diffKrBL79deep
628          _RL diffKrBL79scl
629          _RL diffKrBL79Ho
630          _RL delt
631          _RL tauCD
632          _RL rCD
633          _RL gravity
634          _RL recip_gravity
635          _RL gBaro
636          _RL rhonil
637          _RL recip_rhonil
638          _RL rhoConst
639          _RL recip_rhoConst
640          _RL rhoConstFresh
641          _RL convertEmP2rUnit
642          _RL tRef(Nr)
643          _RL sRef(Nr)
644          _RS fCori(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
645          _RS fCoriG(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
646          _RS fCoriCos(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
647          _RL startTime
648          _RL endTime
649          _RL chkPtFreq
650          _RL pChkPtFreq
651          _RL dumpFreq
652          _RL adjDumpFreq
653          _RL diagFreq
654          _RL taveFreq
655          _RL tave_lastIter
656          _RL monitorFreq
657          _RL afFacMom
658          _RL vfFacMom
659          _RL pfFacMom
660          _RL cfFacMom
661          _RL foFacMom
662          _RL mTFacMom
663          _RL cosPower
664          _RL cAdjFreq
665          _RL omega
666          _RL rotationPeriod
667          _RL tauThetaClimRelax
668          _RL lambdaThetaClimRelax
669          _RL tauSaltClimRelax
670          _RL lambdaSaltClimRelax
671          _RL tauTr1ClimRelax
672          _RL lambdaTr1ClimRelax
673          _RL latBandClimRelax
674          _RL externForcingCycle
675          _RL externForcingPeriod
676          _RL convertFW2Salt
677          _RL temp_EvPrRn
678          _RL salt_EvPrRn
679          _RL trac_EvPrRn
680          _RL horiVertRatio
681          _RL recip_horiVertRatio
682          _RL ivdc_kappa
683          _RL Ro_SeaLevel
684          _RL bottomDragLinear
685          _RL bottomDragQuadratic
686          _RL tCyl
687    
688    C--   COMMON /PARM_A/ Thermodynamics constants ?
689          COMMON /PARM_A/ HeatCapacity_Cp,recip_Cp
690          _RL HeatCapacity_Cp
691          _RL recip_Cp
692    
693    C--   COMMON /PARM_ATM/ Atmospheric physical parameters (Ideal Gas EOS, ...)
694    C     celsius2K :: convert centigrade (Celsius) degree to Kelvin
695    C     atm_Po    :: standard reference pressure
696    C     atm_Cp    :: specific heat (Cp) of the (dry) air at constant pressure
697    C     atm_Rd    :: gas constant for dry air
698    C     atm_kappa :: kappa = R/Cp (R: constant of Ideal Gas EOS)
699    C     atm_Rq    :: water vapour specific volume anomaly relative to dry air
700    C                  (e.g. typical value = (29/18 -1) 10^-3 with q [g/kg])
701    C     integr_GeoPot :: option to select the way we integrate the geopotential
702    C                     (still a subject of discussions ...)
703    C     selectFindRoSurf :: select the way surf. ref. pressure (=Ro_surf) is
704    C             derived from the orography. Implemented: 0,1 (see INI_P_GROUND)
705          COMMON /PARM_ATM/
706         &            celsius2K,
707         &            atm_Cp, atm_Rd, atm_kappa, atm_Rq, atm_Po,
708         &            integr_GeoPot, selectFindRoSurf
709          _RL celsius2K
710          _RL atm_Po, atm_Cp, atm_Rd, atm_kappa, atm_Rq
711          INTEGER integr_GeoPot, selectFindRoSurf
712    
713    C Logical flags for selecting packages
714          LOGICAL useOPPS
715          LOGICAL usePP81
716          LOGICAL useMY82
717          LOGICAL useGGL90
718          LOGICAL useKPP
719          LOGICAL useGMRedi
720          LOGICAL useOBCS
721          LOGICAL useAIM
722          LOGICAL useLand
723          LOGICAL useGrdchk
724          LOGICAL useECCO
725          LOGICAL useSHAP_FILT
726          LOGICAL useZONAL_FILT
727          LOGICAL useFLT
728          LOGICAL usePTRACERS
729          LOGICAL useSBO
730          LOGICAL useSEAICE
731          LOGICAL useBulkForce
732          LOGICAL useThSIce
733          LOGICAL usefizhi
734          LOGICAL usegridalt
735          LOGICAL usediagnostics
736          LOGICAL useEBM
737          LOGICAL useMNC
738          COMMON /PARM_PACKAGES/
739         &        useKPP, useGMRedi, useOBCS, useAIM, useLand, useECCO,
740         &        useSHAP_FILT, useZONAL_FILT, useGrdchk, useFLT,
741         &        usePTRACERS,  useSBO, useSEAICE, useThSIce, useBulkForce,
742         &        usefizhi,  usegridalt, usediagnostics, useEBM, useMNC,
743         &        usePP81, useMY82, useOPPS, useGGL90
744    
745    CEH3 ;;; Local Variables: ***
746    CEH3 ;;; mode:fortran ***
747    CEH3 ;;; End: ***

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.135

  ViewVC Help
Powered by ViewVC 1.1.22