Changeset 4055 for trunk/LMDZ.GENERIC/libf/phygeneric/optci.F90
- Timestamp:
- Feb 6, 2026, 10:20:21 PM (3 weeks ago)
- File:
-
- 1 edited
-
trunk/LMDZ.GENERIC/libf/phygeneric/optci.F90 (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.GENERIC/libf/phygeneric/optci.F90
r3797 r4055 11 11 use radinc_h, only: L_LEVELS, L_NLAYRAD, L_NSPECTI, L_NGAUSS, & 12 12 L_NLEVRAD, L_REFVAR, naerkind 13 use radcommon_h, only: gasi,tlimit,wrefVAR,Cmk,tgasref,pfgasref,wnoi,scalep, indi,glat_ig13 use radcommon_h, only: gasi,tlimit,wrefVAR,Cmk,tgasref,pfgasref,wnoi,scalep,glat_ig 14 14 use gases_h, only: gfrac, ngasmx, igas_N2, igas_He, igas_H2O, igas_H2, & 15 15 igas_CH4, igas_CO2, igas_O2 16 16 use comcstfi_mod, only: g, r, mugaz 17 use callkeys_mod, only: kastprof,continuum,graybody,varspec, & 18 generic_continuum_database 17 use callkeys_mod, only: kastprof,continuum,graybody,varspec 19 18 use recombin_corrk_mod, only: corrk_recombin, gasi_recomb 20 19 use tpindex_mod, only: tpindex … … 98 97 99 98 integer igas, jgas 100 101 integer interm102 99 103 100 logical :: firstcall=.true. … … 126 123 endif ! of if (firstcall) 127 124 128 !! AS: to save time in computing continuum (see bilinearbig)129 IF (.not.ALLOCATED(indi)) THEN130 ALLOCATE(indi(L_NSPECTI,ngasmx,ngasmx))131 indi = -9999 ! this initial value means "to be calculated"132 ENDIF133 134 125 !======================================================================= 135 126 ! Determine the total gas opacity throughout the column, for each … … 191 182 ! include continua if necessary 192 183 193 if(generic_continuum_database)then194 184 T_cont = dble(TMID(k)) 195 185 do igas=1,ngasmx … … 241 231 242 232 enddo ! igas=1,ngasmx 243 244 else ! generic_continuum_database245 246 wn_cont = dble(wnoi(nw))247 T_cont = dble(TMID(k))248 do igas=1,ngasmx249 250 if(gfrac(igas).eq.-1)then ! variable251 p_cont = dble(PMID(k)*scalep*QVAR(k)) ! qvar = mol/mol252 elseif(varspec) then253 p_cont = dble(PMID(k)*scalep*FRACVAR(igas,k)*(1.-QVAR(k)))254 else255 p_cont = dble(PMID(k)*scalep*gfrac(igas)*(1.-QVAR(k)))256 endif257 258 dtemp=0.0d0259 if(igas.eq.igas_N2)then260 261 interm = indi(nw,igas,igas)262 call interpolateN2N2(wn_cont,T_cont,p_cont,dtemp,.false.,interm)263 indi(nw,igas,igas) = interm264 265 elseif(igas.eq.igas_H2)then266 267 ! first do self-induced absorption268 interm = indi(nw,igas,igas)269 call interpolateH2H2(wn_cont,T_cont,p_cont,dtemp,.false.,interm)270 indi(nw,igas,igas) = interm271 272 ! then cross-interactions with other gases273 do jgas=1,ngasmx274 if(varspec) then275 p_cross = dble(PMID(k)*scalep*FRACVAR(jgas,k)*(1.-QVAR(k)))276 else277 p_cross = dble(PMID(k)*scalep*gfrac(jgas)*(1.-QVAR(k)))278 endif279 dtempc = 0.0d0280 if(jgas.eq.igas_N2)then281 interm = indi(nw,igas,jgas)282 call interpolateN2H2(wn_cont,T_cont,p_cross,p_cont,dtempc,.false.,interm)283 indi(nw,igas,jgas) = interm284 elseif(jgas.eq.igas_CO2)then285 interm = indi(nw,igas,jgas)286 call interpolateCO2H2(wn_cont,T_cont,p_cross,p_cont,dtempc,.false.,interm)287 indi(nw,igas,jgas) = interm288 elseif(jgas.eq.igas_He)then289 interm = indi(nw,igas,jgas)290 call interpolateH2He(wn_cont,T_cont,p_cross,p_cont,dtempc,.false.,interm)291 indi(nw,igas,jgas) = interm292 endif293 dtemp = dtemp + dtempc294 enddo295 296 elseif(igas.eq.igas_CH4)then297 298 ! first do self-induced absorption299 interm = indi(nw,igas,igas)300 call interpolateCH4CH4(wn_cont,T_cont,p_cont,dtemp,.false.,interm)301 indi(nw,igas,igas) = interm302 303 ! then cross-interactions with other gases304 do jgas=1,ngasmx305 if(varspec) then306 p_cross = dble(PMID(k)*scalep*FRACVAR(jgas,k)*(1.-QVAR(k)))307 else308 p_cross = dble(PMID(k)*scalep*gfrac(jgas)*(1.-QVAR(k)))309 endif310 dtempc = 0.0d0311 if(jgas.eq.igas_H2)then312 interm = indi(nw,igas,jgas)313 call interpolateH2CH4(wn_cont,T_cont,p_cross,p_cont,dtempc,.false.,interm)314 indi(nw,igas,jgas) = interm315 elseif(jgas.eq.igas_CO2)then316 interm = indi(nw,igas,jgas)317 call interpolateCO2CH4(wn_cont,T_cont,p_cross,p_cont,dtempc,.false.,interm)318 indi(nw,igas,jgas) = interm319 elseif(jgas.eq.igas_He)then320 interm = indi(nw,igas,jgas)321 call interpolateHeCH4(wn_cont,T_cont,p_cross,p_cont,dtempc,.false.,interm)322 indi(nw,igas,jgas) = interm323 endif324 dtemp = dtemp + dtempc325 enddo326 327 elseif(igas.eq.igas_H2O.and.T_cont.gt.100.0)then328 ! Compute self and foreign (with air) continuum of H2O329 p_air = dble(PMID(k)*scalep) - p_cont ! note assumes background is air!330 interm = indi(nw,igas,igas)331 call interpolateH2O_self_foreign(wn_cont,T_cont,p_cont,p_air,dtemp,.false.,interm) ! MTCKD v3.3332 indi(nw,igas,igas) = interm333 334 endif335 336 DCONT = DCONT + dtemp337 338 enddo339 340 ! Oobleck test341 !rho = PMID(k)*scalep / (TMID(k)*286.99)342 !if(WNOI(nw).gt.300.0 .and. WNOI(nw).lt.500.0)then343 ! DCONT = rho * 0.125 * 4.6e-4344 !elseif(WNOI(nw).gt.500.0 .and. WNOI(nw).lt.700.0)then345 ! DCONT = 1000*dpr(k) * 1.0 * 4.6e-4 / g346 ! DCONT = rho * 1.0 * 4.6e-4347 !elseif(WNOI(nw).gt.700.0 .and. WNOI(nw).lt.900.0)then348 ! DCONT = rho * 0.125 * 4.6e-4349 !endif350 351 endif ! generic_continuum_database352 233 353 234 DCONT = DCONT*dz(k)
Note: See TracChangeset
for help on using the changeset viewer.
