1 |
jmc |
1.1 |
C $Header: $ |
2 |
|
|
C $Name: $ |
3 |
|
|
|
4 |
|
|
#include "CPP_OPTIONS.h" |
5 |
|
|
|
6 |
|
|
CBOP |
7 |
|
|
C !ROUTINE: CONFIG_CHECK |
8 |
|
|
C !INTERFACE: |
9 |
|
|
SUBROUTINE CONFIG_CHECK( myThid ) |
10 |
|
|
C !DESCRIPTION: \bv |
11 |
|
|
C *=========================================================* |
12 |
|
|
C | SUBROUTINE CONFIG_CHECK |
13 |
|
|
C | o Check model parameter settings. |
14 |
|
|
C *=========================================================* |
15 |
|
|
C | This routine help to prevent the use of parameters |
16 |
|
|
C | that are not compatible with the model configuration. |
17 |
|
|
C *=========================================================* |
18 |
|
|
C \ev |
19 |
|
|
|
20 |
|
|
C !USES: |
21 |
|
|
IMPLICIT NONE |
22 |
|
|
C === Global variables === |
23 |
|
|
#include "SIZE.h" |
24 |
|
|
#include "EEPARAMS.h" |
25 |
|
|
#include "PARAMS.h" |
26 |
|
|
c #include "GRID.h" |
27 |
|
|
|
28 |
|
|
C !INPUT/OUTPUT PARAMETERS: |
29 |
|
|
C === Routine arguments === |
30 |
|
|
C myThid - Number of this instances of CONFIG_CHECK |
31 |
|
|
INTEGER myThid |
32 |
|
|
CEndOfInterface |
33 |
|
|
|
34 |
|
|
C !LOCAL VARIABLES: |
35 |
|
|
C == Local variables == |
36 |
|
|
C msgBuf :: Informational/error meesage buffer |
37 |
|
|
CHARACTER*(MAX_LEN_MBUF) msgBuf |
38 |
|
|
CEOP |
39 |
|
|
|
40 |
|
|
C- check that CPP option is "defined" when running-flag parameter is on: |
41 |
|
|
|
42 |
|
|
#ifndef ALLOW_NONHYDROSTATIC |
43 |
|
|
IF (nonHydrostatic) THEN |
44 |
|
|
WRITE(msgBuf,'(A)') |
45 |
|
|
& 'CONFIG_CHECK: #undef ALLOW_NONHYDROSTATIC and' |
46 |
|
|
CALL PRINT_ERROR( msgBuf , 1) |
47 |
|
|
WRITE(msgBuf,'(A)') |
48 |
|
|
& 'CONFIG_CHECK: nonHydrostatic is TRUE' |
49 |
|
|
CALL PRINT_ERROR( msgBuf , 1) |
50 |
|
|
STOP 'ABNORMAL END: S/R CONFIG_CHECK' |
51 |
|
|
ENDIF |
52 |
|
|
#endif |
53 |
|
|
|
54 |
|
|
#ifndef EXACT_CONSERV |
55 |
|
|
IF (exactConserv) THEN |
56 |
|
|
WRITE(msgBuf,'(A)') |
57 |
|
|
& 'CONFIG_CHECK: #undef EXACT_CONSERV and' |
58 |
|
|
CALL PRINT_ERROR( msgBuf , 1) |
59 |
|
|
WRITE(msgBuf,'(A)') |
60 |
|
|
& 'CONFIG_CHECK: exactConserv is TRUE' |
61 |
|
|
CALL PRINT_ERROR( msgBuf , 1) |
62 |
|
|
STOP 'ABNORMAL END: S/R CONFIG_CHECK' |
63 |
|
|
ENDIF |
64 |
|
|
#endif |
65 |
|
|
|
66 |
|
|
#ifndef NONLIN_FRSURF |
67 |
|
|
IF (nonlinFreeSurf.NE.0) THEN |
68 |
|
|
WRITE(msgBuf,'(A)') |
69 |
|
|
& 'CONFIG_CHECK: #undef NONLIN_FRSURF and' |
70 |
|
|
CALL PRINT_ERROR( msgBuf , 1) |
71 |
|
|
WRITE(msgBuf,'(A)') |
72 |
|
|
& 'CONFIG_CHECK: nonlinFreeSurf is non-zero' |
73 |
|
|
CALL PRINT_ERROR( msgBuf , 1) |
74 |
|
|
STOP 'ABNORMAL END: S/R CONFIG_CHECK' |
75 |
|
|
ENDIF |
76 |
|
|
#endif |
77 |
|
|
|
78 |
|
|
C- check parameter consistency : |
79 |
|
|
|
80 |
|
|
#ifdef USE_NATURAL_BCS |
81 |
|
|
IF (rigidLid) THEN |
82 |
|
|
WRITE(msgBuf,'(A)') |
83 |
|
|
& 'CONFIG_CHECK: #define USE_NATURAL_BCS and' |
84 |
|
|
CALL PRINT_ERROR( msgBuf , 1) |
85 |
|
|
WRITE(msgBuf,'(A)') |
86 |
|
|
& 'CONFIG_CHECK: rigidLid are not compatible' |
87 |
|
|
CALL PRINT_ERROR( msgBuf , 1) |
88 |
|
|
STOP 'ABNORMAL END: S/R CONFIG_CHECK' |
89 |
|
|
ENDIF |
90 |
|
|
IF (exactConserv) THEN |
91 |
|
|
WRITE(msgBuf,'(A)') |
92 |
|
|
& 'CONFIG_CHECK: #define USE_NATURAL_BCS with' |
93 |
|
|
CALL PRINT_ERROR( msgBuf , 1) |
94 |
|
|
WRITE(msgBuf,'(A)') |
95 |
|
|
& 'CONFIG_CHECK: exactConserv not yet implemented' |
96 |
|
|
CALL PRINT_ERROR( msgBuf , 1) |
97 |
|
|
STOP 'ABNORMAL END: S/R CONFIG_CHECK' |
98 |
|
|
ENDIF |
99 |
|
|
#endif |
100 |
|
|
|
101 |
|
|
IF (rigidLid .AND. exactConserv) THEN |
102 |
|
|
WRITE(msgBuf,'(A)') |
103 |
|
|
& 'CONFIG_CHECK: exactConserv not compatible with' |
104 |
|
|
CALL PRINT_ERROR( msgBuf , 1) |
105 |
|
|
WRITE(msgBuf,'(A)') |
106 |
|
|
& 'CONFIG_CHECK: rigidLid (meaningless in that case)' |
107 |
|
|
CALL PRINT_ERROR( msgBuf , 1) |
108 |
|
|
STOP 'ABNORMAL END: S/R CONFIG_CHECK' |
109 |
|
|
ENDIF |
110 |
|
|
|
111 |
|
|
IF (nonlinFreeSurf.NE.0 .AND. .NOT.exactConserv) THEN |
112 |
|
|
WRITE(msgBuf,'(A)') |
113 |
|
|
& 'CONFIG_CHECK: nonlinFreeSurf cannot be used' |
114 |
|
|
CALL PRINT_ERROR( msgBuf , 1) |
115 |
|
|
WRITE(msgBuf,'(A)') |
116 |
|
|
& 'CONFIG_CHECK: without exactConserv' |
117 |
|
|
CALL PRINT_ERROR( msgBuf , 1) |
118 |
|
|
STOP 'ABNORMAL END: S/R CONFIG_CHECK' |
119 |
|
|
ENDIF |
120 |
|
|
|
121 |
|
|
C- note : not implemented in Release1_beta1 but it's done now (since 01-30-02) |
122 |
|
|
IF (nonlinFreeSurf.NE.0 .AND. useOBCS ) THEN |
123 |
|
|
WRITE(msgBuf,'(A)') |
124 |
|
|
& 'CONFIG_CHECK: nonlinFreeSurf not yet implemented' |
125 |
|
|
CALL PRINT_ERROR( msgBuf , 1) |
126 |
|
|
WRITE(msgBuf,'(A)') |
127 |
|
|
& 'CONFIG_CHECK: in OBC package' |
128 |
|
|
CALL PRINT_ERROR( msgBuf , 1) |
129 |
|
|
STOP 'ABNORMAL END: S/R CONFIG_CHECK' |
130 |
|
|
ENDIF |
131 |
|
|
|
132 |
|
|
IF (nonlinFreeSurf.NE.0 .AND. nonHydrostatic) THEN |
133 |
|
|
WRITE(msgBuf,'(A)') |
134 |
|
|
& 'CONFIG_CHECK: nonlinFreeSurf not yet implemented' |
135 |
|
|
CALL PRINT_ERROR( msgBuf , 1) |
136 |
|
|
WRITE(msgBuf,'(A)') |
137 |
|
|
& 'CONFIG_CHECK: in nonHydrostatic code' |
138 |
|
|
CALL PRINT_ERROR( msgBuf , 1) |
139 |
|
|
STOP 'ABNORMAL END: S/R CONFIG_CHECK' |
140 |
|
|
ENDIF |
141 |
|
|
|
142 |
|
|
WRITE(msgBuf,'(A)') 'CONFIG_CHECK: OK' |
143 |
|
|
CALL PRINT_MESSAGE(msgBuf,standardMessageUnit, |
144 |
|
|
& SQUEEZE_RIGHT,myThid) |
145 |
|
|
|
146 |
|
|
RETURN |
147 |
|
|
END |