150 |
_RL fCoriV(1-Olx:sNx+Olx,1-Oly:sNy+Oly) |
_RL fCoriV(1-Olx:sNx+Olx,1-Oly:sNy+Oly) |
151 |
_RL surfkz(1-Olx:sNx+Olx,1-Oly:sNy+Oly) |
_RL surfkz(1-Olx:sNx+Olx,1-Oly:sNy+Oly) |
152 |
|
|
153 |
|
C centreX,centreY :: used for calculating averages at centre of cell |
154 |
|
C numerator,denominator :: of the renormalisation factor |
155 |
|
C uInt :: column integral of u velocity (sum u*dz) |
156 |
|
C vInt :: column integral of v velocity (sum v*dz) |
157 |
|
C KdqdxInt :: column integral of K*dqdx (sum K*dqdx*dz) |
158 |
|
C KdqdyInt :: column integral of K*dqdy (sum K*dqdy*dz) |
159 |
|
C uKdqdyInt :: column integral of u*K*dqdy (sum u*K*dqdy*dz) |
160 |
|
C vKdqdxInt :: column integral of v*K*dqdx (sum v*K*dqdx*dz) |
161 |
|
C uXiyInt :: column integral of u*Xiy (sum u*Xiy*dz) |
162 |
|
C vXixInt :: column integral of v*Xix (sum v*Xix*dz) |
163 |
|
C Renorm :: renormalisation factor at the centre of a cell |
164 |
|
C RenormU :: renormalisation factor at the western face of a cell |
165 |
|
C RenormV :: renormalisation factor at the southern face of a cell |
166 |
_RL centreX, centreY |
_RL centreX, centreY |
167 |
_RL numerator, denominator |
_RL numerator, denominator |
168 |
_RL uInt(1-Olx:sNx+Olx,1-Oly:sNy+Oly) |
_RL uInt(1-Olx:sNx+Olx,1-Oly:sNy+Oly) |
919 |
vKdqdxInt(i,j)=zeroRL |
vKdqdxInt(i,j)=zeroRL |
920 |
uXiyInt(i,j)=zeroRL |
uXiyInt(i,j)=zeroRL |
921 |
vXixInt(i,j)=zeroRL |
vXixInt(i,j)=zeroRL |
922 |
Renorm(i,j)=zeroRL |
Renorm(i,j)=oneRL |
923 |
|
RenormU(i,j)=oneRL |
924 |
|
RenormV(i,j)=oneRL |
925 |
ENDDO |
ENDDO |
926 |
ENDDO |
ENDDO |
927 |
DO k=1,Nr |
DO k=1,Nr |
968 |
denominator = uXiyInt(i,j) - vXixInt(i,j) |
denominator = uXiyInt(i,j) - vXixInt(i,j) |
969 |
C We can have troubles with floating point exceptions if the denominator |
C We can have troubles with floating point exceptions if the denominator |
970 |
C of the renormalisation if the ocean is resting (e.g. intial conditions). |
C of the renormalisation if the ocean is resting (e.g. intial conditions). |
971 |
C So we make the renormalisation factor zero if the denominator is very small |
C So we make the renormalisation factor one if the denominator is very small |
972 |
IF (denominator.LE.small) THEN |
C The renormalisation factor is supposed to correct the error in the extraction of |
973 |
Renorm(i,j)=zeroRL |
C potential energy associated with the truncation of the expansion. Thus, we |
974 |
ELSE |
C enforce a minimum value for the renormalisation factor. |
975 |
|
C We also enforce a maximum renormalisation factor. |
976 |
|
IF (denominator.GT.small) THEN |
977 |
Renorm(i,j) = ABS(numerator/denominator) |
Renorm(i,j) = ABS(numerator/denominator) |
978 |
|
Renorm(i,j) = MAX(Renorm(i,j),GM_K3D_minRenorm) |
979 |
|
Renorm(i,j) = MIN(Renorm(i,j),GM_K3D_maxRenorm) |
980 |
ENDIF |
ENDIF |
981 |
ENDIF |
ENDIF |
982 |
ENDDO |
ENDDO |
993 |
DO k=1,Nr |
DO k=1,Nr |
994 |
DO j=1-Oly+1,sNy+Oly |
DO j=1-Oly+1,sNy+Oly |
995 |
DO i=1-Olx+1,sNx+Olx |
DO i=1-Olx+1,sNx+Olx |
996 |
ustar(i,j,k) = -Renorm(i,j)*Xix(i,j,k)/coriU(i,j) |
ustar(i,j,k) = -RenormU(i,j)*Xix(i,j,k)/coriU(i,j) |
997 |
ENDDO |
ENDDO |
998 |
ENDDO |
ENDDO |
999 |
ENDDO |
ENDDO |
1002 |
DO k=1,Nr |
DO k=1,Nr |
1003 |
DO j=1-Oly+1,sNy+Oly |
DO j=1-Oly+1,sNy+Oly |
1004 |
DO i=1-Olx+1,sNx+Olx |
DO i=1-Olx+1,sNx+Olx |
1005 |
vstar(i,j,k) = -Renorm(i,j)*Xiy(i,j,k)/coriV(i,j) |
vstar(i,j,k) = -RenormV(i,j)*Xiy(i,j,k)/coriV(i,j) |
1006 |
ENDDO |
ENDDO |
1007 |
ENDDO |
ENDDO |
1008 |
ENDDO |
ENDDO |