/[MITgcm]/MITgcm/pkg/gmredi/gmredi_check.F
ViewVC logotype

Diff of /MITgcm/pkg/gmredi/gmredi_check.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.8 by jmc, Mon Jan 13 19:02:45 2003 UTC revision 1.12 by jmc, Sun Dec 5 22:08:29 2004 UTC
# Line 1  Line 1 
1  C $Header$  C $Header$
2  C $Name$  C $Name$
3    
4  #include "CPP_OPTIONS.h"  #include "GMREDI_OPTIONS.h"
5    
6        SUBROUTINE GMREDI_CHECK( myThid )        SUBROUTINE GMREDI_CHECK( myThid )
7  C     /==========================================================\  C     /==========================================================\
# Line 16  C     === Global variables === Line 16  C     === Global variables ===
16  #include "EEPARAMS.h"  #include "EEPARAMS.h"
17  #include "PARAMS.h"  #include "PARAMS.h"
18  #include "GMREDI.h"  #include "GMREDI.h"
19    #ifdef ALLOW_GENERIC_ADVDIFF
20    #include "GAD.h"
21    #endif
22    
23  C     === Routine arguments ===  C     === Routine arguments ===
24  C     myThid -  Number of this instances  C     myThid -  Number of this instances
# Line 27  C     msgBuf      - Informational/error Line 30  C     msgBuf      - Informational/error
30    
31    
32  #ifdef ALLOW_GMREDI  #ifdef ALLOW_GMREDI
       IF (GMRediIsOn) THEN  
33    
34         WRITE(msgBuf,'(A)') 'GMREDI_CHECK: #define GMREDI'         WRITE(msgBuf,'(A)') 'GMREDI_CHECK: #define GMREDI'
35         CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,         CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
36       &                    SQUEEZE_RIGHT , 1)       &                    SQUEEZE_RIGHT , 1)
37    
 C      GM/Redi needs implicit diffusion (will be packaged later)  
        IF (.NOT.implicitDiffusion) THEN  
         WRITE(msgBuf,'(A)') 'GM/Redi needs implicitDiffusion=.true.'  
         CALL PRINT_ERROR( msgBuf , 1)  
         STOP 'ABNORMAL END: S/R GMREDI_CHECK'  
        ENDIF  
   
38  C- print out some kee parameters :  C- print out some kee parameters :
39         CALL WRITE_0D_L( GM_AdvForm, INDEX_NONE,         CALL WRITE_0D_L( GM_AdvForm, INDEX_NONE,
40       &  'GM_AdvForm =', '  /* if FALSE => use SkewFlux Form */')           &  'GM_AdvForm =', '  /* if FALSE => use SkewFlux Form */')    
# Line 64  C- print out some kee parameters : Line 59  C- print out some kee parameters :
59         CALL WRITE_0D_R8( GM_slopeSqCutoff, INDEX_NONE,         CALL WRITE_0D_R8( GM_slopeSqCutoff, INDEX_NONE,
60       &  ' GM_slopeSqCutoff =', '  /* Slope^2 cut-off value */')             &  ' GM_slopeSqCutoff =', '  /* Slope^2 cut-off value */')      
61    
62    
63    C--  Check parameters:
64    
65          _BEGIN_MASTER(myThid)
66    
67    C-     GM/Redi needs implicit diffusion (will be packaged later)
68           IF (.NOT.implicitDiffusion) THEN
69            WRITE(msgBuf,'(A)') 'GM/Redi needs implicitDiffusion=.true.'
70            CALL PRINT_ERROR( msgBuf , 1)
71            STOP 'ABNORMAL END: S/R GMREDI_CHECK'
72           ENDIF
73    
74    #ifndef GM_VISBECK_VARIABLE_K
75    C     Make sure we are not trying to use something that is unavailable
76          IF (GM_Visbeck_alpha .NE. 0.) THEN
77           WRITE(msgBuf,'(A)')
78         &   ' GMREDI_CHECK: Visbeck variables used in data.gmredi'
79           CALL PRINT_ERROR( msgBuf, 1 )
80           WRITE(msgBuf,'(A)')
81         &   ' GMREDI_CHECK: without #define GM_VISBECK_VARIABLE_K'
82           CALL PRINT_ERROR( msgBuf, 1 )
83           STOP 'ABNORMAL END: S/R GMREDI_CHECK'
84          ENDIF
85    #endif
86    
87    #ifndef GM_BOLUS_ADVEC
88    C     Make sure we are not trying to use some arrays that are unavailable
89          IF (GM_AdvForm) THEN
90           WRITE(msgBuf,'(A)')
91         &   ' GMREDI_CHECK: GM Advection form used in data.gmredi'
92           CALL PRINT_ERROR( msgBuf, 1 )
93           WRITE(msgBuf,'(A)')
94         &   ' GMREDI_CHECK: without #define GM_BOLUS_ADVEC'
95           CALL PRINT_ERROR( msgBuf, 1 )
96           STOP 'ABNORMAL END: S/R GMREDI_CHECK'
97        ENDIF        ENDIF
98    #endif
99    
100    #ifndef GM_EXTRA_DIAGONAL
101    C     Make sure we are not trying to use some arrays that are unavailable
102          IF (GM_ExtraDiag) THEN
103           WRITE(msgBuf,'(A)')
104         &   ' GMREDI_CHECK: GM_skew_Flux_K & GM_isopycK not equal'
105           CALL PRINT_ERROR( msgBuf, 1 )
106           WRITE(msgBuf,'(A)')
107         &   ' GMREDI_CHECK: without #define GM_EXTRA_DIAGONAL'
108           CALL PRINT_ERROR( msgBuf, 1 )
109           STOP 'ABNORMAL END: S/R GMREDI_CHECK'
110          ENDIF
111  #endif  #endif
112    
113    #ifdef ALLOW_GENERIC_ADVDIFF
114    C     Check size of overlap region
115          IF ( GM_AdvForm .AND. .NOT.GM_AdvSeparate
116         &       .AND. GM_Visbeck_alpha.NE.0.
117         &       .AND. useMultiDimAdvec
118         &       .AND. (Olx.LT.3 .OR. Oly.LT.3) ) THEN
119    C       Visbeck variable K requires 1 more row/column in the overlap:
120    C       might need to increase Olx,Oly from 2 to 3 if GM advective
121    C       form & multi-dim advection are used. This happens when:
122    C       a) using a 5 points stencil advection scheme ; or
123    C       b) using a 3 points stencil advection scheme on CS-grid
124    C note: not clear how to check (b) since none of the advection scheme
125    C       currently implemented falls in this category, except if
126    C       GAD_FLUX_LIMITER.h is changed to use a "constant" flux-limiter
127    C       (from Lax-Wendroff to 1rst Order upwind).
128    C-------
129    c       IF ( (useCubedSphereExchange
130    c    &       .AND.(    tempAdvScheme.EQ.ENUM_LAXWENDROFF
131    c    &            .OR. saltAdvScheme.EQ.ENUM_LAXWENDROFF )
132    c    &       ).OR.(    tempAdvScheme.EQ.ENUM_FLUX_LIMIT
133    c    &            .OR. saltAdvScheme.EQ.ENUM_FLUX_LIMIT
134    c    &            .OR. tempAdvScheme.EQ.ENUM_DST3_FLUX_LIMIT
135    c    &            .OR. saltAdvScheme.EQ.ENUM_DST3_FLUX_LIMIT
136    c    &            .OR. tempAdvScheme.EQ.ENUM_DST3
137    c    &            .OR. saltAdvScheme.EQ.ENUM_DST3 )
138    c    &     ) THEN
139              WRITE(msgBuf,'(A,A)')
140         &     'GMREDI_CHECK: Visbeck + GM_AdvForm in MultiDimAdvec'
141              CALL PRINT_ERROR( msgBuf , myThid)
142              WRITE(msgBuf,'(A)') 'GMREDI_CHECK: need at least Olx,Oly = 3'
143              CALL PRINT_ERROR( msgBuf , myThid)
144              STOP 'ABNORMAL END: S/R GMREDI_CHECK'
145    c       ENDIF
146          ENDIF
147    #endif /* ALLOW_GENERIC_ADVDIFF */
148    
149          _END_MASTER(myThid)
150    
151    #endif /* ALLOW_GMREDI */
152        RETURN        RETURN
153        END        END

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.12

  ViewVC Help
Powered by ViewVC 1.1.22