| 44 |
|
|
| 45 |
C !LOCAL VARIABLES: ==================================================== |
C !LOCAL VARIABLES: ==================================================== |
| 46 |
C i,j :: loop indices |
C i,j :: loop indices |
| 47 |
INTEGER I,J |
INTEGER i,j |
| 48 |
CEOP |
CEOP |
| 49 |
|
|
| 50 |
C This defn of KE should not ever be used. Just to let you know. |
C This defn of KE should not ever be used. Just to let you know. |
| 53 |
C KE = --- | U + V | |
C KE = --- | U + V | |
| 54 |
C 2 \ / |
C 2 \ / |
| 55 |
C |
C |
| 56 |
|
#ifdef ALLOW_AUTODIFF_TAMC |
| 57 |
|
DO j=1-OLy,sNy+OLy |
| 58 |
|
DO i=1-OLx,sNx+OLx |
| 59 |
|
KE(i,j) = 0. |
| 60 |
|
ENDDO |
| 61 |
|
ENDDO |
| 62 |
|
#endif |
| 63 |
|
|
| 64 |
IF (KEscheme.EQ.-1) THEN |
IF (KEscheme.EQ.-1) THEN |
| 65 |
DO J=1-OLy,sNy+OLy-1 |
DO j=1-OLy,sNy+OLy-1 |
| 66 |
DO I=1-OLx,sNx+OLx-1 |
DO i=1-OLx,sNx+OLx-1 |
| 67 |
KE(i,j) = 0.125*( |
KE(i,j) = 0.125*( |
| 68 |
& ( uFld(i,j)+uFld(i+1, j ) )**2 |
& ( uFld(i,j)+uFld(i+1, j ) )**2 |
| 69 |
& +( vFld(i,j)+vFld( i ,j+1) )**2 ) |
& +( vFld(i,j)+vFld( i ,j+1) )**2 ) |
| 70 |
|
ENDDO |
| 71 |
ENDDO |
ENDDO |
|
ENDDO |
|
| 72 |
|
|
| 73 |
ELSEIF (KEscheme.EQ.0) THEN |
ELSEIF (KEscheme.EQ.0) THEN |
| 74 |
C This defn of KE should be used for the vector invariant equations. |
C This defn of KE should be used for the vector invariant equations. |
| 77 |
C KE = --- | U + V | |
C KE = --- | U + V | |
| 78 |
C 2 \ / |
C 2 \ / |
| 79 |
C |
C |
| 80 |
DO J=1-OLy,sNy+OLy-1 |
DO j=1-OLy,sNy+OLy-1 |
| 81 |
DO I=1-OLx,sNx+OLx-1 |
DO i=1-OLx,sNx+OLx-1 |
| 82 |
KE(i,j) = 0.25*( |
KE(i,j) = 0.25*( |
| 83 |
& ( uFld( i , j )*uFld( i , j ) |
& ( uFld( i , j )*uFld( i , j ) |
| 84 |
& +uFld(i+1, j )*uFld(i+1, j ) ) |
& +uFld(i+1, j )*uFld(i+1, j ) ) |
| 90 |
|
|
| 91 |
ELSEIF (KEscheme.EQ.1) THEN |
ELSEIF (KEscheme.EQ.1) THEN |
| 92 |
C As above but including the area |
C As above but including the area |
| 93 |
DO J=1-OLy,sNy+OLy-1 |
DO j=1-OLy,sNy+OLy-1 |
| 94 |
DO I=1-OLx,sNx+OLx-1 |
DO i=1-OLx,sNx+OLx-1 |
| 95 |
KE(i,j) = 0.25*( |
KE(i,j) = 0.25*( |
| 96 |
& ( uFld(i, j )*uFld(i, j )*rAw(i ,j, bi,bj) |
& ( uFld(i, j )*uFld(i, j )*rAw(i ,j, bi,bj) |
| 97 |
& +uFld(i+1,j)*uFld(i+1,j)*rAw(i+1,j,bi,bj) ) |
& +uFld(i+1,j)*uFld(i+1,j)*rAw(i+1,j,bi,bj) ) |
| 104 |
ELSEIF (KEscheme.EQ.2) THEN |
ELSEIF (KEscheme.EQ.2) THEN |
| 105 |
C As KEscheme=0 but including the lopping factors and should be used |
C As KEscheme=0 but including the lopping factors and should be used |
| 106 |
C for the conservative form of the momentum equations. |
C for the conservative form of the momentum equations. |
| 107 |
DO J=1-OLy,sNy+OLy-1 |
DO j=1-OLy,sNy+OLy-1 |
| 108 |
DO I=1-OLx,sNx+OLx-1 |
DO i=1-OLx,sNx+OLx-1 |
| 109 |
KE(i,j) = 0.25*( |
KE(i,j) = 0.25*( |
| 110 |
& ( uFld( i , j )*uFld( i , j )*_hFacW(i,j,k,bi,bj) |
& ( uFld( i , j )*uFld( i , j )*_hFacW(i,j,k,bi,bj) |
| 111 |
& +uFld(i+1, j )*uFld(i+1, j )*_hFacW(i+1,j,k,bi,bj) ) |
& +uFld(i+1, j )*uFld(i+1, j )*_hFacW(i+1,j,k,bi,bj) ) |
| 117 |
|
|
| 118 |
ELSEIF (KEscheme.EQ.3) THEN |
ELSEIF (KEscheme.EQ.3) THEN |
| 119 |
C As above but including the area |
C As above but including the area |
| 120 |
DO J=1-OLy,sNy+OLy-1 |
DO j=1-OLy,sNy+OLy-1 |
| 121 |
DO I=1-OLx,sNx+OLx-1 |
DO i=1-OLx,sNx+OLx-1 |
| 122 |
KE(i,j) = 0.25*( |
KE(i,j) = 0.25*( |
| 123 |
& ( |
& ( |
| 124 |
& uFld(i, j )*uFld(i, j ) |
& uFld(i, j )*uFld(i, j ) |
| 125 |
& *_hFacW(i ,j, k,bi,bj)*rAw(i ,j, bi,bj) |
& *_hFacW(i ,j, k,bi,bj)*rAw(i ,j, bi,bj) |
| 126 |
& +uFld(i+1,j)*uFld(i+1,j) |
& +uFld(i+1,j)*uFld(i+1,j) |
| 127 |
& *_hFacW(i+1,j,k,bi,bj)*rAw(i+1,j,bi,bj) |
& *_hFacW(i+1,j,k,bi,bj)*rAw(i+1,j,bi,bj) |
| 128 |
& ) |
& ) |
| 129 |
& + ( |
& + ( |
| 130 |
& vFld(i, j )*vFld(i, j ) |
& vFld(i, j )*vFld(i, j ) |
| 131 |
& *_hFacS(i, j, k,bi,bj)*rAs(i ,j, bi,bj) |
& *_hFacS(i, j, k,bi,bj)*rAs(i ,j, bi,bj) |