[greg@Uranus:~/WRF/WPS/data/SRTM_conversion]$ nm write_geogrid.o
U __stack_chk_fail
U __strncpy_chk
U fclose
U fopen
U free
U fwrite
U malloc
00000000 T write_geogrid
Location: Saint Paul, MN USA / BSD, CentOS, Debian, OS X, Solaris
Posts: 2,288
Thanks Given: 430
Thanked 480 Times in 395 Posts
Hi.
You can see now that Fortran compiles the external link name as:
Code:
undefined reference to `write_geogrid_'
but gcc is compiling the name as:
Code:
00000000 T write_geogrid
You can try adding the underscore to the name in the c code, but I'm guessing that that you will need to work on the binding relationship that is the Fortran-95 standard. That will also affect how memory items are thought to be arranged between Fortran and c.
But try changing the name in the c code first to see what that does ... cheers, drl
Ok I add a '_' to the write_geogrid in the c code. Now the compilation seems ok because there is no errors. But when I'm executing I have this error:
Code:
[greg@Uranus:~/WRF/WPS/data/SRTM_conversion]$ ./rd_wr_formatted.exe srtm_35_05.asc
At line 66 of file rd_wr_formatted.f90 (unit = 10, file = 'srtm_35_05.asc')
Fortran runtime error: Bad value during floating point read
Location: Saint Paul, MN USA / BSD, CentOS, Debian, OS X, Solaris
Posts: 2,288
Thanks Given: 430
Thanked 480 Times in 395 Posts
Hi.
Are you sure that the data file has 12,001 data items on a line? (I think that's what that means.)
Code:
33 format(f6.1, 12000f7.1)
if so, nx and ny at 1200 seem less than necessary.
Otherwise, what is the intention?
In any case, for debugging a program until you feel it is correct, I suggest that you use compiler-supplied tests, such as -fbounds-check -- see man gfortran for details ... cheers, drl
---------- Post updated at 16:36 ---------- Previous update was at 09:09 ----------
Hi.
In looking over your program again, and with writing a small test case, I think the format 33 with 12000f7.1 is probably OK, provided that there are enough legitimate values to satisfy 1200 values for 1200 lines. Your write statement inside the reading loop will probably print nx+1 for i because it was recently used in the implicit loop.
I think that means we need to look at a sample of the real data file. I was able to obtain this error message:
Code:
At line 15 of file three.f90 (unit = 10, file = 'data1')
Fortran runtime error: Bad value during floating point read
I got this by damaging a value in my data file, from "7" to "x":
I've received some executable script for test, but executing this script continuously give me following message
./example: error while loading shared libraries: libgfortran.so.1: cannot open shared object file: No such file or directory
Google search told me to do as following
$... (1 Reply)
Hello,
I hope this is the correct forum for this post. I have the following
problem:
A Fortran 77 program that has to deal with several large
matrices (each approx. 5000 x 5000) and uses lapack and blas
subroutines has been correctly compiled and executed using Debian
Etch. When I tried... (1 Reply)
Hello,
My problem is with compiling a program modelling shallow water.
In it there is a subroutine called stat with 9 parameters.
In the main program it is called with 9 parameters also
I'm running Ubuntu 11.04 with gfortran version 4.5.
Thanks.
---------- Post updated at 11:57 PM... (0 Replies)
Dear all
I am new to C programming
In response to the post
cat get_time.c
#include <stdlib.h>
#include <sys/time.h>
main()
{
struct timeval tv;
struct timezone tz;
struct tm *tm;
gettimeofday(&tv, &tz);
tm=localtime(&tv.tv_sec);
printf("... (2 Replies)
hi, I first want to apologize for my poor english !
I'm a newbe on Unix system and I have to install NRPE on an AIX 5.3.
I have downloaded the NRPE Source code and i need to compile them...
the problem is, when I do a:
./configure --enable-command-args --disable-ssl
it returns me :... (1 Reply)
Hi,
I have AIX 5.3 and my code is written in proc . i am getting following error during compilation
Please help?////.....
[H[2J:-d:
Compiling with RMS
cc -w -q32 -qidirfirst -ISource/Header -I/usr/vacpp/include -q32 -DRMS -DDISEC -DDBG -DBIGENDIAN -DBIT32 -c -q32... (0 Replies)
Hi,
Environment : HP-UX avalon B.11.11 U 9000/800 3547052374 unlimited-user license
aCC version :aCC: HP ANSI C++ B3910B A.03.37
I need to find a way out of this errors.can anyone help me .
$ aCC db.cc -I$ORACLE_HOME/rdbms/public -I/disk1/oracle/product/10.2.0.2/*
Error (future)... (1 Reply)
i have a class name 1.c in tht i am using function n wich has his body in 2.c and declaration in 2.h
now how can i compile 1.c.
ex;
1.c
int main()
{
//some data
n(10);
//somedata
}
*****
2.c
int n(int k)
{
//some data
}
int main()
{
some data (2 Replies)
I am compiling a software named wine
When i run make then at the end following error generated.
DVAPI32_ -foversion.res version.rc
ld.so.1: ../../tools/wrc/wrc: fatal: relocation error: file ../../tools/wrc/wrc: symbol wine_casemap_upper: referenced symbol not found
*** Signal 9
make:... (0 Replies)