1 |
C $Header$ |
C $Header$ |
2 |
C $Name$ |
C $Name$ |
3 |
|
|
4 |
#include "CPP_OPTIONS.h" |
#include "GMREDI_OPTIONS.h" |
5 |
|
|
6 |
SUBROUTINE GMREDI_CHECK( myThid ) |
SUBROUTINE GMREDI_CHECK( myThid ) |
7 |
C /==========================================================\ |
C /==========================================================\ |
16 |
#include "EEPARAMS.h" |
#include "EEPARAMS.h" |
17 |
#include "PARAMS.h" |
#include "PARAMS.h" |
18 |
#include "GMREDI.h" |
#include "GMREDI.h" |
19 |
|
#include "GAD.h" |
20 |
|
|
21 |
C === Routine arguments === |
C === Routine arguments === |
22 |
C myThid - Number of this instances |
C myThid - Number of this instances |
28 |
|
|
29 |
|
|
30 |
#ifdef ALLOW_GMREDI |
#ifdef ALLOW_GMREDI |
|
IF (GMRediIsOn) THEN |
|
31 |
|
|
32 |
WRITE(msgBuf,'(A)') 'GMREDI_CHECK: #define GMREDI' |
WRITE(msgBuf,'(A)') 'GMREDI_CHECK: #define GMREDI' |
33 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
34 |
& SQUEEZE_RIGHT , 1) |
& SQUEEZE_RIGHT , 1) |
35 |
|
|
|
C GM/Redi needs implicit diffusion (will be packaged later) |
|
|
IF (.NOT.implicitDiffusion) THEN |
|
|
WRITE(msgBuf,'(A)') 'GM/Redi needs implicitDiffusion=.true.' |
|
|
CALL PRINT_ERROR( msgBuf , 1) |
|
|
STOP 'ABNORMAL END: S/R GMREDI_CHECK' |
|
|
ENDIF |
|
|
|
|
36 |
C- print out some kee parameters : |
C- print out some kee parameters : |
37 |
CALL WRITE_0D_L( GM_AdvForm, INDEX_NONE, |
CALL WRITE_0D_L( GM_AdvForm, INDEX_NONE, |
38 |
& 'GM_AdvForm =', ' /* if FALSE => use SkewFlux Form */') |
& 'GM_AdvForm =', ' /* if FALSE => use SkewFlux Form */') |
57 |
CALL WRITE_0D_R8( GM_slopeSqCutoff, INDEX_NONE, |
CALL WRITE_0D_R8( GM_slopeSqCutoff, INDEX_NONE, |
58 |
& ' GM_slopeSqCutoff =', ' /* Slope^2 cut-off value */') |
& ' GM_slopeSqCutoff =', ' /* Slope^2 cut-off value */') |
59 |
|
|
60 |
|
|
61 |
|
C-- Check parameters: |
62 |
|
|
63 |
|
_BEGIN_MASTER(myThid) |
64 |
|
|
65 |
|
C- GM/Redi needs implicit diffusion (will be packaged later) |
66 |
|
IF (.NOT.implicitDiffusion) THEN |
67 |
|
WRITE(msgBuf,'(A)') 'GM/Redi needs implicitDiffusion=.true.' |
68 |
|
CALL PRINT_ERROR( msgBuf , 1) |
69 |
|
STOP 'ABNORMAL END: S/R GMREDI_CHECK' |
70 |
|
ENDIF |
71 |
|
|
72 |
|
#ifndef GM_VISBECK_VARIABLE_K |
73 |
|
C Make sure we are not trying to use something that is unavailable |
74 |
|
IF (GM_Visbeck_alpha .NE. 0.) THEN |
75 |
|
WRITE(msgBuf,'(A)') |
76 |
|
& ' GMREDI_CHECK: Visbeck variables used in data.gmredi' |
77 |
|
CALL PRINT_ERROR( msgBuf, 1 ) |
78 |
|
WRITE(msgBuf,'(A)') |
79 |
|
& ' GMREDI_CHECK: without #define GM_VISBECK_VARIABLE_K' |
80 |
|
CALL PRINT_ERROR( msgBuf, 1 ) |
81 |
|
STOP 'ABNORMAL END: S/R GMREDI_CHECK' |
82 |
|
ENDIF |
83 |
|
#endif |
84 |
|
|
85 |
|
#ifndef GM_BOLUS_ADVEC |
86 |
|
C Make sure we are not trying to use some arrays that are unavailable |
87 |
|
IF (GM_AdvForm) THEN |
88 |
|
WRITE(msgBuf,'(A)') |
89 |
|
& ' GMREDI_CHECK: GM Advection form used in data.gmredi' |
90 |
|
CALL PRINT_ERROR( msgBuf, 1 ) |
91 |
|
WRITE(msgBuf,'(A)') |
92 |
|
& ' GMREDI_CHECK: without #define GM_BOLUS_ADVEC' |
93 |
|
CALL PRINT_ERROR( msgBuf, 1 ) |
94 |
|
STOP 'ABNORMAL END: S/R GMREDI_CHECK' |
95 |
ENDIF |
ENDIF |
96 |
|
#endif |
97 |
|
|
98 |
|
#ifndef GM_EXTRA_DIAGONAL |
99 |
|
C Make sure we are not trying to use some arrays that are unavailable |
100 |
|
IF (GM_ExtraDiag) THEN |
101 |
|
WRITE(msgBuf,'(A)') |
102 |
|
& ' GMREDI_CHECK: GM_skew_Flux_K & GM_isopycK not equal' |
103 |
|
CALL PRINT_ERROR( msgBuf, 1 ) |
104 |
|
WRITE(msgBuf,'(A)') |
105 |
|
& ' GMREDI_CHECK: without #define GM_EXTRA_DIAGONAL' |
106 |
|
CALL PRINT_ERROR( msgBuf, 1 ) |
107 |
|
STOP 'ABNORMAL END: S/R GMREDI_CHECK' |
108 |
|
ENDIF |
109 |
#endif |
#endif |
110 |
|
|
111 |
|
IF ( GM_AdvForm .AND. .NOT.GM_AdvSeparate |
112 |
|
& .AND. (tempMultiDimAdvec.OR.saltMultiDimAdvec) |
113 |
|
& .AND. (Olx.LT.3 .OR. Oly.LT.3) ) THEN |
114 |
|
C note: a) this is a practical limitation. In theory, WITHOUT Visbeck, |
115 |
|
C changing some loop indices would make it works with Olx=Oly=2 |
116 |
|
C b) we really need 1 flag (like multiDimAdvection) that tells |
117 |
|
C if a least 1 tracer is using a multi-Dim advection scheme. |
118 |
|
WRITE(msgBuf,'(A,2I3,A)') |
119 |
|
& 'GMREDI_CHECK: Olx,Oly WRONG: cannot use those AdvScheme (', |
120 |
|
& tempAdvScheme, saltAdvScheme, ') ' |
121 |
|
CALL PRINT_ERROR( msgBuf , myThid) |
122 |
|
WRITE(msgBuf,'(A,A)') |
123 |
|
& 'GMREDI_CHECK: and GM_AdvForm(not_Separate) with', |
124 |
|
& ' (Olx,Oly) smaller than 3' |
125 |
|
CALL PRINT_ERROR( msgBuf , myThid) |
126 |
|
STOP 'ABNORMAL END: S/R GMREDI_CHECK' |
127 |
|
ENDIF |
128 |
|
|
129 |
|
_END_MASTER(myThid) |
130 |
|
|
131 |
|
#endif /* ALLOW_GMREDI */ |
132 |
RETURN |
RETURN |
133 |
END |
END |