Changeset 873 for trunk/LMDZ.GENERIC/libf
- Timestamp:
- Feb 9, 2013, 5:48:51 PM (12 years ago)
- Location:
- trunk/LMDZ.GENERIC/libf/phystd
- Files:
-
- 1 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.GENERIC/libf/phystd/callkeys.h
r728 r873 8 8 & , iaervar,iddist,topdustref,callstats,calleofdump & 9 9 & , enertest & 10 & , callgasvis, Continuum,H2Ocont_simple,graybody &10 & , callgasvis,continuum,H2Ocont_simple,graybody & 11 11 & , Nmix_co2, radfixed, dusttau & 12 12 & , meanOLR, specOLR & … … 35 35 & , season,diurnal,tlocked,lwrite & 36 36 & , callstats,calleofdump & 37 & , callgasvis, Continuum,H2Ocont_simple,graybody37 & , callgasvis,continuum,H2Ocont_simple,graybody 38 38 39 39 logical enertest -
trunk/LMDZ.GENERIC/libf/phystd/inifis.F
r804 r873 203 203 write(*,*) "call continuum opacities in radiative transfer ?", 204 204 & "(matters only if callrad=T)" 205 Continuum=.true. ! default value206 call getin(" Continuum",Continuum)207 write(*,*) " Continuum = ",Continuum205 continuum=.true. ! default value 206 call getin("continuum",continuum) 207 write(*,*) " continuum = ",continuum 208 208 209 209 write(*,*) "use analytic function for H2O continuum ?" -
trunk/LMDZ.GENERIC/libf/phystd/interpolateH2H2.F90
r716 r873 1 subroutine interpolateH2H2(wn,temp,pres,abcoef,firstcall )1 subroutine interpolateH2H2(wn,temp,pres,abcoef,firstcall,a) 2 2 3 3 !================================================================== … … 15 15 16 16 use datafile_mod, only: datadir 17 17 18 implicit none 18 19 … … 52 53 double precision blah, Ttemp 53 54 integer nres 55 56 integer a 54 57 55 58 if(temp.gt.400)then … … 104 107 print*,' pressure ',pres,' Pa' 105 108 106 call bilinearH2H2(wn_arr,temp_arr,abs_arr,wn,temp,abcoef)109 endif 107 110 108 print*,'the absorption is ',abcoef,' cm^5 molecule^-2' 109 print*,'or ',abcoef*losch**2,' cm^-1 amagat^-2' 111 call bilinearbig(wn_arr,temp_arr,abs_arr,wn,temp,abcoef,a) 112 113 !print*,'the absorption is ',abcoef,' cm^5 molecule^-2' 114 !print*,'or ',abcoef*losch**2,' cm^-1 amagat^-2' 110 115 111 116 abcoef=abcoef*losch**2*100.0*amagat**2 ! convert to m^-1 112 117 113 print*,'We have ',amagat,' amagats of H2' 114 print*,'So the absorption is ',abcoef,' m^-1' 115 116 !open(117,file='T_array.dat') 117 !do iT=1,nT 118 ! write(117,*), temp_arr(iT) 119 !end do 120 !close(117) 121 122 !open(115,file='nu_array.dat') 123 !do k=1,nS 124 ! write(115,*), wn_arr(k) 125 !end do 126 !close(115) 127 128 !open(113,file='abs_array.dat') 129 !do iT=1,nT 130 ! do k=1,nS 131 ! write(113,*), abs_arr(k,iT)*losch**2 132 ! end do 133 !end do 134 !close(113) 135 136 else 137 138 call bilinearH2H2(wn_arr,temp_arr,abs_arr,wn,temp,abcoef) 139 abcoef=abcoef*losch**2*100.0*amagat**2 ! convert to m^-1 118 !print*,'We have ',amagat,' amagats of H2' 119 !print*,'So the absorption is ',abcoef,' m^-1' 140 120 141 121 ! unlike for Rayleigh scattering, we do not currently weight by the BB function 142 122 ! however our bands are normally thin, so this is no big deal. 143 123 144 endif145 146 124 return 147 125 end subroutine interpolateH2H2 148 149 150 !-------------------------------------------------------------------------151 subroutine bilinearH2H2(x_arr,y_arr,f2d_arr,x_in,y_in,f)152 ! Necessary for interpolation of continuum data153 154 implicit none155 156 integer nX,nY,i,j,a,b157 parameter(nX=2428)158 parameter(nY=10)159 160 real*8 x_in,y_in,x,y,x1,x2,y1,y2161 real*8 f,f11,f12,f21,f22,fA,fB162 real*8 x_arr(nX)163 real*8 y_arr(nY)164 real*8 f2d_arr(nX,nY)165 166 integer strlen167 character*100 label168 label='subroutine bilinear'169 170 x=x_in171 y=y_in172 173 174 ! 1st check we're within the wavenumber range175 if ((x.lt.x_arr(2)).or.(x.gt.x_arr(nX-2))) then176 f=0.0D+0177 return178 else179 180 ! in the x (wavenumber) direction 1st181 i=1182 10 if (i.lt.(nX+1)) then183 if (x_arr(i).gt.x) then184 x1=x_arr(i-1)185 x2=x_arr(i)186 a=i-1187 i=9999188 endif189 i=i+1190 goto 10191 endif192 endif193 194 if ((y.lt.y_arr(1)).or.(y.gt.y_arr(nY))) then195 write(*,*) 'Warning from bilinearH2H2:'196 write(*,*) 'Outside continuum temperature range!'197 if(y.lt.y_arr(1))then198 y=y_arr(1)+0.01199 endif200 if(y.gt.y_arr(nY))then201 y=y_arr(nY)-0.01202 endif203 else204 205 ! in the y (temperature) direction 2nd206 j=1207 20 if (j.lt.(nY+1)) then208 if (y_arr(j).gt.y) then209 y1=y_arr(j-1)210 y2=y_arr(j)211 b=j-1212 j=9999213 endif214 j=j+1215 goto 20216 endif217 endif218 219 f11=f2d_arr(a,b)220 f21=f2d_arr(a+1,b)221 f12=f2d_arr(a,b+1)222 f22=f2d_arr(a+1,b+1)223 224 call bilinear(f,f11,f21,f12,f22,x,x1,x2,y,y1,y2)225 226 return227 end subroutine bilinearH2H2 -
trunk/LMDZ.GENERIC/libf/phystd/interpolateH2He.F90
r716 r873 1 subroutine interpolateH2He(wn,temp,presH2,presHe,abcoef,firstcall )1 subroutine interpolateH2He(wn,temp,presH2,presHe,abcoef,firstcall,a) 2 2 3 3 !================================================================== … … 15 15 16 16 use datafile_mod, only: datadir 17 17 18 implicit none 18 19 … … 55 56 integer nres 56 57 57 58 integer a 59 58 60 if(temp.gt.400)then 59 61 print*,'Your temperatures are too high for this H2-He CIA dataset.' … … 108 110 print*,' and He partial pressure ',presHe,' Pa' 109 111 110 call bilinearH2He(wn_arr,temp_arr,abs_arr,wn,temp,abcoef)112 endif 111 113 112 print*,'the absorption is ',abcoef,' cm^5 molecule^-2' 113 print*,'or ',abcoef*losch**2,' cm^-1 amagat^-2' 114 call bilinearbig(wn_arr,temp_arr,abs_arr,wn,temp,abcoef,a) 115 116 !print*,'the absorption is ',abcoef,' cm^5 molecule^-2' 117 !print*,'or ',abcoef*losch**2,' cm^-1 amagat^-2' 114 118 115 119 abcoef=abcoef*losch**2*100.0*amagatH2*amagatHe ! convert to m^-1 116 120 117 print*,'We have ',amagatH2,' amagats of H2' 118 print*,'and ',amagatHe,' amagats of He' 119 print*,'So the absorption is ',abcoef,' m^-1' 120 121 else 122 123 call bilinearH2He(wn_arr,temp_arr,abs_arr,wn,temp,abcoef) 124 abcoef=abcoef*losch**2*100.0*amagatH2*amagatHe ! convert to m^-1 121 !print*,'We have ',amagatH2,' amagats of H2' 122 !print*,'and ',amagatHe,' amagats of He' 123 !print*,'So the absorption is ',abcoef,' m^-1' 125 124 126 125 ! unlike for Rayleigh scattering, we do not currently weight by the BB function 127 126 ! however our bands are normally thin, so this is no big deal. 128 127 129 endif130 131 128 return 132 129 end subroutine interpolateH2He 133 134 135 !-------------------------------------------------------------------------136 subroutine bilinearH2He(x_arr,y_arr,f2d_arr,x_in,y_in,f)137 ! Necessary for interpolation of continuum data138 139 implicit none140 141 integer nX,nY,i,j,a,b142 parameter(nX=2428)143 parameter(nY=10)144 145 real*8 x_in,y_in,x,y,x1,x2,y1,y2146 real*8 f,f11,f12,f21,f22,fA,fB147 real*8 x_arr(nX)148 real*8 y_arr(nY)149 real*8 f2d_arr(nX,nY)150 151 integer strlen152 character*100 label153 label='subroutine bilinear'154 155 x=x_in156 y=y_in157 158 ! 1st check we're within the wavenumber range159 if ((x.lt.x_arr(2)).or.(x.gt.x_arr(nX-2))) then160 f=0.0D+0161 return162 else163 164 ! in the x (wavenumber) direction 1st165 i=1166 10 if (i.lt.(nX+1)) then167 if (x_arr(i).gt.x) then168 x1=x_arr(i-1)169 x2=x_arr(i)170 a=i-1171 i=9999172 endif173 i=i+1174 goto 10175 endif176 endif177 178 if ((y.lt.y_arr(1)).or.(y.gt.y_arr(nY))) then179 write(*,*) 'Warning from bilinearH2He:'180 write(*,*) 'Outside continuum temperature range!'181 if(y.lt.y_arr(1))then182 y=y_arr(1)+0.01183 endif184 if(y.gt.y_arr(nY))then185 y=y_arr(nY)-0.01186 endif187 else188 189 ! in the y (temperature) direction 2nd190 j=1191 20 if (j.lt.(nY+1)) then192 if (y_arr(j).gt.y) then193 y1=y_arr(j-1)194 y2=y_arr(j)195 b=j-1196 j=9999197 endif198 j=j+1199 goto 20200 endif201 endif202 203 f11=f2d_arr(a,b)204 f21=f2d_arr(a+1,b)205 f12=f2d_arr(a,b+1)206 f22=f2d_arr(a+1,b+1)207 208 call bilinear(f,f11,f21,f12,f22,x,x1,x2,y,y1,y2)209 210 211 return212 end subroutine bilinearH2He -
trunk/LMDZ.GENERIC/libf/phystd/optci.F90
r716 r873 4 4 5 5 use radinc_h 6 use radcommon_h, only: gasi,tlimit,wrefVAR,Cmk,tgasref,pfgasref,wnoi,scalep 6 use radcommon_h, only: gasi,tlimit,wrefVAR,Cmk,tgasref,pfgasref,wnoi,scalep,indi 7 7 use gases_h 8 8 implicit none … … 70 70 71 71 ! variables for k in units m^-1 72 real*8 rho, dz(L_LEVELS) 72 real*8 dz(L_LEVELS) 73 !real*8 rho !! see test below 73 74 74 75 integer igas, jgas 76 77 integer interm 75 78 76 79 !--- Kasting's CIA ---------------------------------------- … … 87 90 !---------------------------------------------------------- 88 91 92 !! AS: to save time in computing continuum (see bilinearbig) 93 IF (.not.ALLOCATED(indi)) THEN 94 ALLOCATE(indi(L_NSPECTI,ngasmx)) 95 indi = -9999 ! this initial value means "to be calculated" 96 ENDIF 97 89 98 !======================================================================= 90 99 ! Determine the total gas opacity throughout the column, for each … … 133 142 134 143 do K=2,L_LEVELS 135 do nw=1,L_NSPECTI 144 145 do NW=1,L_NSPECTI 136 146 137 147 DCONT = 0.0 ! continuum absorption 138 148 139 if( Continuum.and.(.not.graybody))then149 if(continuum.and.(.not.graybody))then 140 150 ! include continua if necessary 141 151 wn_cont = dble(wnoi(nw)) … … 157 167 158 168 ! first do self-induced absorption 159 call interpolateH2H2(wn_cont,T_cont,p_cont,dtemp,.false.) 169 interm = indi(nw,igas) 170 call interpolateH2H2(wn_cont,T_cont,p_cont,dtemp,.false.,interm) 171 indi(nw,igas) = interm 160 172 161 173 ! then cross-interactions with other gases … … 166 178 call interpolateN2H2(wn_cont,T_cont,p_cross,p_cont,dtempc,.false.) 167 179 elseif(jgas.eq.igas_He)then 168 call interpolateH2He(wn_cont,T_cont,p_cross,p_cont,dtempc,.false.) 180 interm = indi(nw,jgas) 181 call interpolateH2He(wn_cont,T_cont,p_cross,p_cont,dtempc,.false.,interm) 182 indi(nw,jgas) = interm 169 183 endif 170 184 dtemp = dtemp + dtempc … … 228 242 229 243 KCOEF(1) = GASI(MT(K),MP(K),NVAR(K),NW,NG) + WRATIO(K)* & 230 (GASI(MT(K),MP(K),NVAR(K)+1,NW,NG) - & 244 (GASI(MT(K),MP(K),NVAR(K)+1,NW,NG) - & 231 245 GASI(MT(K),MP(K),NVAR(K),NW,NG)) 232 246 … … 242 256 (GASI(MT(K)+1,MP(K),NVAR(K)+1,NW,NG) - & 243 257 GASI(MT(K)+1,MP(K),NVAR(K),NW,NG)) 258 244 259 endif 245 260 … … 252 267 253 268 TAUGSURF(NW,NG) = TAUGSURF(NW,NG) + TAUGAS + DCONT 254 DTAUKI(K,nw,ng) = TAUGAS + DCONT ! For parameterized continuum absorption 269 DTAUKI(K,nw,ng) = TAUGAS & 270 + DCONT ! For parameterized continuum absorption 255 271 256 272 do iaer=1,naerkind … … 278 294 ! we need to calculate the scattering albedo and asymmetry factors 279 295 296 do iaer=1,naerkind 280 297 DO NW=1,L_NSPECTI 281 298 DO K=2,L_LEVELS+1 282 do iaer=1,naerkind283 299 TAUAEROLK(K,NW,IAER) = TAUAERO(K,IAER)*QSIAER(K,NW,IAER) 284 end do285 300 ENDDO 286 301 ENDDO 302 end do 287 303 288 304 DO NW=1,L_NSPECTI -
trunk/LMDZ.GENERIC/libf/phystd/optcv.F90
r716 r873 4 4 5 5 use radinc_h 6 use radcommon_h, only: gasv, tlimit, wrefVAR, Cmk, tgasref, pfgasref,wnov,scalep 6 use radcommon_h, only: gasv, tlimit, wrefVAR, Cmk, tgasref, pfgasref,wnov,scalep,indv 7 7 use gases_h 8 8 … … 35 35 !------------------------------------------------------------------- 36 36 37 #include "comcstfi.h" 37 38 #include "callkeys.h" 38 #include "comcstfi.h" 39 39 40 40 41 real*8 DTAUV(L_NLAYRAD,L_NSPECTV,L_NGAUSS) … … 46 47 real*8 COSBV(L_NLAYRAD,L_NSPECTV,L_NGAUSS) 47 48 real*8 WBARV(L_NLAYRAD,L_NSPECTV,L_NGAUSS) 48 real*8 TAURAY(L_NSPECTV)49 49 50 50 ! for aerosols 51 real*8 QXVAER(L_LEVELS+1,L_NSPECTV,NAERKIND)52 real*8 QSVAER(L_LEVELS+1,L_NSPECTV,NAERKIND)53 real*8 GVAER(L_LEVELS+1,L_NSPECTV,NAERKIND)54 real*8 TAUAERO(L_LEVELS+1,NAERKIND)55 real*8 TAUAEROLK(L_LEVELS+1,L_NSPECTV,NAERKIND)56 real*8 TAEROS(L_LEVELS,L_NSPECTV,NAERKIND)57 58 integer L, NW, NG, K, NG1(L_NSPECTV),LK, IAER51 real*8 QXVAER(L_LEVELS+1,L_NSPECTV,NAERKIND) 52 real*8 QSVAER(L_LEVELS+1,L_NSPECTV,NAERKIND) 53 real*8 GVAER(L_LEVELS+1,L_NSPECTV,NAERKIND) 54 real*8 TAUAERO(L_LEVELS+1,NAERKIND) 55 real*8 TAUAEROLK(L_LEVELS+1,L_NSPECTV,NAERKIND) 56 real*8 TAEROS(L_LEVELS,L_NSPECTV,NAERKIND) 57 58 integer L, NW, NG, K, LK, IAER 59 59 integer MT(L_LEVELS), MP(L_LEVELS), NP(L_LEVELS) 60 60 real*8 ANS, TAUGAS 61 real*8 TAURAY(L_NSPECTV) 61 62 real*8 TRAY(L_LEVELS,L_NSPECTV) 63 real*8 TRAYAER 62 64 real*8 DPR(L_LEVELS), U(L_LEVELS) 63 65 real*8 LCOEF(4), LKCOEF(L_LEVELS,4) 64 66 65 real*8 taugsurf(L_NSPECTV,L_NGAUSS-1), TRAYAER 67 real*8 taugsurf(L_NSPECTV,L_NGAUSS-1) 68 real*8 DCONT 69 double precision wn_cont, p_cont, p_air, T_cont, dtemp, dtempc 70 double precision p_cross 66 71 67 72 ! variable species mixing ratio variables 68 real*8 QVAR(L_LEVELS), WRATIO(L_LEVELS), MUVAR(L_LEVELS)69 real*8 KCOEF(4)73 real*8 QVAR(L_LEVELS), WRATIO(L_LEVELS), MUVAR(L_LEVELS) 74 real*8 KCOEF(4) 70 75 integer NVAR(L_LEVELS) 71 76 … … 74 79 75 80 ! variables for k in units m^-1 76 double precision wn_cont, p_cont, p_air, T_cont, dtemp 77 double precision p_cross 78 real*8 dz(L_LEVELS), DCONT 81 real*8 dz(L_LEVELS) 79 82 80 83 integer igas, jgas 84 85 integer interm 86 87 !! AS: to save time in computing continuum (see bilinearbig) 88 IF (.not.ALLOCATED(indv)) THEN 89 ALLOCATE(indv(L_NSPECTV,ngasmx)) 90 indv = -9999 ! this initial value means "to be calculated" 91 ENDIF 81 92 82 93 !======================================================================= … … 95 106 ! if we have continuum opacities, we need dz 96 107 if(kastprof)then 97 dz(k) = dpr(k)*( 8314.5/muvar(k))*TMID(K)/(g*PMID(K))108 dz(k) = dpr(k)*(1000.0*8.3145/muvar(k))*TMID(K)/(g*PMID(K)) 98 109 U(k) = (Cmk*mugaz/(muvar(k)))*DPR(k) 99 110 else … … 109 120 end do 110 121 122 111 123 DO NW=1,L_NSPECTV 124 do iaer=1,naerkind 125 TAEROS(K,NW,IAER) = TAUAERO(K,IAER) * QXVAER(K,NW,IAER) 126 end do 112 127 TRAY(K,NW) = TAURAY(NW) * DPR(K) 113 114 do iaer=1,naerkind115 TAEROS(K,NW,IAER) = TAUAERO(K,IAER) * QXVAER(K,NW,IAER)116 end do117 118 128 END DO 119 end do 120 121 ! TRAYAER is Tau RAYleigh scattering, plus AERosol opacity 129 end do ! levels 122 130 123 131 ! we ignore K=1... 124 132 do K=2,L_LEVELS 133 125 134 do NW=1,L_NSPECTV 126 135 127 136 TRAYAER = TRAY(K,NW) 137 ! TRAYAER is Tau RAYleigh scattering, plus AERosol opacity 128 138 do iaer=1,naerkind 129 139 TRAYAER = TRAYAER + TAEROS(K,NW,IAER) … … 132 142 DCONT = 0.0 ! continuum absorption 133 143 134 if(c allgasvis.and.continuum.and.(.not.graybody))then144 if(continuum.and.(.not.graybody).and.callgasvis)then 135 145 ! include continua if necessary 136 146 wn_cont = dble(wnov(nw)) … … 153 163 154 164 ! first do self-induced absorption 155 call interpolateH2H2(wn_cont,T_cont,p_cont,dtemp,.false.) 165 interm = indv(nw,igas) 166 call interpolateH2H2(wn_cont,T_cont,p_cont,dtemp,.false.,interm) 167 indv(nw,igas) = interm 156 168 157 169 ! then cross-interactions with other gases 158 170 do jgas=1,ngasmx 159 171 p_cross = dble(PMID(k)*scalep*gfrac(jgas)*(1.-QVAR(k))) 160 if(jgas.eq.igas_N2)then 161 call interpolateN2H2(wn_cont,T_cont,p_cross,p_cont,dtemp,.false.) 172 dtempc = 0.0 173 if(jgas.eq.igas_N2)then 174 call interpolateN2H2(wn_cont,T_cont,p_cross,p_cont,dtempc,.false.) 162 175 ! should be irrelevant in the visible 163 176 elseif(jgas.eq.igas_He)then 164 call interpolateH2He(wn_cont,T_cont,p_cross,p_cont,dtemp,.false.) 177 interm = indv(nw,jgas) 178 call interpolateH2He(wn_cont,T_cont,p_cross,p_cont,dtempc,.false.,interm) 179 indv(nw,jgas) = interm 165 180 endif 181 dtemp = dtemp + dtempc 166 182 enddo 167 183 … … 181 197 enddo 182 198 183 DCONT = DCONT*dz(k) 199 DCONT = DCONT*dz(k) 200 184 201 endif 185 202 186 do NG=1,L_NGAUSS-1187 188 ! =======================================================================189 ! Now compute TAUGAS 190 ! 191 ! 192 ! 193 194 if 203 do ng=1,L_NGAUSS-1 204 205 ! Now compute TAUGAS 206 207 ! Interpolate between water mixing ratios 208 ! WRATIO = 0.0 if the requested water amount is equal to, or outside the 209 ! the water data range 210 211 if(L_REFVAR.eq.1)then ! added by RW for special no variable case 195 212 KCOEF(1) = GASV(MT(K),MP(K),1,NW,NG) 196 213 KCOEF(2) = GASV(MT(K),MP(K)+1,1,NW,NG) … … 198 215 KCOEF(4) = GASV(MT(K)+1,MP(K),1,NW,NG) 199 216 else 217 200 218 KCOEF(1) = GASV(MT(K),MP(K),NVAR(K),NW,NG) + WRATIO(K)* & 201 219 (GASV(MT(K),MP(K),NVAR(K)+1,NW,NG) - & … … 213 231 (GASV(MT(K)+1,MP(K),NVAR(K)+1,NW,NG) - & 214 232 GASV(MT(K)+1,MP(K),NVAR(K),NW,NG)) 233 215 234 endif 216 235 217 ! 218 219 ANS = LKCOEF(K,1)*KCOEF(1) + LKCOEF(K,2)*KCOEF(2) + &236 ! Interpolate the gaseous k-coefficients to the requested T,P values 237 238 ANS = LKCOEF(K,1)*KCOEF(1) + LKCOEF(K,2)*KCOEF(2) + & 220 239 LKCOEF(K,3)*KCOEF(3) + LKCOEF(K,4)*KCOEF(4) 221 240 222 TAUGAS = U(k)*ANS 223 224 !TAUGSURF(NW,NG) = TAUGSURF(NW,NG) + TAUGAS 241 TAUGAS = U(k)*ANS 242 225 243 TAUGSURF(NW,NG) = TAUGSURF(NW,NG) + TAUGAS + DCONT 226 DTAUKV(K,nw,ng) = TAUGAS + TRAYAER & ! TRAYAER includes all scattering contributions 227 + DCONT ! for continuum absorption 244 DTAUKV(K,nw,ng) = TAUGAS & 245 + TRAYAER & ! TRAYAER includes all scattering contributions 246 + DCONT ! For parameterized continuum aborption 228 247 229 248 end do 230 249 231 232 ! Now fill in the "clear" part of the spectrum (NG = L_NGAUSS), 233 ! which holds continuum opacity only 234 235 NG = L_NGAUSS 250 ! Now fill in the "clear" part of the spectrum (NG = L_NGAUSS), 251 ! which holds continuum opacity only 252 253 NG = L_NGAUSS 236 254 DTAUKV(K,nw,ng) = TRAY(K,NW) + DCONT ! For parameterized continuum absorption 255 237 256 do iaer=1,naerkind 238 DTAUKV(K,nw,ng) = DTAUKV(K,nw,ng) + TAEROS(K,NW,IAER) 239 ! & + DCONT ! For parameterized continuum absorption 257 DTAUKV(K,nw,ng) = DTAUKV(K,nw,ng) + TAEROS(K,NW,IAER) 240 258 end do ! a bug was here! 241 259 … … 248 266 ! we need to calculate the scattering albedo and asymmetry factors 249 267 268 do iaer=1,naerkind 250 269 DO NW=1,L_NSPECTV 251 DO K=2,L_LEVELS 252 do iaer=1,naerkind 270 DO K=2,L_LEVELS ! AS: shouldn't this be L_LEVELS+1 ? (see optci) 253 271 TAUAEROLK(K,NW,IAER) = TAUAERO(K,IAER) * QSVAER(K,NW,IAER) 254 end do255 272 ENDDO 256 273 ENDDO 257 274 end do 258 275 259 276 DO NW=1,L_NSPECTV 260 261 262 K = 2*L+1 263 264 DTAUV(L,nw,ng) = DTAUKV(K,NW,NG)+DTAUKV(K+1,NW,NG)265 266 atemp=0.267 btemp=TRAY(K,NW) + TRAY(K+1,NW)268 277 DO NG=1,L_NGAUSS 278 DO L=1,L_NLAYRAD-1 279 280 K = 2*L+1 281 DTAUV(L,nw,ng) = DTAUKV(K,NW,NG) + DTAUKV(K+1,NW,NG) 282 283 atemp = 0. 284 btemp = TRAY(K,NW) + TRAY(K+1,NW) 285 ctemp=0.9999*(TRAY(K,NW) + TRAY(K+1,NW)) 269 286 do iaer=1,naerkind 270 287 atemp = atemp + & 271 288 GVAER(K,NW,IAER) * TAUAEROLK(K,NW,IAER) + & 272 289 GVAER(K+1,NW,IAER) * TAUAEROLK(K+1,NW,IAER) 273 btemp = btemp + & 274 TAUAEROLK(K,NW,IAER) + TAUAEROLK(K+1,NW,IAER) 275 ctemp = ctemp + & 276 TAUAEROLK(K,NW,IAER) + TAUAEROLK(K+1,NW,IAER) 290 btemp = btemp + TAUAEROLK(K,NW,IAER) + TAUAEROLK(K+1,NW,IAER) 291 ctemp = ctemp + TAUAEROLK(K,NW,IAER) + TAUAEROLK(K+1,NW,IAER) 277 292 end do 278 293 WBARV(L,nw,ng) = ctemp / DTAUV(L,nw,ng) 279 294 COSBV(L,NW,NG) = atemp/btemp 280 WBARV(L,nw,ng) = ctemp/DTAUV(L,nw,ng) 281 282 END DO 295 296 END DO ! L vertical loop 283 297 284 298 ! No vertical averaging on bottom layer … … 299 313 WBARV(L,nw,ng) = ctemp/DTAUV(L,nw,ng) 300 314 301 END DO ! NG gauss pointloop315 END DO ! NG Gauss loop 302 316 END DO ! NW spectral loop 303 317 304 305 306 318 ! Total extinction optical depths 307 319 308 DO NW=1,L_NSPECTV 320 DO NW=1,L_NSPECTV 309 321 DO NG=1,L_NGAUSS ! full gauss loop 310 322 TAUV(1,NW,NG)=0.0D0 … … 321 333 322 334 323 RETURN 324 END SUBROUTINE OPTCV 335 return 336 337 338 end subroutine optcv -
trunk/LMDZ.GENERIC/libf/phystd/radcommon_h.F90
r726 r873 66 66 REAL*8 blamv(L_NSPECTV+1) ! these are needed by suaer.F90 67 67 68 !! AS: introduced to avoid doing same computations again for continuum 69 INTEGER, DIMENSION(:,:), ALLOCATABLE :: indi 70 INTEGER, DIMENSION(:,:), ALLOCATABLE :: indv 71 68 72 !!! ALLOCATABLE STUFF SO THAT DIMENSIONS ARE READ in *.dat FILES -- AS 12/2011 69 73 REAL*8, DIMENSION(:,:,:,:,:), ALLOCATABLE :: gasi, gasv -
trunk/LMDZ.GENERIC/libf/phystd/sugas_corrk.F90
r869 r873 55 55 56 56 double precision testcont ! for continuum absorption initialisation 57 58 integer :: dummy 57 59 58 60 !======================================================================= … … 596 598 597 599 ! first do self-induced absorption 598 call interpolateH2H2(500.D+0,250.D+0,17500.D+0,testcont,.true.) 600 dummy = -9999 601 call interpolateH2H2(500.D+0,250.D+0,17500.D+0,testcont,.true.,dummy) 599 602 ! then cross-interactions with other gases 600 603 do jgas=1,ngasmx … … 602 605 call interpolateN2H2(592.D+0,278.15D+0,200000.D+0,10000.D+0,testcont,.true.) 603 606 elseif (jgas .eq. igas_He) then 604 call interpolateH2He(500.D+0,250.D+0,200000.D+0,10000.D+0,testcont,.true.) 607 dummy = -9999 608 call interpolateH2He(500.D+0,250.D+0,200000.D+0,10000.D+0,testcont,.true.,dummy) 605 609 endif 606 610 enddo
Note: See TracChangeset
for help on using the changeset viewer.