/[MITgcm]/MITgcm_contrib/submesoscale/code/gmredi_check.F
ViewVC logotype

Annotation of /MITgcm_contrib/submesoscale/code/gmredi_check.F

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


Revision 1.4 - (hide annotations) (download)
Fri Mar 12 18:31:00 2010 UTC (15 years, 4 months ago) by zhc
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +36 -24 lines
updated with checkpoint62c

1 zhc 1.4 C $Header: /u/gcmpack/MITgcm/pkg/gmredi/gmredi_check.F,v 1.18 2009/04/28 23:27:24 jmc Exp $
2 dimitri 1.1 C $Name: $
3    
4     #include "GMREDI_OPTIONS.h"
5     #ifdef ALLOW_PTRACERS
6     # include "PTRACERS_OPTIONS.h"
7     #endif
8    
9     CBOP
10     C !ROUTINE: GMREDI_CHECK
11     C !INTERFACE:
12     SUBROUTINE GMREDI_CHECK( myThid )
13    
14     C !DESCRIPTION: \bv
15     C *==========================================================*
16     C | SUBROUTINE GMREDI_CHECK
17     C | o Check consistency with model configuration
18     C *==========================================================*
19     C *==========================================================*
20     C \ev
21    
22     C !USES:
23     IMPLICIT NONE
24    
25     C === Global variables ===
26     #include "SIZE.h"
27     #include "EEPARAMS.h"
28     #include "PARAMS.h"
29     #include "GMREDI.h"
30     #ifdef ALLOW_GENERIC_ADVDIFF
31     # include "GAD.h"
32     #endif
33     #ifdef ALLOW_PTRACERS
34     # include "PTRACERS_SIZE.h"
35     # include "PTRACERS_PARAMS.h"
36     #endif
37    
38     C !INPUT/OUTPUT PARAMETERS:
39     C === Routine arguments ===
40     C myThid :: my Thread Id number
41     INTEGER myThid
42    
43     #ifdef ALLOW_GMREDI
44     C !LOCAL VARIABLES:
45     C === Local variables ===
46     C msgBuf :: Informational/error meesage buffer
47     CHARACTER*(MAX_LEN_MBUF) msgBuf
48     CEOP
49     #ifdef ALLOW_PTRACERS
50     INTEGER iTr
51     LOGICAL redFlag
52     #endif
53    
54     _BEGIN_MASTER(myThid)
55    
56     WRITE(msgBuf,'(A)') 'GMREDI_CHECK: #define GMREDI'
57     CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
58     & SQUEEZE_RIGHT , myThid )
59    
60     C- print out some kee parameters :
61     CALL WRITE_0D_L( GM_AdvForm, INDEX_NONE,
62 zhc 1.4 & 'GM_AdvForm =', ' /* if FALSE => use SkewFlux Form */')
63 dimitri 1.3 CALL WRITE_0D_L( GM_InMomAsStress, INDEX_NONE,
64 zhc 1.4 & 'GM_InMomAsStress =', ' /* if TRUE => apply as Eddy Stress */')
65 dimitri 1.1 CALL WRITE_0D_L( GM_AdvSeparate, INDEX_NONE,
66     & 'GM_AdvSeparate =',' /* Calc Bolus & Euler Adv. separately */')
67     CALL WRITE_0D_L( GM_ExtraDiag, INDEX_NONE,
68 zhc 1.4 & 'GM_ExtraDiag =',' /* Tensor Extra Diag (line 1&2) non 0 */')
69     CALL WRITE_0D_RL( GM_isopycK, INDEX_NONE, 'GM_isopycK =',
70     & ' /* Background Isopyc. Diffusivity [m^2/s] */')
71     CALL WRITE_0D_RL( GM_background_K*GM_skewflx, INDEX_NONE,
72     & 'GM_skewflx*K =',
73     & ' /* Background GM_SkewFlx Diffusivity [m^2/s] */')
74     CALL WRITE_0D_RL( GM_background_K*GM_advect, INDEX_NONE,
75     & 'GM_advec*K =',
76     & ' /* Backg. GM-Advec(=Bolus) Diffusivity [m^2/s]*/')
77     CALL WRITE_0D_RL( GM_background_K*GM_advect, INDEX_NONE,
78     & 'GM_Kmin_horiz =',
79     & ' /* Minimum Horizontal Diffusivity [m^2/s] */')
80     CALL WRITE_0D_RL( GM_Visbeck_alpha, INDEX_NONE,
81     & 'GM_Visbeck_alpha =', ' /* Visbeck alpha coeff. [-] */')
82     CALL WRITE_0D_RL( GM_Small_Number, INDEX_NONE,
83     & 'GM_Small_Number =', ' /* epsilon used in slope calc */')
84     CALL WRITE_0D_RL( GM_slopeSqCutoff, INDEX_NONE,
85     & 'GM_slopeSqCutoff =', ' /* Slope^2 cut-off value */')
86     CALL WRITE_0D_C( GM_taper_scheme, 0, INDEX_NONE,
87     & 'GM_taper_scheme =',
88     & ' /* Type of Tapering/Clipping scheme */')
89     CALL WRITE_0D_RL( GM_maxSlope, INDEX_NONE,
90     & 'GM_maxSlope =', ' /* Maximum Slope (Tapering/Clipping) */')
91     CALL WRITE_0D_RL( GM_facTrL2dz, INDEX_NONE,
92     & 'GM_facTrL2dz =',
93     & ' /* Minimum Trans.Layer Thick. (factor of dz) */')
94     CALL WRITE_0D_RL( GM_facTrL2ML, INDEX_NONE,
95     & 'GM_facTrL2ML =',
96     & ' /* Max.Trans.Layer Thick. (factor of MxL Depth)*/')
97     CALL WRITE_0D_RL( GM_maxTransLay, INDEX_NONE,
98     & 'GM_maxTransLay =',
99     & ' /* Maximum Transition Layer Thickness [m] */')
100 dimitri 1.1
101     C-- Check parameters:
102    
103     C- GM/Redi needs implicit diffusion (will be packaged later)
104     IF ( .NOT.implicitDiffusion ) THEN
105     WRITE(msgBuf,'(A)') 'GM/Redi needs implicitDiffusion=.true.'
106     CALL PRINT_ERROR( msgBuf , myThid )
107     STOP 'ABNORMAL END: S/R GMREDI_CHECK'
108     ENDIF
109    
110     #ifndef GM_VISBECK_VARIABLE_K
111     C Make sure we are not trying to use something that is unavailable
112     IF ( GM_Visbeck_alpha.NE.0. ) THEN
113     WRITE(msgBuf,'(A)')
114     & ' GMREDI_CHECK: Visbeck variables used in data.gmredi'
115     CALL PRINT_ERROR( msgBuf, myThid )
116     WRITE(msgBuf,'(A)')
117     & ' GMREDI_CHECK: without #define GM_VISBECK_VARIABLE_K'
118     CALL PRINT_ERROR( msgBuf, myThid )
119     STOP 'ABNORMAL END: S/R GMREDI_CHECK'
120     ENDIF
121     #endif
122    
123     #ifndef GM_BOLUS_ADVEC
124     C Make sure we are not trying to use some arrays that are unavailable
125     IF ( GM_AdvForm ) THEN
126     WRITE(msgBuf,'(A)')
127     & ' GMREDI_CHECK: GM Advection form used in data.gmredi'
128     CALL PRINT_ERROR( msgBuf, myThid )
129     WRITE(msgBuf,'(A)')
130     & ' GMREDI_CHECK: without #define GM_BOLUS_ADVEC'
131     CALL PRINT_ERROR( msgBuf, myThid )
132     STOP 'ABNORMAL END: S/R GMREDI_CHECK'
133     ENDIF
134     #endif
135    
136     #ifndef GM_EXTRA_DIAGONAL
137     C Make sure we are not trying to use some arrays that are unavailable
138     IF ( GM_ExtraDiag ) THEN
139     WRITE(msgBuf,'(A)')
140     & ' GMREDI_CHECK: GM_skew_Flux_K & GM_isopycK not equal'
141     CALL PRINT_ERROR( msgBuf, myThid )
142     WRITE(msgBuf,'(A)')
143     & ' GMREDI_CHECK: without #define GM_EXTRA_DIAGONAL'
144     CALL PRINT_ERROR( msgBuf, myThid )
145     STOP 'ABNORMAL END: S/R GMREDI_CHECK'
146     ENDIF
147     #endif
148    
149 dimitri 1.2 #ifdef GM_SUBMESO
150     IF (GM_SM_Ce .gt. 0 _d 0) THEN
151     C Make sure we are not trying to use some arrays that are unavailable
152     IF ((.not.GM_ExtraDiag ).and.(.not.GM_AdvForm)) THEN
153     WRITE(msgBuf,'(A)')
154     & ' GMREDI: GM_SUBMESO needs GM_EXTRA_DIAGONAL or GM_BOLUS_ADVEC'
155     CALL PRINT_ERROR( msgBuf, myThid )
156     WRITE(msgBuf,'(A)')
157     & ' GMREDI_CHECK: add #define GM_EXTRA_DIAGONAL'
158     CALL PRINT_ERROR( msgBuf, myThid )
159     STOP 'ABNORMAL END: S/R GMREDI_CHECK'
160     ENDIF
161     ENDIF
162     #endif
163 zhc 1.4
164 dimitri 1.1 #ifdef ALLOW_PTRACERS
165     IF ( GM_AdvForm .AND. .NOT.GM_AdvSeparate
166     & .AND. usePTRACERS ) THEN
167     redFlag = .FALSE.
168     DO iTr=1,PTRACERS_numInUse
169     IF ( .NOT.PTRACERS_useGMRedi(iTr) ) THEN
170     redFlag = .TRUE.
171     WRITE(msgBuf,'(2A,I3,A,L5)') ' GMREDI_CHECK:',
172     & ' pTracers_useGMRedi(',iTr,' )=', PTRACERS_useGMRedi(iTr)
173     CALL PRINT_ERROR( msgBuf, myThid )
174     ENDIF
175     ENDDO
176     IF ( redFlag ) THEN
177     WRITE(msgBuf,'(2A)') ' GMREDI_CHECK:',
178     & ' but GM Advective Form applies to all tracers !'
179     CALL PRINT_ERROR( msgBuf, myThid )
180     STOP 'ABNORMAL END: S/R GMREDI_CHECK'
181     ENDIF
182     ENDIF
183     #endif /* ALLOW_PTRACERS */
184    
185     #ifdef ALLOW_GENERIC_ADVDIFF
186     C Check size of overlap region
187     IF ( GM_AdvForm .AND. .NOT.GM_AdvSeparate
188     & .AND. GM_Visbeck_alpha.NE.0.
189     & .AND. useMultiDimAdvec
190     & .AND. (Olx.LT.3 .OR. Oly.LT.3) ) THEN
191     C Visbeck variable K requires 1 more row/column in the overlap:
192     C might need to increase Olx,Oly from 2 to 3 if GM advective
193     C form & multi-dim advection are used. This happens when:
194     C a) using a 5 points stencil advection scheme ; or
195     C b) using a 3 points stencil advection scheme on CS-grid
196     C note: not clear how to check (b) since none of the advection scheme
197     C currently implemented falls in this category, except if
198     C GAD_FLUX_LIMITER.h is changed to use a "constant" flux-limiter
199     C (from Lax-Wendroff to 1rst Order upwind).
200     C-------
201     c IF ( (useCubedSphereExchange
202     c & .AND.( tempAdvScheme.EQ.ENUM_LAXWENDROFF
203     c & .OR. saltAdvScheme.EQ.ENUM_LAXWENDROFF )
204     c & ).OR.( tempAdvScheme.EQ.ENUM_FLUX_LIMIT
205     c & .OR. saltAdvScheme.EQ.ENUM_FLUX_LIMIT
206     c & .OR. tempAdvScheme.EQ.ENUM_DST3_FLUX_LIMIT
207     c & .OR. saltAdvScheme.EQ.ENUM_DST3_FLUX_LIMIT
208     c & .OR. tempAdvScheme.EQ.ENUM_DST3
209     c & .OR. saltAdvScheme.EQ.ENUM_DST3 )
210     c & ) THEN
211     WRITE(msgBuf,'(A,A)')
212     & 'GMREDI_CHECK: Visbeck + GM_AdvForm in MultiDimAdvec'
213     CALL PRINT_ERROR( msgBuf , myThid )
214     WRITE(msgBuf,'(A)') 'GMREDI_CHECK: need at least Olx,Oly = 3'
215     CALL PRINT_ERROR( msgBuf , myThid )
216     STOP 'ABNORMAL END: S/R GMREDI_CHECK'
217     c ENDIF
218     ENDIF
219     #endif /* ALLOW_GENERIC_ADVDIFF */
220    
221     _END_MASTER(myThid)
222    
223     #endif /* ALLOW_GMREDI */
224     RETURN
225     END

  ViewVC Help
Powered by ViewVC 1.1.22