1 | SUBROUTINE SFLUXV(IPRINT,IG,dist_sol,falbe,icld) |
---|
2 | |
---|
3 | use dimphy |
---|
4 | USE TGMDAT_MOD, ONLY: UBARI,UBARV,UBAR0 |
---|
5 | USE TGMDAT_MOD, ONLY: F0PI |
---|
6 | IMPLICIT NONE |
---|
7 | #include "dimensions.h" |
---|
8 | #include "comorbit.h" |
---|
9 | |
---|
10 | c ASTUCE POUR EVITER klon... EN ATTENDANT MIEUX |
---|
11 | INTEGER ngrid |
---|
12 | PARAMETER (ngrid=(jjm-1)*iim+2) ! = klon |
---|
13 | c |
---|
14 | INTEGER IG,IPRINT,icld |
---|
15 | real dist_sol,falbe(ngrid) |
---|
16 | |
---|
17 | INTEGER NLAYER,NLEVEL,NSPECV,NSPC1V |
---|
18 | PARAMETER (NLAYER=llm,NLEVEL=NLAYER+1) |
---|
19 | PARAMETER (NSPECV=24,NSPC1V=25) |
---|
20 | INTEGER NT,NTERM(NSPECV),J,K |
---|
21 | |
---|
22 | REAL FUW(NLEVEL),FDW(NLEVEL) |
---|
23 | REAL DT0(NLAYER),T0(NLEVEL),WB0(NLAYER),CO0(NLAYER) |
---|
24 | REAL BTOP, BSURF |
---|
25 | REAL ATERM(4,NSPECV),BTERM(4,NSPECV) |
---|
26 | REAL PEXPON(NSPECV), SOLARF(NSPECV) |
---|
27 | REAL DTAUV(ngrid,NLAYER,NSPECV,4) |
---|
28 | & ,TAUV (ngrid,NLEVEL,NSPECV,4) |
---|
29 | & ,WBARV(ngrid,NLAYER,NSPECV,4) |
---|
30 | & ,COSBV(ngrid,NLAYER,NSPECV,4) |
---|
31 | & ,DTAUVP(ngrid,NLAYER,NSPECV,4) |
---|
32 | & ,TAUVP(ngrid,NLEVEL,NSPECV,4) |
---|
33 | & ,WBARVP(ngrid,NLAYER,NSPECV,4) |
---|
34 | & ,COSBVP(ngrid,NLAYER,NSPECV,4) |
---|
35 | REAL BWNV(NSPC1V),WNOV(NSPECV) |
---|
36 | & ,DWNV(NSPECV),WLNV(NSPECV) |
---|
37 | REAL FNETV(ngrid,NLEVEL), |
---|
38 | & FUPV(ngrid,NLEVEL,NSPECV), |
---|
39 | & FDV(ngrid,NLEVEL,NSPECV), |
---|
40 | & FMNETV(ngrid,NLEVEL), |
---|
41 | & FMUPV(NLEVEL),FMDV(NLEVEL) |
---|
42 | |
---|
43 | COMMON /VISGAS/SOLARF,NTERM,PEXPON, |
---|
44 | & ATERM,BTERM |
---|
45 | |
---|
46 | COMMON /OPTICV/ DTAUV |
---|
47 | & ,TAUV |
---|
48 | & ,WBARV |
---|
49 | & ,COSBV |
---|
50 | & ,DTAUVP |
---|
51 | & ,TAUVP |
---|
52 | & ,WBARVP |
---|
53 | & ,COSBVP |
---|
54 | |
---|
55 | COMMON /SPECTV/ BWNV,WNOV |
---|
56 | & ,DWNV,WLNV |
---|
57 | |
---|
58 | COMMON /FLUXvV/ FNETV, |
---|
59 | & FUPV, |
---|
60 | & FDV, |
---|
61 | & FMNETV |
---|
62 | |
---|
63 | |
---|
64 | * ON NE FAIT PAS LE CALCUL POUR TOUS LES IG EN MEME TEMPS |
---|
65 | * IG EST EN ARGUMENT...et SFLUXV EST APPELLEE NGRIDMX FOIS! |
---|
66 | |
---|
67 | C ZERO THE NET FLUXES |
---|
68 | DO 212 J=1,NLEVEL |
---|
69 | FNETV(ig,J)=-0. |
---|
70 | FMNETV(ig,J)=-0. |
---|
71 | 212 CONTINUE |
---|
72 | C |
---|
73 | C WE NOW ENTER A MAJOR LOOP OVER SPECRAL INTERVALS IN THE VISIBLE |
---|
74 | C AND OVER THE HORIZONTAL GRIDS |
---|
75 | C TO CALCULATE THE NET FLUX IN EACH SPECTRAL INTERVAL |
---|
76 | C |
---|
77 | C *************************************************************** |
---|
78 | |
---|
79 | |
---|
80 | DO 500 K=1,NSPECV ! #2 |
---|
81 | C ZERO THE SPECTRAL FLUXES IN ANTCIPATION OF SUMMING OVER NTERMS |
---|
82 | |
---|
83 | DO 214 J=1,NLEVEL ! #3 |
---|
84 | FUPV(ig,J,K)=0. |
---|
85 | FDV(ig,J,K)=0. |
---|
86 | 214 CONTINUE |
---|
87 | C |
---|
88 | C SET UP THE UPPER AND LOWER BOUNDARY CONDITIONS ON THE VISIBLE |
---|
89 | F0PI=SOLARF(K)*(p_elips/dist_sol)**2. |
---|
90 | BTOP=0.0 |
---|
91 | C |
---|
92 | C LOOP OVER THE NTERMS BEGINING HERE |
---|
93 | DO 912 NT=1,NTERM(K) |
---|
94 | IF (ICLD.eq.1) THEN |
---|
95 | BSURF=0.+ falbe(ig)*UBAR0*F0PI*EXP(-TAUV(ig,NLEVEL,K,NT)/UBAR0) |
---|
96 | ELSE |
---|
97 | BSURF=0.+ falbe(ig)*UBAR0*F0PI*EXP(-TAUVP(ig,NLEVEL,K,NT)/UBAR0) |
---|
98 | ENDIF |
---|
99 | C |
---|
100 | C* WE CAN NOW SOLVE FOR THE COEFFICIENTS OF THE TWO STREAM |
---|
101 | C CALL A SUBROUTINE THAT SOLVES FOR THE FLUX TERMS |
---|
102 | C WITHIN EACH INTERVAL AT THE MIDPOINT WAVENUMBER |
---|
103 | C |
---|
104 | C FUW AND FDW ARE WORKING FLUX ARRAYS THAT WILL BE USED TO |
---|
105 | C RETURN FLUXES FOR A GIVEN NT |
---|
106 | C |
---|
107 | C23456789012345678901234567890123456789012345678901234567890123456789012 |
---|
108 | C |
---|
109 | C USE DT0,T0,WB0,CO0 INSTEAD OF DTAUV(ig,1,K,NT)..etc... |
---|
110 | |
---|
111 | IF (ICLD.EQ.1) THEN |
---|
112 | DO J=1,NLAYER |
---|
113 | DT0(J)=DTAUV(ig,J,K,NT) |
---|
114 | T0(J) =TAUV(ig,J,K,NT) |
---|
115 | WB0(J)=WBARV(ig,J,K,NT) |
---|
116 | CO0(J)=COSBV(ig,J,K,NT) |
---|
117 | ENDDO |
---|
118 | T0(NLEVEL)=TAUV(ig,NLEVEL,K,NT) |
---|
119 | ELSE |
---|
120 | DO J=1,NLAYER |
---|
121 | DT0(J)=DTAUVP(ig,J,K,NT) |
---|
122 | T0(J) =TAUVP(ig,J,K,NT) |
---|
123 | WB0(J)=WBARVP(ig,J,K,NT) |
---|
124 | CO0(J)=COSBVP(ig,J,K,NT) |
---|
125 | ENDDO |
---|
126 | T0(NLEVEL)=TAUVP(ig,NLEVEL,K,NT) |
---|
127 | |
---|
128 | ENDIF |
---|
129 | |
---|
130 | c PRINT*,'entree gfluxv #: ',ig,K |
---|
131 | c write(*,*) (DT0(J),J=1,NLAYER) |
---|
132 | c print*,'---' |
---|
133 | c write(*,*) (T0(J),J=1,NLEVEL) |
---|
134 | c print*,'---' |
---|
135 | c write(*,*) (WB0(J),J=1,NLAYER) |
---|
136 | c print*,'---' |
---|
137 | c write(*,*) (CO0(J),J=1,NLAYER) |
---|
138 | c print*,'UBAR0 ',UBAR0 |
---|
139 | c print*,NLEVEL,WNOV(K),F0PI,falbe(ig),BTOP,BSURF |
---|
140 | FUW = 0.0 |
---|
141 | FDW = 0.0 |
---|
142 | FMUPV=0.0 |
---|
143 | FMDV= 0.0 |
---|
144 | |
---|
145 | CALL GFLUXV(NLEVEL,WNOV(K),DT0,T0, |
---|
146 | & WB0,CO0,F0PI,falbe(ig),BTOP,BSURF,FUW,FDW,FMUPV, |
---|
147 | & FMDV,IPRINT) |
---|
148 | c PRINT*,'sortie gfluxv #: ',ig,K |
---|
149 | c print*,'UBAR0 ',UBAR0 |
---|
150 | |
---|
151 | C NOW CALCULTE THE CUMULATIVE VISIBLE NET FLUX |
---|
152 | |
---|
153 | DO 300 J=1,NLEVEL !<------------ |
---|
154 | FMNETV(ig,J)=FMNETV(ig,J)+( FMUPV(J)-FMDV(J) )*ATERM(NT,K) |
---|
155 | FNETV(ig,J)=FNETV(ig,J)+( FUW(J)-FDW(J) )*ATERM(NT,K) |
---|
156 | |
---|
157 | C AND THE SPECTRAL FLUXES SUMMED OVER THE NTERMS |
---|
158 | FUPV(ig,J,K)=FUPV(ig,J,K)+FUW(J)*ATERM(NT,K) |
---|
159 | FDV(ig,J,K)=FDV(ig,J,K)+FDW(J)*ATERM(NT,K) |
---|
160 | 300 CONTINUE !<-------------- |
---|
161 | C |
---|
162 | C |
---|
163 | 912 CONTINUE |
---|
164 | 500 CONTINUE |
---|
165 | |
---|
166 | C *** END OF MAJOR SPECTRAL INTERVAL LOOP IN THE VISIBLE***** |
---|
167 | RETURN |
---|
168 | END |
---|