ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I had been using my code(fortran 90) on linux openSuse, and it was working perfectly. Yet, now that I have switched to ubuntu and I have installed gfortran, it gives me error as sollows:
data vk /1,1,1, -1,1,1, 1,-1,1, 1,1,-1, -1,-1,-1, 1,-1,-1, -1,1,-1, -1,-1,1/
1
Error: DATA statement at (1) has more variables than values
makefile:21: recipe for target 'analysis.o' failed
make: *** [analysis.o] Error 1
I really appreciate if someone could help me with this problem. Thanks a lot.
Hi. For future reference it is best to include enough code in support of your question. And then also place code as well as things like command line outputs in within [code][/code] tags to maintain the spacing and formatting and also make it easier for readers of your questions.
The error report seems to echo the line in your source it has a problem with.
As with all syntax, you should look at that line, see if it matches correct FORTRAN syntax.
I feel you should check the space between "data" and "vk" and determine what it is and what it should be, whether it is an actual SPACE versus TAB.
This may be a newly edited line where the editor on your new system acts differently when you do certain keystrokes.
I'll move this to the Programming forum where I feel you'll get better assistance from readers. (Also renamed the question since "I" is not really helpful for people to see what the nature of your problem is.)
Last edited by rtmistler; 02-15-2017 at 01:53 PM.
Reason: Clarified and reorganized the post better
dimension vk(24) -- okay
dimension vk(3,8) -- okay
dimension vk(25) -- bad: not enough value for 25 elemenets
dimension vk(5,5) -- bad: not enough value for 25 elemenets
Yes: please take the time to "write for the future." Your post will be seen for years to come. Flag it as [SOLVED] and write a short "closing comment" that is intended to be beneficial to the next by giving him or her the that solved the same problem for you.
In particular, you imply that the same Fortran-90 source code was acceptable to Intel's compiler but not to Gnu's. That's very interesting. And, that's what we'd like to know more about from you in your closing-comments to this thread. (Anyone could be "stuck, and stuck for a very long time" by a subtle difference between two compilers.)
Last edited by sundialsvcs; 02-17-2017 at 08:23 AM.
My data had only 8 entries, whereas, I had double precision:: vk(3,10),vk1(3,10),vkr,ar, ai,theta, when I changed it to
double precision:: vk(3,8),vk1(3,8),vkr,ar, ai,theta, it worked perfectly.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.