[ET Trac] #2886: support cell centered directions when calling Fortran scheduled functions

Roland Haas trac-noreply at einsteintoolkit.org
Tue Sep 9 09:30:42 CDT 2025


#2886: support cell centered directions when calling Fortran scheduled functions

 Reporter: Roland Haas
   Status: open
Milestone: 
  Version: 
     Type: enhancement
 Priority: major
Component: Cactus

Comment (by Roland Haas):

A somehwat ugly workaround right now would be use of Fortran 2003’s `iso_c_binding` module and using C pointers as intermediate pointers as in [https://gcc.gnu.org/onlinedocs/gfortran/C\_005fF\_005fPOINTER.html](https://gcc.gnu.org/onlinedocs/gfortran/C_005fF_005fPOINTER.html)

```fortran
    program main
      use iso_c_binding
      implicit none
      interface
        subroutine my_routine(p) bind(c,name='myC_func')
          import :: c_ptr
          type(c_ptr), intent(out) :: p
        end subroutine
      end interface
      type(c_ptr) :: cptr
      real,pointer :: a(:)
      call my_routine(cptr)
      call c_f_pointer(cptr, a, [12])
    end program main
```

‌

--
Ticket URL: https://bitbucket.org/einsteintoolkit/tickets/issues/2886/support-cell-centered-directions-when
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.einsteintoolkit.org/pipermail/trac/attachments/20250909/7a6970d7/attachment.htm>


More information about the Trac mailing list