1 | SUBROUTINE SW_venus_dc( PRMU0, PFRAC, |
---|
2 | S PPB, pt, |
---|
3 | S PHEAT, |
---|
4 | S PTOPSW,PSOLSW,ZFSNET) |
---|
5 | |
---|
6 | use dimphy |
---|
7 | use cpdet_mod, only: cpdet |
---|
8 | IMPLICIT none |
---|
9 | |
---|
10 | #include "dimensions.h" |
---|
11 | #include "YOMCST.h" |
---|
12 | C |
---|
13 | C ------------------------------------------------------------------ |
---|
14 | C |
---|
15 | C PURPOSE. |
---|
16 | C -------- |
---|
17 | C |
---|
18 | c this routine loads and interpolates the shortwave radiation |
---|
19 | c fluxes taken from Dave Crisp calculations for Venus. |
---|
20 | c Ref: Crisp 1986. |
---|
21 | C |
---|
22 | C AUTHOR. |
---|
23 | C ------- |
---|
24 | C Sebastien Lebonnois |
---|
25 | C |
---|
26 | C MODIFICATIONS. |
---|
27 | C -------------- |
---|
28 | C ORIGINAL : 27/07/2005 |
---|
29 | C ------------------------------------------------------------------ |
---|
30 | C |
---|
31 | C* ARGUMENTS: |
---|
32 | C |
---|
33 | c inputs |
---|
34 | |
---|
35 | REAL PRMU0 ! COSINE OF ZENITHAL ANGLE |
---|
36 | REAL PFRAC ! fraction de la journee |
---|
37 | REAL PPB(klev+1) ! inter-couches PRESSURE (bar) |
---|
38 | REAL pt(klev) ! mid-layer temperature |
---|
39 | C |
---|
40 | c output |
---|
41 | |
---|
42 | REAL PHEAT(klev) ! SHORTWAVE HEATING (K/VENUSDAY) within each layer |
---|
43 | REAL PTOPSW ! SHORTWAVE FLUX AT T.O.A. (net) |
---|
44 | REAL PSOLSW ! SHORTWAVE FLUX AT SURFACE (net) |
---|
45 | REAL ZFSNET(klev+1) ! net solar flux at ppb levels |
---|
46 | |
---|
47 | C |
---|
48 | C* LOCAL VARIABLES: |
---|
49 | C |
---|
50 | integer nldc,nszadc |
---|
51 | real dureejour |
---|
52 | parameter (nldc=49) ! fichiers Crisp |
---|
53 | parameter (nszadc=8) ! fichiers Crisp |
---|
54 | parameter (dureejour=10.087e6) |
---|
55 | |
---|
56 | integer i,j,nsza,nsza0,nl0 |
---|
57 | real solarrate ! solar heating rate (K/earthday) |
---|
58 | real zsnet(nldc+1,nszadc) ! net solar flux (W/m**2) (+ vers bas) |
---|
59 | real zsdn,zsup ! downward/upward solar flux (W/m**2) |
---|
60 | real solza(nszadc) ! solar zenith angles in table |
---|
61 | real presdc(nldc+1) ! pressure levels in table (bar) |
---|
62 | real tempdc(nldc+1) ! temperature in table (K) |
---|
63 | real altdc(nldc+1) ! altitude in table (km) |
---|
64 | real coolrate ! IR heating rate (K/earthday) ? |
---|
65 | real totalrate ! total rate (K/earthday) |
---|
66 | real zldn ! downward IR flux (W/m**2) ? |
---|
67 | real zlup ! upward IR flux (W/m**2) ? |
---|
68 | real zsolnet(nldc) ! for testing mean net solar flux in DC |
---|
69 | character*22 nullchar |
---|
70 | real sza0,factsza,factflux |
---|
71 | logical firstcall |
---|
72 | data firstcall/.true./ |
---|
73 | REAL,save,allocatable :: zsolVE(:) ! net solar flux at ppb levels, fichiers VE |
---|
74 | save solza,zsnet,presdc,tempdc,altdc |
---|
75 | save firstcall |
---|
76 | |
---|
77 | c ------------------------ |
---|
78 | c Loading the file |
---|
79 | c ------------------------ |
---|
80 | |
---|
81 | if (firstcall) then |
---|
82 | allocate(zsolVE(klevp1)) |
---|
83 | |
---|
84 | open(11,file='dataDCrisp.dat') |
---|
85 | read(11,*) nullchar |
---|
86 | |
---|
87 | do nsza=1,nszadc |
---|
88 | read(11,*) nullchar |
---|
89 | read(11,*) nullchar |
---|
90 | read(11,*) nullchar |
---|
91 | read(11,'(22x,F11.5)') solza(nsza) |
---|
92 | read(11,*) nullchar |
---|
93 | read(11,*) nullchar |
---|
94 | read(11,*) nullchar |
---|
95 | read(11,'(3(2x,F10.4),36x,4(2x,F11.5))') |
---|
96 | . presdc(nldc+1),tempdc(nldc+1), altdc(nldc+1), |
---|
97 | . zsdn,zsup,zldn,zlup |
---|
98 | zsnet(nldc+1,nsza)=zsdn-zsup |
---|
99 | do i=1,nldc |
---|
100 | j = nldc+1-i ! changing: vectors from surface to top |
---|
101 | read(11,'(6(2x,F10.4),4(2x,F11.5))') |
---|
102 | . presdc(j),tempdc(j),altdc(j), |
---|
103 | . solarrate,coolrate,totalrate, |
---|
104 | . zsdn,zsup,zldn,zlup |
---|
105 | zsnet(j,nsza)=zsdn-zsup |
---|
106 | enddo |
---|
107 | enddo |
---|
108 | |
---|
109 | close(11) |
---|
110 | |
---|
111 | c ----------- TEST ------------ |
---|
112 | c Fichiers de Vincent |
---|
113 | c ----------------------------- |
---|
114 | c open(12,file='flux_vis_dcGCM.txt') |
---|
115 | c read(12,*) nullchar |
---|
116 | c |
---|
117 | c do j=1,klev+1 |
---|
118 | c read(12,*) zlup,zldn,zsolVE(j) |
---|
119 | c enddo |
---|
120 | c |
---|
121 | c close(12) |
---|
122 | c ----------------------------- |
---|
123 | c -------- FIN TEST ---------- |
---|
124 | |
---|
125 | firstcall=.false. |
---|
126 | endif |
---|
127 | |
---|
128 | c ----------- TEST ------------ |
---|
129 | c Moyenne planetaire |
---|
130 | c ----------------------------- |
---|
131 | c do j=1,nldc |
---|
132 | c --- |
---|
133 | c zsolnet(j) = zsnet(j,1)*0.5* |
---|
134 | c . sin(solza(1)*RPI/180.)*solza(2)*RPI/180./2. |
---|
135 | c do nsza=2,nszadc-1 |
---|
136 | c zsolnet(j) = zsolnet(j)+zsnet(j,nsza)*0.5* |
---|
137 | c . sin(solza(nsza)*RPI/180.)* |
---|
138 | c . (solza(nsza+1)-solza(nsza-1))*RPI/180./2. |
---|
139 | c enddo |
---|
140 | c zsolnet(j) = zsolnet(j)+zsdn(j,nszadc)*0.5* |
---|
141 | c . sin(solza(nszadc)*RPI/180.)* |
---|
142 | c . (90.-solza(nszadc-1))*RPI/180./2. |
---|
143 | c --- |
---|
144 | c zsolnet(j) = 0.0 |
---|
145 | c do nsza=1,nszadc-1 |
---|
146 | c zsolnet(j) = zsolnet(j)+(zsnet(j,nsza ) |
---|
147 | c . +zsnet(j,nsza+1))*0.5* |
---|
148 | c . (cos(solza(nsza )*RPI/180.)- |
---|
149 | c . cos(solza(nsza+1)*RPI/180.) ) |
---|
150 | c enddo |
---|
151 | c zsolnet(j) = zsolnet(j)+zsnet(j,nszadc)*0.25* |
---|
152 | c . cos(solza(nszadc)*RPI/180.) |
---|
153 | c --- |
---|
154 | c print*,j,altdc(j),zsolnet(j) |
---|
155 | c enddo |
---|
156 | c stop |
---|
157 | c ----------------------------- |
---|
158 | c -------- FIN TEST ---------- |
---|
159 | |
---|
160 | c -------------------------------------- |
---|
161 | c Interpolation in the GCM vertical grid |
---|
162 | c -------------------------------------- |
---|
163 | |
---|
164 | c Zenith angle |
---|
165 | c ------------ |
---|
166 | |
---|
167 | sza0 = acos(PRMU0)/3.1416*180. |
---|
168 | c print*,'Angle Zenithal =',sza0,' PFRAC=',PFRAC |
---|
169 | |
---|
170 | do nsza=1,nszadc |
---|
171 | if (solza(nsza).le.sza0) then |
---|
172 | nsza0 = nsza+1 |
---|
173 | endif |
---|
174 | enddo |
---|
175 | |
---|
176 | if (nsza0.ne.nszadc+1) then |
---|
177 | factsza = (sza0-solza(nsza0-1))/(solza(nsza0)-solza(nsza0-1)) |
---|
178 | else |
---|
179 | factsza = min((sza0-solza(nszadc))/(90.-solza(nszadc)), 1.) |
---|
180 | endif |
---|
181 | |
---|
182 | c Pressure levels |
---|
183 | c --------------- |
---|
184 | |
---|
185 | do j=1,klev+1 |
---|
186 | nl0 = 2 |
---|
187 | do i=1,nldc |
---|
188 | if (presdc(i).ge.PPB(j)) then |
---|
189 | nl0 = i+1 |
---|
190 | endif |
---|
191 | enddo |
---|
192 | |
---|
193 | factflux = (log10(max(PPB(j),presdc(nldc+1))) |
---|
194 | . -log10(presdc(nl0-1))) |
---|
195 | . /(log10(presdc(nl0))-log10(presdc(nl0-1))) |
---|
196 | c factflux = (max(PPB(j),presdc(nldc+1))-presdc(nl0-1)) |
---|
197 | c . /(presdc(nl0)-presdc(nl0-1)) |
---|
198 | if (nsza0.ne.nszadc+1) then |
---|
199 | ZFSNET(j) = factflux * factsza *zsnet(nl0,nsza0) |
---|
200 | . + factflux *(1.-factsza)*zsnet(nl0,nsza0-1) |
---|
201 | . + (1.-factflux)* factsza *zsnet(nl0-1,nsza0) |
---|
202 | . + (1.-factflux)*(1.-factsza)*zsnet(nl0-1,nsza0-1) |
---|
203 | else |
---|
204 | ZFSNET(j) = factflux *(1.-factsza)*zsnet(nl0,nsza0-1) |
---|
205 | . + (1.-factflux)*(1.-factsza)*zsnet(nl0-1,nsza0-1) |
---|
206 | endif |
---|
207 | |
---|
208 | ZFSNET(j) = ZFSNET(j)*PFRAC |
---|
209 | |
---|
210 | enddo |
---|
211 | |
---|
212 | c ----------- TEST ------------ |
---|
213 | c Fichiers de Vincent |
---|
214 | c ----------------------------- |
---|
215 | c do j=1,klev+1 |
---|
216 | c ZFSNET(j)=zsolVE(j) |
---|
217 | c enddo |
---|
218 | c ----------------------------- |
---|
219 | c -------- FIN TEST ---------- |
---|
220 | |
---|
221 | PTOPSW = ZFSNET(klev+1) |
---|
222 | PSOLSW = ZFSNET(1) |
---|
223 | |
---|
224 | c Heating rates |
---|
225 | c ------------- |
---|
226 | c On utilise le gradient du flux pour calculer le taux de chauffage: |
---|
227 | c heat(K/s) = d(fluxnet) (W/m2) |
---|
228 | c *g (m/s2) |
---|
229 | c /(-dp) (epaisseur couche, en Pa=kg/m/s2) |
---|
230 | c /cp (J/kg/K) |
---|
231 | |
---|
232 | do j=1,klev |
---|
233 | ! ADAPTATION GCM POUR CP(T) |
---|
234 | PHEAT(j) = (ZFSNET(j+1)-ZFSNET(j)) |
---|
235 | . *RG/cpdet(pt(j)) / ((PPB(j)-PPB(j+1))*1.e5) |
---|
236 | PHEAT(j) = PHEAT(j)*dureejour ! K/venus_day |
---|
237 | enddo |
---|
238 | |
---|
239 | return |
---|
240 | end |
---|
241 | |
---|