1 |
C $Header: /u/gcmpack/MITgcm/pkg/thsice/thsice_check.F,v 1.5 2013/02/07 17:32:48 jmc Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "THSICE_OPTIONS.h" |
5 |
|
6 |
SUBROUTINE THSICE_CHECK( myThid ) |
7 |
|
8 |
c ================================================================== |
9 |
c SUBROUTINE THSICE_CHECK |
10 |
c ================================================================== |
11 |
c |
12 |
IMPLICIT NONE |
13 |
|
14 |
c == global variables == |
15 |
|
16 |
#include "SIZE.h" |
17 |
#include "EEPARAMS.h" |
18 |
#include "PARAMS.h" |
19 |
#include "THSICE_SIZE.h" |
20 |
#include "THSICE_PARAMS.h" |
21 |
|
22 |
c == routine arguments == |
23 |
|
24 |
c myThid :: my Thread Id number |
25 |
|
26 |
INTEGER myThid |
27 |
|
28 |
c == local variables == |
29 |
CHARACTER*(MAX_LEN_MBUF) msgBuf |
30 |
|
31 |
c == end of interface == |
32 |
|
33 |
_BEGIN_MASTER(myThid) |
34 |
|
35 |
WRITE(msgBuf,'(A)') 'THSICE_CHECK: #define THSICE' |
36 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
37 |
& SQUEEZE_RIGHT , myThid ) |
38 |
|
39 |
C-- Check parameter consistency: |
40 |
IF ( thSIceAdvScheme.EQ.0 .AND. thSIce_diffK.NE.0. ) THEN |
41 |
WRITE(msgBuf,'(2A)') |
42 |
& 'THSICE_CHECK: to use thSIce_diffK, needs to select', |
43 |
& ' one advection scheme (thSIceAdvScheme<>0)' |
44 |
CALL PRINT_ERROR( msgBuf , myThid ) |
45 |
STOP 'ABNORMAL END: S/R THSICE_CHECK' |
46 |
ENDIF |
47 |
#ifndef ALLOW_GENERIC_ADVDIFF |
48 |
IF ( thSIceAdvScheme.NE.0 ) THEN |
49 |
WRITE(msgBuf,'(2A)') 'THSICE_CHECK: Need to compile ', |
50 |
& '"generic_advdiff" pkg in order to use thSIceAdvScheme' |
51 |
CALL PRINT_ERROR( msgBuf , myThid ) |
52 |
STOP 'ABNORMAL END: S/R THSICE_CHECK' |
53 |
ENDIF |
54 |
#endif /* ndef ALLOW_GENERIC_ADVDIFF */ |
55 |
|
56 |
IF ( thSIceBalanceAtmFW.NE.0 ) THEN |
57 |
#ifndef ALLOW_BALANCE_FLUXES |
58 |
WRITE(msgBuf,'(2A)') 'THSICE_CHECK: to use thSIceBalanceAtmFW', |
59 |
& 'needs to compile with ALLOW_BALANCE_FLUXES defined' |
60 |
CALL PRINT_ERROR( msgBuf , myThid ) |
61 |
STOP 'ABNORMAL END: S/R THSICE_CHECK' |
62 |
#endif |
63 |
IF ( balanceEmPmR ) THEN |
64 |
WRITE(msgBuf,'(2A)') 'THSICE_CHECK: cannot use', |
65 |
& ' both balanceEmPmR and thSIceBalanceAtmFW' |
66 |
CALL PRINT_ERROR( msgBuf , myThid ) |
67 |
STOP 'ABNORMAL END: S/R THSICE_CHECK' |
68 |
ENDIF |
69 |
ENDIF |
70 |
|
71 |
#ifdef ALLOW_AUTODIFF |
72 |
IF ( nitMaxTsf .GT. MaxTsf ) THEN |
73 |
WRITE(msgBuf,'(2A)') |
74 |
& 'THSICE_CHECK: Need to set MaxTsf >= nitMaxTsf for TAF' |
75 |
CALL PRINT_ERROR( msgBuf , myThid ) |
76 |
STOP 'ABNORMAL END: S/R THSICE_CHECK' |
77 |
ENDIF |
78 |
# ifdef ALLOW_DBUG_THSICE |
79 |
WRITE(msgBuf,'(2A)') |
80 |
& 'THSICE_CHECK: cannot compile AD-code with ALLOW_DBUG_THSICE' |
81 |
CALL PRINT_ERROR( msgBuf , myThid ) |
82 |
STOP 'ABNORMAL END: S/R THSICE_CHECK' |
83 |
# endif |
84 |
#endif /* ALLOW_AUTODIFF */ |
85 |
|
86 |
#ifdef OLD_THSICE_CALL_SEQUENCE |
87 |
WRITE(msgBuf,'(2A)') '** WARNING ** THSICE_CHECK: ', |
88 |
& 'OLD_THSICE_CALL_SEQUENCE code no longer maintained' |
89 |
CALL PRINT_MESSAGE( msgBuf, errorMessageUnit, |
90 |
& SQUEEZE_RIGHT, myThid ) |
91 |
WRITE(msgBuf,'(2A)') '** WARNING ** THSICE_CHECK: ', |
92 |
& 'option and related code will be removed after chkpt-64e' |
93 |
CALL PRINT_MESSAGE( msgBuf, errorMessageUnit, |
94 |
& SQUEEZE_RIGHT, myThid ) |
95 |
|
96 |
#endif |
97 |
|
98 |
_END_MASTER(myThid) |
99 |
|
100 |
RETURN |
101 |
END |