1 |
C $Header: /u/gcmpack/MITgcm/pkg/shelfice/shelfice_check.F,v 1.5 2007/10/10 09:26:39 mlosch Exp $ |
2 |
C $Name: $ |
3 |
#include "SHELFICE_OPTIONS.h" |
4 |
|
5 |
SUBROUTINE SHELFICE_CHECK( myThid ) |
6 |
C /==========================================================\ |
7 |
C | SUBROUTINE SHELFICE_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 "SHELFICE.h" |
18 |
|
19 |
C === Routine arguments === |
20 |
C myThid - Number of this instance of SHELFICE_CHECK |
21 |
INTEGER myThid |
22 |
|
23 |
#ifdef ALLOW_SHELFICE |
24 |
|
25 |
C === Local variables === |
26 |
C msgBuf - Informational/error meesage buffer |
27 |
CHARACTER*(MAX_LEN_MBUF) msgBuf |
28 |
|
29 |
_BEGIN_MASTER(myThid) |
30 |
|
31 |
WRITE(msgBuf,'(A)') 'SHELFICE_CHECK: #define ALLOW_SHELFICE' |
32 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
33 |
& SQUEEZE_RIGHT, myThid ) |
34 |
|
35 |
C So far, SHELFICE works only with oceanic z-coordinates |
36 |
IF ( buoyancyRelation .NE. 'OCEANIC' ) THEN |
37 |
WRITE(msgBuf,'(A)') |
38 |
& 'SHELFICE works only with buoyancyRelation = ''OCEANIC''' |
39 |
CALL PRINT_ERROR( msgBuf, myThid ) |
40 |
STOP 'ABNORMAL END: S/R SHELFICE_CHECK' |
41 |
ENDIF |
42 |
|
43 |
CML#ifdef ALLOW_NONHYDROSTATIC |
44 |
CML IF ( nonHydrostatic ) THEN |
45 |
CML WRITE(msgBuf,'(A)') |
46 |
CML & 'Currently SHELFICE and nonHydrostatic cannot be turned' |
47 |
CML CALL PRINT_ERROR( msgBuf , 1) |
48 |
CML WRITE(msgBuf,'(A)') 'on at the same time' |
49 |
CML CALL PRINT_ERROR( msgBuf , 1) |
50 |
CML STOP 'ABNORMAL END: S/R SHELFICE_CHECK' |
51 |
CML ENDIF |
52 |
CML#endif /* ALLOW_NONHYDROSTATIC */ |
53 |
|
54 |
C SHELFICE may not work with many other packages, |
55 |
C e.g. vertical mixing schemes, in particular KPP will not work properly, |
56 |
C as KPP requires surface fluxes at the surface, whereas shelfice will |
57 |
C provide interfacial fluxes at some depth. Richardson flux number based |
58 |
C schemes such as Packanowski-Philander (PP81) should be no problem. |
59 |
CML#ifdef ALLOW_KPP |
60 |
CML IF ( useKPP ) THEN |
61 |
CML WRITE(msgBuf,'(A)') |
62 |
CML & 'SHELFICE and KPP cannot be turned on at the same time' |
63 |
CML CALL PRINT_ERROR( msgBuf , 1) |
64 |
CML STOP 'ABNORMAL END: S/R SHELFICE_CHECK' |
65 |
CML ENDIF |
66 |
CML#endif ALLOW_KPP |
67 |
|
68 |
#ifndef ALLOW_ISOMIP_TD |
69 |
IF ( useISOMIPTD ) THEN |
70 |
WRITE(msgBuf,'(A,A,A)') |
71 |
& 'Run-time control flag useISOMIPTD was used' |
72 |
CALL PRINT_ERROR( msgBuf, myThid ) |
73 |
WRITE(msgBuf,'(A,A,A)') |
74 |
& 'when CPP flag ALLOW_ISOMIP_TD was unset' |
75 |
CALL PRINT_ERROR( msgBuf, myThid ) |
76 |
STOP 'ABNORMAL END: S/R SHELFICE_CHECK' |
77 |
ENDIF |
78 |
#else |
79 |
IF ( useISOMIPTD ) THEN |
80 |
IF ( SHELFICEconserve ) THEN |
81 |
WRITE(msgBuf,'(A,A,A)') |
82 |
& 'Run-time control flag SHELFICEconserve=.TRUE. was used' |
83 |
CALL PRINT_ERROR( msgBuf, myThid ) |
84 |
WRITE(msgBuf,'(A,A,A)') |
85 |
& 'when useISOMIPTD=.TRUE.; this does not work!' |
86 |
CALL PRINT_ERROR( msgBuf, myThid ) |
87 |
STOP 'ABNORMAL END: S/R SHELFICE_CHECK' |
88 |
ENDIF |
89 |
ENDIF |
90 |
#endif /* ALLOW_ISOMIP_TD */ |
91 |
|
92 |
#ifndef SHI_ALLOW_GAMMAFRICT |
93 |
IF ( SHELFICEuseGammaFrict ) THEN |
94 |
WRITE(msgBuf,'(A,A,A)') |
95 |
& 'Run-time control flag SHELFICEuseGammaFrict was used' |
96 |
CALL PRINT_ERROR( msgBuf, myThid ) |
97 |
WRITE(msgBuf,'(A,A,A)') |
98 |
& 'when CPP flag SHI_ALLOW_GAMMAFRICT was unset' |
99 |
CALL PRINT_ERROR( msgBuf, myThid ) |
100 |
STOP 'ABNORMAL END: S/R SHELFICE_CHECK' |
101 |
ENDIF |
102 |
#endif /* SHI_ALLOW_GAMMAFRICT */ |
103 |
|
104 |
_END_MASTER(myThid) |
105 |
|
106 |
#endif /* ALLOW_SHELFICE */ |
107 |
|
108 |
RETURN |
109 |
END |