I encountered a problem with the latest version of the Fortran interface on the Greene cluster. When trying to read a field with fit_eval_field_f, the my code crashes.
I think the problem is that the C-version of fio_eval_field is called with a constant (0):
|
subroutine fio_eval_field_f(ifield, x, v, ierr) |
|
integer, intent(in) :: ifield |
|
real, intent(in), dimension(*) :: x |
|
real, intent(out), dimension(*) :: v |
|
integer, intent(out) :: ierr |
|
call fio_eval_field(ifield, x, v, 0, ierr) |
|
end subroutine fio_eval_field_f |
|
|
|
subroutine fio_eval_field_deriv_f(ifield, x, v, ierr) |
|
integer, intent(in) :: ifield |
|
real, intent(in), dimension(*) :: x |
|
real, intent(out), dimension(*) :: v |
|
integer, intent(out) :: ierr |
|
call fio_eval_field_deriv(ifield, x, v, 0, ierr) |
|
end subroutine fio_eval_field_deriv_f |
I modified the code slightly by declaring an integer variable s and setting s=0
subroutine fio_eval_field_f(ifield, x, v, ierr)
integer, intent(in) :: ifield
real, intent(in), dimension(*) :: x
real, intent(out), dimension(*) :: v
integer, intent(out) :: ierr
integer :: s
s=0
call fio_eval_field(ifield, x, v, s, ierr)
end subroutine fio_eval_field_f
subroutine fio_eval_field_deriv_f(ifield, x, v, ierr)
integer, intent(in) :: ifield
real, intent(in), dimension(*) :: x
real, intent(out), dimension(*) :: v
integer, intent(out) :: ierr
integer :: s
s=0
call fio_eval_field_deriv(ifield, x, v, s, ierr)
end subroutine fio_eval_field_deriv_f
This turned out to work. The only way I can make sense of this is that somewhere down the call-tree, a program tries to write into s, which results in a segfault if s is a constant.
I encountered a problem with the latest version of the Fortran interface on the Greene cluster. When trying to read a field with fit_eval_field_f, the my code crashes.
I think the problem is that the C-version of fio_eval_field is called with a constant (
0):fusion-io/fusion_io/fusion_io_fortran.F90
Lines 40 to 54 in 4ba28ce
I modified the code slightly by declaring an integer variable
sand settings=0This turned out to work. The only way I can make sense of this is that somewhere down the call-tree, a program tries to write into s, which results in a segfault if s is a constant.