Command line argument in GFortran
Hi there. I have a problem. Trying to run a Fortran program which compiles I get an early exit and I don't know how to correct it. The program is posted here. You can see from the code (first few lines, actually) that it wants to read a command line and find out the name of the file where the input array for Fast Fourier Transform is. I found such an array on the web and placed it in a file named: array.dat. Then I tried to run the program (after compilation) as:
Code:
./a.out -o array.dat How shall I arrange it? Thanks, - A. |
I haven't done anything with Fortran in more than 20 years, so please excuse me if I am missing something obvious, but ....
I see the test for COMMAND_ARGUMENT_COUNT(), and I see the call to COMMAND_ARGUMENT_COUNT(), but nowhere do I see the function defined. So, It should generate the error because the test will fail every time. Is the function COMMAND_ARGUMENT_COUNT() a Fortran builtin, or is it something you overlooked adding to the program? |
COMMAND_ARGUMENT_COUNT is an intrinsic procedure for GFortran. The problem I have is that I don't know how to put arguments on the command line. After searching for quite a while I found that this subject is poorly referenced. There are a few examples to follow and I will try to do this tonight or tomorrow.
|
that FFT program will requite that the image used is a SQUARE image that is of a "power of 2 "
256x256, 1024 x 1024 , 2048 x 2048 if not then it will resize it but saved as the " array.dat " i would say as a ASCII CSV format "dat" ( ascii raw) the same as you would fro Matlab or Octave or mathmatica |
I believe it should be
Code:
./a.out array.dat |
Turtleli is correct. I found it out by trial and error. I first used -o because I found a similar script somewhere and it thought it was essential, then I dropped it. So, John W. says that I have to provide such huge input arrays. Well, It can be done with some analytical functions. I will look into it. Thanks.
|
a image that is 256x256 is tiny
i normally run images with 4096x4096 though a FFT based program i have seen a lot of old FORTRAN and matlab .m files that used 128^2 or 256^2 at least it is not asking for the image to be in the .UCF format i take it you already have the input dat file there should be a image folder with test data some of the std ones are Mozart001_256.ucf( or bin , raw or pgm ) vase001_128.ucf( or bin,raw or pgm ) lena256.ucf( or bin,raw or pgm ) |
Quote:
Code:
./a.out < array.dat |
All times are GMT -5. The time now is 09:10 PM. |