Passing logical variables from Fortran subroutine to C subroutine 
Author Message
 Passing logical variables from Fortran subroutine to C subroutine

A "C" subroutine is called from fortran 90 program with logical varibles
e.g.

   logical :: periods(ndim),reorder
   [....]
   call mpi_cart_create(MPI_COMM_WORLD,ndim,dims,periods,reorder, &
                                    comm_2d,ierr)

The C suboutine recieves like this:

   void mpi_cart_create_(c, n, d, p, re, nc, ierr)
   int  *c, *n, *d, *p, *re, *nc, *ierr;

i.e. like integer. Is this o.k.?

--
----------------------------------------------------------------------
Yon Han Chong                     |
Flow Control and Prediction Group | Tel: + 44 1234 750 111 ext. 5420

Cranfield University              | Fax: + 44 1234 752 149
United Kingdom                    | Mobile: + 44 958 381 395
----------------------------------------------------------------------



Sat, 12 Aug 2000 03:00:00 GMT  
 Passing logical variables from Fortran subroutine to C subroutine

logical does look the same as integer on many systems when passed to C;
however, the value scheme is up for grabs - could be odd or negative for .true.
, usually 0 for .false.

Tim



Sun, 13 Aug 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. passing functions or subroutines in a subroutine

2. pass a subroutine (use derived data type) as an argument to another subroutine

3. Character variable variable passed as a subroutine argument

4. Q. Passing variable dimensioned arrays to subroutines.

5. Programming Style - Passing Variables to Subroutines

6. Passing arrays to subroutines in fortran 90

7. passing pointer based arrays to subroutines in fortran

8. passing dynamic arrays to subroutines in MS Fortran

9. is it possible to pass C++ vectors to fortran subroutines

10. wanted fortran variable metric subroutine

11. How to pas an overloaded subroutine as an argument to another subroutine

12. Fortran subroutine to run in ADAMS/Solver FORTRAN

 

 
Powered by phpBB® Forum Software