** Warning **
Issuing rollback() due to DESTROY without explicit disconnect() of DBD::mysql::db handle dbname=MITgcm at /usr/local/share/lxr/lib/LXR/Common.pm line 1224.
Last-Modified: Wed, 10 Sep 2024 05:11:47 GMT
Content-Type: text/html; charset=utf-8
MITgcm/MITgcm/pkg/generic_advdiff/gad_som_prep_cs_corner.F
File indexing completed on 2018-03-02 18:41:10 UTC
view on github raw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
b79a2b44f2 Jean* 0001 #include "GAD_OPTIONS.h "
0002
0003
0004
0005
0006 SUBROUTINE GAD_SOM_PREP_CS_CORNER (
0007 U smVol , smTr0 , smTr , smCorners ,
0008 I prep4dirX , overlapOnly , interiorOnly ,
0009 I N_edge , S_edge , E_edge , W_edge ,
0010 I iPass , k , myNz , bi , bj , myThid )
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 IMPLICIT NONE
0023
0024
0025 #include "SIZE.h "
0026 #include "EEPARAMS.h "
0027 #include "GAD.h "
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046 INTEGER myNz
0047 _RL smVol (1-OLx :sNx +OLx ,1-OLy :sNy +OLy ,myNz )
0048 _RL smTr0 (1-OLx :sNx +OLx ,1-OLy :sNy +OLy ,myNz )
0049 _RL smTr (1-OLx :sNx +OLx ,1-OLy :sNy +OLy ,myNz ,nSx ,nSy ,nSOM )
0050 _RL smCorners (OLx ,OLy ,4,-1:nSOM )
0051 LOGICAL prep4dirX , overlapOnly , interiorOnly
0052 LOGICAL N_edge , S_edge , E_edge , W_edge
0053 INTEGER iPass , k , bi , bj
0054 INTEGER myThid
0055
0056
0057
0058
0059 INTEGER i ,j , jPass , n
0060 LOGICAL southWestCorner
0061 LOGICAL southEastCorner
0062 LOGICAL northEastCorner
0063 LOGICAL northWestCorner
0064
0065 southWestCorner = S_edge .AND. W_edge
0066 southEastCorner = S_edge .AND. E_edge
0067 northEastCorner = N_edge .AND. E_edge
0068 northWestCorner = N_edge .AND. W_edge
0069
0070 IF ( overlapOnly ) THEN
0071
0072
0073
0074
0075
0076
0077
0078
0079 DO jPass = iPass ,2
0080
0081 IF ( ( jPass .EQ. 2 .AND. prep4dirX ) .OR.
0082 & ( jPass .EQ. 1 .AND. .NOT. prep4dirX ) ) THEN
0083
0084 CALL GAD_SOM_FILL_CS_CORNER ( .TRUE. ,
0085 U smVol (1-OLx ,1-OLy ,k ),
0086 U smTr0 (1-OLx ,1-OLy ,k ),
0087 U smTr (1-OLx ,1-OLy ,k ,bi ,bj ,1),
0088 U smTr (1-OLx ,1-OLy ,k ,bi ,bj ,2),
0089 U smTr (1-OLx ,1-OLy ,k ,bi ,bj ,3),
0090 U smTr (1-OLx ,1-OLy ,k ,bi ,bj ,4),
0091 U smTr (1-OLx ,1-OLy ,k ,bi ,bj ,5),
0092 U smTr (1-OLx ,1-OLy ,k ,bi ,bj ,6),
0093 U smTr (1-OLx ,1-OLy ,k ,bi ,bj ,7),
0094 U smTr (1-OLx ,1-OLy ,k ,bi ,bj ,8),
0095 U smTr (1-OLx ,1-OLy ,k ,bi ,bj ,9),
0096 I bi , bj , myThid )
0097
0098
0099
0100 ELSE
0101
0102
0103
0104
0105
0106
0107 CALL GAD_SOM_FILL_CS_CORNER ( .FALSE. ,
0108 U smVol (1-OLx ,1-OLy ,k ),
0109 U smTr0 (1-OLx ,1-OLy ,k ),
0110 U smTr (1-OLx ,1-OLy ,k ,bi ,bj ,1),
0111 U smTr (1-OLx ,1-OLy ,k ,bi ,bj ,2),
0112 U smTr (1-OLx ,1-OLy ,k ,bi ,bj ,3),
0113 U smTr (1-OLx ,1-OLy ,k ,bi ,bj ,4),
0114 U smTr (1-OLx ,1-OLy ,k ,bi ,bj ,5),
0115 U smTr (1-OLx ,1-OLy ,k ,bi ,bj ,6),
0116 U smTr (1-OLx ,1-OLy ,k ,bi ,bj ,7),
0117 U smTr (1-OLx ,1-OLy ,k ,bi ,bj ,8),
0118 U smTr (1-OLx ,1-OLy ,k ,bi ,bj ,9),
0119 I bi , bj , myThid )
0120
0121 ENDIF
0122
0123 IF ( jPass .EQ. 1 ) THEN
0124
0125 IF ( southWestCorner ) THEN
0126 DO j =1,OLy
0127 DO i =1,OLx
0128 smCorners (i ,j ,1,-1) = smVol (i -OLx ,j -OLy ,k )
0129 smCorners (i ,j ,1, 0) = smTr0 (i -OLx ,j -OLy ,k )
0130 DO n =1,nSOM
0131 smCorners (i ,j ,1,n ) = smTr (i -OLx ,j -OLy ,k ,bi ,bj ,n )
0132 ENDDO
0133 ENDDO
0134 ENDDO
0135 ENDIF
0136 IF ( southEastCorner ) THEN
0137 DO j =1,OLy
0138 DO i =1,OLx
0139 smCorners (i ,j ,2,-1) = smVol (sNx +i ,j -OLy ,k )
0140 smCorners (i ,j ,2, 0) = smTr0 (sNx +i ,j -OLy ,k )
0141 DO n =1,nSOM
0142 smCorners (i ,j ,2,n ) = smTr (sNx +i ,j -OLy ,k ,bi ,bj ,n )
0143 ENDDO
0144 ENDDO
0145 ENDDO
0146 ENDIF
0147 IF ( northEastCorner ) THEN
0148 DO j =1,OLy
0149 DO i =1,OLx
0150 smCorners (i ,j ,3,-1) = smVol (sNx +i ,sNy +j ,k )
0151 smCorners (i ,j ,3, 0) = smTr0 (sNx +i ,sNy +j ,k )
0152 DO n =1,nSOM
0153 smCorners (i ,j ,3,n ) = smTr (sNx +i ,sNy +j ,k ,bi ,bj ,n )
0154 ENDDO
0155 ENDDO
0156 ENDDO
0157 ENDIF
0158 IF ( northWestCorner ) THEN
0159 DO j =1,OLy
0160 DO i =1,OLx
0161 smCorners (i ,j ,4,-1) = smVol (i -OLx ,sNy +j ,k )
0162 smCorners (i ,j ,4, 0) = smTr0 (i -OLx ,sNy +j ,k )
0163 DO n =1,nSOM
0164 smCorners (i ,j ,4,n ) = smTr (i -OLx ,sNy +j ,k ,bi ,bj ,n )
0165 ENDDO
0166 ENDDO
0167 ENDDO
0168 ENDIF
0169
0170 ENDIF
0171
0172
0173 ENDDO
0174
0175 ELSEIF ( .NOT. interiorOnly ) THEN
0176
0177
0178 IF ( southWestCorner ) THEN
0179 DO j =1,OLy
0180 DO i =1,OLx
0181 smVol (i -OLx ,j -OLy ,k ) = smCorners (i ,j ,1,-1)
0182 smTr0 (i -OLx ,j -OLy ,k ) = smCorners (i ,j ,1, 0)
0183 DO n =1,nSOM
0184 smTr (i -OLx ,j -OLy ,k ,bi ,bj ,n ) = smCorners (i ,j ,1, n )
0185 ENDDO
0186 ENDDO
0187 ENDDO
0188 ENDIF
0189 IF ( southEastCorner ) THEN
0190 DO j =1,OLy
0191 DO i =1,OLx
0192 smVol (sNx +i ,j -OLy ,k ) = smCorners (i ,j ,2,-1)
0193 smTr0 (sNx +i ,j -OLy ,k ) = smCorners (i ,j ,2, 0)
0194 DO n =1,nSOM
0195 smTr (sNx +i ,j -OLy ,k ,bi ,bj ,n ) = smCorners (i ,j ,2, n )
0196 ENDDO
0197 ENDDO
0198 ENDDO
0199 ENDIF
0200 IF ( northEastCorner ) THEN
0201 DO j =1,OLy
0202 DO i =1,OLx
0203 smVol (sNx +i ,sNy +j ,k ) = smCorners (i ,j ,3,-1)
0204 smTr0 (sNx +i ,sNy +j ,k ) = smCorners (i ,j ,3, 0)
0205 DO n =1,nSOM
0206 smTr (sNx +i ,sNy +j ,k ,bi ,bj ,n ) = smCorners (i ,j ,3, n )
0207 ENDDO
0208 ENDDO
0209 ENDDO
0210 ENDIF
0211 IF ( northWestCorner ) THEN
0212 DO j =1,OLy
0213 DO i =1,OLx
0214 smVol (i -OLx ,sNy +j ,k ) = smCorners (i ,j ,4,-1)
0215 smTr0 (i -OLx ,sNy +j ,k ) = smCorners (i ,j ,4, 0)
0216 DO n =1,nSOM
0217 smTr (i -OLx ,sNy +j ,k ,bi ,bj ,n ) = smCorners (i ,j ,4, n )
0218 ENDDO
0219 ENDDO
0220 ENDDO
0221 ENDIF
0222
0223
0224
0225 ENDIF
0226
0227 RETURN
0228 END