Re: gcc vs gfortran

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Actually, this is what I have:

in C

double complex a, b, z
int lnchf ip
out = conhyp_ (&a, &b, &z, &lnchf, &ip) ;

In Fortran:
      FUNCTION CONHYP (A,B,Z,LNCHF,IP)

      INTEGER LNCHF,IP
      COMPLEX*16 CHGF,A,B,Z,CONHYP

And what I get is
A= b, B=z (the other values are wrong)
It means that the first variable (here a) is just lost
How can I fix this?


>
> > in c, I use double complex
> > in f95, I use COMPLEX*16
>
> Never heard of double complex in c.
>
> Fortran passes all arguments by reference, so a fortran
> routine that has a complex*16 arg probably needs something
> like this in C
>
> struct c16 {
>    double real;
>    double imag;
> };
>
> fortran_routine(struct c16* arg);
>
> That would be my guess, anyway.
> _______________________________________________
> users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
> To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx
> Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
> List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
> List Archives: https://lists.fedoraproject.org/archives/list/users@xxxxxxxxxxxxxxxxxxxxxxx
>
_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/users@xxxxxxxxxxxxxxxxxxxxxxx



[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux