1 |
C $Header: /u/gcmpack/MITgcm/pkg/gmredi/gmredi_do_exch.F,v 1.2 2013/09/15 14:31:11 m_bates Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "GMREDI_OPTIONS.h" |
5 |
|
6 |
CBOP |
7 |
C !ROUTINE: GMREDI_DO_EXCH |
8 |
C !INTERFACE: |
9 |
SUBROUTINE GMREDI_DO_EXCH( |
10 |
I myTime, myIter, myThid ) |
11 |
|
12 |
C !DESCRIPTION: \bv |
13 |
C *==========================================================* |
14 |
C | SUBROUTINE GMREDI_DO_EXCH |
15 |
C | o Apply Exchanges to GM-Redi variables when necessary |
16 |
C *==========================================================* |
17 |
C \ev |
18 |
|
19 |
C !USES: |
20 |
IMPLICIT NONE |
21 |
|
22 |
C == Global variables == |
23 |
#include "SIZE.h" |
24 |
#include "EEPARAMS.h" |
25 |
#include "PARAMS.h" |
26 |
#include "GMREDI.h" |
27 |
|
28 |
C !INPUT/OUTPUT PARAMETERS: |
29 |
C myTime :: Current time in simulation |
30 |
C myIter :: Current iteration number in simulation |
31 |
C myThid :: my Thread Id. number |
32 |
_RL myTime |
33 |
INTEGER myIter |
34 |
INTEGER myThid |
35 |
CEOP |
36 |
|
37 |
C !LOCAL VARIABLES: |
38 |
|
39 |
#ifdef GM_BOLUS_ADVEC |
40 |
#ifdef ALLOW_EDDYPSI |
41 |
IF ( GM_InMomAsStress ) THEN |
42 |
#else |
43 |
C For multi-dim advection, need valid bolus velocity in halo regions |
44 |
C near CS-corners: Because of sigmaR averaging @ U & V points, that |
45 |
C would require calling FILL_CS_CORNER_TR before each averaging (similar |
46 |
C to what is done in grad_sigma.F), near CS-corner values are not right. |
47 |
C This exchange fixes this Pb. Fix also a similar Pb with VisbeckK or |
48 |
C with GM-bolus 2-D mapping factor (GM_bolFac2d). |
49 |
IF ( useCubedSphereExchange |
50 |
& .AND. GM_AdvForm |
51 |
& .AND. .NOT.GM_AdvSeparate |
52 |
& .AND. useMultiDimAdvec ) THEN |
53 |
#endif |
54 |
#ifdef ALLOW_DEBUG |
55 |
IF (debugMode) CALL DEBUG_CALL('EXCH_UV(GM_PsiX,Y)',myThid) |
56 |
#endif |
57 |
CALL EXCH_UV_XYZ_RL( GM_PsiX, GM_PsiY, .TRUE., myThid ) |
58 |
ENDIF |
59 |
#endif /* GM_BOLUS_ADVEC */ |
60 |
|
61 |
RETURN |
62 |
END |