yairsuari
- 7
- 0
i have a fortran 90 function invoked:
iret = store_data(ncid_bfm,var_ids(n),OCET_SHAPE,NO_BOXES,garray=D3DIAGNOS(i,
each time i get to that line i get segmentation fault
on the calling unit variables a defined like so:
!BOP
!
! !IROUTINE: Store the results
!
! !INTERFACE:
subroutine save_bfm(time)
!
! !DESCRIPTION:
! output of BFM variables
!
! !USES:
use mem, only: D3STATE,D3DIAGNOS,D2STATE,D2DIAGNOS
implicit none
!
! !INPUT PARAMETERS:
REALTYPE,intent(in) :: time
! !LOCAL VARIABLES:
integer :: iret
integer :: i,j,k,n
REALTYPE :: temp_time
and on the invoked function the definitions are:
integer function store_data(ncid,id,var_shape,nbox, &
iscalar,iarray,scalar,array,garray, &
array2d,array3d)
!
! !DESCRIPTION:
! This routine is used to store a variable in the NetCDF file.
! The subroutine uses {\tt optional} parameters to find out which data
! type to save.
!
! !USES:
IMPLICIT NONE
!
! !INPUT PARAMETERS:
integer, intent(in) :: ncid,id,var_shape,nbox
integer, optional :: iscalar
integer, optional :: iarray(1:nbox)
REALTYPE, optional :: scalar
REALTYPE, optional :: array(1:nbox)
REALTYPE, optional :: garray(1:nbox)
REALTYPE, optional :: array2d(:,:)
REALTYPE, optional :: array3d(:,:,:)
!
! !REVISION HISTORY:
! Original author(s): Karsten Bolding & Hans Burchard
! Modifications: Marcello Vichi
!
!EOP
!
! !LOCAL VARIABLES:
integer :: iret,n=0
integer :: idum(1:nbox)
REAL_4B :: r4,dum(1:nbox)
!
my question is what can i do to prevent this fault??
iret = store_data(ncid_bfm,var_ids(n),OCET_SHAPE,NO_BOXES,garray=D3DIAGNOS(i,

each time i get to that line i get segmentation fault
on the calling unit variables a defined like so:
!BOP
!
! !IROUTINE: Store the results
!
! !INTERFACE:
subroutine save_bfm(time)
!
! !DESCRIPTION:
! output of BFM variables
!
! !USES:
use mem, only: D3STATE,D3DIAGNOS,D2STATE,D2DIAGNOS
implicit none
!
! !INPUT PARAMETERS:
REALTYPE,intent(in) :: time
! !LOCAL VARIABLES:
integer :: iret
integer :: i,j,k,n
REALTYPE :: temp_time
and on the invoked function the definitions are:
integer function store_data(ncid,id,var_shape,nbox, &
iscalar,iarray,scalar,array,garray, &
array2d,array3d)
!
! !DESCRIPTION:
! This routine is used to store a variable in the NetCDF file.
! The subroutine uses {\tt optional} parameters to find out which data
! type to save.
!
! !USES:
IMPLICIT NONE
!
! !INPUT PARAMETERS:
integer, intent(in) :: ncid,id,var_shape,nbox
integer, optional :: iscalar
integer, optional :: iarray(1:nbox)
REALTYPE, optional :: scalar
REALTYPE, optional :: array(1:nbox)
REALTYPE, optional :: garray(1:nbox)
REALTYPE, optional :: array2d(:,:)
REALTYPE, optional :: array3d(:,:,:)
!
! !REVISION HISTORY:
! Original author(s): Karsten Bolding & Hans Burchard
! Modifications: Marcello Vichi
!
!EOP
!
! !LOCAL VARIABLES:
integer :: iret,n=0
integer :: idum(1:nbox)
REAL_4B :: r4,dum(1:nbox)
!
my question is what can i do to prevent this fault??