Skip to content
  • Giannis Nikiteas's avatar
    Makes the Fortran API user friendly · b710adbc
    Giannis Nikiteas authored
    - You can use Fortran arrays as inputs, which are internally converted to C ptrs
    - You can input normal Fortran strings which are internally converted to C strs
    - You don't have to pass the size as an argument
    - Return arrays are now Fortran allocatables arrays
    - Jagged arrays are inserted/output as a single array and an array with the lengths of each dimension as opposed to cptr, cptr, size_n
    - Pairs are now a (1:2,n) array that is cast into an assumed shape array in C
    - `intent` keywords have been added to most variable types
    - Had to create a dummy modue `fsize_m` to prevent the intrinsic `size()` being shadowed by any potential variables being named `size`
    
    NOTES:
    1. All the memory allocations in C need to be freed with a C callback otherwise we are leaking memory
    2.
    
    TODO List:
    1. Add intent(out) for oint, osize, odouble
    2. Add optional arguments for ierr
    3. Add more generic optional arguments see Python
    4. Allow for already allocated arrays to be deallocated internally
    b710adbc