Back to home page

MITgcm

 
 

    


File indexing completed on 2018-03-02 18:39:50 UTC

view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
6d54cf9ca1 Ed H*0001 #include "EXF_OPTIONS.h"
7f861c1808 Patr*0002 
163e9e8048 Jean*0003       SUBROUTINE EXF_FILTER_RL(
                0004      U                          arr,
                0005      I                          ckind, myThid )
7f861c1808 Patr*0006 
163e9e8048 Jean*0007 C     ==================================================================
                0008 C     SUBROUTINE EXF_FILTER_RL
                0009 C     ==================================================================
                0010 C
                0011 C     o apply mask to input field
                0012 C
                0013 C     ==================================================================
                0014 C     SUBROUTINE EXF_FILTER_RL
                0015 C     ==================================================================
7f861c1808 Patr*0016 
163e9e8048 Jean*0017       IMPLICIT NONE
7f861c1808 Patr*0018 
163e9e8048 Jean*0019 C     == global variables ==
7f861c1808 Patr*0020 #include "EEPARAMS.h"
                0021 #include "SIZE.h"
cee16b76ae Dimi*0022 #include "PARAMS.h"
163e9e8048 Jean*0023 #include "GRID.h"
                0024 c#include "EXF_CONSTANTS.h"
7f861c1808 Patr*0025 
163e9e8048 Jean*0026 C     == routine arguments ==
7f861c1808 Patr*0027       _RL arr(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
163e9e8048 Jean*0028       CHARACTER*1 ckind
                0029       INTEGER myThid
7f861c1808 Patr*0030 
163e9e8048 Jean*0031 C     == local variables ==
                0032       INTEGER bi,bj
                0033       INTEGER i,j, ks
7f861c1808 Patr*0034 
163e9e8048 Jean*0035 C     == end of interface ==
7f861c1808 Patr*0036 
163e9e8048 Jean*0037 C     filter forcing field array
                0038       IF ( ckind.NE.' ' ) THEN
7f861c1808 Patr*0039 
163e9e8048 Jean*0040         ks = 1
                0041         IF ( usingPCoords ) ks = Nr
7f861c1808 Patr*0042 
163e9e8048 Jean*0043         DO bj = myByLo(myThid), myByHi(myThid)
                0044          DO bi = myBxLo(myThid), myBxHi(myThid)
cee16b76ae Dimi*0045 
163e9e8048 Jean*0046 C         Set undefined values to zero.
                0047 Crg not necessary and
                0048 Crg would require additional intermediate results in adjoint
                0049 crg          DO j = 1,sNy
                0050 crg            DO i = 1,sNx
                0051 crg              IF (arr(i,j,bi,bj) .LE. exf_undef) THEN
7f861c1808 Patr*0052 crg                arr(i,j,bi,bj) = 0. _d 0
163e9e8048 Jean*0053 crg              ENDIF
                0054 crg            ENDDO
                0055 crg          ENDDO
                0056 
                0057 C         Set land points to zero
                0058           IF     ( ckind .EQ. 'c' ) THEN
                0059             DO j = 1,sNy
                0060              DO i = 1,sNx
                0061                IF ( maskC(i,j,ks,bi,bj) .EQ. 0. ) THEN
                0062                  arr(i,j,bi,bj) = 0. _d 0
                0063                ENDIF
                0064              ENDDO
                0065             ENDDO
                0066           ELSEIF ( ckind .EQ. 'w' ) THEN
                0067             DO j = 1,sNy
                0068              DO i = 1,sNx
                0069                IF ( maskW(i,j,ks,bi,bj) .EQ. 0. ) THEN
                0070                  arr(i,j,bi,bj) = 0. _d 0
                0071                ENDIF
                0072              ENDDO
                0073             ENDDO
                0074           ELSEIF ( ckind .EQ. 's' ) THEN
                0075             DO j = 1,sNy
                0076              DO i = 1,sNx
                0077                IF ( maskS(i,j,ks,bi,bj) .EQ. 0. ) THEN
                0078                  arr(i,j,bi,bj) = 0. _d 0
                0079                ENDIF
                0080              ENDDO
                0081             ENDDO
                0082           ENDIF
                0083 
                0084          ENDDO
                0085         ENDDO
cee16b76ae Dimi*0086       ENDIF
                0087 
163e9e8048 Jean*0088       RETURN
                0089       END