1 |
jmc |
1.12 |
C $Header: /u/gcmpack/MITgcm/pkg/gmredi/gmredi_check.F,v 1.11 2004/11/21 15:57:17 jmc Exp $ |
2 |
jmc |
1.8 |
C $Name: $ |
3 |
heimbach |
1.1 |
|
4 |
edhill |
1.9 |
#include "GMREDI_OPTIONS.h" |
5 |
heimbach |
1.1 |
|
6 |
|
|
SUBROUTINE GMREDI_CHECK( myThid ) |
7 |
|
|
C /==========================================================\ |
8 |
|
|
C | SUBROUTINE GMREDI_CHECK | |
9 |
|
|
C | o Check dependances with other packages | |
10 |
|
|
C |==========================================================| |
11 |
|
|
C \==========================================================/ |
12 |
|
|
IMPLICIT NONE |
13 |
|
|
|
14 |
|
|
C === Global variables === |
15 |
|
|
#include "SIZE.h" |
16 |
|
|
#include "EEPARAMS.h" |
17 |
|
|
#include "PARAMS.h" |
18 |
|
|
#include "GMREDI.h" |
19 |
jmc |
1.12 |
#ifdef ALLOW_GENERIC_ADVDIFF |
20 |
jmc |
1.10 |
#include "GAD.h" |
21 |
jmc |
1.12 |
#endif |
22 |
heimbach |
1.1 |
|
23 |
|
|
C === Routine arguments === |
24 |
|
|
C myThid - Number of this instances |
25 |
|
|
INTEGER myThid |
26 |
|
|
|
27 |
|
|
C === Local variables === |
28 |
|
|
C msgBuf - Informational/error meesage buffer |
29 |
|
|
CHARACTER*(MAX_LEN_MBUF) msgBuf |
30 |
|
|
|
31 |
|
|
|
32 |
|
|
#ifdef ALLOW_GMREDI |
33 |
|
|
|
34 |
adcroft |
1.3 |
WRITE(msgBuf,'(A)') 'GMREDI_CHECK: #define GMREDI' |
35 |
|
|
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
36 |
|
|
& SQUEEZE_RIGHT , 1) |
37 |
heimbach |
1.1 |
|
38 |
jmc |
1.5 |
C- print out some kee parameters : |
39 |
|
|
CALL WRITE_0D_L( GM_AdvForm, INDEX_NONE, |
40 |
|
|
& 'GM_AdvForm =', ' /* if FALSE => use SkewFlux Form */') |
41 |
jmc |
1.6 |
CALL WRITE_0D_L( GM_AdvSeparate, INDEX_NONE, |
42 |
|
|
& 'GM_AdvSeparate =',' /* Calc Bolus & Euler Adv. separately */') |
43 |
jmc |
1.5 |
CALL WRITE_0D_L( GM_ExtraDiag, INDEX_NONE, |
44 |
|
|
& 'GM_ExtraDiag =',' /* Tensor Extra Diag (line 1&2) non 0 */') |
45 |
|
|
CALL WRITE_0D_R8( GM_isopycK, INDEX_NONE,'GM_isopycK =', |
46 |
|
|
& ' /* Background Isopyc. Diffusivity ( m^2/s ) */') |
47 |
|
|
CALL WRITE_0D_R8( GM_background_K*GM_skewflx, INDEX_NONE, |
48 |
|
|
& ' GM_skewflx*K =', |
49 |
|
|
& ' /* Background GM_SkewFlx Diffusivity ( m^2/s ) */') |
50 |
|
|
CALL WRITE_0D_R8( GM_background_K*GM_advect, INDEX_NONE, |
51 |
|
|
& ' GM_advec*K =', |
52 |
|
|
& ' /* Backg. GM-Advec(=Bolus) Diffusivity ( m^2/s ) */') |
53 |
|
|
CALL WRITE_0D_R8( GM_Visbeck_alpha, INDEX_NONE, |
54 |
|
|
& ' GM_Visbeck_alpha =',' /* Visbeck alpha coeff. ( ) */') |
55 |
|
|
WRITE(msgBuf,'(A,A40)')' Tapering/Cliping : ',GM_taper_scheme |
56 |
|
|
CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1) |
57 |
jmc |
1.8 |
CALL WRITE_0D_R8( GM_Small_Number, INDEX_NONE, |
58 |
|
|
& ' GM_Small_Number =',' /* epsilon used in slope calc */') |
59 |
|
|
CALL WRITE_0D_R8( GM_slopeSqCutoff, INDEX_NONE, |
60 |
|
|
& ' GM_slopeSqCutoff =', ' /* Slope^2 cut-off value */') |
61 |
heimbach |
1.1 |
|
62 |
jmc |
1.10 |
|
63 |
|
|
C-- Check parameters: |
64 |
|
|
|
65 |
|
|
_BEGIN_MASTER(myThid) |
66 |
|
|
|
67 |
|
|
C- GM/Redi needs implicit diffusion (will be packaged later) |
68 |
|
|
IF (.NOT.implicitDiffusion) THEN |
69 |
|
|
WRITE(msgBuf,'(A)') 'GM/Redi needs implicitDiffusion=.true.' |
70 |
|
|
CALL PRINT_ERROR( msgBuf , 1) |
71 |
|
|
STOP 'ABNORMAL END: S/R GMREDI_CHECK' |
72 |
|
|
ENDIF |
73 |
|
|
|
74 |
|
|
#ifndef GM_VISBECK_VARIABLE_K |
75 |
|
|
C Make sure we are not trying to use something that is unavailable |
76 |
|
|
IF (GM_Visbeck_alpha .NE. 0.) THEN |
77 |
|
|
WRITE(msgBuf,'(A)') |
78 |
|
|
& ' GMREDI_CHECK: Visbeck variables used in data.gmredi' |
79 |
|
|
CALL PRINT_ERROR( msgBuf, 1 ) |
80 |
|
|
WRITE(msgBuf,'(A)') |
81 |
|
|
& ' GMREDI_CHECK: without #define GM_VISBECK_VARIABLE_K' |
82 |
|
|
CALL PRINT_ERROR( msgBuf, 1 ) |
83 |
|
|
STOP 'ABNORMAL END: S/R GMREDI_CHECK' |
84 |
|
|
ENDIF |
85 |
|
|
#endif |
86 |
|
|
|
87 |
|
|
#ifndef GM_BOLUS_ADVEC |
88 |
|
|
C Make sure we are not trying to use some arrays that are unavailable |
89 |
|
|
IF (GM_AdvForm) THEN |
90 |
|
|
WRITE(msgBuf,'(A)') |
91 |
|
|
& ' GMREDI_CHECK: GM Advection form used in data.gmredi' |
92 |
|
|
CALL PRINT_ERROR( msgBuf, 1 ) |
93 |
|
|
WRITE(msgBuf,'(A)') |
94 |
|
|
& ' GMREDI_CHECK: without #define GM_BOLUS_ADVEC' |
95 |
|
|
CALL PRINT_ERROR( msgBuf, 1 ) |
96 |
|
|
STOP 'ABNORMAL END: S/R GMREDI_CHECK' |
97 |
heimbach |
1.1 |
ENDIF |
98 |
jmc |
1.10 |
#endif |
99 |
heimbach |
1.1 |
|
100 |
jmc |
1.10 |
#ifndef GM_EXTRA_DIAGONAL |
101 |
|
|
C Make sure we are not trying to use some arrays that are unavailable |
102 |
|
|
IF (GM_ExtraDiag) THEN |
103 |
|
|
WRITE(msgBuf,'(A)') |
104 |
|
|
& ' GMREDI_CHECK: GM_skew_Flux_K & GM_isopycK not equal' |
105 |
|
|
CALL PRINT_ERROR( msgBuf, 1 ) |
106 |
|
|
WRITE(msgBuf,'(A)') |
107 |
|
|
& ' GMREDI_CHECK: without #define GM_EXTRA_DIAGONAL' |
108 |
|
|
CALL PRINT_ERROR( msgBuf, 1 ) |
109 |
|
|
STOP 'ABNORMAL END: S/R GMREDI_CHECK' |
110 |
|
|
ENDIF |
111 |
heimbach |
1.1 |
#endif |
112 |
jmc |
1.10 |
|
113 |
jmc |
1.12 |
#ifdef ALLOW_GENERIC_ADVDIFF |
114 |
jmc |
1.11 |
C Check size of overlap region |
115 |
jmc |
1.10 |
IF ( GM_AdvForm .AND. .NOT.GM_AdvSeparate |
116 |
jmc |
1.11 |
& .AND. GM_Visbeck_alpha.NE.0. |
117 |
|
|
& .AND. useMultiDimAdvec |
118 |
jmc |
1.10 |
& .AND. (Olx.LT.3 .OR. Oly.LT.3) ) THEN |
119 |
jmc |
1.11 |
C Visbeck variable K requires 1 more row/column in the overlap: |
120 |
|
|
C might need to increase Olx,Oly from 2 to 3 if GM advective |
121 |
|
|
C form & multi-dim advection are used. This happens when: |
122 |
|
|
C a) using a 5 points stencil advection scheme ; or |
123 |
|
|
C b) using a 3 points stencil advection scheme on CS-grid |
124 |
|
|
C note: not clear how to check (b) since none of the advection scheme |
125 |
|
|
C currently implemented falls in this category, except if |
126 |
|
|
C GAD_FLUX_LIMITER.h is changed to use a "constant" flux-limiter |
127 |
|
|
C (from Lax-Wendroff to 1rst Order upwind). |
128 |
|
|
C------- |
129 |
|
|
c IF ( (useCubedSphereExchange |
130 |
|
|
c & .AND.( tempAdvScheme.EQ.ENUM_LAXWENDROFF |
131 |
|
|
c & .OR. saltAdvScheme.EQ.ENUM_LAXWENDROFF ) |
132 |
|
|
c & ).OR.( tempAdvScheme.EQ.ENUM_FLUX_LIMIT |
133 |
|
|
c & .OR. saltAdvScheme.EQ.ENUM_FLUX_LIMIT |
134 |
|
|
c & .OR. tempAdvScheme.EQ.ENUM_DST3_FLUX_LIMIT |
135 |
|
|
c & .OR. saltAdvScheme.EQ.ENUM_DST3_FLUX_LIMIT |
136 |
|
|
c & .OR. tempAdvScheme.EQ.ENUM_DST3 |
137 |
|
|
c & .OR. saltAdvScheme.EQ.ENUM_DST3 ) |
138 |
|
|
c & ) THEN |
139 |
|
|
WRITE(msgBuf,'(A,A)') |
140 |
|
|
& 'GMREDI_CHECK: Visbeck + GM_AdvForm in MultiDimAdvec' |
141 |
|
|
CALL PRINT_ERROR( msgBuf , myThid) |
142 |
|
|
WRITE(msgBuf,'(A)') 'GMREDI_CHECK: need at least Olx,Oly = 3' |
143 |
|
|
CALL PRINT_ERROR( msgBuf , myThid) |
144 |
|
|
STOP 'ABNORMAL END: S/R GMREDI_CHECK' |
145 |
|
|
c ENDIF |
146 |
jmc |
1.10 |
ENDIF |
147 |
jmc |
1.12 |
#endif /* ALLOW_GENERIC_ADVDIFF */ |
148 |
jmc |
1.10 |
|
149 |
|
|
_END_MASTER(myThid) |
150 |
|
|
|
151 |
|
|
#endif /* ALLOW_GMREDI */ |
152 |
adcroft |
1.3 |
RETURN |
153 |
|
|
END |