1 |
C $Header$ |
C $Header$ |
2 |
C $Name$ |
C $Name$ |
3 |
|
|
4 |
c #include "PACKAGES_CONFIG.h" |
#include "PACKAGES_CONFIG.h" |
5 |
#include "CPP_OPTIONS.h" |
#include "CPP_OPTIONS.h" |
6 |
|
|
7 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
20 |
#include "SIZE.h" |
#include "SIZE.h" |
21 |
#include "EEPARAMS.h" |
#include "EEPARAMS.h" |
22 |
#include "PARAMS.h" |
#include "PARAMS.h" |
23 |
|
#include "EOS.h" |
24 |
|
|
25 |
C !INPUT/OUTPUT PARAMETERS: |
C !INPUT/OUTPUT PARAMETERS: |
26 |
C myThid - Number of this instance of SET_PARMS |
C myThid :: My Thread Id number |
27 |
INTEGER myThid |
INTEGER myThid |
28 |
|
|
29 |
C !LOCAL VARIABLES: |
C !FUNCTIONS: |
|
CHARACTER*(MAX_LEN_MBUF) msgBuf |
|
|
c INTEGER IL, iUnit |
|
30 |
c INTEGER ILNBLNK |
c INTEGER ILNBLNK |
31 |
c EXTERNAL ILNBLNK |
c EXTERNAL ILNBLNK |
32 |
|
|
33 |
|
C !LOCAL VARIABLES: |
34 |
|
CHARACTER*(MAX_LEN_MBUF) msgBuf |
35 |
|
_RL tmpVar |
36 |
CEOP |
CEOP |
37 |
|
|
38 |
_BEGIN_MASTER(myThid) |
_BEGIN_MASTER(myThid) |
63 |
momImplVertAdv = momAdvection .AND. momImplVertAdv |
momImplVertAdv = momAdvection .AND. momImplVertAdv |
64 |
implicitViscosity= momViscosity .AND. implicitViscosity |
implicitViscosity= momViscosity .AND. implicitViscosity |
65 |
use3Dsolver = nonHydrostatic.OR. implicitIntGravWave |
use3Dsolver = nonHydrostatic.OR. implicitIntGravWave |
66 |
|
|
67 |
|
C-- Free-surface & pressure method |
68 |
|
IF ( selectNHfreeSurf.NE.0 .AND. |
69 |
|
& ( .NOT.nonHydrostatic .OR. usingPCoords |
70 |
|
& .OR. .NOT.exactConserv |
71 |
|
& ) ) THEN |
72 |
|
WRITE(msgBuf,'(2A)') '** WARNING ** SET_PARMS: ', |
73 |
|
& 'reset selectNHfreeSurf to zero' |
74 |
|
CALL PRINT_MESSAGE( msgBuf, errorMessageUnit, |
75 |
|
& SQUEEZE_RIGHT, myThid ) |
76 |
|
selectNHfreeSurf = 0 |
77 |
|
ENDIF |
78 |
C-- Set default Vorticity-Term Scheme: |
C-- Set default Vorticity-Term Scheme: |
79 |
IF ( vectorInvariantMomentum ) THEN |
IF ( vectorInvariantMomentum ) THEN |
80 |
IF ( selectVortScheme.EQ.UNSET_I ) THEN |
IF ( selectVortScheme.EQ.UNSET_I ) THEN |
85 |
ELSEIF ( selectVortScheme.NE.UNSET_I ) THEN |
ELSEIF ( selectVortScheme.NE.UNSET_I ) THEN |
86 |
WRITE(msgBuf,'(A,A)') '** WARNING ** SET_PARMS: ', |
WRITE(msgBuf,'(A,A)') '** WARNING ** SET_PARMS: ', |
87 |
& 'Vector-Invariant Momentum unused => ignore selectVortScheme' |
& 'Vector-Invariant Momentum unused => ignore selectVortScheme' |
88 |
CALL PRINT_MESSAGE( msgBuf, errorMessageUnit, SQUEEZE_RIGHT, 1 ) |
CALL PRINT_MESSAGE( msgBuf, errorMessageUnit, |
89 |
|
& SQUEEZE_RIGHT, myThid ) |
90 |
ENDIF |
ENDIF |
91 |
C-- Momentum viscosity on/off flag. |
C-- Momentum viscosity on/off flag. |
92 |
IF ( momViscosity ) THEN |
IF ( momViscosity ) THEN |
93 |
vfFacMom = 1.D0 |
vfFacMom = 1. _d 0 |
94 |
ELSE |
ELSE |
95 |
vfFacMom = 0.D0 |
vfFacMom = 0. _d 0 |
96 |
ENDIF |
ENDIF |
97 |
C-- Momentum advection on/off flag. |
C-- Momentum advection on/off flag. |
98 |
IF ( momAdvection ) THEN |
IF ( momAdvection ) THEN |
99 |
afFacMom = 1.D0 |
afFacMom = 1. _d 0 |
100 |
ELSE |
ELSE |
101 |
afFacMom = 0.D0 |
afFacMom = 0. _d 0 |
102 |
ENDIF |
ENDIF |
103 |
C-- Momentum forcing on/off flag. |
C-- Momentum forcing on/off flag. |
104 |
IF ( momForcing ) THEN |
IF ( momForcing ) THEN |
105 |
foFacMom = 1.D0 |
foFacMom = 1. _d 0 |
106 |
ELSE |
ELSE |
107 |
foFacMom = 0.D0 |
foFacMom = 0. _d 0 |
108 |
ENDIF |
ENDIF |
109 |
C-- Coriolis term on/off flag. |
C-- Coriolis term on/off flag. |
110 |
IF ( useCoriolis ) THEN |
IF ( useCoriolis ) THEN |
111 |
cfFacMom = 1.D0 |
cfFacMom = 1. _d 0 |
112 |
ELSE |
ELSE |
113 |
cfFacMom = 0.D0 |
cfFacMom = 0. _d 0 |
114 |
ENDIF |
ENDIF |
115 |
C-- Pressure term on/off flag. |
C-- Pressure term on/off flag. |
116 |
IF ( momPressureForcing ) THEN |
IF ( momPressureForcing ) THEN |
117 |
pfFacMom = 1.D0 |
pfFacMom = 1. _d 0 |
118 |
ELSE |
ELSE |
119 |
pfFacMom = 0.D0 |
pfFacMom = 0. _d 0 |
120 |
ENDIF |
ENDIF |
121 |
C-- Metric terms on/off flag. |
C-- Metric terms on/off flag. |
122 |
IF ( metricTerms ) THEN |
IF ( metricTerms ) THEN |
123 |
mTFacMom = 1.D0 |
mTFacMom = 1. _d 0 |
124 |
ELSE |
ELSE |
125 |
mTFacMom = 0.D0 |
mTFacMom = 0. _d 0 |
126 |
ENDIF |
ENDIF |
127 |
|
|
128 |
C-- Advection and Forcing for Temp and salt on/off flags |
C-- Advection and Forcing for Temp and salt on/off flags |
133 |
tempImplVertAdv = tempAdvection .AND. tempImplVertAdv |
tempImplVertAdv = tempAdvection .AND. tempImplVertAdv |
134 |
saltImplVertAdv = saltAdvection .AND. saltImplVertAdv |
saltImplVertAdv = saltAdvection .AND. saltImplVertAdv |
135 |
|
|
136 |
|
C-- Dynamically Active Tracers : set flags |
137 |
|
tempIsActiveTr = momPressureForcing .AND. tempAdvection |
138 |
|
saltIsActiveTr = momPressureForcing .AND. saltAdvection |
139 |
|
IF ( eosType.EQ.'IDEALGAS' .AND. atm_Rq.EQ.0. ) THEN |
140 |
|
saltIsActiveTr = .FALSE. |
141 |
|
ELSEIF ( eosType.EQ.'LINEAR' ) THEN |
142 |
|
IF ( tAlpha.EQ.0. ) tempIsActiveTr = .FALSE. |
143 |
|
IF ( sBeta .EQ.0. ) saltIsActiveTr = .FALSE. |
144 |
|
ENDIF |
145 |
|
|
146 |
C-- When using the dynamical pressure in EOS (with Z-coord.), |
C-- When using the dynamical pressure in EOS (with Z-coord.), |
147 |
C needs to activate specific part of the code (restart & exchange) |
C needs to activate specific part of the code (restart & exchange) |
148 |
c useDynP_inEos_Zc = .FALSE. |
c useDynP_inEos_Zc = .FALSE. |
149 |
useDynP_inEos_Zc = ( fluidIsWater .AND. usingZCoords |
useDynP_inEos_Zc = ( fluidIsWater .AND. usingZCoords |
150 |
& .AND. ( eosType .EQ. 'JMD95P' .OR. |
& .AND. ( eosType .EQ. 'JMD95P' .OR. |
151 |
& eosType .EQ. 'UNESCO' .OR. |
& eosType .EQ. 'UNESCO' .OR. |
152 |
& eosType .EQ. 'MDJWF' ) ) |
& eosType .EQ. 'MDJWF' .OR. |
153 |
|
& eosType .EQ. 'TEOS10' ) ) |
154 |
|
|
155 |
|
C-- Adjust parameters related to length of the simulation |
156 |
|
|
157 |
|
C- Need to adjust endTime for sub-timestep mismatch , since in |
158 |
|
C several places, test for last iteration with time==endTime : |
159 |
|
tmpVar = startTime + deltaTClock*FLOAT(nTimeSteps) |
160 |
|
IF ( endTime.NE.tmpVar ) THEN |
161 |
|
IF ( ABS(endTime-tmpVar).GT.deltaTClock*1. _d -6 ) THEN |
162 |
|
WRITE(msgBuf,'(A,A)') '** WARNING ** SET_PARMS: ', |
163 |
|
& '(endTime-baseTime) not multiple of time-step' |
164 |
|
CALL PRINT_MESSAGE( msgBuf, errorMessageUnit, |
165 |
|
& SQUEEZE_RIGHT, myThid ) |
166 |
|
WRITE(msgBuf,'(2A,1PE20.13)') '** WARNING ** SET_PARMS: ', |
167 |
|
& 'Previous endTime=', endTime |
168 |
|
CALL PRINT_MESSAGE( msgBuf, errorMessageUnit, |
169 |
|
& SQUEEZE_RIGHT, myThid ) |
170 |
|
WRITE(msgBuf,'(2A,1PE20.13)') '** WARNING ** SET_PARMS: ', |
171 |
|
& 'Adjusted endTime=', tmpVar |
172 |
|
CALL PRINT_MESSAGE( msgBuf, errorMessageUnit, |
173 |
|
& SQUEEZE_RIGHT, myThid ) |
174 |
|
ENDIF |
175 |
|
endTime = tmpVar |
176 |
|
ENDIF |
177 |
|
|
178 |
|
#ifdef ALLOW_LONGSTEP |
179 |
|
IF ( usePTRACERS ) THEN |
180 |
|
CALL LONGSTEP_CHECK_ITERS(myThid) |
181 |
|
ENDIF |
182 |
|
#endif /* ALLOW_LONGSTEP */ |
183 |
|
|
184 |
C-- After this point, main model parameters are not supposed to be modified. |
C-- After this point, main model parameters are not supposed to be modified. |
185 |
WRITE(msgBuf,'(A,A)') 'SET_PARMS: done' |
WRITE(msgBuf,'(A,A)') 'SET_PARMS: done' |