Ignore:
Timestamp:
Mar 30, 2022, 12:19:20 PM (3 years ago)
Author:
gmilcareck
Message:

Major changes to CIA interpolation:
1) Add contribution from CH4 (H2-CH4,He-CH4,CH4-CH4) ;
2) Add some tests before interpolation for H2, He and CH4 ;
3) Add the possibility to choose between a normal or equilibrium ortho:para
fraction for CIA H2;
4) Change "strictboundH2H2cia" to the generic "strictboundcia" for H2,He,CH4.
It can be added for others CIA (N2,H,CO2...) if you want.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.GENERIC/libf/phystd/interpolateH2H2.F90

    r2633 r2655  
     1
    12     subroutine interpolateH2H2(wn,temp,pres,abcoef,firstcall,ind)
    23
     
    1718!==================================================================
    1819
    19       use callkeys_mod, only: versH2H2cia, strictboundH2H2cia
     20      use callkeys_mod, only: versH2H2cia, strictboundcia, H2orthopara_mixture
    2021      use datafile_mod, only: datadir
    2122
     
    6061
    6162      integer ind
    62 
     63     
    6364      if(temp.gt.400)then
    64          if (strictboundH2H2cia) then
    65             print*,'Your temperatures are too high for this H2-H2 CIA dataset. If you '
    66             print*,'really want to run simulations with hydrogen at T > 400 K, contact'
    67             print*,'Robin Wordsworth [rwordsworth@uchicago.edu].'
    68             stop
    69          else
    70             print*,'Your temperatures are too high for this H2-H2 CIA dataset'
    71             print*,'you have chosen strictboundH2H2cia = ', strictboundH2H2cia
    72             print*,'*********************************************************'
    73             print*,' we allow model to continue but with temp = 400          '
    74             print*,'  ...       for H2-H2 CIA dataset          ...           '
    75             print*,'  ... we assume we know what you are doing ...           '
    76             print*,'*********************************************************'
    77             temp = 400
    78          endif
     65        if (strictboundcia) then
     66          print*,'Your temperatures are too high for this H2-H2 CIA dataset. If you '
     67          print*,'really want to run simulations with hydrogen at T > 400 K, contact'
     68          print*,'Robin Wordsworth [rwordsworth@uchicago.edu].'
     69          stop
     70        else
     71          print*,'Your temperatures are too high for this H2-H2 CIA dataset'
     72          print*,'you have chosen strictboundcia = ', strictboundcia
     73          print*,'*********************************************************'
     74          print*,' we allow model to continue but with temp = 400          '
     75          print*,'  ...       for H2-H2 CIA dataset          ...           '
     76          print*,'  ... we assume we know what you are doing ...           '
     77          print*,'*********************************************************'
     78          temp = 400
     79        endif
     80      elseif(temp.lt.40)then     
     81        if (strictboundcia) then
     82          print*,'Your temperatures are too low for this H2-H2 CIA dataset. If you '
     83          print*,'really want to run simulations with hydrogen at T < 40 K, contact'
     84          print*,'Robin Wordsworth [rwordsworth@uchicago.edu].'
     85          stop
     86        else
     87          print*,'Your temperatures are too low for this H2-H2 CIA dataset'
     88          print*,'you have chosen strictboundcia = ', strictboundcia
     89          print*,'*********************************************************'
     90          print*,' we allow model to continue but with temp = 40           '
     91          print*,'  ...       for H2-H2 CIA dataset          ...           '
     92          print*,'  ... we assume we know what you are doing ...           '
     93          print*,'*********************************************************'
     94          temp = 40
     95        endif           
    7996      endif
    8097
     
    88105         ! Only two possible versions for now : 2011 or 2018 (sanity check in inifis_mod)
    89106         if (versH2H2cia.eq.2011) then
    90            dt_file=TRIM(datadir)//'/continuum_data/H2-H2_norm_2011.cia'
    91107           nS = 2428
     108           if (H2orthopara_mixture.eq."normal") then
     109             dt_file=TRIM(datadir)//'/continuum_data/H2-H2_norm_2011.cia'
     110           else if (H2orthopara_mixture.eq."equilibrium") then
     111             dt_file=TRIM(datadir)//'/continuum_data/H2-H2_eq_2011.cia'
     112           endif
    92113         else if (versH2H2cia.eq.2018) then
    93            dt_file=TRIM(datadir)//'/continuum_data/H2-H2_norm_2018.cia'
    94114           nS = 9600
     115           if (H2orthopara_mixture.eq."normal") then
     116             dt_file=TRIM(datadir)//'/continuum_data/H2-H2_norm_2018.cia'
     117           else if (H2orthopara_mixture.eq."equilibrium") then
     118             dt_file=TRIM(datadir)//'/continuum_data/H2-H2_eq_2018.cia'
     119           endif
    95120         endif
    96121
     
    106131           write(*,*) 'is correct. You can change it in callphys.def with:'
    107132           write(*,*) 'datadir = /absolute/path/to/datagcm'
    108            write(*,*) 'Also check that the continuum data continuum_data/H2-H2_norm_2011.cia or H2-H2_norm_2018.cia is there.'
     133           write(*,*) 'Also check that the continuum data is there.'
    109134           call abort
    110135         else
     
    113138           write(*,*) '... You are using H2-H2 CIA from 2011 but you should use more recent data available on HITRAN !'
    114139           write(*,*) '... (Especially if you are running a giant planet atmosphere)'
    115            write(*,*) '... Just find out the H2-H2_norm_2018.cia, put it in your datadir and have a look at interpolateH2H2.F90 ! .'
     140           write(*,*) '... Just find out the H2-H2 CIA from 2018, put it in your datadir and have a look at interpolateH2H2.F90 ! .'
    116141         endif
    117142
     
    149174
    150175      endif
    151 
     176     
     177           
     178           
    152179         call bilinearbig(nS,nT,wn_arr,temp_arr,abs_arr,wn,temp,abcoef,ind)
    153180
Note: See TracChangeset for help on using the changeset viewer.