13.11.2014 Views

Abrir - RDU

Abrir - RDU

Abrir - RDU

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Apéndices 300<br />

write(fs2211,992) path,dir2211,f2211<br />

write(fs1121,992) path,dir1121,f1121<br />

write(fs2121,992) path,dir2121,f2121<br />

write(fs1221,992) path,dir1221,f1221<br />

write(fs2221,992) path,dir2221,f2221<br />

write(fs1112,992) path,dir1112,f1112<br />

write(fs2112,992) path,dir2112,f2112<br />

write(fs1212,992) path,dir1212,f1212<br />

write(fs2212,992) path,dir2212,f2212<br />

write(fs1122,992) path,dir1122,f1122<br />

write(fs2122,992) path,dir2122,f2122<br />

write(fs1222,992) path,dir1222,f1222<br />

write(fs2222,992) path,dir2222,f2222<br />

open(30,file=fs1111,status=. o ld”)<br />

open(31,file=fs2111,status=. o ld”)<br />

open(32,file=fs1211,status=. o ld”)<br />

open(33,file=fs2211,status=. o ld”)<br />

open(34,file=fs1121,status=. o ld”)<br />

open(35,file=fs2121,status=. o ld”)<br />

open(36,file=fs1221,status=. o ld”)<br />

open(37,file=fs2221,status=. o ld”)<br />

open(38,file=fs1112,status=. o ld”)<br />

open(39,file=fs2112,status=. o ld”)<br />

open(40,file=fs1212,status=. o ld”)<br />

open(41,file=fs2212,status=. o ld”)<br />

open(42,file=fs1122,status=. o ld”)<br />

open(43,file=fs2122,status=. o ld”)<br />

open(44,file=fs1222,status=. o ld”)<br />

open(45,file=fs2222,status=. o ld”)<br />

do !j=1,np1<br />

do i=1,16<br />

read(29+i,*,end=1010) flux(i)<br />

enddo<br />

!tenemos la funcion en cada uno de los 16 puntos<br />

!ahora la interpolacion 4d<br />

call interp4d(x,vert,flux,p) !p es el valor interpolado<br />

!ahora deberiamos guardar el par lon,p en alguna variable...<br />

speckur(pos)=p<br />

pos=pos+1<br />

enddo<br />

1010 close(30)<br />

close(31)<br />

close(32)<br />

close(33)<br />

close(34)<br />

close(35)<br />

close(36)<br />

close(37)<br />

close(38)<br />

close(39)<br />

close(40)<br />

close(41)<br />

close(42)<br />

close(43)<br />

close(44)<br />

close(45)<br />

!tenemos en speckur(1:pos) el espectro interpolado<br />

if (wspec.eq.1) then<br />

write(*,*) ”Writting (minimmum-chicuad) fitted spectra<br />

to disk”<br />

write(52,*) ”Writting (minimmum-chicuad) fitted spectra<br />

to disk”<br />

fout1=”dataout/min.chicuad.//file<br />

fout2=”dataout/resampled.//file<br />

open(48,file=fout1)<br />

open(51,file=fout2)<br />

write(48,*) teff,logg,feh,xita,vrot<br />

write(48,*)<br />

do i=1,pos<br />

write(48,*) lam13(i),speckur(i),speckur(i)-spec2(i) !lam, flux,<br />

difference with observed<br />

enddo<br />

do i=ndesder13, nhastar13<br />

write(51,*) lam13(i),spec2(i)!lam, flux<br />

enddo<br />

close(48)<br />

close(51)<br />

endif<br />

!speckur(1:points) tiene el mismo formato lamda que specobs<br />

!entonces podemos comparar ambos espectros<br />

call comspec1(spec2,speckur,ndesder13,nhastar13,chicuad)<br />

125 funk=chicuad<br />

write(*,*) ”funk called with ”,teff,logg,feh,xita,-¿”,chicuad<br />

write(52,*) ”funk called with ”,teff,logg,feh,xita,-¿”,chicuad<br />

end<br />

!******************************************************<br />

subroutine resample(desde,hasta,spec1,spec4,nd13,nh13)<br />

!lleva al formato de la grilla lambda de munari<br />

!entrada=desde,hasta,spec1<br />

!deben ser conocidas (en common)= lam13, np1<br />

!salida=spec4,nd13,nh13<br />

real found<br />

real*8 desde,hasta,spec1(2e5,2),spec4(2e5)<br />

real*8 x2,x1,y2,y1,x,px<br />

integer nx1,nx2,nd13,nh13<br />

common /comunes/<br />

spec2,lam13,vrot,points,ndesder13,nhastar13,<br />

np1,wspec,file<br />

real*8 spec2(2e5),lam13(2e5),vrot,vrad<br />

integer points<br />

integer ndesder13,nhastar13,np1,wspec<br />

character file*80<br />

save /comunes/<br />

!busca el 1er pto en R13 q es anterior al desde: ”desder13”

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!