dustem_write_align.pro 1.39 KB
PRO dustem_write_align,file,st_align

Ncomments=12
c=strarr(Ncomments)

c(0)='# DUSTEM: definition of grain alignment'
c(1)='# for each grain TYPE make sure you have the following files'
c(2)='# Q1_TYPE.DAT and Q2_TYPE in /oprop'
c(3)='# Qc_TYPE.DAT for circular polarization'
c(4)='# QH1_TYPE.DAT QH2_TYPE.DAT for an anistropic radiation field'
c(5)='# Q1_TYPE_RRFxxx.DAT and Q2_TYPE_RRFxxx.DAT when running with RRF option'
c(6)='#'
c(7)='# run keywords'
c(8)='# lin for linear, circ for circular, anis for anistropic extinction and emission, univ for universal alignment law, RRF'
c(9)='# degree of anisotropy of the radiation : if > 0, read QH1 and QH2 files'
c(10)='# alignmentlaw (idg, rat, par), parameters (par1 par2 par3)'
c(11)='#'

openw,unit,file,/get_lun

FOR ii=0,Ncomments-1 DO printf,unit,c(ii)

printf,unit,st_align.keywords,format='(A-40)'
printf,unit,st_align.anisG0,format='(E10.2)'

if !run_univ eq 1 then begin
        printf,unit,st_align.grains(0).law,st_align.grains(0).athresh,st_align.grains(0).pstiff,st_align.grains(0).plev,format='(A-10,2X,10(E18.10,2X))' 
endif else begin
	for i=0,n_elements(st_align.grains)-1 do begin
        	if st_align.grains(i).aligned then if st_align.grains(i).law ne '' then printf,unit,st_align.grains(i).law,st_align.grains(i).athresh,st_align.grains(i).pstiff,st_align.grains(i).plev,format='(A-10,2X,10(E18.10,2X))'
	endfor
endelse

close,unit
free_lun,unit


END