GIDForums  

Go Back   GIDForums > Computer Programming Forums > C Programming Language
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 14-Oct-2005, 12:24
stormlab stormlab is offline
New Member
 
Join Date: Sep 2005
Posts: 20
stormlab is on a distinguished road

Problem with porting of Linux code to Windows, FORTRAN/C.


Hello,

There is a Linux console tool (written in FORTRAN/C) which I want to port under Windows. It can be started with one parameter:

$gribprint gfs1.grib

Example output on the console:

--------------------------------------------------
rec GRIB Lvl Lvl Lvl Time Fcst
Num Code Code one two hour
--------------------------------------------------
1 11 1 0 0 2005-10-11_00:00 +00

I have success with the compilation of the program under Windows. If I run it without argument it works fine and displays a help message. But if I run it with an argument (gfs1.grib) it starts to read the file and then it gives error message (it says that error log is created but I can't find it, W2K). The gfs1.grib file is ok. I'm wondering where is the problem and I guess that it's in the file:

/regrid/pregrid/util/cio.c

where are the I/O (read & write) functions. Here are the original sources for UNIX/Linux:

ftp://ftp.ucar.edu/mesouser/MM5V3/REGRID.TAR.gz

Thanks for any ideas!


Best Regards,

Angel
  #2  
Old 14-Oct-2005, 15:56
davekw7x davekw7x is offline
Outstanding Member
 
Join Date: Feb 2004
Location: Left Coast, USA
Posts: 5,309
davekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to behold

Re: Problem with porting of Linux code to Windows, FORTRAN/C.


Quote:
Originally Posted by stormlab
Hello,

There is a Linux console tool (written in FORTRAN/C)If I run it without argument it works fine and displays a help message. But if I run it with an argument (gfs1.grib) it starts to read the file and then it gives error message (it says that error log is created but I can't find it, W2K). The gfs1.grib file is ok. I'm wondering where is the problem and I guess that it's in the file:

/regrid/pregrid/util/cio.c

where are the I/O (read & write) functions. Here are the original sources for UNIX/Linux:

[Link to program tarball was given here]


Since I don't have any compiler that will compile the 87 or so FORTRAN 90 files in your bundle, there's no way that I could help debug the lone C file there. In other words I can't do anything specific to help.

If I had this project and I observed that it bombs when I give it a command line argument, I would start with the command line argument and work forward from there. Find the FORTRAN files with "handle_arguments" and "getarg" function definitions and put in debugging write() statements to show exactly what the program is working with at each step.

If I thought there was a problem with I/O, and particularly with that one stinkin' C file, I would create a small project using whatever I/O routines that the big job uses and I would track things down with the small job: if it opens a file for writing, where does it put the dang thing. I would sprinkle lots of FORTRAN write() statements, and, perhaps, a few C printf() statements around the landscape. Things like that.

(Actually, I might first go to the compiler vendor's (Portland Group???) forum and poke around there for a while.)

Good luck,

Dave
  #3  
Old 15-Oct-2005, 03:53
stormlab stormlab is offline
New Member
 
Join Date: Sep 2005
Posts: 20
stormlab is on a distinguished road

Re: Problem with porting of Linux code to Windows, FORTRAN/C.


Hi Dave,

Thank you very much for you response. As I see you are a regular visitor to this forum and you know a lot about the programming:-)

The compiler is PGI pgf90 from http://www.pgroup.com.

Greetings,

Angel
 
 

Recent GIDBlogNot selected for officer school by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Porting of Linux code to windows. stormlab C Programming Language 3 10-Sep-2005 01:41
Windows and Linux, hosting plans from $2.99/year, reseller from $3/month! hoststock Web Hosting Advertisements & Offers 0 26-Jul-2005 14:16
Guidelines for posting requests for help - UPDATED! WaltP C++ Forum 0 21-Apr-2005 02:44
CDialog::Onsize problem in Windows 2000 Professional Environment vikravel MS Visual C++ / MFC Forum 0 31-Jan-2005 06:59

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 00:36.


vBulletin, Copyright © 2000 - 2010, Jelsoft Enterprises Ltd.