1 |
C $Header: /u/gcmpack/MITgcm/pkg/obcs/obcs_check.F,v 1.10 2006/09/27 11:31:58 mlosch Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "OBCS_OPTIONS.h" |
5 |
|
6 |
SUBROUTINE OBCS_CHECK( myThid ) |
7 |
C /==========================================================\ |
8 |
C | SUBROUTINE OBCS_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 "OBCS.h" |
19 |
|
20 |
C === Routine arguments === |
21 |
C myThid - Number of this instances |
22 |
INTEGER myThid |
23 |
|
24 |
#ifdef ALLOW_OBCS |
25 |
|
26 |
C === Local variables === |
27 |
C msgBuf - Informational/error meesage buffer |
28 |
CHARACTER*(MAX_LEN_MBUF) msgBuf |
29 |
INTEGER i,j,bi,bj |
30 |
|
31 |
WRITE(msgBuf,'(A)') 'OBCS_CHECK: #define ALLOW_OBCS' |
32 |
CALL PRINT_MESSAGE(msgBuf,standardMessageUnit, |
33 |
& SQUEEZE_RIGHT,myThid) |
34 |
|
35 |
#ifdef ALLOW_CD_CODE |
36 |
IF ( useCDscheme ) THEN |
37 |
WRITE(msgBuf,'(A)') |
38 |
& 'OBCS_CHECK: ERROR: useCDscheme = .TRUE.' |
39 |
CALL PRINT_ERROR( msgBuf , 1) |
40 |
WRITE(msgBuf,'(A)') |
41 |
& 'OBCS_CHECK: ERROR: The CD-scheme does not work with OBCS.' |
42 |
CALL PRINT_ERROR( msgBuf , 1) |
43 |
WRITE(msgBuf,'(A)') |
44 |
& 'OBCS_CHECK: ERROR: Sorry, not yet implemented.' |
45 |
CALL PRINT_ERROR( msgBuf , 1) |
46 |
STOP 'ABNORMAL END: S/R OBCS_CHECK' |
47 |
ENDIF |
48 |
#endif /* ALLOW_CD_CODE */ |
49 |
|
50 |
#ifdef ALLOW_ORLANSKI |
51 |
WRITE(msgBuf,'(A)') 'OBCS_CHECK: #define ALLOW_ORLANSKI' |
52 |
CALL PRINT_MESSAGE(msgBuf,standardMessageUnit, |
53 |
& SQUEEZE_RIGHT,myThid) |
54 |
#else |
55 |
IF (useOrlanskiNorth.OR.useOrlanskiSouth.OR. |
56 |
& useOrlanskiEast.OR.useOrlanskiWest) THEN |
57 |
WRITE(msgBuf,'(A)') |
58 |
& 'OBCS_CHECK: ERROR: #undef OBCS_RADIATE_ORLANSKI and' |
59 |
CALL PRINT_ERROR( msgBuf , 1) |
60 |
WRITE(msgBuf,'(A)') |
61 |
& 'OBCS_CHECK: ERROR: one of useOrlanski* logicals is true' |
62 |
CALL PRINT_ERROR( msgBuf , 1) |
63 |
STOP 'ABNORMAL END: S/R OBCS_CHECK' |
64 |
ENDIF |
65 |
#endif /* ALLOW_ORLANSKI */ |
66 |
|
67 |
IF (useOrlanskiNorth.OR.useOrlanskiSouth.OR. |
68 |
& useOrlanskiEast.OR.useOrlanskiWest) THEN |
69 |
IF (nonlinFreeSurf.GT.0) THEN |
70 |
WRITE(msgBuf,'(A)') |
71 |
& 'OBCS_CHECK: ERROR: useOrlanski* Rad OBC with' |
72 |
CALL PRINT_ERROR( msgBuf , 1) |
73 |
WRITE(msgBuf,'(A)') |
74 |
& 'OBCS_CHECK: ERROR: nonlinFreeSurf not yet implemented' |
75 |
CALL PRINT_ERROR( msgBuf , 1) |
76 |
STOP 'ABNORMAL END: S/R OBCS_CHECK' |
77 |
ENDIF |
78 |
IF (usePTracers) THEN |
79 |
WRITE(msgBuf,'(A)') |
80 |
& 'OBCS_CHECK: ERROR: useOrlanski* Rad OBC with' |
81 |
CALL PRINT_ERROR( msgBuf , 1) |
82 |
WRITE(msgBuf,'(A)') |
83 |
& 'OBCS_CHECK: ERROR: pTracers not yet implemented' |
84 |
CALL PRINT_ERROR( msgBuf , 1) |
85 |
STOP 'ABNORMAL END: S/R OBCS_CHECK' |
86 |
ENDIF |
87 |
IF (useSEAICE) THEN |
88 |
WRITE(msgBuf,'(A)') |
89 |
& 'OBCS_CHECK: ERROR: useOrlanski* Rad OBC with' |
90 |
CALL PRINT_ERROR( msgBuf , 1) |
91 |
WRITE(msgBuf,'(A)') |
92 |
& 'OBCS_CHECK: ERROR: SEAICE not yet implemented' |
93 |
CALL PRINT_ERROR( msgBuf , 1) |
94 |
STOP 'ABNORMAL END: S/R OBCS_CHECK' |
95 |
ENDIF |
96 |
ENDIF |
97 |
|
98 |
#ifndef ALLOW_OBCS_PRESCRIBE |
99 |
IF (useOBCSprescribe) THEN |
100 |
WRITE(msgBuf,'(A)') |
101 |
& 'OBCS_CHECK: ERROR: useOBCSprescribe = .TRUE. for' |
102 |
CALL PRINT_ERROR( msgBuf , 1) |
103 |
WRITE(msgBuf,'(A)') |
104 |
& 'OBCS_CHECK: undef ALLOW_OBCS_PRESCRIBE' |
105 |
CALL PRINT_ERROR( msgBuf , 1) |
106 |
STOP 'ABNORMAL END: S/R OBCS_CHECK' |
107 |
ENDIF |
108 |
#endif |
109 |
|
110 |
IF (useSEAICE .AND. .NOT. useEXF) THEN |
111 |
WRITE(msgBuf,'(A)') |
112 |
& 'OBCS_CHECK: ERROR: for SEAICE OBCS, use' |
113 |
CALL PRINT_ERROR( msgBuf , 1) |
114 |
WRITE(msgBuf,'(A)') |
115 |
& 'OBCS_CHECK: pkg/exf to read input files' |
116 |
CALL PRINT_ERROR( msgBuf , 1) |
117 |
STOP 'ABNORMAL END: S/R OBCS_CHECK' |
118 |
ENDIF |
119 |
|
120 |
IF ( debugLevel.GE.debLevB ) THEN |
121 |
_BEGIN_MASTER( myThid ) |
122 |
DO bj = 1,nSy |
123 |
DO bi = 1,nSx |
124 |
write(*,*) 'bi,bj:',bi,bj,' OB_Jn=',(OB_Jn(i,bi,bj),i=1,sNx) |
125 |
write(*,*) 'bi,bj:',bi,bj,' OB_Js=',(OB_Js(i,bi,bj),i=1,sNx) |
126 |
write(*,*) 'bi,bj:',bi,bj,' OB_Ie=',(OB_Ie(j,bi,bj),j=1,sNy) |
127 |
write(*,*) 'bi,bj:',bi,bj,' OB_Iw=',(OB_Iw(j,bi,bj),j=1,sNy) |
128 |
ENDDO |
129 |
ENDDO |
130 |
_END_MASTER(myThid) |
131 |
ENDIF |
132 |
|
133 |
WRITE(msgBuf,'(A)') 'OBCS_CHECK: OK' |
134 |
CALL PRINT_MESSAGE(msgBuf,standardMessageUnit, |
135 |
& SQUEEZE_RIGHT,myThid) |
136 |
|
137 |
#endif /* ALLOW_OBCS */ |
138 |
RETURN |
139 |
END |