Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

GFORTRAN ERROR - OSX EL CAPITAN(10.11.6)

Status
Not open for further replies.

noele_ocean

Technical User
Sep 20, 2016
1
BR
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
[pre] 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
[/pre]
-------------------------####-------------------------------####--------------------------------
[pre]
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
[/pre]
 
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top