[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [CPROG] Hvordan includerer man et tortran bibliotek i gcc



Niels L Ellegaard wrote:
> 
> Er der nogen, der har en fil, der beskriver hvordan man henter et
> FORTRAN bibliotek ind i gcc.

Har du både gcc og g77 installeret?

Hvis jeg var dig, ville jeg starte med at lave to små programmer:

test1.c
test2.f

I test2.f laver du en subroutine, i test1.c laver du et main program,
som kalder routinen i test2.f.

På den måde får du erfaringer med forskelle i navngivning af subroutiner
og forskelle i parameteroverførsel.

Bemærk, hedder subroutinen gulerod, skal den kaldes som gulerod_ fra C.

Parameterne skal overføres by reference.


	subroutine test1(a,b,c)
	double precision a,b,c
	....


skal kaldes som:

  double a,b,c;
  test1_(&a,&b,&c);

Husk også FORTRAN's måde at behandle indices for arrays; tælling i
første index.

Mogens
-- 
Mogens Kjaer, Carlsberg Laboratory, Dept. of Chemistry
Gamle Carlsberg Vej 10, DK-2500 Valby, Denmark
Phone: +45 33 27 53 25, Fax: +45 33 27 47 08
Email: sslug@sslug Homepage: http://www.crc.dk


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 20:07 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *