pro write_potential,infile ; ; IDL> restore,'W05scEpot.xdr' ; IDL> help ; % At $MAIN$ ; AB BYTE = Array[28] ; ALSCHFITS DOUBLE = Array[18, 28] ; CSIZE INT = 28 ; D1 INT = 15 ; D2 INT = 18 ; EX FLOAT = Array[2] ; LS INT = Array[28] ; MAXL INT = 12 ; MAXM INT = 2 ; MS INT = Array[28] ; SCHFITS DOUBLE = Array[15, 28] ; restore,infile print,' ' print,'write_potential:' print,'Restored file ',infile xdrpos = strpos(infile,'xdr') if (xdrpos lt 0) then begin print,'>>> could not find xdr in infile: ',infile return endif outfile = strmid(infile,0,xdrpos) + 'dat' openw,lu,outfile,/get_lun print,'Opened file ',outfile,' for writing.' printf,lu,format="(a)",outfile printf,lu,format="(28i3)",ab printf,lu,format="(3i3)",csize,d1,d2 for i=0,csize-1 do printf,lu,format="(6e20.9)",alschfits[*,i] printf,lu,format="(2f10.3)",ex printf,lu,format="(28i3)",ls printf,lu,format="(2i3)",maxl,maxm printf,lu,format="(28i3)",ms for i=0,csize-1 do printf,lu,format="(6e20.9)",schfits[*,i] close,lu print,'Wrote file ',outfile end ;----------------------------------------------------------------------- pro write_scha,infile ; ; IDL> restore,'SCHAtable.xdr' ; IDL> help ; % At $MAIN$ ; ALLNKM DOUBLE = Array[19, 7, 68] ; MAXK INT = 18 ; MAXM INT = 6 ; TH0S FLOAT = Array[68] ; print,' ' print,'write_scha:' restore,infile print,'Restored file ',infile xdrpos = strpos(infile,'xdr') if (xdrpos lt 0) then begin print,'>>> could not find xdr in infile: ',infile return endif outfile = strmid(infile,0,xdrpos) + 'dat' openw,lu,outfile,/get_lun print,'Opened file ',outfile,' for writing.' printf,lu,format="(a)",outfile printf,lu,format="(2i3)",maxk,maxm d1=19 & d2=7 & d3=68 for i=0,d3-1 do begin for j=0,d2-1 do begin printf,lu,format="(6e20.9)",allnkm[*,j,i] endfor endfor printf,lu,format="(8f10.4)",th0s close,lu print,'Wrote file ',outfile end ;----------------------------------------------------------------------- pro write_bndy,infile ; ; IDL> restore,'W05scBndy.xdr' ; IDL> help ; % At $MAIN$ ; BNDYA DOUBLE = Array[6] ; BNDYB DOUBLE = Array[7] ; EX FLOAT = Array[2] ; NA LONG = 6 ; NB LONG = 7 ; print,' ' print,'write_bndy:' restore,infile print,'Restored file ',infile xdrpos = strpos(infile,'xdr') if (xdrpos lt 0) then begin print,'>>> could not find xdr in infile: ',infile return endif outfile = strmid(infile,0,xdrpos) + 'dat' openw,lu,outfile,/get_lun print,'Opened file ',outfile,' for writing.' printf,lu,format="(a)",outfile printf,lu,format="(2i3)",na,nb printf,lu,format="(8e20.9)",bndya printf,lu,format="(8e20.9)",bndyb printf,lu,format="(8e20.9)",ex close,lu print,'Wrote file ',outfile end ;----------------------------------------------------------------------- pro write_data ; ; Restore weimer05 xdr files, and write data to new ascii text file ; for reading by f90 code translation of weimer05. ; ; W05scEpot and W05scBpot format and dimensions are identical: ; write_potential,'W05scEpot.xdr' write_potential,'W05scBpot.xdr' write_scha,'SCHAtable.xdr' write_bndy,'W05scBndy.xdr' end