- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
I have a C function that needs to call a FORTRAN function, passing it an array of pointers. The C prototype for the interface is:
typdef void (*callbackfunc) (double *t, int *h1, int *h2, int *numAs, int Ahs[], int *aVs[]);
The last argument "int *aVs[]" is where I'm confused on the FORTRAN side. The actual data contained in the aVs array could be of type integer or double, and I need to be able to 'cast' this to the appropriate type in the corresponding fortran function. I belive I need to use some type of 'transfer mold' or something... but I'm just not sure. Any ideas on what the corresponding FORTRAN subroutine would look like for receiving the "int*[]" argument and being able to cast that to an integer or double array for processing?
Thanks,
Brian Palmer
typdef void (*callbackfunc) (double *t, int *h1, int *h2, int *numAs, int Ahs[], int *aVs[]);
The last argument "int *aVs[]" is where I'm confused on the FORTRAN side. The actual data contained in the aVs array could be of type integer or double, and I need to be able to 'cast' this to the appropriate type in the corresponding fortran function. I belive I need to use some type of 'transfer mold' or something... but I'm just not sure. Any ideas on what the corresponding FORTRAN subroutine would look like for receiving the "int*[]" argument and being able to cast that to an integer or double array for processing?
Thanks,
Brian Palmer
- Marcas:
- Intel® Fortran Compiler
Link copiado
1 Responder
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
An array of type C_PTR from ISO_C_BINDING. You'll then need to use C_F_POINTER to convert each element to a Fortran POINTER to INTEGER.
Responder
Opções do tópico
- Subscrever fonte RSS
- Marcar tópico como novo
- Marcar tópico como lido
- Flutuar este Tópico para o utilizador atual
- Marcador
- Subscrever
- Página amigável para impressora