Back to home page

MITgcm

 
 

    


File indexing completed on 2018-03-02 18:36:13 UTC

view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
34b7cbca00 Jean*0001 #include "CPP_EEOPTIONS.h"
                0002 
                0003 C--  File reset_halo.F: to fill-up halo region with constant value
                0004 C--   Contents
                0005 C--   o RESET_HALO_RL
                0006 C--   o RESET_HALO_RS
                0007 
                0008 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
                0009 
                0010 CBOP
                0011 C     !ROUTINE: RESET_HALO_RL
                0012 C     !INTERFACE:
                0013       SUBROUTINE RESET_HALO_RL(
                0014      U                          glFld,
                0015      I                          fixVal, kSize, myThid )
                0016 C     !DESCRIPTION: \bv
                0017 C     *==========================================================*
                0018 C     | S/R RESET_HALO_RL
                0019 C     *==========================================================*
                0020 C     | o Reset to constant value the halo region of a global
                0021 C     |   3-D array. Note: used for debugging only .
                0022 C     *==========================================================*
                0023 C     \ev
                0024 
                0025 C     !USES:
                0026       IMPLICIT NONE
                0027 #include "SIZE.h"
                0028 #include "EEPARAMS.h"
                0029 
                0030 C     !INPUT/OUTPUT PARAMETERS:
                0031 C     == Routine Arguments ==
                0032 C     glFld    :: field global array to update in halo-region
                0033 C     fixVal   :: constant value to fill-up the halo region with
                0034 C     kSize    :: size of 3-D field-array
                0035 C     myThid   :: my Thread Id number
                0036       INTEGER kSize
                0037       _RL glFld(1-OLx:sNx+OLx,1-OLy:sNy+OLy,kSize,nSx,nSy)
                0038       _RL fixVal
                0039       INTEGER myThid
                0040 
                0041 C     !LOCAL VARIABLES:
                0042 C     == Local variables ==
                0043       INTEGER bi, bj, k
                0044       INTEGER ii, i, j
                0045 CEOP
                0046 
                0047       DO bj = myByLo(myThid), myByHi(myThid)
                0048        DO bi = myBxLo(myThid), myBxHi(myThid)
                0049 
                0050         DO k=1,kSize
                0051 
                0052          DO j=1-OLy,sNy+OLy
                0053           IF ( j.LT.1 .OR. j.GT.sNy ) THEN
                0054            DO i=1-OLx,sNx+OLx
                0055              glFld(i,j,k,bi,bj) = fixVal
                0056            ENDDO
                0057           ELSE
                0058            DO ii=1-OLx,OLx
                0059              i = ii
                0060              IF ( ii.GE.1 ) i= ii+sNx
                0061              glFld(i,j,k,bi,bj) = fixVal
                0062            ENDDO
                0063           ENDIF
                0064          ENDDO
                0065 
                0066         ENDDO
                0067 
                0068 C-   end bi,bj loops
                0069        ENDDO
                0070       ENDDO
                0071 
                0072       RETURN
                0073       END
                0074 
                0075 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
                0076 
                0077 CBOP
                0078 C     !ROUTINE: RESET_HALO_RS
                0079 C     !INTERFACE:
                0080       SUBROUTINE RESET_HALO_RS(
                0081      U                          glFld,
                0082      I                          fixVal, kSize, myThid )
                0083 C     !DESCRIPTION: \bv
                0084 C     *==========================================================*
                0085 C     | S/R RESET_HALO_RS
                0086 C     *==========================================================*
                0087 C     | o Reset to constant value the halo region of a global
                0088 C     |   3-D array. Note: used for debugging only .
                0089 C     *==========================================================*
                0090 C     \ev
                0091 
                0092 C     !USES:
                0093       IMPLICIT NONE
                0094 #include "SIZE.h"
                0095 #include "EEPARAMS.h"
                0096 
                0097 C     !INPUT/OUTPUT PARAMETERS:
                0098 C     == Routine Arguments ==
                0099 C     glFld    :: field global array to update in halo-region
                0100 C     fixVal   :: constant value to fill-up the halo region with
                0101 C     kSize    :: size of 3-D field-array
                0102 C     myThid   :: my Thread Id number
                0103       INTEGER kSize
                0104       _RS glFld(1-OLx:sNx+OLx,1-OLy:sNy+OLy,kSize,nSx,nSy)
                0105       _RS fixVal
                0106       INTEGER myThid
                0107 
                0108 C     !LOCAL VARIABLES:
                0109 C     == Local variables ==
                0110       INTEGER bi, bj, k
                0111       INTEGER ii, i, j
                0112 CEOP
                0113 
                0114       DO bj = myByLo(myThid), myByHi(myThid)
                0115        DO bi = myBxLo(myThid), myBxHi(myThid)
                0116 
                0117         DO k=1,kSize
                0118 
                0119          DO j=1-OLy,sNy+OLy
                0120           IF ( j.LT.1 .OR. j.GT.sNy ) THEN
                0121            DO i=1-OLx,sNx+OLx
                0122              glFld(i,j,k,bi,bj) = fixVal
                0123            ENDDO
                0124           ELSE
                0125            DO ii=1-OLx,OLx
                0126              i = ii
                0127              IF ( ii.GE.1 ) i= ii+sNx
                0128              glFld(i,j,k,bi,bj) = fixVal
                0129            ENDDO
                0130           ENDIF
                0131          ENDDO
                0132 
                0133         ENDDO
                0134 
                0135 C-   end bi,bj loops
                0136        ENDDO
                0137       ENDDO
                0138 
                0139       RETURN
                0140       END