This function creates for writing a new PCK file whose pathname is the string pointed to by filename, and returns an ephemeris descriptor associated to it. If a file with the same name already exists, it is overwritten.

The function writeph_close() must be called to free memory allocated by this function.

The function writeph_dump() and writeph_restore() can be called to create a checkpoint restart if the creation of the file is very long.

The following example creates and writes the ephemeris file ephemeris.bpc

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

weph = writeph_pck_create("ephemeris.bpc"//C_NULL_CHAR, "asteroid_1"//C_NULL_CHAR, 0)
if (C_ASSOCIATED(weph)) then

     ! ... computation ...

     call writeph_close(weph)
endif