06.11.2013 Views

The Basis System - Weapons and Complex Integration - Lawrence ...

The Basis System - Weapons and Complex Integration - Lawrence ...

The Basis System - Weapons and Complex Integration - Lawrence ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

create mydump<br />

write all<br />

call pfbasave("dump")<br />

close<br />

# on a later date ...<br />

restore mydump<br />

Example: More Sophisticated Dump/Restart From Fortran<br />

Here is a typical invocation from Fortran, saving all user functions, macros, <strong>and</strong> variables along<br />

with all variables that have the attribute changed, keep, or dump. <strong>The</strong> calls to pfbalist are<br />

to ensure that variables to which the user has given these attributes at run-time are able to be given<br />

the attribute after restore by pfbaset.<br />

subroutine dumper(dumpname)<br />

character*(*) dumpname<br />

integer fileid, pfbopen, basisexe, status<br />

external pfbopen,basisexe<br />

logical isthere<br />

character*300 basiscmd<br />

inquire(file=dumpname,exist=isthere)<br />

if(isthere) then<br />

basiscmd="/bin/rm "//dumpname<br />

status = basisexe(basiscmd)<br />

endif<br />

fileid = pfbopen(dumpname,"w")<br />

call pfbalist("v_changed","changed")<br />

call pfbalist("v_keep","keep")<br />

call pfbalist("v_dump","dump")<br />

call pfbsave("all",fileid)<br />

call pfbasave("dump|keep|changed",fileid)<br />

call pfbclose(fileid)<br />

return<br />

end<br />

subroutine restart(dumpname)<br />

integer fileid, pfbopen<br />

external pfbopen<br />

character*(*) dumpname<br />

integer space<br />

80.4. Restoring From A FIle 481

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

Saved successfully!

Ooh no, something went wrong!