473,748 Members | 10,028 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

convert 'C' code to 'Fortran'

sam
Hi,
Can anyone help me find a software that can convert a code in 'C'
to 'Fortran77/90' automatically?

Thanks in advance.

Sam.
Nov 14 '05 #1
26 13563
sam wrote:
Hi,
Can anyone help me find a software that can convert a code in 'C'
to 'Fortran77/90' automatically?

Thanks in advance.

Sam.


Wow, - good luck :)
Nov 14 '05 #2
sam wrote:
Hi,
Can anyone help me find a software that can convert a code in 'C'
to 'Fortran77/90' automatically?


This is not really on-topic.
However, there is a slightly more topical version: Why fix something
that is not broken?
C modules can communicate with fortran modules.
Now the problem is just how to fit the two together.
Google for "mix fortran and C". It basically comes down to
providing interfaces, creating the right headers and intelligent
makefiles.

Cheers
Michael
--
E-Mail: Mine is an /at/ gmx /dot/ de address.
Nov 14 '05 #3
> Can anyone help me find a software that can convert a code in 'C'
to 'Fortran77/90' automatically?


Good luck. You'll need it. C concepts like pointers don't
translate very well into FORTRAN.

Gordon L. Burditt
Nov 14 '05 #4
sam wrote:
Hi,
Can anyone help me find a software that can convert a code in 'C'
to 'Fortran77/90' automatically?

This is off-topic for this newsgroup. However, I suggest using a search
engine for f2c.

Brian
Nov 14 '05 #5
On Wed, 10 Nov 2004, Default User wrote:
sam wrote:
Can anyone help me find a software that can convert a code in 'C'
to 'Fortran77/90' automatically?


This is off-topic for this newsgroup. However, I suggest using a search
engine for f2c.


That is in the wrong direction...

Tak-Shing

Nov 14 '05 #6

"Tak-Shing Chan" <es***@city.ac. uk> wrote in message
news:Pine.GSO.4 .33.04111020593 10.12278-100000@swindon. ..
On Wed, 10 Nov 2004, Default User wrote:
sam wrote:
Can anyone help me find a software that can convert a code in 'C'
to 'Fortran77/90' automatically?


This is off-topic for this newsgroup. However, I suggest using a search
engine for f2c.


That is in the wrong direction...

So you can use it to check your result, in the unexpected case that the
original C code fell within the subset of C used by f2c, and your OS gets
along with the f2c conventions.
Nov 14 '05 #7
Jim
On Wed, 10 Nov 2004 21:00:12 +0000, Tak-Shing Chan <es***@city.ac. uk>
wrote:
On Wed, 10 Nov 2004, Default User wrote:
sam wrote:
Can anyone help me find a software that can convert a code in 'C'
to 'Fortran77/90' automatically?


This is off-topic for this newsgroup. However, I suggest using a search
engine for f2c.


That is in the wrong direction...

Tak-Shing


Try searching for c2f then.

Jim
Nov 14 '05 #8
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Michael Mair wrote:
| sam wrote:
|
|> Hi,
|> Can anyone help me find a software that can convert a code in 'C'
|> to 'Fortran77/90' automatically?
|
|
| This is not really on-topic.
| However, there is a slightly more topical version: Why fix something
| that is not broken?

Maybe because the Fortran compiler's optimization is better than the
platform's C compiler. Or to make calling the code from Fortran easier.
Or a small number of other possible reasons.

Obviously, going the other way is a lot more common. The Fortran FAQ
I'll link to later says that there aren't any tools to automate the c2f
conversion.

| C modules can communicate with fortran modules.

True, but it isn't always easy. There are more issues involved in this
than I'll go into here, but there is a (long) discussion of it at
section 3.1.3 of the Fortran FAQ at this address:

~ http://www.faqs.org/faqs/fortran-faq/

| Now the problem is just how to fit the two together.

And it is, indeed, a problem. ;)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFBkxGaKxa tjOtX+j0RArp4AJ 9kXvMBB1BHuetZo bFJS5bB9iwkCwCe OCdR
GpWhVHxh1RLZn/JHtRI+rkk=
=Z1NT
-----END PGP SIGNATURE-----
Nov 14 '05 #9
Chris Barts wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Michael Mair wrote:
| sam wrote:
|
|> Hi,
|> Can anyone help me find a software that can convert a code in 'C'
|> to 'Fortran77/90' automatically?
|
|
| This is not really on-topic.
| However, there is a slightly more topical version: Why fix something
| that is not broken?

Maybe because the Fortran compiler's optimization is better than the
platform's C compiler. Or to make calling the code from Fortran easier.
Or a small number of other possible reasons.
Well, as the OP did not give a _good_ reasons, I assumed (s)he was not
aware of this way.

Obviously, going the other way is a lot more common. The Fortran FAQ
I'll link to later says that there aren't any tools to automate the c2f
conversion.
Yep, this I know. I would rather go for the f2c but the OP seemed
to want to have Fortran.
| C modules can communicate with fortran modules.

True, but it isn't always easy. There are more issues involved in this
than I'll go into here, but there is a (long) discussion of it at
section 3.1.3 of the Fortran FAQ at this address:

~ http://www.faqs.org/faqs/fortran-faq/

| Now the problem is just how to fit the two together.

And it is, indeed, a problem. ;)


*g* Maybe.
Up to now, I only had the dubious pleasure of getting F77 code
to work together with C code, always the C code calling -- and
this went always straight by recipe.

Thanks for the additional information :-)
Michael
--
E-Mail: Mine is an /at/ gmx /dot/ de address.
Nov 14 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1713
by: Graham Feeley | last post by:
Hi I have data resembling like this Clearing, The Italian Job, The Final Cut, The Manson Family, The I would like some code to convert the data to The Clearing The Italian Job The Final Cut
1
3450
by: Diego | last post by:
Hi, Anyone can help to convert this code to C#? Public Class MonImageConverter Inherits System.Windows.Forms.AxHost Public Sub New() MyBase.New("59EE46BA-677D-4d20-BF10-8D8067CB8B33") 'note the GUID here has no meaning. End Sub
8
1627
by: Mike | last post by:
is there a tool that will convert cold fusion code to C#? Or anything out there to help in this process? thx
15
2807
by: Tanzim Saqib | last post by:
I've been trying to learn VB.NET. I know VB6. I can not convert the following VB6 code segment to VB.NET In VB 6: ' In a module starts here: Public Declare Function SetTimer Lib "user32" (ByVal hwnd As Long, ByVal nIDEvent As Long, ByVal uElapse As Long, ByVal lpTimerFunc As Long) As Long Public Declare Function KillTimer Lib "user32" (ByVal hwnd As Long, ByVal nIDEvent As Long) As Long Public Declare Function GetAsyncKeyState Lib...
3
1662
by: Dushyant | last post by:
Hello everyone, I am working on converting one code from VB to VB.NET. I am stuck at some point, please help me how to convert following code from VB to VB.NET : Dim xImage As System.Windows.Forms.ImageList xImage = xImageLst.ListImages.Add(, "Open", LoadPicture(xPath & File_File_Open)) Regards,
2
1309
by: shapper | last post by:
Hello, Could someone, please, convert the following code line to VB.NET? bool containsValue = myList.Any(item =item.NameParameter == nameParameterValue); (This is .NET 3.5. I couldn't find a converter that does this) Thanks,
1
1213
by: shapper | last post by:
Hello, I am having problems in converting the following code line to VB.NET: Control list = MyFun(myControl, delegate(Control ctl) { ctl.ID == "MyControl"; }); Could someone please help me out? Thanks,
4
1698
by: Sam | last post by:
I am new in software development, and need some help. Please help me convert a class written in c# to vb.net. Thanks, Sam
3
1633
mshmyob
by: mshmyob | last post by:
I am new to vb.net and would like to be able to convert the following code to it's own function - either inside the current module or better yet in a seperate class. This code currently runs in the KEYPRESS event and ensures only numbers, decimal point, 2 decimals etc. are entered and not letters. Works exactly how I want it but would now like it in a function. I need this code in numerous text box controls but I would rather just call it...
2
2454
by: royhoja | last post by:
How do i convert the following code into a function? What parameters would be in the function? printingform(???,???) #include <stdio.h> #include <string.h> int main() { int i;
0
8984
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8823
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9530
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9363
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9312
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6793
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
3300
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2775
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2206
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.