Programming :: Get An Error Using A Namelist In A Fortran 90 Program ?
Aug 26, 2010
I have a program which reads some parameters in from an input file before solving a differential equation. This program compiles fine, I'm using Numerical Algorithms Group (NAG) libraries to solve the differential equation so I'm also the NAG compiler called nagfor.
The namelist I have is declared as follows:
And the input file is:
When I run the code I get the following error message:
I really can't see what's wrong with this code.
Also, I'm using Fedora 11, and running the code in tcsh if this is relevant.
View 1 Replies
ADVERTISEMENT
May 19, 2011
i am graduate student and my X colleague gave me this Fortran 77 program to run my result files with. She is no longer reachable. I compiled the following program with gfortran, it compiled well but, when i run it, gave me end of file error. My output file (which is the input file for this program (DFILE1) ) has about 78,000 lines of velocities of atoms (Vx, Vy, Vz with 1000 steps.. an example of some of the atom's velocities in the 1st step is given at the end of this program). I will be highly obliged if any one can help me with this.I run this program on opensuse linux 11.3 version /32 bit/i586
error message:
Code:
At line 124 of file v.autocorrelation.f (unit = 10, file = 'DFILE1')
Fortran runtime error: End of file
Code:
PROGRAM TCORR
COMMON / BLOCK1 / STORX, STORY, STORZ
COMMON / BLOCK2 / VX, VY, VZ
COMMON / BLOCK3 / VACF, ANORM
C *******************************************************************
code....
View 6 Replies
View Related
Apr 14, 2011
I've a FORTRAN program that I would like to compile in my machine. I've gfortran installed, so I issue the command: gfortran asc2bin.f write_geogrid.o
but this error are displayed
Code:
asc2bin.f:3.72:
INTEGER isigned,i,j,endian,wordsize,nx,ny,xllcorner,yllcorner,
1
Error: Invalid character in name at (1)
[Code].....
View 1 Replies
View Related
Mar 9, 2011
I have a new problem; i want to call a subroutine's fortran which have a function in the argument and the compilation ran properly, but when i execute the program this shows me an "Segmentation fault". This is my c++ program:
Code: //Main.cpp
#include <stdio.h>
#include <iostream>
[code]....
View 2 Replies
View Related
Jun 28, 2011
I am getting error Fortran runtime error: Bad value during floating point read. How do I format negative sign?
[code]...
View 1 Replies
View Related
Feb 4, 2010
I've installed openMPI-1.4.1 on my laptop and I'm trying to compile some fortran code I've written using MPI. I downloaded the openMPI-1.4.1 file from the openMPI website and used the shell script they provide to install it. This is the shell script:
shell$ cd openmpi-1.4.1
shell$ ./configure --prefix=/usr/local
shell$ make all install
There was an additional line extracting the tar file, but I did this by hand. The first time I ran this script there was an error on the final stage saying that a directory couldn't be created because of lack of permission. I decided to run the script again this time as a sudo.
Having run the script again everything appeared to install properly, however when I went to compile some fairly simple code I got a message saying that the compiler couldn't find MPI. I was using this command: gfortran messages.f90 -o messages I looked on the openMPI website where it recommends compiling with a compiler called mpif. However when I type mpif messages.f90 -o messages I get an error message saying mpif isn't a recognized command......
View 2 Replies
View Related
Sep 2, 2011
I am having a problem with a simple program I wrote in Fortran (gfortran). This program basically reads a long list of numbers and makes some operations with them. Double precision is used in the variables and functions, and AFAIK everything is in order with the program. The thing is that I accidentally noticed that said program yields different results, and I am talking about integers being different, something noticeable. Apparently the offending chunk of code might be:
Code:
DOUBLE PRECISION FUNCTION tamano (x1,y1,z1)
DOUBLE PRECISION x1,y1,z1
tamano=dsqrt((x1)**2+(y1)**2+(z1)**2)
[code]....
One of the involved machines has F15 x86_64 and the other one F15 i686. My first guess is that this has something to do with how Fortran handles precision (which I supposed was the same for 32 and 64 bits). To compile the program I use:
Code:
gfortran --free-form -fno-whole-file program.f90
Is there another option I should pass the compiler to make sure the same precision is used in both cases? Or what can I do here?
View 3 Replies
View Related
Feb 6, 2010
I have compiled a Fortran program by using
gfortran -ggdb file.f90
To try to step through it in the debugger, I enter
gdb a.out
but I cannot create a break point. I have tried a number of commands including
b <line number>
b <subroutine name>
View 1 Replies
View Related
May 19, 2010
I want to compile MFiX which is a simulation software. Therefore, I installed the Intel Fortran Compiler Ver. 11.x When compiling, I can only choose between Ver.9.x and 10.x.
This is a part of the error message when choosing either:
Is there a possibility to link the program to the newer compiler version?
I'm using Centos 5.4.
View 5 Replies
View Related
Apr 8, 2010
Command to compile n execute a Fortran program on a Linux machine
View 6 Replies
View Related
Apr 15, 2009
I'm trying to call some Fortran 95 code in C, but I'm having problems with integers not having the same value in C as in Fortran, and changing values upon each run of the program. I think it has to do with the integer type, but I don't know how to fix it. I'm running Gentoo x86. Here are the files I've got:
foo.c:
Code:
#include <stdio.h>
extern int qux_();
main() {
[code]....
View 2 Replies
View Related
Sep 29, 2010
There are examples everywhere about calling f77 subroutine from IDL, but I have not found any material about IDL calling fortran written in f90 way(free style). I tried the following example, but write the subroutines in free style. When I run the makefile, it gives an error 'undefined reference to main_'.
Code:
SUBROUTINE SUM_ARRAY(argc, argv) !Called by IDL
INTEGER*4 argc, argv(*) !Argc and Argv are integers
j = LOC(argc) !Obtains the number of arguments (argc)
[code]....
View 1 Replies
View Related
Jan 21, 2011
I want to call a subroutine in Fortran 90 from a c++ code. I can do it, when the fortran code have no module. But i need to call the subroutine in a fortran code that have an module. I have a simple program that shows my problem. The Fortran code is:
Code: !add2.f90
Module add2
Implicit none
Contains
[code]....
collect2: ld returned 1 exit status I Dont know where is the problem. Maybe it is in the call of the function. I found that the syntax have this form: extern void __namemodule__NMOD_namesubrutine(arg)
View 6 Replies
View Related
May 16, 2010
I have two arrays of data, called data1.dat and data2.dat. each contains 60 data. What I want to do is to compare the data in each file and write the counting into bins. It goes like this. First, take the first data in data1.dat file and compare with the 60 data in data2.dat file. If there is any data which is same with the data in data1.dat then it count in bin. The total bins are also 60. Next it goes to the second data in data1.dat and compare with all the 60 data in data2.dat. If there is any data same then it add in second bin. And it repeats to all the data in data1.dat
View 3 Replies
View Related
Jun 10, 2009
I'm not a Fortran coder but I need to call the sub-routine ADAPT.f from a c code.This subroutine calculates a multiple integral of a given function.My problem is that the c code works with no problem in a 32 bit machine but it does not in a 64 bit machine, and the problem seems to be related to adapt, which calculations gives a NA rather than the result of integration.Since fortran is quite obscure for me, I don't know why is this happening. Maybe I should change some data type (from real to double), but I'm not sure. Does anyone have a clue?
View 3 Replies
View Related
Jun 29, 2011
I have a 50 file name NSSAVE0001.vtk to NSSAVE0050.vtk.Do I have to manually type individually command to open each file or can I have a loop to open file?
View 3 Replies
View Related
Mar 15, 2011
The following is the error in my program :
Here is my program...
View 7 Replies
View Related
Mar 10, 2011
I am dealing with one FORTRAN 90 code, have made small changes.
milenko@milenkons:~/mt4$ make mt4
make: 'mt4' is up to date.
milenko@milenkons:~/mt4$ ifort -c MT2DDIB1.FOR
milenko@milenkons:~/mt4$ make mt4
make: 'mt4' is up to date.
milenko@milenkons:~/mt4$ make mt4
make: 'mt4' is up to date.
milenko@milenkons:~/mt4$ make mt4
make: 'mt4' is up to date.
I go for make command but it does not see that the source code has been modified.Than I do compilation from command line,try make again but no use.
F95=ifort
FFLAFGS= -O1
mt3: driver_mt2ddi.o constants.o settings.o params.o mt2dmod.o fdsystem.o mt2ddat.o mt2dsens.o
$(F95) -o $(FFLAGS) mt3 constants.o settings.o params.o mt2dmod.o fdsystem.o mt2ddat.o mt2dsens.o driver_mt2ddi.o
driver_mt2ddi.o: driver_mt2ddi.for constants.o settings.o params.o mt2dmod.o fdsystem.o mt2ddat.o mt2dsens.o
$(F95) -c $(FFLAGS) driver_mt2ddi.for
View 2 Replies
View Related
Nov 7, 2010
I am trying to write a loop to open four main-data-files. At each open of the main-data-file, I want the loop to open another four sub-files and split the data from the mail-data-file according to the creteria and dump into the four files. When the loop goes to the second main-data-file, it shall generate another 4 sub-files with different file name. And the process goes on. That means I will have total of 16 sub files for the four main-data-files. Each four files from the 16 files shall have specific name on it. Based on the code which I given below, I would say when the file at UNIT=100 is opened, 4 new files needed to be opened as well. They are:
maximum_dist_001_064.dat
maximum_dist_065_128.dat
maximum_dist_129_192.dat
maximum_dist_193_256.dat
View 1 Replies
View Related
Oct 19, 2009
I (my friend) have a fortran program with the code along the following lines:
Code:
SUBROUTINE NY
REAL, DIMENSION(4000,4000) :: a, b, c
...
RETURN
END SUBROUTINE PARAMETERS
The problem is that the huge matrices are retained in memory even after the subroutine ends. Is there an easy way to declare the arrays in a sort of dynamic way, like they were in the following C example?
Code:
void ny(void) {
double a[4000,4000];
...
}
I mean in the C example the memory is released as soon ny() exits.
View 5 Replies
View Related
Oct 28, 2010
Code:
Above is a code for UDP server which I am trying.
When I compile it I get following errors
Code:
View 1 Replies
View Related
Nov 18, 2010
I have the following code:
Code:
And it gives this error:
Code:
View 2 Replies
View Related
Jun 8, 2010
I'm trying to implement a solver for a system of differential equations in Fortran. The solver contains a number of functions which are supposed take real values, 1D arrays of real values or both as arguments and return arrays of real numbers, all of which cause the program to segfault. Example:
Code:
function y_exakt(t)
implicit none
real::t, pi
[code]....
(the last number in the array seems to change randomly). Then the program crashes either when f(t,y) is called or when dy is returned (after removing the call to f). What could cause these (memory?) problems and/or what could I do to identify the problem? Increasing the maximum stack size with ulimit or compiling the program with -fno-automatic has had no effect. I'm using gfortran (gcc 4.4.3) on a 64-bit Ubuntu Lucid machine. The complete program can be found at [URL].
View 3 Replies
View Related
Aug 25, 2010
I have two sets of data. 1,2,3,4 and 6,7,8 and I have written a fortran code to put them in order as below:
program gap
implicit none
integer:: i, j
do i = 1,4
do j = 6, 8
[Code]...
I want a space once every row loop has finish.I am dont know how to write the data as shown above using the fortran code in this post.
View 2 Replies
View Related
Nov 2, 2010
I am trying to store the results of my code to a separate text file.But the problem is, as my results comes from a loop, my text file shows only the last result, not all of them.Like if the loop runs 5 time the text file shows the result for the 5th step.But i need to store all of them (1 to 5).Can I use awk to print the output field and store to another file and creat a new line so that the next output field goes to a new line?(just an idea, dont know).
#!/bin/basth
for (( i=1; i<=5; i++))
do
./file.exe > output.txt
done
View 2 Replies
View Related
May 26, 2010
I am using the C++ compiler G++ to compile my programs on Linux Mint 8 - Gnome.
I recently installed QT and when I tried to compile a simple "Hello World!" program it gave me this error:
Quote:
This is the code in HelloWorldQt.cpp:
Code:
I have tried using GTK instead but I get a similar error.
View 7 Replies
View Related
Jul 21, 2010
I'm building my main program on SUSE using C, but the compiler returns the error below.
Code:
Here's my code to which the errors are pointing to:
Code:
View 3 Replies
View Related
May 8, 2010
I've created 3 files: swap.h and swap.c then make static library from it
Code:
Then I write 2 program to test this library: test_swap.c and test_swap.cpp
I compile
Code:
What's wrong with this in C++? And how can I make a library that can work both for any C and C++ program?
Here the source code
Code:
Code:
Code:
View 2 Replies
View Related
Feb 28, 2011
I was trying to get the ssid of WLAN through the following C program
What is the cause of this error?
View 1 Replies
View Related
Jun 14, 2010
I have a problem when I want to run executable program,I get this:
./xtramp: error while loading shared libraries: libf2c.so.2: cannot open shared object file: No such file or directory. My machine is x86_64,may be ere is problem.Anu ideas how to solve this?
View 6 Replies
View Related