1 |
C $Header: /u/gcmpack/MITgcm/model/src/set_parms.F,v 1.1 2006/03/17 16:12:55 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: SET_PARMS |
10 |
C !INTERFACE: |
11 |
SUBROUTINE SET_PARMS( myThid ) |
12 |
|
13 |
C !DESCRIPTION: |
14 |
C Set model "parameters" that might depend on the use of some pkgs; |
15 |
C called from INITIALISE_FIXED, after INI_PARMS & PACKAGES_READPARAMS |
16 |
C NOTES: After leaving this S/R, parameters will not change anymore. |
17 |
|
18 |
C !USES: |
19 |
IMPLICIT NONE |
20 |
#include "SIZE.h" |
21 |
#include "EEPARAMS.h" |
22 |
#include "PARAMS.h" |
23 |
|
24 |
C !INPUT/OUTPUT PARAMETERS: |
25 |
C myThid - Number of this instance of SET_PARMS |
26 |
INTEGER myThid |
27 |
|
28 |
C !LOCAL VARIABLES: |
29 |
CHARACTER*(MAX_LEN_MBUF) msgBuf |
30 |
c INTEGER IL, iUnit |
31 |
c INTEGER ILNBLNK |
32 |
c EXTERNAL ILNBLNK |
33 |
|
34 |
CEOP |
35 |
|
36 |
_BEGIN_MASTER(myThid) |
37 |
|
38 |
IF ( useOffLine ) THEN |
39 |
WRITE(msgBuf,'(A,A)') 'S/R SET_PARMS: ', |
40 |
& ' Off-Line => turn off Temp,Salt & Mom_Stepping flags' |
41 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
42 |
& SQUEEZE_RIGHT , 1) |
43 |
tempStepping = .FALSE. |
44 |
saltStepping = .FALSE. |
45 |
momStepping = .FALSE. |
46 |
ENDIF |
47 |
|
48 |
C-- Set (or reset) On/Off flags : |
49 |
|
50 |
C-- On/Off flags for each terms of the momentum equation |
51 |
nonHydrostatic = momStepping .AND. nonHydrostatic |
52 |
quasiHydrostatic = momStepping .AND. quasiHydrostatic |
53 |
momAdvection = momStepping .AND. momAdvection |
54 |
momViscosity = momStepping .AND. momViscosity |
55 |
momForcing = momStepping .AND. momForcing |
56 |
useCoriolis = momStepping .AND. useCoriolis |
57 |
use3dCoriolis= useCoriolis .AND. use3dCoriolis |
58 |
useCDscheme = momStepping .AND. useCDscheme |
59 |
momPressureForcing= momStepping .AND. momPressureForcing |
60 |
implicitIntGravWave=momPressureForcing .AND. implicitIntGravWave |
61 |
momImplVertAdv = momAdvection .AND. momImplVertAdv |
62 |
implicitViscosity= momViscosity .AND. implicitViscosity |
63 |
use3Dsolver = nonHydrostatic.OR. implicitIntGravWave |
64 |
C-- Momentum viscosity on/off flag. |
65 |
IF ( momViscosity ) THEN |
66 |
vfFacMom = 1.D0 |
67 |
ELSE |
68 |
vfFacMom = 0.D0 |
69 |
ENDIF |
70 |
C-- Momentum advection on/off flag. |
71 |
IF ( momAdvection ) THEN |
72 |
afFacMom = 1.D0 |
73 |
ELSE |
74 |
afFacMom = 0.D0 |
75 |
ENDIF |
76 |
C-- Momentum forcing on/off flag. |
77 |
IF ( momForcing ) THEN |
78 |
foFacMom = 1.D0 |
79 |
ELSE |
80 |
foFacMom = 0.D0 |
81 |
ENDIF |
82 |
C-- Coriolis term on/off flag. |
83 |
IF ( useCoriolis ) THEN |
84 |
cfFacMom = 1.D0 |
85 |
ELSE |
86 |
cfFacMom = 0.D0 |
87 |
ENDIF |
88 |
C-- Pressure term on/off flag. |
89 |
IF ( momPressureForcing ) THEN |
90 |
pfFacMom = 1.D0 |
91 |
ELSE |
92 |
pfFacMom = 0.D0 |
93 |
ENDIF |
94 |
C-- Metric terms on/off flag. |
95 |
IF ( metricTerms ) THEN |
96 |
mTFacMom = 1.D0 |
97 |
ELSE |
98 |
mTFacMom = 0.D0 |
99 |
ENDIF |
100 |
|
101 |
C-- Advection and Forcing for Temp and salt on/off flags |
102 |
tempAdvection = tempStepping .AND. tempAdvection |
103 |
tempForcing = tempStepping .AND. tempForcing |
104 |
saltAdvection = saltStepping .AND. saltAdvection |
105 |
saltForcing = saltStepping .AND. saltForcing |
106 |
tempImplVertAdv = tempAdvection .AND. tempImplVertAdv |
107 |
saltImplVertAdv = saltAdvection .AND. saltImplVertAdv |
108 |
|
109 |
C-- When using the dynamical pressure in EOS (with Z-coord.), |
110 |
C needs to activate specific part of the code (restart & exchange) |
111 |
c useDynP_inEos_Zc = .FALSE. |
112 |
useDynP_inEos_Zc = ( fluidIsWater .AND. usingZCoords |
113 |
& .AND. ( eosType .EQ. 'JMD95P' .OR. |
114 |
& eosType .EQ. 'UNESCO' .OR. |
115 |
& eosType .EQ. 'MDJWF' ) ) |
116 |
|
117 |
C-- After this point, main model parameters are not supposed to be modified. |
118 |
WRITE(msgBuf,'(A,A)') 'SET_PARMS: done' |
119 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
120 |
& SQUEEZE_RIGHT , 1) |
121 |
|
122 |
_END_MASTER(myThid) |
123 |
|
124 |
C-- Everyone else must wait for the parameters to be set |
125 |
_BARRIER |
126 |
|
127 |
RETURN |
128 |
END |