Changeset 2422 for trunk/LMDZ.GENERIC/libf
- Timestamp:
- Oct 21, 2020, 4:35:34 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.GENERIC/libf/phystd/ave_stelspec.F90
r1784 r2422 27 27 use datafile_mod, only: datadir 28 28 use callkeys_mod, only: stelbbody,stelTbb,startype 29 use ioipsl_getin_p_mod, only: getin_p 29 30 30 31 implicit none … … 41 42 real dl 42 43 43 character(len=100) 44 character(len=100) :: file_id,file_id_lam 44 45 character(len=200) :: file_path,file_path_lam 46 character(len=150) :: stelspec_file 45 47 46 48 real lam_temp … … 120 122 file_id_lam='/stellar_spectra/lambda_Proxima.dat' 121 123 Nfine=5000 124 Case(11) 125 ! look for a " stelspec_file= ..." option in def files 126 write(*,*) "Input stellar spectra files for radiative transfer is:" 127 stelspec_file = "sun.txt" ! default 128 call getin_p("stelspec_file",stelspec_file) ! default path 129 write(*,*) " stelspec_file = ",trim(stelspec_file) 130 write(*,*) 'Please use ',1,' and only ',1,' header line in ',trim(stelspec_file) 131 ! look for a " tstellar= ..." option in def files 132 write(*,*) "Input stellar temperature is:" 133 tstellar = -1. ! default 134 call getin_p("tstellar",tstellar) ! default path 135 write(*,*) " tstellar = ",tstellar 136 if (tstellar.eq.-1.) then 137 write(*,*)'Error: with startype 11 tstellar need to be specified' 138 write(*,*)' Specified in callphys.def tstellar=...' 139 stop 140 end if 141 142 ! Opening file 143 file_path = trim(datadir)//'/stellar_spectra/'//stelspec_file 144 print*, 'stellar flux : ', file_path 145 OPEN(UNIT=110,FILE=file_path,STATUS='old',iostat=ios) 146 147 if (ios /= 0) THEN 148 write(*,*)'Error: cannot open stelspec_file file ', trim(stelspec_file) 149 write(*,*)'It should be in :',trim(datadir),'/stellar_spectra/' 150 write(*,*)'1) You can change the data directory in callphys.def' 151 write(*,*)' with:' 152 write(*,*)' datadir=/path/to/the/directory' 153 write(*,*)'2) You can change the input stelspec_file file name in' 154 write(*,*)' callphys.def with:' 155 write(*,*)' stelspec_file=filename' 156 stop 157 end if 158 159 ! Get number of line in the file 160 READ(110,*) ! skip header 161 Nfine = 0 162 do 163 read(110,*,iostat=ios) 164 if (ios<0) exit 165 Nfine = Nfine + 1 166 end do 167 rewind(110) ! Rewind file after counting lines 168 READ(110,*) ! skip header 122 169 Case Default 123 170 print*,'Error: unknown star type chosen' … … 128 175 allocate(lam(Nfine),stel_f(Nfine)) 129 176 177 if (startype.eq.11) then 178 do ifine=1,Nfine 179 read(110,*) lam(ifine), stel_f(ifine) ! lam [um] stel_f [per unit of wavelength] (integrated and normalized by Fat1AU) 180 enddo 181 close(110) 182 else 130 183 file_path_lam=TRIM(datadir)//TRIM(file_id_lam) 131 184 open(110,file=file_path_lam,form='formatted',status='old',iostat=ios) … … 163 216 close(111) 164 217 endif 218 end if 165 219 !$OMP END MASTER 166 220 !$OMP BARRIER
Note: See TracChangeset
for help on using the changeset viewer.