CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC subroutine read_costar() CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC C Reads CoStar flux grid ! C C NOTE: The CoStar flux file must be available as 'f_costar.fluxes' C at the call of read_costar. It will be read on unit 11. C C On exit the output is given in the common block 'costar': C wave_co: wavelength array (real*8) [Angstroem] C fnu_co: 2-d flux array (real*8, dimensions: kwave>=126, C imodel >=27) C fnu_co(kwave,imodel) gives the decadic logarithm of C the astrophysical flux for model 'imodel' and C wavelength point 'kwave'. C The units are [erg cm^-2 s^-1 Hz^-1] C teff_co: Teff array (real*8, dimension >=27) for models C 1..n_co C xlogg_co: log10(g) array (real*8, dimension >=27) for models C 1..n_co C nw_co: number of wavelength points read C n_co: number of model read C C To access the data include the lines marked with !*** INCLUDE C in your routine !! C C Author: Daniel Schaerer (January, 1996) C//// Declarations ///////////////////////////////////////////////////// C--Implicit implicit real*8 (a-h,o-z) C--Local variables integer nskip character dummy*80,fname*20 real*8 tempw,xdummy C--Common block and parameters (for exportation of data !) !*** INCLUDE parameter (nwmax=130,n_comax=30) !*** INCLUDE common /costar/ wave_co(nwmax),fnu_co(nwmax,n_comax), !*** INCLUDE & teff_co(n_comax),xlogg_co(n_comax), !*** INCLUDE & nw_co,n_co !*** INCLUDE C//// End of Declarations ////////////////////////////////////////////// fname = 'f_costar.fluxes' open (11,file=fname,status='old',err=100) c read header read (11,*) nskip do i=1,nskip read (11,'(a)') dummy enddo c read total number of CoStar models, # wavelength points c and stellar parameters read (11,*) n_co,nw_co do i=1,n_co c here we only read Teff and logg of the models (skip other c parameters) read (11,*) dummy,xdummy,xdummy,teff_co(i),xlogg_co(i) c if you prefer to use a fixed format use next line ! c read (11,200) dummy,xdummy,xdummy,teff_co(i),xlogg_co(i) enddo c initialise wavelength grid: do i=1,nw_co wave_co(i) = 0.d+0 enddo c NOW read data for each model: do i=1,n_co read (11,*) nskip do k=1,nskip read (11,'(a)') dummy enddo do k=1,nw_co read (11,*) tempw,fnu_co(k,i) c if you prefer to use a fixed format use next line ! c read (11,201) tempw,fnu_co(k,i) if (wave_co(k).ne.0.and.tempw.ne.wave_co(k)) then stop 'read_costar: Wavelength grid differs !' endif wave_co(k) = tempw enddo enddo 110 continue close (11) return 100 stop 'read_costar: Error opening f_costar.fluxes !' 200 format (a2,6x,f4.0,4x,e7.2,1x,f7.1,1x,f6.1,1x,f7.3,1x,f6.2,3x, & f6.3,1x,f7.1,2x,a5) 201 format (f12.2,1x,f12.5) end C//// End of read_costar ///////////////////////////////////////////////