1 | ! |
---|
2 | ! $Header$ |
---|
3 | ! |
---|
4 | c |
---|
5 | c |
---|
6 | #undef DEBUG_IO |
---|
7 | c#define DEBUG_IO |
---|
8 | |
---|
9 | SUBROUTINE caldyn_p |
---|
10 | $ (itau,ucov,vcov,teta,ps,masse,pk,pkf,phis , |
---|
11 | $ phi,conser,du,dv,dteta,dp,w,pbaru,pbarv,time ) |
---|
12 | USE parallel |
---|
13 | USE Write_Field_p |
---|
14 | |
---|
15 | IMPLICIT NONE |
---|
16 | |
---|
17 | c======================================================================= |
---|
18 | c |
---|
19 | c Auteur : P. Le Van |
---|
20 | c |
---|
21 | c Objet: |
---|
22 | c ------ |
---|
23 | c |
---|
24 | c Calcul des tendances dynamiques. |
---|
25 | c |
---|
26 | c Modif 04/93 F.Forget |
---|
27 | c======================================================================= |
---|
28 | |
---|
29 | c----------------------------------------------------------------------- |
---|
30 | c 0. Declarations: |
---|
31 | c ---------------- |
---|
32 | |
---|
33 | #include "dimensions.h" |
---|
34 | #include "paramet.h" |
---|
35 | #include "comconst.h" |
---|
36 | #include "comvert.h" |
---|
37 | #include "comgeom.h" |
---|
38 | |
---|
39 | c Arguments: |
---|
40 | c ---------- |
---|
41 | |
---|
42 | LOGICAL conser |
---|
43 | |
---|
44 | INTEGER itau |
---|
45 | REAL vcov(ip1jm,llm),ucov(ip1jmp1,llm),teta(ip1jmp1,llm) |
---|
46 | REAL ps(ip1jmp1),phis(ip1jmp1) |
---|
47 | REAL pk(iip1,jjp1,llm),pkf(ip1jmp1,llm) |
---|
48 | REAL vcont(ip1jm,llm),ucont(ip1jmp1,llm) |
---|
49 | REAL phi(ip1jmp1,llm),masse(ip1jmp1,llm) |
---|
50 | REAL dv(ip1jm,llm),du(ip1jmp1,llm) |
---|
51 | REAL dteta(ip1jmp1,llm),dp(ip1jmp1) |
---|
52 | REAL pbaru(ip1jmp1,llm),pbarv(ip1jm,llm) |
---|
53 | REAL time |
---|
54 | |
---|
55 | c Local: |
---|
56 | c ------ |
---|
57 | |
---|
58 | REAL ang(ip1jmp1,llm),p(ip1jmp1,llmp1) |
---|
59 | REAL massebx(ip1jmp1,llm),masseby(ip1jm,llm),psexbarxy(ip1jm) |
---|
60 | REAL vorpot(ip1jm,llm) |
---|
61 | REAL w(ip1jmp1,llm),ecin(ip1jmp1,llm),convm(ip1jmp1,llm) |
---|
62 | REAL bern(ip1jmp1,llm) |
---|
63 | REAL massebxy(ip1jm,llm) |
---|
64 | |
---|
65 | |
---|
66 | INTEGER ij,l,ijb,ije,ierr |
---|
67 | |
---|
68 | c----------------------------------------------------------------------- |
---|
69 | c Calcul des tendances dynamiques: |
---|
70 | c -------------------------------- |
---|
71 | CALL covcont_p ( llm , ucov , vcov , ucont, vcont ) |
---|
72 | CALL pression_p ( ip1jmp1, ap , bp , ps , p ) |
---|
73 | cym CALL psextbar ( ps , psexbarxy ) |
---|
74 | CALL massdair_p ( p , masse ) |
---|
75 | CALL massbar_p ( masse, massebx , masseby ) |
---|
76 | call massbarxy_p( masse, massebxy ) |
---|
77 | CALL flumass_p ( massebx, masseby , vcont, ucont ,pbaru, pbarv ) |
---|
78 | CALL dteta1_p ( teta , pbaru , pbarv, dteta ) |
---|
79 | CALL convmas_p ( pbaru, pbarv , convm ) |
---|
80 | |
---|
81 | #ifdef DEBUG_IO |
---|
82 | call WriteField_p('ucont',reshape(ucont,(/iip1,jmp1,llm/))) |
---|
83 | call WriteField_p('vcont',reshape(vcont,(/iip1,jjm,llm/))) |
---|
84 | call WriteField_p('p',reshape(p,(/iip1,jmp1,llmp1/))) |
---|
85 | call WriteField_p('masse',reshape(masse,(/iip1,jmp1,llm/))) |
---|
86 | call WriteField_p('massebx',reshape(massebx,(/iip1,jmp1,llm/))) |
---|
87 | call WriteField_p('masseby',reshape(masseby,(/iip1,jjm,llm/))) |
---|
88 | call WriteField_p('massebxy',reshape(massebxy,(/iip1,jjm,llm/))) |
---|
89 | call WriteField_p('pbaru',reshape(pbaru,(/iip1,jmp1,llm/))) |
---|
90 | call WriteField_p('pbarv',reshape(pbarv,(/iip1,jjm,llm/))) |
---|
91 | call WriteField_p('dteta',reshape(dteta,(/iip1,jmp1,llm/))) |
---|
92 | call WriteField_p('convm',reshape(convm,(/iip1,jmp1,llm/))) |
---|
93 | #endif |
---|
94 | |
---|
95 | ijb=ij_begin |
---|
96 | ije=ij_end |
---|
97 | |
---|
98 | DO ij =ijb, ije |
---|
99 | dp( ij ) = convm( ij,1 ) / airesurg( ij ) |
---|
100 | ENDDO |
---|
101 | |
---|
102 | CALL vitvert_p ( convm , w ) |
---|
103 | CALL tourpot_p ( vcov , ucov , massebxy , vorpot ) |
---|
104 | CALL dudv1_p ( vorpot , pbaru , pbarv , du , dv ) |
---|
105 | |
---|
106 | #ifdef DEBUG_IO |
---|
107 | call WriteField_p('w',reshape(w,(/iip1,jmp1,llm/))) |
---|
108 | call WriteField_p('vorpot',reshape(vorpot,(/iip1,jjm,llm/))) |
---|
109 | call WriteField_p('du',reshape(du,(/iip1,jmp1,llm/))) |
---|
110 | call WriteField_p('dv',reshape(dv,(/iip1,jjm,llm/))) |
---|
111 | #endif |
---|
112 | CALL enercin_p ( vcov , ucov , vcont , ucont , ecin ) |
---|
113 | CALL bernoui_p ( ip1jmp1, llm , phi , ecin , bern ) |
---|
114 | CALL dudv2_p ( teta , pkf , bern , du , dv ) |
---|
115 | |
---|
116 | #ifdef DEBUG_IO |
---|
117 | call WriteField_p('ecin',reshape(ecin,(/iip1,jmp1,llm/))) |
---|
118 | call WriteField_p('bern',reshape(bern,(/iip1,jmp1,llm/))) |
---|
119 | call WriteField_p('du',reshape(du,(/iip1,jmp1,llm/))) |
---|
120 | call WriteField_p('dv',reshape(dv,(/iip1,jjm,llm/))) |
---|
121 | #endif |
---|
122 | |
---|
123 | ijb=ij_begin-iip1 |
---|
124 | ije=ij_end+iip1 |
---|
125 | |
---|
126 | if (pole_nord) ijb=ij_begin |
---|
127 | if (pole_sud) ije=ij_end |
---|
128 | |
---|
129 | DO l=1,llm |
---|
130 | DO ij=ijb,ije |
---|
131 | ang(ij,l) = ucov(ij,l) + constang(ij) |
---|
132 | ENDDO |
---|
133 | ENDDO |
---|
134 | |
---|
135 | |
---|
136 | CALL advect_p( ang, vcov, teta, w, massebx, masseby,du,dv,dteta) |
---|
137 | |
---|
138 | C WARNING probleme de peridocite de dv sur les PC/linux. Pb d'arrondi |
---|
139 | C probablement. Observe sur le code compile avec pgf90 3.0-1 |
---|
140 | ijb=ij_begin |
---|
141 | ije=ij_end |
---|
142 | if (pole_sud) ije=ij_end-iip1 |
---|
143 | |
---|
144 | DO l = 1, llm |
---|
145 | DO ij = ijb, ije, iip1 |
---|
146 | IF( dv(ij,l).NE.dv(ij+iim,l) ) THEN |
---|
147 | c PRINT *,'!!!ATTENTION!!! probleme de periodicite sur vcov', |
---|
148 | c , ' dans caldyn' |
---|
149 | c PRINT *,' l, ij = ', l, ij, ij+iim,dv(ij+iim,l),dv(ij,l) |
---|
150 | dv(ij+iim,l) = dv(ij,l) |
---|
151 | endif |
---|
152 | enddo |
---|
153 | enddo |
---|
154 | c----------------------------------------------------------------------- |
---|
155 | c Sorties eventuelles des variables de controle: |
---|
156 | c ---------------------------------------------- |
---|
157 | |
---|
158 | IF( conser ) THEN |
---|
159 | c ym ---> exige communication collective ( aussi dans advect) |
---|
160 | CALL sortvarc |
---|
161 | $ ( itau,ucov,teta,ps,masse,pk,phis,vorpot,phi,bern,dp,time,vcov ) |
---|
162 | |
---|
163 | ENDIF |
---|
164 | |
---|
165 | RETURN |
---|
166 | END |
---|