[RegCNET] Makefile_gnu

Антон Резников reznikov_anton at mail.ru
Tue May 18 18:12:50 CEST 2010


> 
> On Tuesday Dec 01 2009 Maurice wrote that he had written a Makefile_gnu which may be used with gFortran compiler. This is due to license restrictions on the IFC compiler. Is it possible to obtain a copy of his Makefile_gnu? I have tried to write a makefile for gfortran but  both  make'and  make -f' still requires the  f77' command with my makefile! Are there any  other changes in the gfortran environment to run  the terrain script? Thanks and Cheers!
> 
> Gachari F.
> Jomo Kenyatta university, Nairobi.

Makefiles for my GNU/Linux Debian (32/64-bit) systems.

Makefile for terrain:
#  Makefile for RegCM@  run on PC_LINUX
#  by using GNU Fortran compiler

FC = gfortran 
FFLAGS = -O1 -frecord-marker=4 -fsecond-underscore -std=legacy

LDFLAGS = -L../../Commons/env/liblinux/ -lnetcdf

CC = gcc

LD = $(FC)

SRC = terrain.f

OBJ = terrain.o system.o

all: terrain

.c.o:
        $(FC) -c -o $@ $^

.f.o:
        $(FC) -c $(FFLAGS) -o $@ $^

terrain: $(OBJ)
        $(LD) -o $@ $(OBJ) $(LDFLAGS)

clean:
        rm -f *.o terrain
# --------------------------------------------------------------------
# DO NOT DELETE THIS LINE -- make depend depends on it.

terrain.o: domain.param terrain.f 


Makefile for ICBC:
#  Makefile for RegCM@  run on PC_LINUX (AMD 64bit CPU)
#  by using Portland Group FORTRAN compiler

FC = gfortran 
FFLAGS = -O1 -frecord-marker=4 -std=legacy
LDFLAGS = -L../../Commons/env/liblinux/ -lnetcdf

LD = $(FC)

SRC1a = SST_1DEG.f

OBJ1a = SST_1DEG.o system.o

SRC1b = SST_FVGCM.f

OBJ1b = SST_FVGCM.o system.o

SRC1c = SST_EH5OM.f

OBJ1c = SST_EH5OM.o system.o

SRC2 = ICBC.f

OBJ2 = ICBC.o system.o

all: SST SST_FVGCM SST_EH5OM ICBC

.f.o:
        $(FC) -c -o $@ $^ $(FFLAGS)

SST: $(OBJ1a)
        $(LD) -o $@ $(OBJ1a) $(LDFLAGS)

SST_FVGCM: $(OBJ1b)
        $(LD) -o $@ $(OBJ1b)

SST_EH5OM: $(OBJ1c)
        $(LD) -o $@ $(OBJ1c)

ICBC: $(OBJ2)
        $(LD) -o $@ $(OBJ2) $(LDFLAGS)

clean:
        rm -f *.o SST SST_FVGCM SST_EH5OM ICBC
# --------------------------------------------------------------------
# DO NOT DELETE THIS LINE -- make depend depends on it.

SST_1DEG.o: icbc.param SST_1DEG.f
SST_FVGCM.o: icbc.param SST_FVGCM.f
SST_EH5OM.o: icbc.param SST_EH5OM.f
ICBC.o: icbc.param ICBC.f


Makefile for regcm:
FFLAGS = -O1 -fsecond-underscore -std=legacy
FC = gfortran
LD = $(FC) 

SRC = \
aermix.f aeroppt.f aerout.f albedov.f balanc.f balbak.f bconst.f bdyin.f bdyuv.f \
bdyval.f blhnew.f BLOCKDATA001.f bmpara.f bndry.f \
carbon.f cdiv.f chdrydep.f chemtap.f chrsetc.f chsrfem.f \
cldefr.f cldems.f cldfrac.f co2.f colmod3.f conadv.f condch.f \
condcq.f condtq.f conmas.f cumtran.f cupara.f \
cuparan.f cupemandrv.f cupeman.f cup.f \
depth.f deriv.f diffu.f diffut.f \
dragdn.f drag.f drip.f dsflx.f EDDY.f elmhes.f eltran.f \
eomb.f FINDDATE.f for_next.f frawat.f getdat.f grads_stuf.f \
hadv.f holtbl.f \
hqr2.f hqr.f htdiff.f ice.f inirad.f initb.f INITDATE.f init.f \
inidust.f initlk.f interf.f intmax.f invmtrx.f isamax.f isrchfgt.f \
isrchfle.f lakedrv.f lake.f lenchr.f lfdrag.f lftemp.f \
ljchrn.f lshfch.f lutbl.f mapsmp.f maximi.f minimi.f MIXER.f mkfile.f \
nconvp.f nudge.f o3data.f outprt.f output.f \
outsav.f outsrf.f outsub.f outtap0.f outtap.f param.f pcp.f \
radabs.f radclr.f radclw.f radcsw.f radctl.f radded.f radems.f \
radini.f radinp.f radout.f radoz2.f radtap.f radtpl.f reorder.f regcm.f \
resetr.f rg.f root.f satur.f saxpy.f sgedi.f sgefa.f slice.f slice3d.f \
snow.f soilbc.f solar1.f spinit.f spline.f splitf.f \
sponge.f spstep.f sscal.f sswap.f stomat.f \
TEMP.f tend.f tgrund.f tpfc.f tracbud.f tracdiag.f \
tractend2.f trcab.f trcabn.f trcems.f trcmix.f trcplk.f trcpth.f \
tseice.f tstep.f vadv.f vcheke.f vcheki.f vchekt.f \
vcover.f vecbats.f vmodes.f vmultm.f vnorml.f vorder.f vprntm.f \
vprntv.f vtlaps.f water.f wheneq.f whenfgt.f whenflt.f whenne.f \
zengocndrv.f zengocn.f zenith.f zenitm.f

OBJ = \
aermix.o aeroppt.o aerout.o albedov.o balanc.o balbak.o bconst.o bdyin.o bdyuv.o \
bdyval.o blhnew.o BLOCKDATA001.o bmpara.o bndry.o \
carbon.o cdiv.o chdrydep.o chemtap.o chrsetc.o chsrfem.o \
cldefr.o cldems.o cldfrac.o co2.o colmod3.o conadv.o condch.o \
condcq.o condtq.o conmas.o cumtran.o cupara.o \
cuparan.o cup.o cupemandrv.o cupeman.o \
depth.o deriv.o diffu.o diffut.o \
dragdn.o drag.o drip.o dsflx.o EDDY.o elmhes.o eltran.o \
eomb.o FINDDATE.o for_next.o frawat.o getdat.o grads_stuf.o \
hadv.o holtbl.o \
hqr2.o hqr.o htdiff.o ice.o inirad.o initb.o INITDATE.o init.o \
inidust.o initlk.o interf.o intmax.o invmtrx.o isamax.o isrchfgt.o \
isrchfle.o lakedrv.o lake.o lenchr.o lfdrag.o lftemp.o \
ljchrn.o lshfch.o lutbl.o mapsmp.o maximi.o minimi.o MIXER.o mkfile.o \
nconvp.o nudge.o o3data.o outprt.o output.o \
outsav.o outsrf.o outsub.o outtap0.o outtap.o param.o pcp.o \
radabs.o radclr.o radclw.o radcsw.o radctl.o radded.o radems.o \
radini.o radinp.o radout.o radoz2.o radtap.o radtpl.o reorder.o regcm.o \
resetr.o rg.o root.o satur.o saxpy.o sgedi.o sgefa.o slice.o slice3d.o \
snow.o soilbc.o solar1.o spinit.o spline.o splitf.o \
sponge.o spstep.o sscal.o sswap.o stomat.o \
TEMP.o tend.o tgrund.o tpfc.o tracbud.o tracdiag.o \
tractend2.o trcab.o trcabn.o trcems.o trcmix.o trcplk.o trcpth.o \
tseice.o tstep.o vadv.o vcheke.o vcheki.o vchekt.o \
vcover.o vecbats.o vmodes.o vmultm.o vnorml.o vorder.o vprntm.o \
vprntv.o vtlaps.o water.o wheneq.o whenfgt.o whenflt.o whenne.o \
zengocndrv.o zengocn.o zenith.o zenitm.o

all: regcm

.f.o:
        $(LD) -c -o $@ $(FFLAGS) $^ 

regcm:  $(OBJ) system.o
        $(LD) -o $@ $(FFLAGS) $^ # -Vaxlib

clean:
        rm -f $(OBJ) regcm *.o




More information about the RegCNET mailing list