Nп/п : 59 из 100
 От   : pehache                             2:5075/128        05 сен 23 11:50:13
 К    : db                                                    05 сен 23 12:52:02
 Тема : Re: Calling a C++ function from Forttran
----------------------------------------------------------------------------------
                                                                                 
@MSGID: <klobumFfoflU1@mid.individual.net>
79f86c57
@REPLY: 1@dont-email.me> e2827ca3
@REPLYADDR pehache <pehache.7@gmail.com>
@REPLYTO 2:5075/128 pehache
@CHRS: CP866 2
@RFC: 1 0
@RFC-Message-ID:
<klobumFfoflU1@mid.individual.net>
@RFC-References: 1@dont-email.me>
@TZUTC: 0200
@PID: Mozilla/5.0 (Macintosh; Intel Mac OS X
10.13; rv:91.0) Gecko/20100101 Thunderbird/91.11.0
@TID: FIDOGATE-5.12-ge4e8b94
Le 04/09/2023 ? 16:43, db a ?crit :
> I see that rather than try to convert a C++ function to
> Fortran, it might be better to call it from a Fortran
> program. So I found a description of how to do it, and
> it involves an interface:

> interface
> subroutine normal_vec(seed, n, x) bind(c)
> import c_int, c_double
> integer(kind=c_int), intent(in), value :: seed, n
> real(kind=c_double)                    :: x(n)
> end subroutine normal_vec
> end interface

> This is for an example of a random number generator.
> I note a declaration of the variable type c_double.
> The function I want to call declares "long double"
> but I doubt that I can use

> import c_long double
> ...
> real(kind=c_long double) :: t, JBAND

> where t is the variable passed to the function JBAND


> What should I put there?

real(kind=c_long_double) :: ...


-- 
"...sois ouvert aux id?es des autres pour peu qu`elles aillent dans le
m?me sens que les tiennes.", ST sur fr.bio.medecine
ST passe le mur du ?on : <j3nn2hFmqj7U1@mid.individual.net>
 --- Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:91.0)
Gecko/20100101 Thunderbird/91.11.0
 * Origin: usenet.network (2:5075/128)
SEEN-BY: 5001/100 5005/49 5015/255 5019/40 5020/715
848 1042 4441 12000
SEEN-BY: 5030/49 1081 5058/104 5075/128
@PATH: 5075/128 5020/1042 4441



   GoldED+ VK   │                                                 │   09:55:30    
                                                                                
В этой области больше нет сообщений.

Остаться здесь
Перейти к списку сообщений
Перейти к списку эх