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