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