PGF90-S-0034-Syntax error at or near identifier call

Hi,

When I try to compile a simple fortran code, I am getting “PGF90-S-0034-Syntax error at or near identifier call (hello.f90: 3)”.

Please see below the output for make and the files hello.f90 and Makefile.
Thank you for your help.
Irena



$ make
pgf90 -tp k8-64e -c -O -Mnoupcase -Mdalign -Mdefaultunit -Ktrap=fp -o hello.o hello.f90
PGF90-S-0034-Syntax error at or near identifier call (hello.f90: 3)
0 inform, 0 warnings, 1 severes, 0 fatal for hello
make: *** [hello.o] Error 2


$ more hello.f90
PROGRAM HELLO
CHARACTER*1 COM
c CALL UREADC(‘ENTER COM $’,COM)
CALL UREAD(‘ENTER com $’)
CALL CDCOD(COM)
IF(COM.EQ.‘P’)THEN
PRINT *,‘HELLO’ !COM
ENDIF
END


more Makefile

Determine OS Type (shell tells make to execute “$uname -s”

sysname = $(shell uname -s)

$(variable) accesses data stored in “variable”

ifeq ($(sysname),Linux)

for Portland

FC = pgf90
FFLAGS = -tp k8-64e -c -O -Mnoupcase -Mdalign -Mdefaultunit -Ktrap=fp
DFFLAGS = -c -g -Mnoupcase -Mdalign -Mdefaultunit -Minform=inform -Ktrap=-Mbounds
NTCCHOME = /p/xshare/RHEL5/path/
NETCDFHOME = /usr/pppl/pgi/11-pkgs/netcdf-4.2
endif

FALL = $(subst .f90,.o, $(wildcard *.f90))
OBJ = $(filter-out hello%, $(FALL))

UFLIB = -L$(NTCCHOME)/shlib -lportlib -lureadsub -lvaxonly

#ctype_wa.o
hello: hello.o $(OBJ)
#ctype_wa.o
$(FC) -o hello hello.o $(OBJ) $(UFLIB)

%.o: %.f90
$(FC) $(FFLAGS) -o $@ $<

clean:
rm *.o
rm -f hello

Irena,

Because your file had the .f90 extension, the compiler
treated your file as free-format. This is fine because you are
starting the program in the first column, and not column seven,
like fixed format fortran.

The fixed format comment character is “C” or “c” or “!” in column 1.

The free-format comment character is “!” anywhere.

replace “c” with “!” and the program should compile.

Add -Mfree
to your compile line to force free format, regardless of extension.

Add -Mfixed
to your compile line to force fixed format, regardless of extension.

dave

Dave,

Thank you for your help - it worked!
Irena