Back to home page

MITgcm

 
 

    


File indexing completed on 2018-03-02 18:38:22 UTC

view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
c5ea996ba0 Jean*0001 #include "CHEAPAML_OPTIONS.h"
                0002 
                0003 CBOP
                0004 C     !ROUTINE: CHEAPAML_COPY_EDGES
                0005 C     !INTERFACE:
                0006       SUBROUTINE CHEAPAML_COPY_EDGES(
                0007      I                     xIsPeriodic, yIsPeriodic,
                0008      I                     refFld,
                0009      U                     trcFld,
                0010      I                     bi, bj, myIter, myThid )
                0011 C     !DESCRIPTION: \bv
                0012 C     *==========================================================*
                0013 C     | S/R CHEAPAML_COPY_EDGES
                0014 C     | o If not periodic, copy Edges of reference array "refFld"
                0015 C     |   into current tracer field array "trcFld"
                0016 C     *==========================================================*
                0017 C     \ev
                0018 
                0019 C     !USES:
                0020       IMPLICIT NONE
                0021 C     == Global variables ===
                0022 #include "SIZE.h"
                0023 #include "EEPARAMS.h"
                0024 #include "PARAMS.h"
                0025 
                0026 C     !INPUT/OUTPUT PARAMETERS:
                0027 C     == Routine Arguments ==
                0028 C     xIsPeriodic :: periodic in X dir
                0029 C     yIsPeriodic :: periodic in Y dir
                0030 C     refFld      :: reference tracer field (copy from this field)
                0031 C     trcFld      :: current tracer field to update at the Edges
                0032 C     bi, bj      :: tile indices
                0033 C     myIter      :: current iteration number
                0034 C     myThid      :: my Thread Id number
                0035       LOGICAL xIsPeriodic, yIsPeriodic
                0036       _RL  refFld(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
                0037       _RL  trcFld(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
                0038       INTEGER bi, bj, myIter, myThid
                0039 
                0040 C     !LOCAL VARIABLES:
                0041 C     == Local variables ==
                0042       INTEGER i, j, iG, jG
                0043 CEOP
                0044 
                0045 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
                0046 
                0047 c     DO bj=myByLo(myThid),myByHi(myThid)
                0048 c      DO bi=myBxLo(myThid),myBxHi(myThid)
                0049 
                0050         IF (.NOT.xIsPeriodic) THEN
                0051           iG = 1 + myXGlobalLo-1+(bi-1)*sNx
                0052           IF (iG.EQ.1) THEN
                0053             DO j=1-OLy,sNy+OLy
                0054              DO i=1-OLx,1
                0055                trcFld(i,j) = refFld(i,j)
                0056              ENDDO
                0057             ENDDO
                0058           ENDIF
                0059           iG = sNx + myXGlobalLo-1+(bi-1)*sNx
                0060           IF (iG.GE.Nx) THEN
                0061             DO j=1-OLy,sNy+OLy
                0062              DO i=sNx,sNx+OLx
                0063                trcFld(i,j) = refFld(i,j)
                0064              ENDDO
                0065             ENDDO
                0066           ENDIF
                0067         ENDIF
                0068 
                0069         IF (.NOT.yIsPeriodic) THEN
                0070           jG = 1 + myYGlobalLo-1+(bj-1)*sNy
                0071           IF (jG.EQ.1) THEN
                0072             DO j=1-OLy,1
                0073              DO i=1-OLx,sNx+OLx
                0074                trcFld(i,j) = refFld(i,j)
                0075              ENDDO
                0076             ENDDO
                0077           ENDIF
                0078           jG = sNy + myYGlobalLo-1+(bj-1)*sNy
                0079           IF (jG.GE.Ny) THEN
                0080             DO j=sNy,sNy+OLy
                0081              DO i=1-OLx,sNx+OLx
                0082                trcFld(i,j) = refFld(i,j)
                0083              ENDDO
                0084             ENDDO
                0085           ENDIF
                0086         ENDIF
                0087 
                0088 c      ENDDO
                0089 c     ENDDO
                0090 
                0091       RETURN
                0092       END