INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-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!

*Tek-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.

Jobs

GFORTRAN ERROR - OSX EL CAPITAN(10.11.6)

GFORTRAN ERROR - OSX EL CAPITAN(10.11.6)

(OP)
Hi Guys...

When I try to compile code , appears this error..


$ gfortran try_read_co2atm.f
Undefined symbols for architecture x86_64:
"_read_co2atm_", referenced from:
_MAIN__ in ccbeq7qj.o
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status

Someone can help me??

Many thanks in advance

The Code
 PROGRAM try_read_co2atm
C     ------------------------------------------------------------------
C     Test PROGRAM to READ historical atmospheric CO2 (uatm)
C 
      IMPLICIT NONE 

      INTEGER maxrec, nmxr
      PARAMETER (maxrec=1200, nmxr=700)

      REAL yrco2rec(maxrec), atmco2rec(maxrec)
      INTEGER luco2, irec
      INTEGER nco2rec
      INTEGER is, ireadf
      INTEGER nsipl, nstab

      REAL futco2(nmxr,8)
      REAL dummy

      CALL read_co2atm('test', nco2rec, yrco2rec, atmco2rec)

      DO irec=1,nco2rec
        WRITE(*,'(2f8.2)') yrco2rec(irec),atmco2rec(irec)
      END DO

      STOP 
      END
 
-------------------------####-------------------------------####--------------------------------
      SUBROUTINE read_co2atm(futr_scen, nco2rec, yrco2rec, atmco2rec)

      IMPLICIT NONE 

      INTEGER maxrec, nmxr
      PARAMETER (maxrec=1200, nmxr=700)

      REAL yrco2rec(maxrec), atmco2rec(maxrec)
      INTEGER luco2, irec
      INTEGER nco2rec
      INTEGER is, ireadf
      INTEGER nsipl, nstab

      REAL futco2(nmxr,8)
      REAL dummy

      CHARACTER*4 futr_scen

C     OPEN FILE
C     ---------
      luco2=50
      OPEN(luco2+1, FILE='splmlo_co2_noces.dat', FORM='formatted', 
     &     STATUS='old')
C     --------------------------
C     Get atmospheric CO2 data
C     --------------------------
      WRITE(*,*)'  '
      WRITE(*,*)'--------------------------------------------------'
      WRITE(*,*)'Atm. CO2 from fit to Siple-Mauna Loa record'
      WRITE(*,*)'--------------------------------------------------'

C     ----------------------------------
C     READ historical co2 concentrations
C     ----------------------------------
C     READ(luco2+1,200)
C 200  FORMAT(////)

      DO irec=1,maxrec
C           Read from splco2.dat (historical emissions)
        READ(luco2+1,*,ERR=222,END=222)
     &      yrco2rec(irec),atmco2rec(irec)
        nco2rec = irec
      END DO

 222  CONTINUE

       WRITE(*,*) 'Atm. CO2:  No. of entries for 1-box atmosphere =',
     &            nco2rec

      CLOSE(luco2+1)

      RETURN
      END
 

RE: GFORTRAN ERROR - OSX EL CAPITAN(10.11.6)

Try changing the first character of the ----### comment separating the two routines to !

I haven't tried it on OSX: only on Linux. That is the only thing gfortran is complaining about.

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 Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

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

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

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

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close