PRO dustem_write_grain_lv,file,st Ncomments=13 c=strarr(Ncomments) c(0)='# DUSTEM: definition of grain populations' c(1)='# for each grain TYPE make sure you have the following files' c(2)='# Q_TYPE.DAT in code_f90/les_QABS' c(3)='# C_TYPE.DAT in code_f90/les_CAPA' c(4)='# if option(MIX) MIX_TYPE.DAT in code_f90/les_DAT' c(5)='# if option(POL) POL_TYPE.DAT in code_f90/les_DAT' c(6)='# if keyword(SIZE) SIZE_TYPE.DAT in code_f90/les_DAT' c(7)='#' c(8)='# run keywords' c(9)='# G0 scaling factor for radiation field' c(10)='# nr of grain types' c(11)='# grain type - Mdust/MH - rho(g/cm3) - amin(cm) - amax(cm) - alpha - nsize' c(12)='#' OPENW,unit,file,/get_lun FOR i=0,Ncomments-1 DO BEGIN printf,unit,c(i) ENDFOR printf,unit,st.keywords printf,unit,st.G0 printf,unit,st.ngrains frmt='(A10,5E14.6,I4,A10)' ;frmt='(A10,5E12.2,I4,A10)' FOR i=0,st.ngrains-1 DO BEGIN printf,unit,st.grains(i).type,st.grains(i).propmass,st.grains(i).densgr,st.grains(i).tmin,st.grains(i).tmax, $ st.grains(i).alpha, st.grains(i).ndiscr,st.grains(i).flag,format=frmt IF !dust.grains EQ 1 THEN BEGIN print,st.grains(i).type,st.grains(i).propmass,st.grains(i).densgr,st.grains(i).tmin,st.grains(i).tmax, $ st.grains(i).alpha, st.grains(i).ndiscr,st.grains(i).flag,format=frmt ENDIF ENDFOR CLOSE,unit free_lun,unit END