Jump to content

problem with fortran code

- - - - -

  • Please log in to reply
3 replies to this topic

#1
fortran_noob

fortran_noob

    Newbie

  • Members
  • Pip
  • 2 posts
hi,

i have some problem trying to run a fortran code. apologies if this is not the appropriate place to post.

i have downloaded the enclosed fortran codes from scatterlib - Project Hosting on Google Code. in a nutshell, these codes calculate light scattering from a spherical particle. i first compile the 2 needed files with


gfortran bhmie.f callbhmie.f


then execute with "./a.out". it is able to run fine, and i can type in inputs. however, when i try to enter a complex number (the complex refractive index), it gives me errors like


At line 33 of file callbhmie.f (unit = 5, file = 'stdin')

Fortran runtime error: bad integer for item 1 in list input


i tried a few different combinations during the input, such as


1.55 -0.008

1.55, 0.008

1.55


but they all give errors similar to the one above. i am not familiar with fortran, but i suspect its the way i input the complex number. anyone knows how i can solve this?

PS: i have started a similar post at [ubuntu] help with a fortran code - Ubuntu Forums

Attached Files



#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others
I'm wondering if it's not a compiler directive issue.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#3
quikcarl

quikcarl

    Newbie

  • Members
  • Pip
  • 2 posts
You need to read through the program for the inputs. I looked at the FORTRAN program and subroutine and it either prompts for the various inputs or just expects you to know what to input and when to input it. So read through the program CALLBHMIE.F for the read statements and what they require.

#4
fortran_noob

fortran_noob

    Newbie

  • Members
  • Pip
  • 2 posts
thanks for your suggestions. turns out i need to enter


(a, b)


where both a and b are positive numbers.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users