🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.lang.f77
Article #359

Re: Query: Sharing f77 COMMONs with C Externals

#359
From: P.A.ul Layman [EE-Device Physics...
Date: Sat, 10 May 1986 14:41
39 lines
1862 bytes
In article <2278@watdcsu.UUCP> I (P.A.ul Layman [EE-Device Physics]) write:
>Provided the common block is not blank common.  This refering to the
>single common block available in f77 which does not have a name such as
>
>	common //a,b,c,...
>
>It is not a great problem. Merely extern the name of the common block
>in your c program.  Just make sure you define it to be the same data type.
>
I just heeded my own advice and looked at the assembler for a f77 program with
a blank common block.  This too can be accessed from c using the name _BLNK__
as in the following example:
main program test.f
_____________________________________
	common //y
	real y(10)
	do 100 i=1,10
100	y(i)=i
	call comtst
	stop
	end
_____________________________________
note that the common statement could also be common y, it makes no differenece.
subroutine comtst.c
_____________________________________
#include <stdio.h>
comtst_()
{
	extern float _BLNK__[];
	int i;
	for ( i=0 ; i<=9 ; i++ )
	    {
	    printf("_BLNK_(%d) = %f\n",i,_BLNK__[i]);
	    }
	return(0);
}
_____________________________________

PAul
Technical Details
Message-ID: <2280@watdcsu.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!watmath!watnot!watdcsu!sgcpal
References: <469@cubsvax.UUCP> <203@mdivax1.UUCP> <204@mdivax1.UUCP> <2278@watdcsu.UUCP>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 9/18/84; site watdcsu.UUCP
Path: arc1-ca.pugleaf.net!utzoo!watmath!watnot!watdcsu!sgcpal
From: sgcpal@watdcsu.UUCP (P.A.ul Layman [EE-Device Physics])
Newsgroups: net.lang.f77
Subject: Re: Query:  Sharing f77 COMMONs with C Externals
Message-ID: <2280@watdcsu.UUCP>
Date: Sat, 10-May-86 10:41:39 EDT
Article-I.D.: watdcsu.2280
Posted: Sat May 10 10:41:39 1986
Date-Received: Sun, 11-May-86 15:29:29 EDT
References: <469@cubsvax.UUCP> <203@mdivax1.UUCP> <204@mdivax1.UUCP> <2278@watdcsu.UUCP>
Reply-To: sgcpal@watdcsu.UUCP (P.A.ul Layman [EE-Device Physics])
Organization: U of Waterloo, Ontario
Lines: 39
Keywords: example with blank common