1 |
m_bates |
1.1 |
C $Header: $ |
2 |
|
|
C $Name: $ |
3 |
|
|
|
4 |
|
|
#include "GMREDI_OPTIONS.h" |
5 |
|
|
|
6 |
|
|
C !ROUTINE: EIGENVAL |
7 |
|
|
C !INTERFACE: |
8 |
|
|
SUBROUTINE GMREDI_CALC_URMS( |
9 |
|
|
I iMin, iMax, jMin, jMax, |
10 |
|
|
I bi, bj, N2, myThid, |
11 |
|
|
O urms, vec) |
12 |
|
|
|
13 |
|
|
C !DESCRIPTION: \bv |
14 |
|
|
C *==========================================================* |
15 |
|
|
C | SUBROUTINE GMREDI_CALC_URMS |
16 |
|
|
C | o Calculate the vertical structure of the rms eddy |
17 |
|
|
C | velocity based on baroclinic modal decomposition |
18 |
|
|
C *==========================================================* |
19 |
|
|
C \ev |
20 |
|
|
|
21 |
|
|
IMPLICIT NONE |
22 |
|
|
|
23 |
|
|
C == Global variables == |
24 |
|
|
#include "SIZE.h" |
25 |
|
|
#include "GRID.h" |
26 |
|
|
#include "EEPARAMS.h" |
27 |
|
|
#include "PARAMS.h" |
28 |
|
|
#include "GMREDI.h" |
29 |
|
|
|
30 |
|
|
C !INPUT/OUTPUT PARAMETERS: |
31 |
|
|
C == Routine arguments == |
32 |
|
|
C bi, bj :: tile indices |
33 |
|
|
INTEGER iMin,iMax,jMin,jMax |
34 |
|
|
INTEGER bi, bj |
35 |
|
|
INTEGER myThid |
36 |
|
|
_RL N2( 1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr) |
37 |
|
|
_RL urms(1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr) |
38 |
|
|
_RL vec(GM_K3D_NModes,1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr) |
39 |
|
|
|
40 |
|
|
C !LOCAL VARIABLES: |
41 |
|
|
C == Local variables == |
42 |
|
|
INTEGER i,j,k,kk,info |
43 |
|
|
_RL bbc( 1-Olx:sNx+Olx,1-Oly:sNy+Oly) |
44 |
|
|
_RL const( 1-Olx:sNx+Olx,1-Oly:sNy+Oly) |
45 |
|
|
|
46 |
|
|
C Constant zero bottom boundary condition |
47 |
|
|
DO j=1-Oly,sNy+Oly |
48 |
|
|
DO i=1-Olx,sNx+Olx |
49 |
|
|
bbc(i,j) = zeroRL |
50 |
|
|
ENDDO |
51 |
|
|
ENDDO |
52 |
|
|
|
53 |
|
|
C Fit urms to the first baroclinic mode using the SBC and BBC |
54 |
|
|
C We need at least two cells to do this |
55 |
|
|
DO j=1-Oly,sNy+Oly |
56 |
|
|
DO i=1-Olx,sNx+Olx |
57 |
|
|
k = kLowC(i,j,bi,bj) |
58 |
|
|
IF (k.GT.2) THEN |
59 |
|
|
const(i,j) = (urms(i,j,k)-urms(i,j,1)) |
60 |
|
|
& /(vec(1,i,j,k)-vec(1,i,j,1)) |
61 |
|
|
ELSE |
62 |
|
|
const(i,j) = zeroRL |
63 |
|
|
ENDIF |
64 |
|
|
ENDDO |
65 |
|
|
ENDDO |
66 |
|
|
|
67 |
|
|
DO k=2,Nr |
68 |
|
|
DO j=1-Oly,sNy+Oly |
69 |
|
|
DO i=1-Olx,sNx+Olx |
70 |
|
|
IF (k.LT.kLowC(i,j,bi,bj)) THEN |
71 |
|
|
urms(i,j,k) = urms(i,j,1) + |
72 |
|
|
& (vec(1,i,j,k)-vec(1,i,j,1))*const(i,j) |
73 |
|
|
ELSE |
74 |
|
|
urms(i,j,k)=zeroRL |
75 |
|
|
ENDIF |
76 |
|
|
ENDDO |
77 |
|
|
ENDDO |
78 |
|
|
ENDDO |
79 |
|
|
|
80 |
|
|
C Land, so, we fill with zeros |
81 |
|
|
DO j=1-Oly,sNy+Oly |
82 |
|
|
DO i=1-Olx,sNx+Olx |
83 |
|
|
if (kLowC(i,j,bi,bj).EQ.0) urms(i,j,1) = zeroRL |
84 |
|
|
ENDDO |
85 |
|
|
ENDDO |
86 |
|
|
|
87 |
|
|
|
88 |
|
|
|
89 |
|
|
END |