Changeset 4055 for trunk/LMDZ.GENERIC/libf/phygeneric/optcv.F90
- Timestamp:
- Feb 6, 2026, 10:20:21 PM (3 weeks ago)
- File:
-
- 1 edited
-
trunk/LMDZ.GENERIC/libf/phygeneric/optcv.F90 (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.GENERIC/libf/phygeneric/optcv.F90
r3797 r4055 10 10 11 11 use radinc_h, only: L_NLAYRAD, L_NLEVRAD, L_LEVELS, L_NSPECTV, L_NGAUSS, L_REFVAR, NAERKIND 12 use radcommon_h, only: gasv, tlimit, wrefVAR, Cmk, tgasref, pfgasref,wnov,scalep, indv,glat_ig12 use radcommon_h, only: gasv, tlimit, wrefVAR, Cmk, tgasref, pfgasref,wnov,scalep,glat_ig 13 13 use gases_h, only: gfrac, ngasmx, igas_H2, igas_H2O, igas_He, igas_N2, & 14 14 igas_CH4, igas_CO2, igas_O2 15 15 use comcstfi_mod, only: g, r, mugaz 16 16 use callkeys_mod, only: kastprof,continuum,graybody,callgasvis,varspec, & 17 generic_continuum_database,rayleigh17 rayleigh 18 18 use recombin_corrk_mod, only: corrk_recombin, gasv_recomb 19 19 use tpindex_mod, only: tpindex … … 107 107 integer igas, jgas 108 108 109 integer interm110 111 109 logical :: firstcall=.true. 112 110 !$OMP THREADPRIVATE(firstcall) … … 120 118 firstcall=.false. 121 119 endif ! of if (firstcall) 122 123 !! AS: to save time in computing continuum (see bilinearbig)124 IF (.not.ALLOCATED(indv)) THEN125 ALLOCATE(indv(L_NSPECTV,ngasmx,ngasmx))126 indv = -9999 ! this initial value means "to be calculated"127 ENDIF128 120 129 121 !======================================================================= … … 211 203 ! include continua if necessary 212 204 213 if(generic_continuum_database)then214 205 T_cont = dble(TMID(k)) 215 206 do igas=1,ngasmx … … 261 252 262 253 enddo ! igas=1,ngasmx 263 264 else ! generic_continuum_database265 266 267 wn_cont = dble(wnov(nw))268 T_cont = dble(TMID(k))269 do igas=1,ngasmx270 271 if(gfrac(igas).eq.-1)then ! variable272 p_cont = dble(PMID(k)*scalep*QVAR(k)) ! qvar = mol/mol273 elseif(varspec) then274 p_cont = dble(PMID(k)*scalep*FRACVAR(igas,k)*(1.-QVAR(k)))275 else276 p_cont = dble(PMID(k)*scalep*gfrac(igas)*(1.-QVAR(k)))277 endif278 279 dtemp=0.0280 if(igas.eq.igas_N2)then281 282 interm = indv(nw,igas,igas)283 ! call interpolateN2N2(wn_cont,T_cont,p_cont,dtemp,.false.,interm)284 indv(nw,igas,igas) = interm285 ! only goes to 500 cm^-1, so unless we're around a cold brown dwarf, this is irrelevant in the visible286 287 elseif(igas.eq.igas_H2)then288 289 ! first do self-induced absorption290 interm = indv(nw,igas,igas)291 call interpolateH2H2(wn_cont,T_cont,p_cont,dtemp,.false.,interm)292 indv(nw,igas,igas) = interm293 294 ! then cross-interactions with other gases295 do jgas=1,ngasmx296 if(varspec) then297 p_cross = dble(PMID(k)*scalep*FRACVAR(jgas,k)*(1.-QVAR(k)))298 else299 p_cross = dble(PMID(k)*scalep*gfrac(jgas)*(1.-QVAR(k)))300 endif301 dtempc = 0.0302 if(jgas.eq.igas_N2)then303 interm = indv(nw,igas,jgas)304 call interpolateN2H2(wn_cont,T_cont,p_cross,p_cont,dtempc,.false.,interm)305 indv(nw,igas,jgas) = interm306 ! should be irrelevant in the visible307 elseif(jgas.eq.igas_CO2)then308 interm = indv(nw,igas,jgas)309 call interpolateCO2H2(wn_cont,T_cont,p_cross,p_cont,dtempc,.false.,interm)310 indv(nw,igas,jgas) = interm311 ! might not be relevant in the visible312 elseif(jgas.eq.igas_He)then313 interm = indv(nw,igas,jgas)314 call interpolateH2He(wn_cont,T_cont,p_cross,p_cont,dtempc,.false.,interm)315 indv(nw,igas,jgas) = interm316 endif317 dtemp = dtemp + dtempc318 enddo319 320 elseif(igas.eq.igas_CH4)then321 322 ! first do self-induced absorption323 interm = indv(nw,igas,igas)324 call interpolateCH4CH4(wn_cont,T_cont,p_cont,dtemp,.false.,interm)325 indv(nw,igas,igas) = interm326 327 ! then cross-interactions with other gases328 do jgas=1,ngasmx329 if(varspec) then330 p_cross = dble(PMID(k)*scalep*FRACVAR(jgas,k)*(1.-QVAR(k)))331 else332 p_cross = dble(PMID(k)*scalep*gfrac(jgas)*(1.-QVAR(k)))333 endif334 dtempc = 0.0d0335 if(jgas.eq.igas_H2)then336 interm = indv(nw,igas,jgas)337 call interpolateH2CH4(wn_cont,T_cont,p_cross,p_cont,dtempc,.false.,interm)338 indv(nw,igas,jgas) = interm339 elseif(jgas.eq.igas_CO2)then340 interm = indv(nw,igas,jgas)341 call interpolateCO2CH4(wn_cont,T_cont,p_cross,p_cont,dtempc,.false.,interm)342 indv(nw,igas,jgas) = interm343 ! might not be relevant in the visible344 elseif(jgas.eq.igas_He)then345 interm = indv(nw,igas,jgas)346 call interpolateHeCH4(wn_cont,T_cont,p_cross,p_cont,dtempc,.false.,interm)347 indv(nw,igas,jgas) = interm348 endif349 dtemp = dtemp + dtempc350 enddo351 352 elseif(igas.eq.igas_H2O.and.T_cont.gt.100.0)then353 ! Compute self and foreign (with air) continuum of H2O354 p_air = dble(PMID(k)*scalep) - p_cont ! note assumes background is air!355 interm = indv(nw,igas,igas)356 call interpolateH2O_self_foreign(wn_cont,T_cont,p_cont,p_air,dtemp,.false.,interm) ! MTCKD v3.3357 indv(nw,igas,igas) = interm358 359 endif360 361 DCONT = DCONT + dtemp362 363 enddo364 365 endif ! generic_continuum_database366 254 367 255 DCONT = DCONT*dz(k)
Note: See TracChangeset
for help on using the changeset viewer.
