1 |
C $Header: $ |
2 |
C $Name: $ |
3 |
#include "KPP_OPTIONS.h" |
4 |
|
5 |
SUBROUTINE KPP_CHECK( myThid ) |
6 |
C /==========================================================\ |
7 |
C | SUBROUTINE KPP_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 |
|
18 |
C === Routine arguments === |
19 |
C myThid - Number of this instance of KPP_INIT |
20 |
INTEGER myThid |
21 |
|
22 |
#ifdef ALLOW_KPP |
23 |
|
24 |
C === Local variables === |
25 |
C msgBuf - Informational/error meesage buffer |
26 |
CHARACTER*(MAX_LEN_MBUF) msgBuf |
27 |
|
28 |
WRITE(msgBuf,'(A)') 'KPP_CHECK: #define ALLOW_KPP' |
29 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
30 |
& SQUEEZE_RIGHT , 1) |
31 |
|
32 |
C KPP needs convection turned off (will be packaged later) |
33 |
IF (cAdjFreq.NE.0. .OR. |
34 |
& ivdc_kappa.NE.0.) THEN |
35 |
WRITE(msgBuf,'(A)') 'Some form of convection has been enabled' |
36 |
CALL PRINT_ERROR( msgBuf , 1) |
37 |
STOP 'ABNORMAL END: S/R KPP_CHECK' |
38 |
ENDIF |
39 |
|
40 |
C KPP needs implicit vertical diffusion and viscosity |
41 |
IF (.NOT.implicitDiffusion ) THEN |
42 |
WRITE(msgBuf,'(A)') 'KPP needs implicitDiffusion to be enabled' |
43 |
CALL PRINT_ERROR( msgBuf , 1) |
44 |
STOP 'ABNORMAL END: S/R KPP_CHECK' |
45 |
ENDIF |
46 |
IF (.NOT.implicitViscosity) THEN |
47 |
WRITE(msgBuf,'(A)') 'KPP needs implicitViscosity to be enabled' |
48 |
CALL PRINT_ERROR( msgBuf , 1) |
49 |
STOP 'ABNORMAL END: S/R KPP_CHECK' |
50 |
ENDIF |
51 |
|
52 |
C Shortwave heating should be defined with KPP |
53 |
#ifndef SHORTWAVE_HEATING |
54 |
WRITE(msgBuf,'(A)') 'KPP needs CPP flag SHORTWAVE_HEATING enabled' |
55 |
CALL PRINT_ERROR( msgBuf , 1) |
56 |
STOP 'ABNORMAL END: S/R KPP_CHECK' |
57 |
#endif /* SHORTWAVE_HEATING */ |
58 |
|
59 |
C Check that overlap region is adequate. |
60 |
C When horizontal smoothing is turned on, |
61 |
C KPP_CALC computes vertical viscosity and diffusivity for region |
62 |
C (-2:sNx+3,-2:sNy+3) as required by CALC_DIFFUSIVITY and requires |
63 |
C values of uVel, vVel, SurfaceTendencyU, SurfaceTendencyV in the |
64 |
C region (-2:sNx+4,-2:sNy+4). |
65 |
C Hence overlap region needs to be set OLx=4, OLy=4. |
66 |
C When option FRUGAL_KPP is used, computation in overlap regions |
67 |
C is replaced with exchange calls hence reducing KPP overlap |
68 |
C requirements to OLx=1, OLy=1. |
69 |
#ifndef FRUGAL_KPP |
70 |
# if defined(KPP_SMOOTH_SHSQ) || defined(KPP_SMOOTH_DVSQ) |
71 |
# define KPP_NEEDS_OVERLAP_4 |
72 |
# endif |
73 |
# if defined(KPP_SMOOTH_DBLOC) || defined(KPP_SMOOTH_DENS) |
74 |
# define KPP_NEEDS_OVERLAP_4 |
75 |
# endif |
76 |
# ifdef KPP_NEEDS_OVERLAP_4 |
77 |
#ifdef KPP_REACTIVATE_OL4 |
78 |
IF (OLx.LT.4 .OR. OLy.LT.4) THEN |
79 |
WRITE(msgBuf,'(A)') 'KPP horizontal smoothing requires OLx=OLy=4' |
80 |
CALL PRINT_ERROR( msgBuf , 1) |
81 |
WRITE(msgBuf,'(A)') 'or CPP option FRUGAL_KPP to be defined.' |
82 |
CALL PRINT_ERROR( msgBuf , 1) |
83 |
STOP 'ABNORMAL END: S/R KPP_CHECK' |
84 |
ENDIF |
85 |
#endif |
86 |
# endif |
87 |
#endif |
88 |
|
89 |
#endif /* ALLOW_KPP */ |
90 |
|
91 |
return |
92 |
end |