1 | ! |
---|
2 | ! $Id $ |
---|
3 | ! |
---|
4 | SUBROUTINE sw_case_williamson91_6_loc(vcov,ucov,teta,masse,ps) |
---|
5 | |
---|
6 | !======================================================================= |
---|
7 | ! |
---|
8 | ! Author: Thomas Dubos original: 26/01/2010 |
---|
9 | ! ------- |
---|
10 | ! |
---|
11 | ! Subject: |
---|
12 | ! ------ |
---|
13 | ! Realise le cas-test 6 de Williamson et al. (1991) : onde de Rossby-Haurwitz |
---|
14 | ! |
---|
15 | ! Method: |
---|
16 | ! -------- |
---|
17 | ! |
---|
18 | ! Interface: |
---|
19 | ! ---------- |
---|
20 | ! |
---|
21 | ! Input: |
---|
22 | ! ------ |
---|
23 | ! |
---|
24 | ! Output: |
---|
25 | ! ------- |
---|
26 | ! |
---|
27 | !======================================================================= |
---|
28 | USE iniprint_mod_h |
---|
29 | USE comgeom_mod_h |
---|
30 | USE parallel_lmdz |
---|
31 | USE comconst_mod, ONLY: cpp, omeg, rad |
---|
32 | USE comvert_mod, ONLY: ap, bp, preff |
---|
33 | |
---|
34 | USE dimensions_mod, ONLY: iim, jjm, llm, ndm |
---|
35 | USE paramet_mod_h |
---|
36 | IMPLICIT NONE |
---|
37 | !----------------------------------------------------------------------- |
---|
38 | ! Declararations: |
---|
39 | ! --------------- |
---|
40 | |
---|
41 | |
---|
42 | |
---|
43 | |
---|
44 | ! Arguments: |
---|
45 | ! ---------- |
---|
46 | |
---|
47 | ! variables dynamiques |
---|
48 | REAL :: vcov(ijb_v:ije_v,llm),ucov(ijb_u:ije_u,llm) ! vents covariants |
---|
49 | REAL :: teta(ijb_u:ije_u,llm) ! temperature potentielle |
---|
50 | REAL :: ps(ijb_u:ije_u) ! pression au sol |
---|
51 | REAL :: masse(ijb_u:ije_u,llm) ! masse d'air |
---|
52 | REAL :: phis(ijb_u:ije_u) ! geopotentiel au sol |
---|
53 | |
---|
54 | ! Local: |
---|
55 | ! ------ |
---|
56 | |
---|
57 | real,allocatable :: ucov_glo(:,:) |
---|
58 | real,allocatable :: vcov_glo(:,:) |
---|
59 | real,allocatable :: teta_glo(:,:) |
---|
60 | real,allocatable :: masse_glo(:,:) |
---|
61 | real,allocatable :: ps_glo(:) |
---|
62 | |
---|
63 | ! REAL p (ip1jmp1,llmp1 ) ! pression aux interfac.des couches |
---|
64 | ! REAL pks(ip1jmp1) ! exner au sol |
---|
65 | ! REAL pk(ip1jmp1,llm) ! exner au milieu des couches |
---|
66 | ! REAL pkf(ip1jmp1,llm) ! exner filt.au milieu des couches |
---|
67 | ! REAL alpha(ip1jmp1,llm),beta(ip1jmp1,llm) |
---|
68 | |
---|
69 | real,allocatable :: p(:,:) |
---|
70 | real,allocatable :: pks(:) |
---|
71 | real,allocatable :: pk(:,:) |
---|
72 | real,allocatable :: pkf(:,:) |
---|
73 | real,allocatable :: alpha(:,:),beta(:,:) |
---|
74 | |
---|
75 | REAL :: sinth,costh,costh2, Ath,Bth,Cth, lon,dps |
---|
76 | INTEGER :: i,j,ij |
---|
77 | |
---|
78 | REAL, PARAMETER :: rho=1 ! masse volumique de l'air (arbitraire) |
---|
79 | REAL, PARAMETER :: K = 7.848e-6 ! K = \omega |
---|
80 | REAL, PARAMETER :: gh0 = 9.80616 * 8e3 |
---|
81 | INTEGER, PARAMETER :: R0=4, R1=R0+1, R2=R0+2 ! mode 4 |
---|
82 | ! NB : rad = 6371220 dans W91 (6371229 dans LMDZ) |
---|
83 | ! omeg = 7.292e-5 dans W91 (7.2722e-5 dans LMDZ) |
---|
84 | |
---|
85 | |
---|
86 | ! ! allocate (global) arrays |
---|
87 | allocate(vcov_glo(ip1jm,llm)) |
---|
88 | allocate(ucov_glo(ip1jmp1,llm)) |
---|
89 | allocate(teta_glo(ip1jmp1,llm)) |
---|
90 | allocate(ps_glo(ip1jmp1)) |
---|
91 | allocate(masse_glo(ip1jmp1,llm)) |
---|
92 | |
---|
93 | allocate(p(ip1jmp1,llmp1)) |
---|
94 | allocate(pks(ip1jmp1)) |
---|
95 | allocate(pk(ip1jmp1,llm)) |
---|
96 | allocate(pkf(ip1jmp1,llm)) |
---|
97 | allocate(alpha(ip1jmp1,llm)) |
---|
98 | allocate(beta(ip1jmp1,llm)) |
---|
99 | |
---|
100 | IF(0==0) THEN |
---|
101 | !c Williamson et al. (1991) : onde de Rossby-Haurwitz |
---|
102 | teta_glo(:,:) = preff/rho/cpp |
---|
103 | !c geopotentiel (pression de surface) |
---|
104 | do j=1,jjp1 |
---|
105 | costh2 = cos(rlatu(j))**2 |
---|
106 | Ath = (R0+1)*(costh2**2) + (2*R0*R0-R0-2)*costh2 - 2*R0*R0 |
---|
107 | Ath = .25*(K**2)*(costh2**(R0-1))*Ath |
---|
108 | Ath = .5*K*(2*omeg+K)*costh2 + Ath |
---|
109 | Bth = (R1*R1+1)-R1*R1*costh2 |
---|
110 | Bth = 2*(omeg+K)*K/(R1*R2) * (costh2**(R0/2))*Bth |
---|
111 | Cth = R1*costh2 - R2 |
---|
112 | Cth = .25*K*K*(costh2**R0)*Cth |
---|
113 | do i=1,iip1 |
---|
114 | ij=(j-1)*iip1+i |
---|
115 | lon = rlonv(i) |
---|
116 | dps = Ath + Bth*cos(R0*lon) + Cth*cos(2*R0*lon) |
---|
117 | ps_glo(ij) = rho*(gh0 + (rad**2)*dps) |
---|
118 | enddo |
---|
119 | enddo |
---|
120 | ! write(lunout,*) 'W91 ps', MAXVAL(ps), MINVAL(ps) |
---|
121 | ! vitesse zonale ucov |
---|
122 | do j=1,jjp1 |
---|
123 | costh = cos(rlatu(j)) |
---|
124 | costh2 = costh**2 |
---|
125 | Ath = rad*K*costh |
---|
126 | Bth = R0*(1-costh2)-costh2 |
---|
127 | Bth = rad*K*Bth*(costh**(R0-1)) |
---|
128 | do i=1,iip1 |
---|
129 | ij=(j-1)*iip1+i |
---|
130 | lon = rlonu(i) |
---|
131 | ucov_glo(ij,1) = (Ath + Bth*cos(R0*lon)) |
---|
132 | enddo |
---|
133 | enddo |
---|
134 | ! write(lunout,*) 'W91 u', MAXVAL(ucov(:,1)), MINVAL(ucov(:,1)) |
---|
135 | ucov_glo(:,1)=ucov_glo(:,1)*cu |
---|
136 | ! vitesse meridienne vcov |
---|
137 | do j=1,jjm |
---|
138 | sinth = sin(rlatv(j)) |
---|
139 | costh = cos(rlatv(j)) |
---|
140 | Ath = -rad*K*R0*sinth*(costh**(R0-1)) |
---|
141 | do i=1,iip1 |
---|
142 | ij=(j-1)*iip1+i |
---|
143 | lon = rlonv(i) |
---|
144 | vcov_glo(ij,1) = Ath*sin(R0*lon) |
---|
145 | enddo |
---|
146 | enddo |
---|
147 | write(lunout,*) 'W91 v', MAXVAL(vcov(:,1)), MINVAL(vcov(:,1)) |
---|
148 | vcov_glo(:,1)=vcov_glo(:,1)*cv |
---|
149 | |
---|
150 | ! ucov_glo=0 |
---|
151 | ! vcov_glo=0 |
---|
152 | ELSE |
---|
153 | ! test non-tournant, onde se propageant en latitude |
---|
154 | do j=1,jjp1 |
---|
155 | do i=1,iip1 |
---|
156 | ij=(j-1)*iip1+i |
---|
157 | ps_glo(ij) = 1e5*(1 + .1*exp(-100*(1+sin(rlatu(j)))**2)) |
---|
158 | enddo |
---|
159 | enddo |
---|
160 | |
---|
161 | ! rho = preff/(cpp*teta) |
---|
162 | teta_glo(:,:) = .01*preff/cpp ! rho = 100 ; phi = ps/rho = 1e3 ; c=30 m/s = 2600 km/j = 23 degres / j |
---|
163 | ucov_glo(:,:)=0. |
---|
164 | vcov_glo(:,:)=0. |
---|
165 | END IF |
---|
166 | |
---|
167 | CALL pression ( ip1jmp1, ap, bp, ps_glo, p ) |
---|
168 | CALL massdair(p,masse_glo) |
---|
169 | |
---|
170 | ! ! copy data from global array to local array: |
---|
171 | teta(ijb_u:ije_u,:)=teta_glo(ijb_u:ije_u,:) |
---|
172 | ucov(ijb_u:ije_u,:)=ucov_glo(ijb_u:ije_u,:) |
---|
173 | vcov(ijb_v:ije_v,:)=vcov_glo(ijb_v:ije_v,:) |
---|
174 | masse(ijb_u:ije_u,:)=masse_glo(ijb_u:ije_u,:) |
---|
175 | ps(ijb_u:ije_u)=ps_glo(ijb_u:ije_u) |
---|
176 | |
---|
177 | ! ! cleanup |
---|
178 | deallocate(teta_glo) |
---|
179 | deallocate(ucov_glo) |
---|
180 | deallocate(vcov_glo) |
---|
181 | deallocate(masse_glo) |
---|
182 | deallocate(ps_glo) |
---|
183 | deallocate(p) |
---|
184 | deallocate(pks) |
---|
185 | deallocate(pk) |
---|
186 | deallocate(pkf) |
---|
187 | deallocate(alpha) |
---|
188 | deallocate(beta) |
---|
189 | |
---|
190 | END SUBROUTINE sw_case_williamson91_6_loc |
---|
191 | !----------------------------------------------------------------------- |
---|