Makefile with pgf90 - KIVA code

Anyone has a sample makefile for KIVA code with pgf90 compiler? I could get one works. Thank you.

Hi foochern,

I don’t but I’m happy to take a look. Where can I find the source? Also, what platform are you using, 32 or 64-bit, Linux, Windows, SUA, or Apple? Which version of the compilers?

  • Mat

I’m using 64-bit linux machine.

Attached is the current makefile for ifort.

How do I changed it to gpf90?

COMPILER = ifort
FC = ifort

FFLAGS= -r8 -mp -O3
#FFLAGS= -r8 -g

LOADER = ifort

LDFLAGS = -mp -static



PROG = mesim_3.3.1.1

COMMON = comkiva.i comfuel.i comerc.i erc.i newbreakup.i

activate.o adjpistn.o adjvalve.o aproj.o bc.o
bcccfl.o bcccin.o bcdiff.o bceps.o bcfc.o
bcmomfl.o bcmomper.o bcnodcpl.o bcpexd.o bcpgrad.o
bcresez.o bcresp.o bcrot1.o bcroxcen.o bdchmqgm.o
bdcomd.o begin.o break.o ccflux.o
chemeq.o chmqgm.o clear.o colide.o convex.o
drdke.o drdp.o drdt.o evap.o exdif.o
exitk.o filmsnap.o fran.o fuel.o
fuelib.o fuelmon.o fulout.o global.o gravity.o
inject.o kesolv.o kiva.o lawall.o lngprt.o
mfluxes.o momflx.o monitor.o newcyc.o nodcpl.o
paccel.o pcoupl.o pexdif.o pfind.o pgrad.o
phaseb.o pinit.o piston.o pmom.o
pmovtv.o psolve.o repack.o rese.o resk.o
resp.o rest.o resuvw.o resy.o rezcomb.o
rezone.o rezpent.o rezwedge.o rinput.o
setfilm.o setup.o setupbc.o setupro.o setvflx.o
snapb.o snapt.o snapvfce.o snapvtop.o soot.o
sort.o sortint.o sortreal.o splash.o spread.o
state.o taperd.o tapewr.o timenrest.o timensave.o
timstp.o tinvrt.o tsolve.o ufinit.o utility.o
valve.o visc.o volume.o vsolve.o wallfilm.o
wallfind.o yit.o ysolve.o prespl.o brkst.o
evapford.o injectford.o gpropford.o rinputford.o
check.o pfindsnap.o timer.o
chemford.o fpfind.o disinteg.o
initialize.o kernel.o loci.o mesh_smoother.o
pmhbum.o pmhdcp.o pmhinp.o pmhtwr.o newkh.o
pmhchf.o pmhehp.o pmhnoz.o firstbreakup.o newtab.o
pmhdat.o pmhini.o pmhtrd.o newini.o injectpdf.o
reinit.o stinit.o cycpack.o second.o

link -----------------------------------------------------------

$(PROG): $(OBJS)
$(LINK) $(OBJS) -o $(PROG)

compile -----------------------------------------------------------


I tried to use -Mbounds to check the code. Received the following message:

0: Subscript out of range for array aaa1 (begin.f: 93)
subscript=2, lower bound=1, upper bound=1, dimension=1

I checked the file begin.f, line 93, it is a do loop as:
do 10 n=1, ncom1
10 aaa1(n)=0.0

ncom1 is a big number, and aaa1 has been declared as aaa1(1). This declaration has no problem with ifort compiler but the problem occurs when I use pgf90. How to overcome this?

Thank you.

Hi foochern,

I think “-Mbounds” is correct in that if you access the second element of single element array then you are accessing beyond the range of the array. However, “-Mbounds” may not be a valid option for your code. In F77 code prior to the advent of pointers, a single element array was often used as a “pointer” to an adjustable length array being passed into a subroutine. I don’t know if this is the case here, but it’s possible.

Does the code work without “-Mbounds”?

  • Mat