1 | SUBROUTINE OPTCV(qaer,nmicro,IPRINT) |
---|
2 | |
---|
3 | |
---|
4 | use dimphy |
---|
5 | #include "dimensions.h" |
---|
6 | #include "microtab.h" |
---|
7 | #include "clesphys.h" |
---|
8 | |
---|
9 | c Argument: |
---|
10 | c --------- |
---|
11 | REAL qaer(klon,nlayer,nqtot) |
---|
12 | integer nmicro |
---|
13 | c --------- |
---|
14 | |
---|
15 | c ASTUCE POUR EVITER klon... EN ATTENDANT MIEUX |
---|
16 | INTEGER ngrid |
---|
17 | PARAMETER (ngrid=(jjm-1)*iim+2) ! = klon |
---|
18 | c |
---|
19 | PARAMETER(NLAYER=llm,NLEVEL=NLAYER+1) |
---|
20 | PARAMETER (NSPECI=46,NSPC1I=47,NSPECV=24,NSPC1V=25) |
---|
21 | |
---|
22 | COMMON /ATM/ Z(NLEVEL),PRESS(NLEVEL),DEN(NLEVEL),TEMP(NLEVEL) |
---|
23 | |
---|
24 | COMMON /GASS/ CH4(NLEVEL),XN2(NLEVEL),H2(NLEVEL),AR(NLEVEL) |
---|
25 | & ,XMU(NLEVEL),GAS1(NLAYER),COLDEN(NLAYER) |
---|
26 | |
---|
27 | COMMON /VISGAS/SOLARF(NSPECV),NTERM(NSPECV),PEXPON(NSPECV), |
---|
28 | & ATERM(4,NSPECV),BTERM(4,NSPECV) |
---|
29 | |
---|
30 | COMMON /AERSOL/ RADIUS(NLAYER), XNUMB(NLAYER) |
---|
31 | & , REALI(NSPECI), XIMGI(NSPECI), REALV(NSPECV), XIMGV(NSPECV) |
---|
32 | |
---|
33 | COMMON /CLOUD/ RADCLD(NLAYER), XNCLD(NLAYER) |
---|
34 | & , RCLDI(NSPECI), XICLDI(NSPECI) |
---|
35 | & , RCLDV(NSPECV), XICLDV(NSPECV) |
---|
36 | |
---|
37 | COMMON /TAUS/ TAUHI(ngrid,NSPECI), TAUCI(ngrid,NSPECI) |
---|
38 | & ,TAUGI(ngrid,NSPECI), TAURV(ngrid,NSPECV) |
---|
39 | & ,TAUHV(ngrid,NSPECV) ,TAUCV(ngrid,NSPECV) |
---|
40 | & ,TAUGV(ngrid,NSPECV) |
---|
41 | |
---|
42 | COMMON /TAUD/ TAUHID(ngrid,NLAYER,NSPECI) |
---|
43 | & ,TAUGID(ngrid,NLAYER,NSPECI) |
---|
44 | & ,TAUHVD(ngrid,NLAYER,NSPECV) |
---|
45 | & ,TAUGVD(ngrid,NLAYER,NSPECV) |
---|
46 | |
---|
47 | COMMON /OPTICV/ DTAUV(ngrid,NLAYER,NSPECV,4) |
---|
48 | & ,TAUV(ngrid,NLEVEL,NSPECV,4) |
---|
49 | & ,WBARV(ngrid,NLAYER,NSPECV,4) |
---|
50 | & ,COSBV(ngrid,NLAYER,NSPECV,4) |
---|
51 | |
---|
52 | COMMON /SPECTV/ BWNV(NSPC1V),WNOV(NSPECV) |
---|
53 | & ,DWNV(NSPECV),WLNV(NSPECV) |
---|
54 | |
---|
55 | COMMON /PLANT/ CSUBP,RSFI,RSFV,F0PI |
---|
56 | COMMON /ADJUST/ RHCH4,FH2,FHAZE,FHVIS,FHIR,TAUFAC,RCLOUD,FARGON |
---|
57 | COMMON /CONST/ RGAS,RHOP,PI,SIGMA |
---|
58 | COMMON /part/ v(nrad),rayon(nrad),vrat,dr(nrad),dv(nrad) |
---|
59 | |
---|
60 | REAL xv1(klev,NSPECV) |
---|
61 | REAL xv2(klev,NSPECV) |
---|
62 | REAL xv3(klev,NSPECV) |
---|
63 | |
---|
64 | REAL QF1(nrad,NSPECV),QF2(nrad,NSPECV) |
---|
65 | REAL QF3(nrad,NSPECV),QF4(nrad,NSPECV) |
---|
66 | REAL QM1(nrad,NSPECV),QM2(nrad,NSPECV) |
---|
67 | REAL QM3(nrad,NSPECV),QM4(nrad,NSPECV) |
---|
68 | |
---|
69 | save qf1,qf2,qf3,qf4,qm1,qm2,qm3,qm4 |
---|
70 | |
---|
71 | integer ioptv,iwarning ! ioptv: premier appel, une seule boucle sur les l.d'o. |
---|
72 | integer ig_,seulmtunpt |
---|
73 | save ioptv,iwarning,seulmtunpt |
---|
74 | data ioptv,iwarning,seulmtunpt/0,0,0/ |
---|
75 | |
---|
76 | real zqaer_1pt(NLAYER,nrad) |
---|
77 | real TAUHVD_1pt(NLAYER,NSPECV) |
---|
78 | real TAUGVD_1pt(NLAYER,NSPECV) |
---|
79 | real TAUHV_1pt(NSPECV),TAUCV_1pt(NSPECV) |
---|
80 | real TAURV_1pt(NSPECV),TAUGV_1pt(NSPECV) |
---|
81 | real DTAUV_1pt(NLAYER,NSPECV,4),TAUV_1pt(NLEVEL,NSPECV,4) |
---|
82 | real WBARV_1pt(NLAYER,NSPECV,4) |
---|
83 | real COSBV_1pt(NLAYER,NSPECV,4) |
---|
84 | character*100 dummy |
---|
85 | real dummy2,dummy3 |
---|
86 | |
---|
87 | C* |
---|
88 | C THIS SUBROUTINE SETS THE OPTICAL CONSTANTS IN THE VISIBLE |
---|
89 | C IT CALCUALTES FOR EACH LAYER, FOR EACH SPECRAL INTERVAL IN THE VIS |
---|
90 | C LAYER: WBAR, DTAU, COSBAR |
---|
91 | C LEVEL: TAU |
---|
92 | C |
---|
93 | sum=0. |
---|
94 | PRINT*,'OPTCV' |
---|
95 | print*,'ATTENTION, TAU UNIFORME DANS OPTCV' |
---|
96 | |
---|
97 | c do nng=2,klon |
---|
98 | c do i=1,klev |
---|
99 | c do j=1,nqtot |
---|
100 | c sum=sum+qaer(nng,i,j)*rayon(j)**3.*1.3333*3.1415*1000. |
---|
101 | c enddo |
---|
102 | c enddo |
---|
103 | c enddo |
---|
104 | c print*,sum/(klon-1),'SOMME COLONNE/OPTCV' |
---|
105 | |
---|
106 | |
---|
107 | C++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
108 | c INITIALISATIONS UNE SEULE FOIS |
---|
109 | C++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
110 | |
---|
111 | if (ioptv.eq.0) then |
---|
112 | |
---|
113 | c verif pour taille zqaer_1pt, sachant que si microfi=0 et nqtot=1, |
---|
114 | c il faut quand meme qu'on lise la look-up table de dim nrad=10 |
---|
115 | c et si microfi=1, on doit avoir nmicro=nrad (dans microtab.h) |
---|
116 | if ((nmicro.ne.nrad).and.(microfi.eq.1)) then |
---|
117 | print*,"nmicro.ne.nrad",nmicro,nrad |
---|
118 | print*,"PROBLEME pour zqaer_1pt dans optcv !!" |
---|
119 | stop |
---|
120 | endif |
---|
121 | |
---|
122 | |
---|
123 | DO 130 K=1,NSPECV |
---|
124 | C LETS USE THE OPTICAL CONSTANTS FOR THOLIN |
---|
125 | CALL THOLIN(WLNV(K),TNR,TNI) |
---|
126 | REALV(K)=TNR |
---|
127 | XIMGV(K)=TNI*FHVIS |
---|
128 | C BUT WE NOW USE THE GEOMETRIC ALBEDO FITTED RESULTS |
---|
129 | C XIMGV(K)=FITEDT(WLNV(K)) |
---|
130 | C XIMGV(K)=FITEDN(WLNV(K)) |
---|
131 | C THE CLOUD IS CLEAR IN THE VISIBLE |
---|
132 | RCLDV(K)=1.27 |
---|
133 | XICLDV(K)=1.E-7 |
---|
134 | 130 CONTINUE |
---|
135 | C |
---|
136 | c open (unit=1,file='xsetupv') |
---|
137 | c do j=1,nspecv |
---|
138 | c read(1,*) a |
---|
139 | c do i=1,klev |
---|
140 | c read(1,*) xv1(i,j),xv2(i,j),xv3(i,j) |
---|
141 | c enddo |
---|
142 | c enddo |
---|
143 | c close(1) |
---|
144 | |
---|
145 | endif ! fin initialisations premier appel |
---|
146 | |
---|
147 | c******* DEBUT DES BOUCLE GRILLE ************************ |
---|
148 | c PRINT*, 'AEROSOLS EN VISIBLE' |
---|
149 | |
---|
150 | DO 101 ig=1,klon !c! BOUCLE SUR GRILLE HORIZONTALE |
---|
151 | |
---|
152 | if (microfi.eq.1) then |
---|
153 | do iq=1,nrad |
---|
154 | do j=1,NLAYER |
---|
155 | zqaer_1pt(j,iq)=qaer(ig,j,iq) |
---|
156 | enddo |
---|
157 | enddo |
---|
158 | else |
---|
159 | if (ig.eq.1) then |
---|
160 | c initialisation zqaer_1pt a partir d'une look-up table (uniforme en ig) |
---|
161 | c boucle sur nrad=10 |
---|
162 | open(10,file="qaer_eq_1d.dat") |
---|
163 | do iq=1,15 |
---|
164 | read(10,'(A100)') dummy |
---|
165 | enddo |
---|
166 | do j=NLAYER,1,-1 |
---|
167 | read(10,*) dummy2,dummy3,(zqaer_1pt(j,iq),iq=1,nrad) |
---|
168 | enddo |
---|
169 | close(10) |
---|
170 | endif |
---|
171 | endif |
---|
172 | |
---|
173 | c if ((ig.eq.klon/2).or.(microfi.eq.0)) then |
---|
174 | c print*,"Q01=",zqaer_1pt(:,1) |
---|
175 | c print*,"Q05=",zqaer_1pt(:,5) |
---|
176 | c print*,"Q10=",zqaer_1pt(:,10) |
---|
177 | c stop |
---|
178 | c endif |
---|
179 | |
---|
180 | iout=0 |
---|
181 | c if ((microfi.eq.0).or.(ig.eq.klon/2)) iout=1 |
---|
182 | if (seulmtunpt.eq.0) then |
---|
183 | call optcv_1pt(zqaer_1pt,ioptv, |
---|
184 | . COSBV_1pt,DTAUV_1pt,TAUHV_1pt,TAUHVD_1pt,TAUCV_1pt, |
---|
185 | . TAURV_1pt,TAUGV_1pt,TAUGVD_1pt,WBARV_1pt,TAUV_1pt,iout) |
---|
186 | ioptv = 1 |
---|
187 | endif |
---|
188 | |
---|
189 | c Pas de microphysique, ni de composition variable: un seul passage |
---|
190 | c dans optci_1pt. |
---|
191 | if ((microfi.eq.0).and.(ylellouch)) then |
---|
192 | seulmtunpt = 1 |
---|
193 | endif |
---|
194 | |
---|
195 | COSBV(ig,:,:,:)= COSBV_1pt(:,:,:) |
---|
196 | WBARV(ig,:,:,:)= WBARV_1pt(:,:,:) |
---|
197 | DTAUV(ig,:,:,:)= DTAUV_1pt(:,:,:) |
---|
198 | TAUHV(ig,:) = TAUHV_1pt(:) |
---|
199 | TAUCV(ig,:) = TAUCV_1pt(:) |
---|
200 | TAURV(ig,:) = TAURV_1pt(:) |
---|
201 | TAUGV(ig,:) = TAUGV_1pt(:) |
---|
202 | TAUV(ig,:,:,:) = TAUV_1pt(:,:,:) |
---|
203 | TAUHVD(ig,:,:) = TAUHVD_1pt(:,:) |
---|
204 | TAUGVD(ig,:,:) = TAUGVD_1pt(:,:) |
---|
205 | |
---|
206 | 101 CONTINUE |
---|
207 | |
---|
208 | c FIN BOUCLE GRILLE ******* |
---|
209 | c****************************** |
---|
210 | |
---|
211 | PRINT*, 'FIN OPTCV' |
---|
212 | RETURN |
---|
213 | END |
---|