×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Problem in FORTRAN compiling

Problem in FORTRAN compiling

Problem in FORTRAN compiling

(OP)
Hello,

Anybody familiar with compiling FORTRAN? I got problem when I tried to compile the code that I wrote . Below is my code :

 This is the Hartman Function
c   Bound: X(j)=[0,1], j=1,2,...,6
c   Global Optimum:-3.322368011415515,
c   (0.201,0.150,0.477,0.275,0.311,0.657)
c     //////// nml     implicit real*8 (a-h,o-z)
      dimension x(nopt),a2(4,6),c2(4),p2(4,6),a3(4,3),c3(4),p3(4,3)
      call scein(nopt)
      call sceua(nopt)           
c
c  Open input 6D
      open(unit=5,file='input.dat',status='old')
      Read(5,*)a2
      Read(5,*)c2
      Read(5,*)p2
c
c  open input Data for Hartman function coefficient (3-D)                     
      open(unit=5,file='input2.dat',status='old')
      Read(5,*)a3
      Read(5,*)c3
      Read(5,*)p3
c           
      if (nopt .gt. 6) then
        write (*,*) ' ???? CHECK THE INPUT FILE ???? '
        stop
      end if
c
      functn = 0.0
      do 50 i = 1, 4
        u = 0.0
        do 40 j = 1, nopt
          if (nopt .eq. 3) then
            a2(i,j) = a3(i,j)
            p2(i,j) = p3(i,j)
          end if
          u = u + a2(i,j) * (x(j) - p2(i,j))**2
   40   continue
        if (nopt .eq. 3) c2(i) = c3(i)
        functn = functn - c2(i) * exp(-u)
   50 continue
c
c
      stop
      end


After I compiled this code, I got this message
"2038-S:"Hartman.for", line 9: nopt can not be specified in a specification expression"

Any idea why this code gave me such kind of error?


Thanks,

Leni


 

RE: Problem in FORTRAN compiling

The string 'nopt' appears to be an undeclared parametric constant.
 

Mike Halloran
Pembroke Pines, FL, USA

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members! Already a Member? Login


Resources

eBook - Manufacturing the Cars of Tomorrow
In this ebook, we'll explore how additive manufacturing is going to transform the way cars are made. This includes commentary from thought leaders such as Ford's CTO, Ken Washington, Customer case studies of ways 3D printing is being used today, and a variety of part examples where 3D printing is already impacting how automobiles are made. Download Now
White Paper - Smart Manufacturing for Semiconductor
New technologies and approaches present great opportunities for semiconductor manufacturers to achieve high levels of innovation, yield and improvement. This white paper explores some of these cutting-edge technologies and how they can be applied effectively in the semiconductor industry. Read about how Smart Manufacturing is transforming the semiconductor industry. Download Now
White Paper - Analysis and Simulation in Aircraft Structure Certification
Organizations using simulation and analysis tools effectively see the benefits in their ability to achieve certification faster and with drastically less total cost than those who do not maximize these tools. Read this White Paper to learn about how digital tools such as analysis and simulation help in aircraft structure certification. Download Now

Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close