Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*_mpitmp.f
*.o
*.a
xcql3d*
14 changes: 14 additions & 0 deletions ADC/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Makefile that builts a library lib$(LIB).a from all
# of the Fortran files found in the current directory.
# Usage: make LIB=<libname>
# Pearu
LIB=ADC
OBJ=$(patsubst %.f,%.o,$(shell ls ADC/*.f))
all: lib$(LIB).a
$(OBJ):
$(FC) -c $(FFLAGS) $(patsubst ADC/%.o,ADC/%.f,ADC/$(@F)) -o $@
lib$(LIB).a: $(OBJ)
$(AR) rus ADC/lib$(LIB).a $?
clean:
rm -f ADC/*.o
rm -f ADC/*.a
285 changes: 143 additions & 142 deletions ainpla.f

Large diffs are not rendered by default.

149 changes: 149 additions & 0 deletions makefile_gfortran_mpi_rhel7
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
# makefile for CQL3D using gfortran64 for mpi on PC

# May/06: makefile_mpi.xxx is a system setup by Nikolai Ershov
# for creation of mpi version of cql3d from the serial
# version. Therefore, only one version of cql3d needs
# be maintained.
# Comments (beginning with CMPI) have been inserted in the source.
# These are processed using python code from the ./mpi subdirectory
# to produce an MPI cql3d version.
# The procedure is described in CompX report
# CQL3D_Parallelization_CompX-2006-1.pdf, and has been evolved
# by Yuri Petrov.
# Please follow this procedure in future cql3d modifications.

SHELL = /bin/sh
NAME = xcql3d_mpi.gfortran64
COMPILER= mpif77
BUILDER= gfortran
INCLUDES = advnce.h comm.h frcomm.h frname.h frname_decl.h name.h \
param.h trans.h wpadvnc.h name_decl.h
SOURCES = $(wildcard ADC/!(*mpitmp*).f)
SOURCES += a_cqlp.f abchief.f achief1.f achiefn.f aclear.f ainalloc.f \
aindflt.f aindflt1.f aindfpa.f aingeom.f ainitial.f \
ainpla.f ainplt.f ainpltpa.f \
ainsetpa.f ainsetva.f ainspec.f ainvnorm.f ampfar.f \
aminmx.f bavdens.f bavgmax.f baviorbt.f \
bcast.f bsl.f bsu.f cfpcoefc.f cfpcoefn.f \
cfpcoefr.f cfpgamma.f cfpleg.f \
cfpmodbe.f cfpsymt.f coefefad.f coefefld.f coefegad.f \
coeffpad.f coefload.f coefmidt.f coefmidv.f \
coefrfad.f coefstup.f coefsyad.f coefwti.f \
coefwtj.f diag.f diagcfac.f \
diagdens.f diagdenz.f diagentr.f diagescl.f diaggnde.f \
diaggnde2.f diagimpd.f diagscal.f diagwrng.f diagxswt.f \
diagxswx.f dsk_gr.f dskout.f efield.f eflditer.f eqalloc.f \
eqcoord.f eqelpse.f eqflxavg.f eqfn.f \
eqfndpsi.f eqfninv.f eqfpsi.f \
eqindflt.f eqinitl.f eqjac.f eqonovrp.f \
eqorbit.f eqrhopsi.f eqrhs.f \
eqtopeol.f equilib.f eqvolpsi.f eqwrng.f \
esefld.f exlin.f exsweep.f exsweept.f \
exsweepx.f finit.f firstdrv.f fle.f flxfn.f \
freya.f freyasou.f frhexdrv.f \
frinitl.f frinitz.f frnbdep2.f frnfreya.f \
frplteq.f frset.f frsmooth.f frsplft.f \
frstup.f frsubs.f frsuppor.f frwrong.f hpalloc0.f \
ilut.f impavnc0.f impchk.f impnorm.f it3dalloc.f \
lookup.f losscone.f lossegy.f lossorbm.f \
losstor.f micfrplt.f micgetr.f \
micgmbnd.f micgnbnd.f micxinil.f micxinim.f micxinit.f \
micxiniz.f netcdfrf.f netcdfrw2.f ntdstore.f \
ntloop.f pack21.f pltcont.f pltcycl.f pltdf.f \
pltdnz.f pltelec.f pltendn.f \
pltends.f pltfluxs.f pltfofvv.f pltfvsv.f pltinit.f pltlosc.f \
pltmain.f pltpower.f pltprppr.f \
pltrstv.f pltrun.f pltstrml.f pltvec.f pltvectr.f \
pltvflux.f profaxis.f profiles.f prppr.f \
prpprctr.f psif.f psifp.f psifppy.f psifpy.f psiinv.f \
r8lsode.f r8subs.f rdc_multi.f rdc_bplt.f restcon.f resthks.f \
restvty.f rf.f sigalloc.f siggy.f sigmax.f sigsetup.f \
sigv5d.f sigfn.f sigie.f sigmaxwl.f sigv.f \
soucrit.f sounorm.f soup.f soup0.f souplt.f \
sourc0.f sourcee.f sourcef.f sourceko.f sourcpwr.f \
synchrad.f tdbootst.f tdboothi.f tdchief.f tddiag.f \
tddsig.f tdeqdsk.f tdfinterp.f tdinitl.f tdinlegw.f \
tdinterp.f tdnflxs.f tdnpa.f tdnpadiag.f tdnpa0.f \
tdnpacxcs.f tdnpalam.f tdnpabscs.f tdoutput.f \
tdplteq.f tdpltjop.f tdpltmne.f tdpro.f \
tdreadf.f tdrmshst.f tdsetnpa.f tdsetsxr.f \
tdstin.f tdsxr.f tdsxr0.f tdsxray.f tdsxrplt.f \
tdtloop.f tdtoarad.f \
tdtoaray.f tdtraloc.f tdtransp.f tdtranspn.f tdtravct.f \
tdtrchk.f tdtrchkd.f tdtrcon.f \
tdtrdfus.f tdtrfcop.f tdtrflg.f tdtrflx.f \
tdtrmuy.f tdtrrsou.f tdtrrtov.f \
tdtrrtov2.f tdtrsavf.f tdtrsym.f tdtrvint.f \
tdtrvsou.f tdtrvtor.f tdtrvtor2.f \
tdtrvtor3.f tdtrwtl.f tdtry.f tdtscinp.f tdtscout.f \
tdwrng.f tdwritef.f tdxin13d.f \
tdxin23d.f tdxin33d.f tdxinitl.f urfalloc.f \
urfavg.f urfb0.f urfbes.f \
urfbplt.f urfchief.f urfdamp0.f urfdamp1.f \
urfdamp2.f urfdampa.f urfdout.f urfedge.f \
urffflx.f urfindfl.f urfinitl.f urfmidv.f \
urfpack.f urfpackm.f urfrays.f urfread.f \
urfread_.f urfsetup.f urfwrite.f urfwrite_.f \
urfwrong.f urfwr0.f urfwr0c.f \
vlf.f vlfalloc.f vlfbplt.f vlfsetup.f vlh.f vlhbplt.f vlhd.f \
wpalloc.f wparsou.f wpavg.f wpbdry.f \
wpcheck.f wpchgdy.f wpcthta.f wpelecf.f \
wpinitl.f wploweq.f wpsavf.f wptrafx.f wptramu.f \
wptrmuy.f wpvptb.f wpwrng.f wpmshchk.f \
zblock.f zcunix.f zfreya.f znonsym.f
PYTHON = python3
OBJECTS = $(SOURCES:.f=.o)
LOCATION = -L$(NETCDF_DIR)/lib -L$(PGPLOT_DIR)/lib -L$(PWD)/ADC
LIBS= -lX11 -lnetcdff -lnetcdf -lpgplot -lADC
INCLUDE=/usr/include
#DEBUG = -g -Mbounds
DEBUG = -g
OPTIMIZE = -O
LISTING = -Mlist
CSPECIAL = -Wno-padded
FFLAGS = $(CSPECIAL) $(OPTIMIZE)
#SPECIAL = -byteswapio -Mbackslash
LDSPECIAL = -Wl,-noinhibit-exec,-rpath,$(PGPLOT_DIR)/lib
#COMPILE = mpif77 -c $(CSPECIAL) -c $(DEBUG) -I $(INCLUDE) # or use $(OPTIMIZE)
COMPILE = $(COMPILER) -c $(FFLAGS) -I $(INCLUDE) # or use $(DEBUG)
LOAD = $(COMPILER) -o $(NAME) $(LDSPECIAL) # Remove -m for optimize
PROTECT = chmod 755
DELETE = rm -f

# The following gives suffixes to be used in checking for suffix rules.
# Written without dependencies, it may be useful to turn of such checking?
.SUFFIXES:

$(NAME): $(OBJECTS)
$(LOAD) $(OBJECTS) $(LOCATION) $(LIBS)
$(PROTECT) $(NAME)

# Following use of pattern matching works;
# it is based on statements in Sect. 10.7 of gmake Manual
# by Stallman and McGrath.
# However, the two rules following this seem clearer to me (BobH).
#%.o: %.f $(INCLUDES)
# $(COMPILE) $< -o $@

include deps #Introduced by John Wright (JCW)
$(SOURCES): $(INCLUDES)

# see Sect. 4.10.1, Static Pattern Rules.
#$(OBJECTS): %.o: %.f $(INCLUDES)
%.o: %.f # $(INCLUDES)
#Changes introduced by JCW so obtain saved copy of mpi modified sources
# mpi/doparallel.py $< mpitmp.f mpi/mpins_par.f
# $(COMPILE) mpitmp.f -o $@
export COMPILER FFLAGS
make -f ADC/Makefile
$(PYTHON) mpi/doparallel.py $< $*_mpitmp.f mpi/mpins_par.f
$(COMPILE) $*_mpitmp.f -o $@

rebuild:
$(COMPILE) $(SOURCES)
$(LOAD) $(OBJECTS) $(LOCATION) $(LIBS)

clean:
make -f ADC/Makefile clean
$(DELETE) $(OBJECTS) *.lst *_mpitmp.f

149 changes: 149 additions & 0 deletions makefile_mpi.gfortran64_rhel
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
# makefile for CQL3D using gfortran64 for mpi on PC

# May/06: makefile_mpi.xxx is a system setup by Nikolai Ershov
# for creation of mpi version of cql3d from the serial
# version. Therefore, only one version of cql3d needs
# be maintained.
# Comments (beginning with CMPI) have been inserted in the source.
# These are processed using python code from the ./mpi subdirectory
# to produce an MPI cql3d version.
# The procedure is described in CompX report
# CQL3D_Parallelization_CompX-2006-1.pdf, and has been evolved
# by Yuri Petrov.
# Please follow this procedure in future cql3d modifications.

SHELL = /bin/sh
NAME = xcql3d_mpi.gfortran64
COMPILER= mpif77
BUILDER= gfortran
INCLUDES = advnce.h comm.h frcomm.h frname.h frname_decl.h name.h \
param.h trans.h wpadvnc.h name_decl.h
SOURCES = $(wildcard ADC/!(*mpitmp*).f)
SOURCES += a_cqlp.f abchief.f achief1.f achiefn.f aclear.f ainalloc.f \
aindflt.f aindflt1.f aindfpa.f aingeom.f ainitial.f \
ainpla.f ainplt.f ainpltpa.f \
ainsetpa.f ainsetva.f ainspec.f ainvnorm.f ampfar.f \
aminmx.f bavdens.f bavgmax.f baviorbt.f \
bcast.f bsl.f bsu.f cfpcoefc.f cfpcoefn.f \
cfpcoefr.f cfpgamma.f cfpleg.f \
cfpmodbe.f cfpsymt.f coefefad.f coefefld.f coefegad.f \
coeffpad.f coefload.f coefmidt.f coefmidv.f \
coefrfad.f coefstup.f coefsyad.f coefwti.f \
coefwtj.f diag.f diagcfac.f \
diagdens.f diagdenz.f diagentr.f diagescl.f diaggnde.f \
diaggnde2.f diagimpd.f diagscal.f diagwrng.f diagxswt.f \
diagxswx.f dsk_gr.f dskout.f efield.f eflditer.f eqalloc.f \
eqcoord.f eqelpse.f eqflxavg.f eqfn.f \
eqfndpsi.f eqfninv.f eqfpsi.f \
eqindflt.f eqinitl.f eqjac.f eqonovrp.f \
eqorbit.f eqrhopsi.f eqrhs.f \
eqtopeol.f equilib.f eqvolpsi.f eqwrng.f \
esefld.f exlin.f exsweep.f exsweept.f \
exsweepx.f finit.f firstdrv.f fle.f flxfn.f \
freya.f freyasou.f frhexdrv.f \
frinitl.f frinitz.f frnbdep2.f frnfreya.f \
frplteq.f frset.f frsmooth.f frsplft.f \
frstup.f frsubs.f frsuppor.f frwrong.f hpalloc0.f \
ilut.f impavnc0.f impchk.f impnorm.f it3dalloc.f \
lookup.f losscone.f lossegy.f lossorbm.f \
losstor.f micfrplt.f micgetr.f \
micgmbnd.f micgnbnd.f micxinil.f micxinim.f micxinit.f \
micxiniz.f netcdfrf.f netcdfrw2.f ntdstore.f \
ntloop.f pack21.f pltcont.f pltcycl.f pltdf.f \
pltdnz.f pltelec.f pltendn.f \
pltends.f pltfluxs.f pltfofvv.f pltfvsv.f pltinit.f pltlosc.f \
pltmain.f pltpower.f pltprppr.f \
pltrstv.f pltrun.f pltstrml.f pltvec.f pltvectr.f \
pltvflux.f profaxis.f profiles.f prppr.f \
prpprctr.f psif.f psifp.f psifppy.f psifpy.f psiinv.f \
r8lsode.f r8subs.f rdc_multi.f rdc_bplt.f restcon.f resthks.f \
restvty.f rf.f sigalloc.f siggy.f sigmax.f sigsetup.f \
sigv5d.f sigfn.f sigie.f sigmaxwl.f sigv.f \
soucrit.f sounorm.f soup.f soup0.f souplt.f \
sourc0.f sourcee.f sourcef.f sourceko.f sourcpwr.f \
synchrad.f tdbootst.f tdboothi.f tdchief.f tddiag.f \
tddsig.f tdeqdsk.f tdfinterp.f tdinitl.f tdinlegw.f \
tdinterp.f tdnflxs.f tdnpa.f tdnpadiag.f tdnpa0.f \
tdnpacxcs.f tdnpalam.f tdnpabscs.f tdoutput.f \
tdplteq.f tdpltjop.f tdpltmne.f tdpro.f \
tdreadf.f tdrmshst.f tdsetnpa.f tdsetsxr.f \
tdstin.f tdsxr.f tdsxr0.f tdsxray.f tdsxrplt.f \
tdtloop.f tdtoarad.f \
tdtoaray.f tdtraloc.f tdtransp.f tdtranspn.f tdtravct.f \
tdtrchk.f tdtrchkd.f tdtrcon.f \
tdtrdfus.f tdtrfcop.f tdtrflg.f tdtrflx.f \
tdtrmuy.f tdtrrsou.f tdtrrtov.f \
tdtrrtov2.f tdtrsavf.f tdtrsym.f tdtrvint.f \
tdtrvsou.f tdtrvtor.f tdtrvtor2.f \
tdtrvtor3.f tdtrwtl.f tdtry.f tdtscinp.f tdtscout.f \
tdwrng.f tdwritef.f tdxin13d.f \
tdxin23d.f tdxin33d.f tdxinitl.f urfalloc.f \
urfavg.f urfb0.f urfbes.f \
urfbplt.f urfchief.f urfdamp0.f urfdamp1.f \
urfdamp2.f urfdampa.f urfdout.f urfedge.f \
urffflx.f urfindfl.f urfinitl.f urfmidv.f \
urfpack.f urfpackm.f urfrays.f urfread.f \
urfread_.f urfsetup.f urfwrite.f urfwrite_.f \
urfwrong.f urfwr0.f urfwr0c.f \
vlf.f vlfalloc.f vlfbplt.f vlfsetup.f vlh.f vlhbplt.f vlhd.f \
wpalloc.f wparsou.f wpavg.f wpbdry.f \
wpcheck.f wpchgdy.f wpcthta.f wpelecf.f \
wpinitl.f wploweq.f wpsavf.f wptrafx.f wptramu.f \
wptrmuy.f wpvptb.f wpwrng.f wpmshchk.f \
zblock.f zcunix.f zfreya.f znonsym.f
PYTHON = python3
OBJECTS = $(SOURCES:.f=.o)
LOCATION = -L$(NETCDF_DIR)/lib -L$(PGPLOT_DIR)/lib -L$(PWD)/ADC
LIBS= -lX11 -lnetcdff -lnetcdf -lpgplot -lADC
INCLUDE=/usr/include
#DEBUG = -g -Mbounds
DEBUG = -g
OPTIMIZE = -O
LISTING = -Mlist
CSPECIAL = -Wno-padded
FFLAGS = $(CSPECIAL) $(OPTIMIZE)
#SPECIAL = -byteswapio -Mbackslash
LDSPECIAL = -Wl,-noinhibit-exec,-rpath,$(PGPLOT_DIR)/lib
#COMPILE = mpif77 -c $(CSPECIAL) -c $(DEBUG) -I $(INCLUDE) # or use $(OPTIMIZE)
COMPILE = $(COMPILER) -c $(FFLAGS) -I $(INCLUDE) # or use $(DEBUG)
LOAD = $(COMPILER) -o $(NAME) $(LDSPECIAL) # Remove -m for optimize
PROTECT = chmod 755
DELETE = rm -f

# The following gives suffixes to be used in checking for suffix rules.
# Written without dependencies, it may be useful to turn of such checking?
.SUFFIXES:

$(NAME): $(OBJECTS)
$(LOAD) $(OBJECTS) $(LOCATION) $(LIBS)
$(PROTECT) $(NAME)

# Following use of pattern matching works;
# it is based on statements in Sect. 10.7 of gmake Manual
# by Stallman and McGrath.
# However, the two rules following this seem clearer to me (BobH).
#%.o: %.f $(INCLUDES)
# $(COMPILE) $< -o $@

include deps #Introduced by John Wright (JCW)
$(SOURCES): $(INCLUDES)

# see Sect. 4.10.1, Static Pattern Rules.
#$(OBJECTS): %.o: %.f $(INCLUDES)
%.o: %.f # $(INCLUDES)
#Changes introduced by JCW so obtain saved copy of mpi modified sources
# mpi/doparallel.py $< mpitmp.f mpi/mpins_par.f
# $(COMPILE) mpitmp.f -o $@
export COMPILER FFLAGS
make -f ADC/Makefile
$(PYTHON) mpi/doparallel.py $< $*_mpitmp.f mpi/mpins_par.f
$(COMPILE) $*_mpitmp.f -o $@

rebuild:
$(COMPILE) $(SOURCES)
$(LOAD) $(OBJECTS) $(LOCATION) $(LIBS)

clean:
make -f ADC/Makefile clean
$(DELETE) $(OBJECTS) *.lst *_mpitmp.f

Loading