1 subroutine write_char(c, iunit) 2 character c 3 integer iunit 4 write(iunit,1000) c 5 1000 format(a,$) 6 end 7 8 subroutine export_wisdom_to_file(iunit) 9 integer iunit 10 external write_char 11c call dfftw_export_wisdom(write_char, iunit) 12 call sfftw_export_wisdom(write_char, iunit) 13 end 14 15 subroutine read_char(ic, iunit) 16 integer ic 17 integer iunit 18 character*256 buf 19 save buf 20 integer ibuf 21 data ibuf/257/ 22 save ibuf 23 if (ibuf .lt. 257) then 24 ic = ichar(buf(ibuf:ibuf)) 25 ibuf = ibuf + 1 26 return 27 endif 28 read(iunit,1000,end=10) buf 29 1000 format(a256) 30 ic = ichar(buf(1:1)) 31 ibuf = 2 32 return 33 10 ic = -1 34 ibuf = 257 35 rewind iunit 36 return 37 end 38 39 subroutine import_wisdom_from_file(isuccess, iunit) 40 integer isuccess 41 integer iunit 42 external read_char 43c call dfftw_import_wisdom(isuccess, read_char, iunit) 44 call sfftw_import_wisdom(isuccess, read_char, iunit) 45 end 46