Changeset 2245 for trunk/LMDZ.GENERIC/libf/phystd/interpolateH2H2.F90
- Timestamp:
- Feb 24, 2020, 6:55:50 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.GENERIC/libf/phystd/interpolateH2H2.F90
r1315 r2245 6 6 ! ------- 7 7 ! Calculates the H2-H2 CIA opacity, using a lookup table from 8 ! HITRAN (2011 )8 ! HITRAN (2011 or later) 9 9 ! 10 10 ! Authors 11 11 ! ------- 12 12 ! R. Wordsworth (2011) 13 ! 13 ! 14 ! + J.Vatant d'Ollone (2019) 15 ! - Enable updated HITRAN file (Karman2019,Fletcher2018) 16 ! (2018 one should be default for giant planets) 14 17 !================================================================== 15 18 19 use callkeys_mod, only: versH2H2cia 16 20 use datafile_mod, only: datadir 17 21 … … 27 31 28 32 integer nS,nT 29 parameter(nS=2428)30 33 parameter(nT=10) 31 34 … … 36 39 37 40 double precision amagat 38 double precision wn_arr(nS)39 41 double precision temp_arr(nT) 40 double precision abs_arr(nS,nT) 42 43 double precision, dimension(:), allocatable :: wn_arr 44 double precision, dimension(:,:), allocatable :: abs_arr 41 45 42 46 integer k,iT 43 47 logical firstcall 44 48 45 save wn_arr, temp_arr, abs_arr !read by master49 save nS, wn_arr, temp_arr, abs_arr !read by master 46 50 47 51 character*100 dt_file 48 integer strlen,ios52 integer ios 49 53 50 character(LEN=*), parameter :: fmat1 = "(A20,F10.3,F10.3,I7,F7.1,E10.3,F5.3)" 54 character(LEN=*), parameter :: fmat11 = "(A20,F10.3,F10.3,I7,F7.1,E10.3,F5.3)" 55 character(LEN=*), parameter :: fmat18 = "(A12,A3,A5,F10.6,F10.4,I7,F7.3,E10.3,F5.3)" 51 56 52 57 character*20 bleh … … 69 74 print*,'Initialising H2-H2 continuum from HITRAN database...' 70 75 71 ! 1.1 Open the ASCII files 72 dt_file=TRIM(datadir)//'/continuum_data/H2-H2_norm_2011.cia' 76 ! 1.1 Open the ASCII files and set nS according to version 77 ! Only two possible versions for now : 2011 or 2018 (sanity check in inifis_mod) 78 if (versH2H2cia.eq.2011) then 79 dt_file=TRIM(datadir)//'/continuum_data/H2-H2_norm_2011.cia' 80 nS = 2428 81 else if (versH2H2cia.eq.2018) then 82 dt_file=TRIM(datadir)//'/continuum_data/H2-H2_norm_2018.cia' 83 nS = 9600 84 endif 85 86 if(.not.allocated(wn_arr)) allocate(wn_arr(nS)) 87 if(.not.allocated(abs_arr)) allocate(abs_arr(nS,nT)) 73 88 74 89 !$OMP MASTER … … 80 95 write(*,*) 'is correct. You can change it in callphys.def with:' 81 96 write(*,*) 'datadir = /absolute/path/to/datagcm' 82 write(*,*) 'Also check that the continuum data continuum_data/H2-H2_norm_2011.cia is there.'97 write(*,*) 'Also check that the continuum data continuum_data/H2-H2_norm_2011.cia or H2-H2_norm_2018.cia is there.' 83 98 call abort 84 99 else 100 101 if(versH2H2cia.eq.2011) then 102 write(*,*) '... You are using H2-H2 CIA from 2011 but you should use more recent data available on HITRAN !' 103 write(*,*) '... (Especially if you are running a giant planet atmosphere)' 104 write(*,*) '... Just find out the H2-H2_norm_2018.cia, put it in your datadir and have a look at interpolateH2H2.F90 ! .' 105 endif 85 106 86 107 do iT=1,nT 108 109 ! Only two possibles values for now : 2011 or 2018 (sanity check in inifis_mod) 110 if(versH2H2cia.eq.2011) then 111 read(33,fmat11) bleh,blah,blah,nres,Ttemp 112 else if (versH2H2cia.eq.2018) then 113 read(33,fmat18) bleh,bleh,bleh,blah,blah,nres,Ttemp 114 endif 87 115 88 read(33,fmat1) bleh,blah,blah,nres,Ttemp89 116 if(nS.ne.nres)then 90 117 print*,'Resolution given in file: ',trim(dt_file)
Note: See TracChangeset
for help on using the changeset viewer.