1 |
C $Header: /u/gcmpack/MITgcm/pkg/ggl90/ggl90_check.F,v 1.4 2009/11/14 14:27:56 dfer Exp $ |
2 |
C $Name: $ |
3 |
#include "GGL90_OPTIONS.h" |
4 |
|
5 |
SUBROUTINE GGL90_CHECK( myThid ) |
6 |
C *==========================================================* |
7 |
C | SUBROUTINE GGL90_CHECK | |
8 |
C | o Validate basic package setup and inter-package | |
9 |
C | dependencies. | |
10 |
C *==========================================================* |
11 |
IMPLICIT NONE |
12 |
|
13 |
C === Global variables === |
14 |
#include "SIZE.h" |
15 |
#include "EEPARAMS.h" |
16 |
#include "PARAMS.h" |
17 |
#include "GGL90.h" |
18 |
|
19 |
C === Routine arguments === |
20 |
C myThid - Number of this instance of GGL90_CHECK |
21 |
INTEGER myThid |
22 |
|
23 |
#ifdef ALLOW_GGL90 |
24 |
|
25 |
C === Local variables === |
26 |
C msgBuf - Informational/error meesage buffer |
27 |
CHARACTER*(MAX_LEN_MBUF) msgBuf |
28 |
|
29 |
WRITE(msgBuf,'(A)') 'GGL90_CHECK: #define ALLOW_GGL90' |
30 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
31 |
& SQUEEZE_RIGHT, myThid ) |
32 |
|
33 |
C So far, GGL90 works only with oceanic z-coordinates |
34 |
IF ( buoyancyRelation .NE. 'OCEANIC' ) THEN |
35 |
WRITE(msgBuf,'(A)') |
36 |
& 'GGL90 works only with buoyancyRelation = ''OCEANIC''' |
37 |
CALL PRINT_ERROR( msgBuf, myThid ) |
38 |
STOP 'ABNORMAL END: S/R GGL90_CHECK' |
39 |
ENDIF |
40 |
|
41 |
C convective adjustment might be needed even with ggl90 |
42 |
IF ( cAdjFreq.NE.0. .OR. ivdc_kappa.NE.0. ) THEN |
43 |
WRITE(msgBuf,'(A)') |
44 |
& 'GGL90_CHECK: Some form of convection has been enabled' |
45 |
CALL PRINT_MESSAGE( msgBuf, errorMessageUnit, |
46 |
& SQUEEZE_RIGHT, myThid ) |
47 |
ENDIF |
48 |
|
49 |
#ifdef ALLOW_GGL90_HORIZDIFF |
50 |
#ifdef ALLOW_GGL90_SMOOTH |
51 |
IF ( GGL90diffTKEh .NE. 0. _d 0 ) THEN |
52 |
WRITE(msgBuf,'(A)') |
53 |
& 'Horizontal diffusion of TKE and smoothing are both on' |
54 |
CALL PRINT_ERROR( msgBuf, myThid ) |
55 |
STOP 'ABNORMAL END: S/R GGL90_CHECK' |
56 |
ENDIF |
57 |
#endif |
58 |
#else |
59 |
IF ( GGL90diffTKEh .NE. 0. _d 0 ) THEN |
60 |
WRITE(msgBuf,'(2A)') |
61 |
& 'Define ALLOW_GGL90_HORIZDIFF in GGL90_OPTIONS.h', |
62 |
& ' to get diffusion of TKE' |
63 |
CALL PRINT_ERROR( msgBuf, myThid ) |
64 |
STOP 'ABNORMAL END: S/R GGL90_CHECK' |
65 |
ENDIF |
66 |
#endif |
67 |
|
68 |
IF ( useKPP ) THEN |
69 |
WRITE(msgBuf,'(A)') |
70 |
& 'GGL90 and KPP cannot be turned on at the same time' |
71 |
CALL PRINT_ERROR( msgBuf, myThid ) |
72 |
STOP 'ABNORMAL END: S/R GGL90_CHECK' |
73 |
ENDIF |
74 |
|
75 |
IF ( usePP81 ) THEN |
76 |
WRITE(msgBuf,'(A)') |
77 |
& 'GGL90 and PP81 cannot be turned on at the same time' |
78 |
CALL PRINT_ERROR( msgBuf, myThid ) |
79 |
STOP 'ABNORMAL END: S/R GGL90_CHECK' |
80 |
ENDIF |
81 |
|
82 |
IF ( useMY82 ) THEN |
83 |
WRITE(msgBuf,'(A)') |
84 |
& 'GGL90 and MY82 cannot be turned on at the same time' |
85 |
CALL PRINT_ERROR( msgBuf, myThid ) |
86 |
STOP 'ABNORMAL END: S/R GGL90_CHECK' |
87 |
ENDIF |
88 |
|
89 |
C GGL90 needs implicit vertical diffusion and viscosity |
90 |
IF (.NOT.implicitDiffusion ) THEN |
91 |
WRITE(msgBuf,'(A)') |
92 |
& 'GGL90 needs implicitDiffusion to be enabled' |
93 |
CALL PRINT_ERROR( msgBuf, myThid ) |
94 |
STOP 'ABNORMAL END: S/R GGL90_CHECK' |
95 |
ENDIF |
96 |
IF (.NOT.implicitViscosity) THEN |
97 |
WRITE(msgBuf,'(A)') |
98 |
& 'GGL90 needs implicitViscosity to be enabled' |
99 |
CALL PRINT_ERROR( msgBuf, myThid ) |
100 |
STOP 'ABNORMAL END: S/R GGL90_CHECK' |
101 |
ENDIF |
102 |
|
103 |
#endif /* ALLOW_GGL90 */ |
104 |
|
105 |
RETURN |
106 |
END |