1 | subroutine lwi(nl,netrad,deltapsi,deltap,temp,coolrate) |
---|
2 | |
---|
3 | c !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
4 | c §§§§!!! VERSION utilisable avec load_psi, |
---|
5 | c differente des versions *.1mat |
---|
6 | c !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
7 | use dimphy |
---|
8 | implicit none |
---|
9 | |
---|
10 | |
---|
11 | #include "dimensions.h" |
---|
12 | #include "comg1d.h" !pour grads 1D |
---|
13 | #include "YOMCST.h" |
---|
14 | #include "timerad.h" |
---|
15 | |
---|
16 | CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC |
---|
17 | C |
---|
18 | C - lwi - |
---|
19 | C |
---|
20 | C PURPOSE: Schema semi - implicite |
---|
21 | C |
---|
22 | C |
---|
23 | CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC |
---|
24 | |
---|
25 | |
---|
26 | c************************************************************************ |
---|
27 | c |
---|
28 | c 0. Declarations |
---|
29 | c ------------ |
---|
30 | c |
---|
31 | c------------------------------------------------------------------------- |
---|
32 | c 0.1 Arguments |
---|
33 | c --------- |
---|
34 | c Inputs |
---|
35 | c....... |
---|
36 | |
---|
37 | integer nl |
---|
38 | real deltapsi(0:nl+1,0:nl+1) ! Dpsi/DT = sum(nu)[ksi DB/DT] |
---|
39 | real netrad(0:nl) ! radiative budget (W/m**2) |
---|
40 | real deltap(nl) !epaisseur de la couche en pression (Pa) |
---|
41 | ! ADAPTATION GCM POUR CP(T) |
---|
42 | real temp(nl) !temperature de la couche |
---|
43 | |
---|
44 | c Outputs |
---|
45 | c........ |
---|
46 | |
---|
47 | real coolrate(nl) |
---|
48 | |
---|
49 | c------------------------------------------------------------------------- |
---|
50 | c 0.2 local arrays |
---|
51 | c ------------ |
---|
52 | c |
---|
53 | real di(nl) |
---|
54 | . , spec(nl) |
---|
55 | . , hi(nl) |
---|
56 | . , bi(nl) |
---|
57 | |
---|
58 | real ci(nl) |
---|
59 | . , ai(nl) |
---|
60 | |
---|
61 | real deltat |
---|
62 | |
---|
63 | real semi,semit,denom |
---|
64 | |
---|
65 | integer i,jl,band |
---|
66 | |
---|
67 | c************************************************************************ |
---|
68 | c |
---|
69 | c 1. Initialisations |
---|
70 | c --------------- |
---|
71 | c |
---|
72 | c----------------------------------------------------------------------- |
---|
73 | deltat = dtimerad |
---|
74 | c print*,'SEMI = ',semi, '(expl:0 semi-implicite:0.5 impl:1)' |
---|
75 | c semi = 0.5 |
---|
76 | c semi = 0.5 |
---|
77 | semi = 1. |
---|
78 | semit = semi * deltat |
---|
79 | |
---|
80 | c print*,'dtimerad,deltat,semit:',dtimerad,deltat,semit |
---|
81 | |
---|
82 | c************************************************************************ |
---|
83 | c |
---|
84 | c 2. |
---|
85 | c --------------- |
---|
86 | c |
---|
87 | c------------------------------------------------------------------------- |
---|
88 | c 2.1 Calcul des di |
---|
89 | c ------------- |
---|
90 | c |
---|
91 | |
---|
92 | do i = 1 , nl-1 |
---|
93 | spec(i) = |
---|
94 | . ( deltapsi(i,nl+1) |
---|
95 | . + deltapsi(i,i+1) |
---|
96 | . + deltapsi(i,i-1) ) |
---|
97 | |
---|
98 | di(i) = 1. + semit * (RG/deltap(i)/cpdet(temp(i))) * spec(i) |
---|
99 | c print*,i,' di(i)=',di(i) |
---|
100 | enddo |
---|
101 | |
---|
102 | |
---|
103 | c couche nl |
---|
104 | c ------------ |
---|
105 | c , on enleve i,i+1 sinon on a 2 fois le cooling2space |
---|
106 | |
---|
107 | spec(nl) = |
---|
108 | . ( deltapsi(nl,nl+1) |
---|
109 | . + deltapsi(nl,nl-1) ) |
---|
110 | |
---|
111 | di(nl) = 1. + semit * (RG/deltap(nl)/cpdet(temp(nl)))*spec(nl) |
---|
112 | |
---|
113 | c------------------------------------------------------------------------- |
---|
114 | c 2.2 Calcul des hi |
---|
115 | c ------------- |
---|
116 | c |
---|
117 | |
---|
118 | do i = 1 , nl-1 |
---|
119 | |
---|
120 | spec(i) = deltapsi(i+1,i) |
---|
121 | |
---|
122 | hi(i) = - semit * (RG/deltap(i)/cpdet(temp(i))) * spec(i) |
---|
123 | |
---|
124 | enddo |
---|
125 | |
---|
126 | c print*,'hi(i)',hi(i) |
---|
127 | |
---|
128 | c------------------------------------------------------------------------- |
---|
129 | c 2.3 Calcul des bi |
---|
130 | c ------------- |
---|
131 | c |
---|
132 | |
---|
133 | |
---|
134 | do i = 2 , nl |
---|
135 | |
---|
136 | spec(i) = deltapsi(i-1,i) |
---|
137 | |
---|
138 | bi(i) = - semit * (RG/deltap(i)/cpdet(temp(i))) * spec(i) |
---|
139 | |
---|
140 | enddo |
---|
141 | |
---|
142 | c print*,'bi(i)',bi(i) |
---|
143 | |
---|
144 | c couche 1 |
---|
145 | c -------- |
---|
146 | c tant qu'on a pas un calcul propre de deltab(0) qui tienne compte de |
---|
147 | c la discontinuite de temperature au sol , on met b1 = 0 |
---|
148 | |
---|
149 | |
---|
150 | bi(1) = 0 |
---|
151 | |
---|
152 | c------------------------------------------------------------------------- |
---|
153 | c 2.4 |
---|
154 | c ------------- |
---|
155 | c |
---|
156 | |
---|
157 | c couche nl |
---|
158 | c ------------ |
---|
159 | |
---|
160 | c ci(nl) = ((RG/CP) * netrad(nl) / deltap(nl)) |
---|
161 | c . / di(nl) |
---|
162 | ci(nl) = netrad(nl) *RG/cpdet(temp(nl)) / deltap(nl) |
---|
163 | |
---|
164 | ai(nl) = - bi(nl) / di(nl) |
---|
165 | |
---|
166 | do i = nl-1 , 1 , -1 |
---|
167 | denom = di(i) + hi(i) * ai(i+1) |
---|
168 | |
---|
169 | c ci(i) = ( (RG/CP) * netrad(i) / deltap(i) |
---|
170 | c . - hi(i) * ci(i+1) ) / denom |
---|
171 | ci(i) = netrad(i) *RG/cpdet(temp(i)) / deltap(i) |
---|
172 | |
---|
173 | ai(i) = -bi(i) / denom |
---|
174 | enddo |
---|
175 | |
---|
176 | c------------------------------------------------------------------------- |
---|
177 | c 2.5 |
---|
178 | c ------------- |
---|
179 | c |
---|
180 | |
---|
181 | coolrate(1) = ci(1) |
---|
182 | |
---|
183 | do i = 2 , nl |
---|
184 | coolrate(i) = ci(i) + ai(i) * coolrate(i-1) |
---|
185 | c print*,i,' coolrate(i)=',coolrate(i) |
---|
186 | enddo |
---|
187 | |
---|
188 | c------------------------------------------------------------------------- |
---|
189 | |
---|
190 | RETURN |
---|
191 | END |
---|