Back to home page

MITgcm

 
 

    


File indexing completed on 2024-02-29 06:10:25 UTC

view on githubraw file Latest commit a4576c7c on 2024-02-28 22:55:11 UTC
37609e3908 Jean*0001 #include "GMREDI_OPTIONS.h"
                0002 
                0003 CBOP
                0004 C     !ROUTINE: GMREDI_DO_EXCH
                0005 C     !INTERFACE:
                0006       SUBROUTINE GMREDI_DO_EXCH(
                0007      I                           myTime, myIter, myThid )
                0008 
                0009 C     !DESCRIPTION: \bv
                0010 C     *==========================================================*
                0011 C     | SUBROUTINE GMREDI_DO_EXCH
                0012 C     | o Apply Exchanges to GM-Redi variables when necessary
                0013 C     *==========================================================*
                0014 C     \ev
                0015 
                0016 C     !USES:
                0017       IMPLICIT NONE
                0018 
                0019 C     == Global variables ==
                0020 #include "SIZE.h"
                0021 #include "EEPARAMS.h"
                0022 #include "PARAMS.h"
                0023 #include "GMREDI.h"
                0024 
                0025 C     !INPUT/OUTPUT PARAMETERS:
                0026 C     myTime :: Current time in simulation
                0027 C     myIter :: Current iteration number in simulation
                0028 C     myThid :: my Thread Id. number
                0029       _RL     myTime
                0030       INTEGER myIter
                0031       INTEGER myThid
                0032 CEOP
                0033 
                0034 C     !LOCAL VARIABLES:
                0035 
                0036 #ifdef GM_BOLUS_ADVEC
5853335f7f Mich*0037 #ifdef ALLOW_EDDYPSI
                0038       IF ( GM_InMomAsStress ) THEN
                0039 #else
37609e3908 Jean*0040 C     For multi-dim advection, need valid bolus velocity in halo regions
                0041 C     near CS-corners: Because of sigmaR averaging @ U & V points, that
                0042 C     would require calling FILL_CS_CORNER_TR before each averaging (similar
                0043 C     to what is done in grad_sigma.F), near CS-corner values are not right.
                0044 C     This exchange fixes this Pb. Fix also a similar Pb with VisbeckK or
                0045 C     with GM-bolus 2-D mapping factor (GM_bolFac2d).
                0046       IF ( useCubedSphereExchange
                0047      &     .AND. GM_AdvForm
                0048      &     .AND. .NOT.GM_AdvSeparate
                0049      &     .AND. useMultiDimAdvec ) THEN
5853335f7f Mich*0050 #endif
37609e3908 Jean*0051 #ifdef ALLOW_DEBUG
                0052         IF (debugMode) CALL DEBUG_CALL('EXCH_UV(GM_PsiX,Y)',myThid)
                0053 #endif
                0054         CALL EXCH_UV_XYZ_RL( GM_PsiX, GM_PsiY, .TRUE., myThid )
                0055       ENDIF
                0056 #endif /* GM_BOLUS_ADVEC */
                0057 
a4576c7cde Juli*0058 #ifdef GM_GEOM_VARIABLE_K
                0059       IF ( GM_useGEOM ) THEN
                0060        _EXCH_XY_RL( GEOM_EKE , myThid )
                0061        _BEGIN_MASTER( myThid )
                0062 C     moved here, outside bi,bj loop:
                0063        IF ( GEOM_startAB .EQ. 0 ) GEOM_startAB = 1
                0064        _END_MASTER( myThid )
                0065       ENDIF
                0066 #endif
                0067 
37609e3908 Jean*0068       RETURN
                0069       END