Changeset 3641 for trunk


Ignore:
Timestamp:
Feb 23, 2025, 10:53:43 PM (30 hours ago)
Author:
mturbet
Message:

generic continuum database

Location:
trunk/LMDZ.GENERIC
Files:
1 added
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.GENERIC/changelog.txt

    r3621 r3641  
    19941994Follow-up of recent changes in iostart (making 1D restarts) from r3562,
    19951995Correspondingly adapt newstart.
     1996
     1997== 23/02/2025 == MT
     1998Implement the new generic continuum database
     1999More details here: https://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php/Continuum_Database
  • trunk/LMDZ.GENERIC/libf/phystd/calc_cpp_mugaz.F90

    r2831 r3641  
    4545            elseif(igas.eq.igas_N2)then
    4646               mugaz_c = mugaz_c + 28.01*gfrac(igas)
     47            elseif(igas.eq.igas_O2)then
     48               mugaz_c = mugaz_c + 31.999*gfrac(igas)
    4749            elseif(igas.eq.igas_H2)then
    4850               mugaz_c = mugaz_c + 2.01*gfrac(igas)
     
    98100            elseif(igas.eq.igas_N2)then
    99101               cpp_c   = cpp_c   + 1.040*gfrac(igas)*28.01/mugaz_c
     102            elseif(igas.eq.igas_O2)then
     103               cpp_c   = cpp_c   + 0.918*gfrac(igas)*31.999/mugaz_c
    100104            elseif(igas.eq.igas_H2)then
    101105               cpp_c   = cpp_c   + 14.31*gfrac(igas)*2.01/mugaz_c
  • trunk/LMDZ.GENERIC/libf/phystd/calc_rayleigh.F90

    r3043 r3641  
    2929      use radcommon_h, only: WAVEV, BWNV, DWNV, tstellar, tauray, taurayvar, scalep
    3030      use gases_h, only: ngasmx, vgas, gnom, gfrac, igas_CO2, igas_H2, &
    31                            igas_H2O, igas_He, igas_N2, igas_CH4, igas_CO
     31                           igas_H2O, igas_He, igas_N2, igas_CH4, igas_CO, &
     32                           igas_O2
    3233      use comcstfi_mod, only: g, mugaz, pi
    3334
  • trunk/LMDZ.GENERIC/libf/phystd/callkeys_mod.F90

    r3309 r3641  
    1313      logical,save :: season,diurnal,tlocked,rings_shadow,lwrite
    1414!$OMP THREADPRIVATE(season,diurnal,tlocked,rings_shadow,lwrite)
    15       logical,save :: callgasvis,continuum,graybody
    16 !$OMP THREADPRIVATE(callgasvis,continuum,graybody)
     15      logical,save :: callgasvis,continuum,generic_continuum_database,graybody
     16!$OMP THREADPRIVATE(callgasvis,continuum,generic_continuum_database,graybody)
    1717      logical,save :: strictboundcorrk                                     
    1818!$OMP THREADPRIVATE(strictboundcorrk)
  • trunk/LMDZ.GENERIC/libf/phystd/inifis_mod.F90

    r3437 r3641  
    341341     call getin_p("continuum",continuum)
    342342     if (is_master) write(*,*) trim(rname)//": continuum = ",continuum
     343     
     344     if (is_master) write(*,*) trim(rname)//&
     345       ": use generic continuum opacity database ?"//&
     346       " (matters only if callrad=T)"
     347     generic_continuum_database=.true. ! default value
     348     call getin_p("generic_continuum_database",generic_continuum_database)
     349     if (is_master) write(*,*) trim(rname)//": generic_continuum_database = ", &
     350     generic_continuum_database
    343351 
    344352     if (is_master) write(*,*) trim(rname)//": version for H2H2 CIA file ?"
  • trunk/LMDZ.GENERIC/libf/phystd/optci.F90

    r3233 r3641  
    1313  use radcommon_h, only: gasi,tlimit,wrefVAR,Cmk,tgasref,pfgasref,wnoi,scalep,indi,glat_ig
    1414  use gases_h, only: gfrac, ngasmx, igas_N2, igas_He, igas_H2O, igas_H2, &
    15                      igas_CH4, igas_CO2
     15                     igas_CH4, igas_CO2, igas_O2
    1616  use comcstfi_mod, only: g, r, mugaz
    17   use callkeys_mod, only: kastprof,continuum,graybody,varspec
     17  use callkeys_mod, only: kastprof,continuum,graybody,varspec, &
     18                          generic_continuum_database
    1819  use recombin_corrk_mod, only: corrk_recombin, gasi_recomb
    1920  use tpindex_mod, only: tpindex
     
    188189        if(continuum.and.(.not.graybody))then
    189190           ! include continua if necessary
    190            wn_cont = dble(wnoi(nw))
    191            T_cont  = dble(TMID(k))
    192            do igas=1,ngasmx
     191           
     192           if(generic_continuum_database)then
     193             T_cont  = dble(TMID(k))
     194             do igas=1,ngasmx
     195             
     196               if(gfrac(igas).eq.-1)then ! variable
     197                 p_cont  = dble(PMID(k)*scalep*QVAR(k)) ! qvar = mol/mol
     198               elseif(varspec) then
     199                 p_cont  = dble(PMID(k)*scalep*FRACVAR(igas,k)*(1.-QVAR(k)))
     200               else
     201                 p_cont  = dble(PMID(k)*scalep*gfrac(igas)*(1.-QVAR(k)))
     202               endif
     203             
     204               dtemp=0.0
     205               
     206               if (igas .eq. igas_N2) then
     207                call interpolate_continuum('',igas_N2,igas_N2,'IR',nw,T_cont,p_cont,p_cont,dtemp,.false.)
     208                do jgas=1,ngasmx
     209                 if (jgas .eq. igas_H2) then
     210                  call interpolate_continuum('',igas_N2,igas_H2,'IR',nw,T_cont,p_cont,p_cont,dtemp,.false.)
     211                 elseif (jgas .eq. igas_O2) then
     212                  call interpolate_continuum('',igas_N2,igas_O2,'IR',nw,T_cont,p_cont,p_cont,dtemp,.false.)
     213                 elseif (jgas .eq. igas_CH4) then
     214                  call interpolate_continuum('',igas_N2,igas_CH4,'IR',nw,T_cont,p_cont,p_cont,dtemp,.false.)
     215                 endif
     216                enddo
     217               elseif (igas .eq. igas_O2) then
     218                call interpolate_continuum('',igas_O2,igas_O2,'IR',nw,T_cont,p_cont,p_cont,dtemp,.false.)
     219                do jgas=1,ngasmx
     220                 if (jgas .eq. igas_CO2) then
     221                  call interpolate_continuum('',igas_CO2,igas_O2,'IR',nw,T_cont,p_cont,p_cont,dtemp,.false.)
     222                 endif
     223                enddo
     224               elseif (igas .eq. igas_H2) then
     225                call interpolate_continuum('',igas_H2,igas_H2,'IR',nw,T_cont,p_cont,p_cont,dtemp,.false.)
     226                do jgas=1,ngasmx
     227                 if (jgas .eq. igas_CH4) then
     228                  call interpolate_continuum('',igas_H2,igas_CH4,'IR',nw,T_cont,p_cont,p_cont,dtemp,.false.)
     229                 elseif (jgas .eq. igas_He) then
     230                  call interpolate_continuum('',igas_H2,igas_He,'IR',nw,T_cont,p_cont,p_cont,dtemp,.false.)
     231                 endif
     232                enddo   
     233               elseif (igas .eq. igas_CH4) then
     234                call interpolate_continuum('',igas_CH4,igas_CH4,'IR',nw,T_cont,p_cont,p_cont,dtemp,.false.)
     235               elseif (igas .eq. igas_H2O) then
     236                call interpolate_continuum('',igas_H2O,igas_H2O,'IR',nw,T_cont,p_cont,p_cont,dtemp,.false.)
     237                do jgas=1,ngasmx
     238                 if (jgas .eq. igas_N2) then
     239                  call interpolate_continuum('',igas_H2O,igas_N2,'IR',nw,T_cont,p_cont,p_cont,dtemp,.false.)
     240                 elseif (jgas .eq. igas_O2) then
     241                  call interpolate_continuum('',igas_H2O,igas_O2,'IR',nw,T_cont,p_cont,p_cont,dtemp,.false.)
     242                 elseif (jgas .eq. igas_CO2) then
     243                  call interpolate_continuum('',igas_H2O,igas_CO2,'IR',nw,T_cont,p_cont,p_cont,dtemp,.false.)
     244                 endif
     245                enddo   
     246               elseif (igas .eq. igas_CO2) then
     247                call interpolate_continuum('',igas_CO2,igas_CO2,'IR',nw,T_cont,p_cont,p_cont,dtemp,.false.)
     248                do jgas=1,ngasmx
     249                 if (jgas .eq. igas_H2) then
     250                  call interpolate_continuum('',igas_CO2,igas_H2,'IR',nw,T_cont,p_cont,p_cont,dtemp,.false.)
     251                 elseif (jgas .eq. igas_CH4) then
     252                  call interpolate_continuum('',igas_CO2,igas_CH4,'IR',nw,T_cont,p_cont,p_cont,dtemp,.false.)
     253                 endif
     254                enddo
     255               endif
     256               
     257               DCONT = DCONT + dtemp
     258               
     259             enddo ! igas=1,ngasmx
     260           else ! generic_continuum_database
     261            wn_cont = dble(wnoi(nw))
     262            T_cont  = dble(TMID(k))
     263            do igas=1,ngasmx
    193264
    194265              if(gfrac(igas).eq.-1)then ! variable
     
    295366           DCONT = DCONT*dz(k)
    296367
    297         endif
     368        endif ! generic_continuum_database
     369       
     370        endif ! continuum
    298371
    299372        do ng=1,L_NGAUSS-1
  • trunk/LMDZ.GENERIC/libf/phystd/optcv.F90

    r3233 r3641  
    1212  use radcommon_h, only: gasv, tlimit, wrefVAR, Cmk, tgasref, pfgasref,wnov,scalep,indv,glat_ig
    1313  use gases_h, only: gfrac, ngasmx, igas_H2, igas_H2O, igas_He, igas_N2, &
    14                      igas_CH4, igas_CO2
     14                     igas_CH4, igas_CO2, igas_O2
    1515  use comcstfi_mod, only: g, r, mugaz
    16   use callkeys_mod, only: kastprof,continuum,graybody,callgasvis,varspec
     16  use callkeys_mod, only: kastprof,continuum,graybody,callgasvis,varspec, &
     17                          generic_continuum_database
    1718  use recombin_corrk_mod, only: corrk_recombin, gasv_recomb
    1819  use tpindex_mod, only: tpindex
     
    193194        if(continuum.and.(.not.graybody).and.callgasvis)then
    194195           ! include continua if necessary
     196           
     197          if(generic_continuum_database)then
     198            T_cont  = dble(TMID(k))
     199            do igas=1,ngasmx
     200             
     201              if(gfrac(igas).eq.-1)then ! variable
     202                p_cont  = dble(PMID(k)*scalep*QVAR(k)) ! qvar = mol/mol
     203              elseif(varspec) then
     204                p_cont  = dble(PMID(k)*scalep*FRACVAR(igas,k)*(1.-QVAR(k)))
     205              else
     206                p_cont  = dble(PMID(k)*scalep*gfrac(igas)*(1.-QVAR(k)))
     207              endif
     208             
     209              dtemp=0.0
     210             
     211              if (igas .eq. igas_N2) then
     212               call interpolate_continuum('',igas_N2,igas_N2,'VI',nw,T_cont,p_cont,p_cont,dtemp,.false.)
     213               do jgas=1,ngasmx
     214                if (jgas .eq. igas_H2) then
     215                 call interpolate_continuum('',igas_N2,igas_H2,'VI',nw,T_cont,p_cont,p_cont,dtemp,.false.)
     216                elseif (jgas .eq. igas_O2) then
     217                 call interpolate_continuum('',igas_N2,igas_O2,'VI',nw,T_cont,p_cont,p_cont,dtemp,.false.)
     218                elseif (jgas .eq. igas_CH4) then
     219                 call interpolate_continuum('',igas_N2,igas_CH4,'VI',nw,T_cont,p_cont,p_cont,dtemp,.false.)
     220                endif
     221               enddo
     222              elseif (igas .eq. igas_O2) then
     223               call interpolate_continuum('',igas_O2,igas_O2,'VI',nw,T_cont,p_cont,p_cont,dtemp,.false.)
     224               do jgas=1,ngasmx
     225                if (jgas .eq. igas_CO2) then
     226                 call interpolate_continuum('',igas_CO2,igas_O2,'VI',nw,T_cont,p_cont,p_cont,dtemp,.false.)
     227                endif
     228               enddo
     229              elseif (igas .eq. igas_H2) then
     230               call interpolate_continuum('',igas_H2,igas_H2,'VI',nw,T_cont,p_cont,p_cont,dtemp,.false.)
     231               do jgas=1,ngasmx
     232                if (jgas .eq. igas_CH4) then
     233                 call interpolate_continuum('',igas_H2,igas_CH4,'VI',nw,T_cont,p_cont,p_cont,dtemp,.false.)
     234                elseif (jgas .eq. igas_He) then
     235                 call interpolate_continuum('',igas_H2,igas_He,'VI',nw,T_cont,p_cont,p_cont,dtemp,.false.)
     236                endif
     237               enddo     
     238              elseif (igas .eq. igas_CH4) then
     239               call interpolate_continuum('',igas_CH4,igas_CH4,'VI',nw,T_cont,p_cont,p_cont,dtemp,.false.)
     240              elseif (igas .eq. igas_H2O) then
     241               call interpolate_continuum('',igas_H2O,igas_H2O,'VI',nw,T_cont,p_cont,p_cont,dtemp,.false.)
     242               do jgas=1,ngasmx
     243                if (jgas .eq. igas_N2) then
     244                 call interpolate_continuum('',igas_H2O,igas_N2,'VI',nw,T_cont,p_cont,p_cont,dtemp,.false.)
     245                elseif (jgas .eq. igas_O2) then
     246                 call interpolate_continuum('',igas_H2O,igas_O2,'VI',nw,T_cont,p_cont,p_cont,dtemp,.false.)
     247                elseif (jgas .eq. igas_CO2) then
     248                 call interpolate_continuum('',igas_H2O,igas_CO2,'VI',nw,T_cont,p_cont,p_cont,dtemp,.false.)
     249                endif
     250               enddo     
     251              elseif (igas .eq. igas_CO2) then
     252               call interpolate_continuum('',igas_CO2,igas_CO2,'VI',nw,T_cont,p_cont,p_cont,dtemp,.false.)
     253               do jgas=1,ngasmx
     254                if (jgas .eq. igas_H2) then
     255                 call interpolate_continuum('',igas_CO2,igas_H2,'VI',nw,T_cont,p_cont,p_cont,dtemp,.false.)
     256                elseif (jgas .eq. igas_CH4) then
     257                 call interpolate_continuum('',igas_CO2,igas_CH4,'VI',nw,T_cont,p_cont,p_cont,dtemp,.false.)
     258                endif
     259               enddo
     260              endif
     261               
     262              DCONT = DCONT + dtemp
     263               
     264            enddo ! igas=1,ngasmx
     265           
     266          else ! generic_continuum_database
     267           
     268           
    195269           wn_cont = dble(wnov(nw))
    196270           T_cont  = dble(TMID(k))
     
    293367           DCONT = DCONT*dz(k)
    294368
    295         endif
    296 
     369        endif ! generic_continuum_database
     370        endif ! continuum
     371       
    297372        do ng=1,L_NGAUSS-1
    298373
  • trunk/LMDZ.GENERIC/libf/phystd/sugas_corrk.F90

    r2875 r3641  
    3131      use gases_h, only: gnom, ngasmx, &
    3232                         igas_H2, igas_H2O, igas_He, igas_N2, igas_CH4, &
    33                          igas_CO2
     33                         igas_CO2, igas_O2
    3434      use ioipsl_getin_p_mod, only: getin_p
    3535      use callkeys_mod, only: varactive,varfixed,graybody,callgasvis,&
    36                 continuum
     36                continuum,generic_continuum_database
    3737      use tracer_h, only : nqtot, moderntracdef, is_recomb, noms
    3838      use recombin_corrk_mod, only: su_recombin,        &
     
    716716!     Initialise the continuum absorption data
    717717      if(continuum)then
    718       do igas=1,ngasmx
    719 
     718      if(generic_continuum_database)then
     719       do igas=1,ngasmx ! we loop on all pairs of molecules that have data available
     720       ! data can be downloaded from https://web.lmd.jussieu.fr/~lmdz/planets/LMDZ.GENERIC/datagcm/continuum_data/
     721        if (igas .eq. igas_N2) then
     722         file_id='/continuum_data/' // 'N2-N2_continuum_70-500K_2025.dat'
     723         file_path=TRIM(datadir)//TRIM(file_id)
     724         call interpolate_continuum(file_path,igas_N2,igas_N2,'IR',1,300.D+0,10000.D+0,20000.D+0,testcont,.true.)
     725         do jgas=1,ngasmx
     726          if (jgas .eq. igas_H2) then
     727           file_id='/continuum_data/' // 'H2-N2_continuum_40-600K_2025.dat'
     728           file_path=TRIM(datadir)//TRIM(file_id)
     729           call interpolate_continuum(file_path,igas_N2,igas_H2,'IR',1,300.D+0,10000.D+0,20000.D+0,testcont,.true.)
     730          elseif (jgas .eq. igas_O2) then
     731           file_id='/continuum_data/' // 'O2-N2_continuum_100-500K_2025.dat'
     732           file_path=TRIM(datadir)//TRIM(file_id)
     733           call interpolate_continuum(file_path,igas_N2,igas_O2,'IR',1,300.D+0,10000.D+0,20000.D+0,testcont,.true.)
     734          elseif (jgas .eq. igas_CH4) then
     735           file_id='/continuum_data/' // 'CH4-N2_continuum_40-600K_2025.dat'
     736           file_path=TRIM(datadir)//TRIM(file_id)
     737           call interpolate_continuum(file_path,igas_N2,igas_CH4,'IR',1,300.D+0,10000.D+0,20000.D+0,testcont,.true.)
     738          endif
     739         enddo
     740        elseif (igas .eq. igas_O2) then
     741         file_id='/continuum_data/' // 'O2-O2_continuum_100-400K_2025.dat'
     742         file_path=TRIM(datadir)//TRIM(file_id)
     743         call interpolate_continuum(file_path,igas_O2,igas_O2,'IR',1,300.D+0,10000.D+0,20000.D+0,testcont,.true.)
     744         do jgas=1,ngasmx
     745          if (jgas .eq. igas_CO2) then
     746           file_id='/continuum_data/' // 'CO2-O2_continuum_150-600K_2025.dat'
     747           file_path=TRIM(datadir)//TRIM(file_id)
     748           call interpolate_continuum(file_path,igas_CO2,igas_O2,'IR',1,300.D+0,10000.D+0,20000.D+0,testcont,.true.)
     749          endif
     750         enddo
     751        elseif (igas .eq. igas_H2) then
     752         file_id='/continuum_data/' // 'H2-H2_continuum_40-7000K_2025.dat'
     753         file_path=TRIM(datadir)//TRIM(file_id)
     754         call interpolate_continuum(file_path,igas_H2,igas_H2,'IR',1,300.D+0,10000.D+0,20000.D+0,testcont,.true.)
     755         do jgas=1,ngasmx
     756          if (jgas .eq. igas_CH4) then
     757           file_id='/continuum_data/' // 'H2-CH4_continuum_40-600K_2025.dat'
     758           file_path=TRIM(datadir)//TRIM(file_id)
     759           call interpolate_continuum(file_path,igas_H2,igas_CH4,'IR',1,300.D+0,10000.D+0,20000.D+0,testcont,.true.)
     760          elseif (jgas .eq. igas_He) then
     761           file_id='/continuum_data/' // 'H2-He_continuum_40-5500K_2025.dat'
     762           file_path=TRIM(datadir)//TRIM(file_id)
     763           call interpolate_continuum(file_path,igas_H2,igas_He,'IR',1,300.D+0,10000.D+0,20000.D+0,testcont,.true.)
     764          endif
     765         enddo   
     766        elseif (igas .eq. igas_CH4) then
     767         file_id='/continuum_data/' // 'CH4-CH4_continuum_40-500K_2025.dat'
     768         file_path=TRIM(datadir)//TRIM(file_id)
     769         call interpolate_continuum(file_path,igas_CH4,igas_CH4,'IR',1,300.D+0,10000.D+0,20000.D+0,testcont,.true.)
     770        elseif (igas .eq. igas_H2O) then
     771         file_id='/continuum_data/' // 'H2O-H2O_continuum_100-2000K_2025.dat'
     772         file_path=TRIM(datadir)//TRIM(file_id)
     773         call interpolate_continuum(file_path,igas_H2O,igas_H2O,'IR',1,300.D+0,10000.D+0,20000.D+0,testcont,.true.)
     774         do jgas=1,ngasmx
     775          if (jgas .eq. igas_N2) then
     776           file_id='/continuum_data/' // 'H2O-N2_continuum_100-2000K_2025.dat'
     777           file_path=TRIM(datadir)//TRIM(file_id)
     778           call interpolate_continuum(file_path,igas_H2O,igas_N2,'IR',1,300.D+0,10000.D+0,20000.D+0,testcont,.true.)
     779          elseif (jgas .eq. igas_O2) then
     780           file_id='/continuum_data/' // 'H2O-O2_continuum_100-2000K_2025.dat'
     781           file_path=TRIM(datadir)//TRIM(file_id)
     782           call interpolate_continuum(file_path,igas_H2O,igas_O2,'IR',1,300.D+0,10000.D+0,20000.D+0,testcont,.true.)
     783          elseif (jgas .eq. igas_CO2) then
     784           file_id='/continuum_data/' // 'H2O-CO2_continuum_100-800K_2025.dat'
     785           file_path=TRIM(datadir)//TRIM(file_id)
     786           call interpolate_continuum(file_path,igas_H2O,igas_CO2,'IR',1,300.D+0,10000.D+0,20000.D+0,testcont,.true.)
     787          endif
     788         enddo   
     789        elseif (igas .eq. igas_CO2) then
     790         file_id='/continuum_data/' // 'CO2-CO2_continuum_100-800K_2025.dat'
     791         file_path=TRIM(datadir)//TRIM(file_id)
     792         call interpolate_continuum(file_path,igas_CO2,igas_CO2,'IR',1,300.D+0,10000.D+0,20000.D+0,testcont,.true.)
     793         do jgas=1,ngasmx
     794          if (jgas .eq. igas_H2) then
     795           file_id='/continuum_data/' // 'CO2-H2_continuum_100-800K_2025.dat'
     796           file_path=TRIM(datadir)//TRIM(file_id)
     797           call interpolate_continuum(file_path,igas_CO2,igas_H2,'IR',1,300.D+0,10000.D+0,20000.D+0,testcont,.true.)
     798          elseif (jgas .eq. igas_CH4) then
     799           file_id='/continuum_data/' // 'CO2-CH4_continuum_100-800K_2025.dat'
     800           file_path=TRIM(datadir)//TRIM(file_id)
     801           call interpolate_continuum(file_path,igas_CO2,igas_CH4,'IR',1,300.D+0,10000.D+0,20000.D+0,testcont,.true.)
     802          endif
     803         enddo
     804        endif
     805       enddo ! igas=1,ngasmx
     806       
     807      else ! generic_continuum_database tag
     808        do igas=1,ngasmx
    720809         if (igas .eq. igas_N2) then
    721810
     
    771860         endif
    772861
    773       enddo
    774       endif
     862      enddo ! igas=1,ngasmx
     863      endif ! generic_continuum_database tag
     864      endif ! continuum flag
    775865
    776866      print*,'----------------------------------------------------'
Note: See TracChangeset for help on using the changeset viewer.