File indexing completed on 2018-03-02 18:45:18 UTC
view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
4e8a78de50 Jean*0001 #include "CPP_OPTIONS.h"
0002
0003 SUBROUTINE MOM_VI_HFACZ_DISS(
0004 I bi,bj,k,
0005 O hFacZ,r_hFacZ,
0006 I myThid)
0007 IMPLICIT NONE
0008
0009
0010
0011
0012
0013
0014
0015 #include "SIZE.h"
6a5bc76422 Jean*0016 #include "EEPARAMS.h"
0017 #include "PARAMS.h"
4e8a78de50 Jean*0018 #include "GRID.h"
0019
0020
0021 INTEGER bi,bj,k
0022 _RS hFacZ(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
0023 _RS r_hFacZ(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
0024 _RS hFacZOpen
0025 INTEGER myThid
0026
0027
0028 INTEGER I,J
0029
0030
0031
0032 DO i=1-Olx,sNx+Olx
0033 hFacZ(i,1-Oly)=0.
0034 r_hFacZ(i,1-Oly)=0.
0035 ENDDO
0036
0037 DO j=2-Oly,sNy+Oly
0038 hFacZ(1-Olx,j)=0.
0039 r_hFacZ(1-Olx,j)=0.
0040 DO i=2-Olx,sNx+Olx
0041 hFacZOpen=MIN(_hFacW(i,j,k,bi,bj)
0042 & + _hFacW(i,j-1,k,bi,bj)
0043 & , _hFacS(i,j,k,bi,bj)
0044 & + _hFacS(i-1,j,k,bi,bj)
0045 & )
0046 hFacZ(i,j)=0.5*hFacZOpen
0047 IF (hFacZ(i,j).EQ.0.) THEN
0048 r_hFacZ(i,j)=0.
0049 ELSE
0050 r_hFacZ(i,j)=1./hFacZ(i,j)
0051 ENDIF
0052 ENDDO
0053 ENDDO
0054
6a5bc76422 Jean*0055
0056
0057
0058 IF (useCubedSphereExchange) THEN
0059 DO j=1,sNy+1,sNy
0060 DO i=1,sNx+1,sNx
0061 hFacZOpen=MIN( _hFacW(i,j,k,bi,bj)
0062 & , _hFacW(i,j-1,k,bi,bj)
0063 & , _hFacS(i,j,k,bi,bj)
0064 & , _hFacS(i-1,j,k,bi,bj)
0065 & )
0066 hFacZ(i,j)=hFacZOpen
0067 IF (hFacZOpen.EQ.0.) THEN
0068 r_hFacZ(i,j)=0.
0069 ELSE
0070 r_hFacZ(i,j)=1./hFacZOpen
0071 ENDIF
0072 ENDDO
0073 ENDDO
0074 ENDIF
0075
4e8a78de50 Jean*0076 RETURN
0077 END