This function dumps the content of the ephemeris descriptor eph to a binary dump file whose pathname is the string pointed to by filename. The state of the ephemeris descriptor eph can be restored from this dump file using the function writeph_restore().

This function can be called to create a checkpoint restart if the creation of the file is very long.

The following example writes a first part to the ephemeris file ephemeris.bsp and continue from a restart checkpoint.

USE, INTRINSIC :: ISO_C_BINDING
use calceph
TYPE(C_PTR) :: weph
INTEGER(C_INT) :: ret

weph = writeph_spk_create("ephemeris.bsp"//C_NULL_CHAR, "asteroid_1"//C_NULL_CHAR)
if (C_ASSOCIATED(weph)) then

     ! ... compute and write to weph ...

     ret = writeph_dump(weph, "checkpoint_ephemeris_bsp.dump")

     ! ... compute and write to weph ...
     ! ... may be an interruption here ....

     call writeph_close(weph)
endif

weph = writeph_spk_open("ephemeris.bsp"//C_NULL_CHAR)
if (C_ASSOCIATED(weph)) then

     ! restart from the checkpoint
     ret = writeph_restore(weph, "checkpoint_ephemeris_bsp.dump")

     ! ... compute and write to weph ...

     call writeph_close(weph)
endif