/[MITgcm]/MITgcm/model/src/set_parms.F
ViewVC logotype

Diff of /MITgcm/model/src/set_parms.F

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

revision 1.1 by jmc, Fri Mar 17 16:12:55 2006 UTC revision 1.11 by jmc, Wed Dec 7 23:31:15 2011 UTC
# Line 1  Line 1 
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-|--+----|
# Line 20  C     !USES: Line 20  C     !USES:
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)
# Line 54  C--   On/Off flags for each terms of the Line 56  C--   On/Off flags for each terms of the
56        momViscosity = momStepping .AND. momViscosity        momViscosity = momStepping .AND. momViscosity
57        momForcing   = momStepping .AND. momForcing        momForcing   = momStepping .AND. momForcing
58        useCoriolis  = momStepping .AND. useCoriolis        useCoriolis  = momStepping .AND. useCoriolis
59          use3dCoriolis= useCoriolis .AND. use3dCoriolis
60        useCDscheme  = momStepping .AND. useCDscheme        useCDscheme  = momStepping .AND. useCDscheme
61        momPressureForcing= momStepping .AND. momPressureForcing        momPressureForcing= momStepping .AND. momPressureForcing
62        implicitIntGravWave=momPressureForcing .AND. implicitIntGravWave        implicitIntGravWave=momPressureForcing .AND. implicitIntGravWave
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          calc_wVelocity   = momStepping .OR. exactConserv
67    
68    C--   Free-surface & pressure method
69          IF ( selectNHfreeSurf.NE.0 .AND.
70         &      ( .NOT.nonHydrostatic .OR. usingPCoords
71         &        .OR. .NOT.exactConserv
72         &      ) ) THEN
73            WRITE(msgBuf,'(2A)') '** WARNING ** SET_PARMS: ',
74         &                       'reset selectNHfreeSurf to zero'
75            CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
76         &                      SQUEEZE_RIGHT, myThid )
77            selectNHfreeSurf = 0
78          ENDIF
79    #ifdef ALLOW_AUTODIFF_TAMC
80          doResetHFactors = .TRUE.
81    #endif
82    #ifndef NONLIN_FRSURF
83          doResetHFactors = .FALSE.
84    #endif
85    C--   Set default Vorticity-Term Scheme:
86          IF ( vectorInvariantMomentum ) THEN
87            IF ( selectVortScheme.EQ.UNSET_I ) THEN
88              selectVortScheme = 1
89              IF ( upwindVorticity )    selectVortScheme = 0
90              IF ( highOrderVorticity ) selectVortScheme = 0
91            ENDIF
92          ELSEIF ( selectVortScheme.NE.UNSET_I ) THEN
93            WRITE(msgBuf,'(A,A)') '** WARNING ** SET_PARMS: ',
94         &   'Vector-Invariant Momentum unused => ignore selectVortScheme'
95            CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
96         &                      SQUEEZE_RIGHT, myThid )
97          ENDIF
98  C--   Momentum viscosity on/off flag.  C--   Momentum viscosity on/off flag.
99        IF ( momViscosity        ) THEN        IF ( momViscosity        ) THEN
100         vfFacMom = 1.D0         vfFacMom = 1. _d 0
101        ELSE        ELSE
102         vfFacMom = 0.D0         vfFacMom = 0. _d 0
103        ENDIF        ENDIF
104  C--   Momentum advection on/off flag.  C--   Momentum advection on/off flag.
105        IF ( momAdvection        ) THEN        IF ( momAdvection        ) THEN
106         afFacMom = 1.D0         afFacMom = 1. _d 0
107        ELSE        ELSE
108         afFacMom = 0.D0         afFacMom = 0. _d 0
109        ENDIF        ENDIF
110  C--   Momentum forcing on/off flag.  C--   Momentum forcing on/off flag.
111        IF ( momForcing ) THEN        IF ( momForcing ) THEN
112         foFacMom = 1.D0         foFacMom = 1. _d 0
113        ELSE        ELSE
114         foFacMom = 0.D0         foFacMom = 0. _d 0
115        ENDIF        ENDIF
116  C--   Coriolis term on/off flag.  C--   Coriolis term on/off flag.
117        IF ( useCoriolis ) THEN        IF ( useCoriolis ) THEN
118         cfFacMom = 1.D0         cfFacMom = 1. _d 0
119        ELSE        ELSE
120         cfFacMom = 0.D0         cfFacMom = 0. _d 0
121        ENDIF        ENDIF
122  C--   Pressure term on/off flag.  C--   Pressure term on/off flag.
123        IF ( momPressureForcing ) THEN        IF ( momPressureForcing ) THEN
124         pfFacMom = 1.D0         pfFacMom = 1. _d 0
125        ELSE        ELSE
126         pfFacMom = 0.D0         pfFacMom = 0. _d 0
127        ENDIF        ENDIF
128  C--   Metric terms on/off flag.  C--   Metric terms on/off flag.
129        IF ( metricTerms ) THEN        IF ( metricTerms ) THEN
130         mTFacMom = 1.D0         mTFacMom = 1. _d 0
131        ELSE        ELSE
132         mTFacMom = 0.D0         mTFacMom = 0. _d 0
133        ENDIF        ENDIF
134    
135  C--   Advection and Forcing for Temp and salt  on/off flags  C--   Advection and Forcing for Temp and salt  on/off flags
# Line 104  C--   Advection and Forcing for Temp and Line 139  C--   Advection and Forcing for Temp and
139        saltForcing   = saltStepping .AND. saltForcing        saltForcing   = saltStepping .AND. saltForcing
140        tempImplVertAdv = tempAdvection .AND. tempImplVertAdv        tempImplVertAdv = tempAdvection .AND. tempImplVertAdv
141        saltImplVertAdv = saltAdvection .AND. saltImplVertAdv        saltImplVertAdv = saltAdvection .AND. saltImplVertAdv
142          doThetaClimRelax = tempForcing .AND.
143         &                 ( tauThetaClimRelax.GT.0. _d 0 )
144          doSaltClimRelax  = saltForcing .AND.
145         &                 ( tauSaltClimRelax .GT.0. _d 0 )
146    
147    C--   Dynamically Active Tracers : set flags
148          tempIsActiveTr = momPressureForcing .AND. tempAdvection
149          saltIsActiveTr = momPressureForcing .AND. saltAdvection
150          IF ( eosType.EQ.'IDEALGAS' .AND. atm_Rq.EQ.0. ) THEN
151            saltIsActiveTr = .FALSE.
152          ELSEIF ( eosType.EQ.'LINEAR' ) THEN
153            IF ( tAlpha.EQ.0. ) tempIsActiveTr = .FALSE.
154            IF ( sBeta .EQ.0. ) saltIsActiveTr = .FALSE.
155          ENDIF
156    
157  C--   When using the dynamical pressure in EOS (with Z-coord.),  C--   When using the dynamical pressure in EOS (with Z-coord.),
158  C     needs to activate specific part of the code (restart & exchange)  C     needs to activate specific part of the code (restart & exchange)
# Line 111  c     useDynP_inEos_Zc = .FALSE. Line 160  c     useDynP_inEos_Zc = .FALSE.
160        useDynP_inEos_Zc = ( fluidIsWater .AND. usingZCoords        useDynP_inEos_Zc = ( fluidIsWater .AND. usingZCoords
161       &              .AND. ( eosType .EQ. 'JMD95P' .OR.       &              .AND. ( eosType .EQ. 'JMD95P' .OR.
162       &                      eosType .EQ. 'UNESCO' .OR.       &                      eosType .EQ. 'UNESCO' .OR.
163       &                      eosType .EQ. 'MDJWF'       )  )       &                      eosType .EQ. 'MDJWF'  .OR.
164         &                      eosType .EQ. 'TEOS10'      )  )
165    
166    C--   Adjust parameters related to length of the simulation
167    
168    C-    Need to adjust endTime for sub-timestep mismatch , since in
169    C     several places, test for last iteration with time==endTime :
170          tmpVar = startTime + deltaTClock*FLOAT(nTimeSteps)
171          IF ( endTime.NE.tmpVar ) THEN
172           IF ( ABS(endTime-tmpVar).GT.deltaTClock*1. _d -6 ) THEN
173            WRITE(msgBuf,'(A,A)') '** WARNING ** SET_PARMS: ',
174         &   '(endTime-baseTime) not multiple of time-step'
175            CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
176         &                      SQUEEZE_RIGHT, myThid )
177            WRITE(msgBuf,'(2A,1PE20.13)') '** WARNING ** SET_PARMS: ',
178         &   'Previous endTime=', endTime
179            CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
180         &                      SQUEEZE_RIGHT, myThid )
181            WRITE(msgBuf,'(2A,1PE20.13)') '** WARNING ** SET_PARMS: ',
182         &   'Adjusted endTime=', tmpVar
183            CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
184         &                      SQUEEZE_RIGHT, myThid )
185           ENDIF
186           endTime = tmpVar
187          ENDIF
188    
189    #ifdef ALLOW_LONGSTEP
190          IF ( usePTRACERS ) THEN
191            CALL LONGSTEP_CHECK_ITERS(myThid)
192          ENDIF
193    #endif /* ALLOW_LONGSTEP */
194    
195  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.
196         WRITE(msgBuf,'(A,A)') 'SET_PARMS: done'         WRITE(msgBuf,'(A,A)') 'SET_PARMS: done'

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.11

  ViewVC Help
Powered by ViewVC 1.1.22