changed function names and logical unit numbers to avoid conflicts in JINTRAC

This commit is contained in:
Lorenzo Figini 2014-06-11 10:05:33 +00:00
parent 560f3053cd
commit 5484959955
4 changed files with 391 additions and 279 deletions

141
Makefile
View File

@ -1,61 +1,112 @@
# Executable name
EXE=gray
LIBFILE=lib$(EXE).a
# Makefile for JETTO fortran 90 library 'gray'
# Author: Lorenzo Figini (figini@ifp.cnr.it)
#
# Derived from
# Makefile for JETTO fortran 77 library 'frantic'
# Author: Derek Harting (d.harting@fz-juelich.de)
# and
# Makefile for ITCequ Fortran 90 library - definitions
# P. Strand, elfps@chalmers.se
# G. Corrigan, gcor@jet.uk
# D. Harting, d.harting@fz-juelich.de
# Objects list
OBJ=gray_main.o gray-externals.o grayl.o reflections.o green_func_p.o \
const_and_precisions.o itm_constants.o itm_types.o
# Set the environment from the top-level Makefile of JETTO
# --------------------------------------------------------
include ../include.mk
# Alternative search paths
vpath %.f90 src
vpath %.f src
# library name
# ------------
LIBNAME=$(JLIBDIR)/libgray.a
# Fortran compiler name and flags
FC=gfortran
FFLAGS=-O0 -g -fbounds-check -Wall
#FFLAGS=-O3
# List source and object files
# ----------------------------
FSRC=$(wildcard *.f *.f90)
FOBJ0=$(FSRC:.f=.o)
FOBJ=$(FOBJ0:.f90=.o)
DIRECTIVES = -DREVISION="'$(shell svnversion)'"
########################################
# Set up compiler specific environment #
########################################
all: library
# set default compiler
# --------------------
FC=$(F90)
# Build executable from object files
$(EXE): main.o $(OBJ)
$(FC) $(FFLAGS) -o $@ $^
# Set compiler debug and optimization flags
# -----------------------------------------
ifeq ("$(DBG)","")
FFLAGS= $(AUTO) -O3
else
FFLAGS= $(AUTO) -O0 -g
endif
$(LIBFILE): $(OBJ)
rm -f $@
ar -rv $@ $^
# Set include directories
# -----------------------
#INC=-I$(JCOMMON_STD)
INC=
# Dependencies on modules
main.o: gray_main.o
#####################################
# Set up RULES specific environment #
#####################################
# suffixes
# --------
.SUFFIXES: .f90 .f .o .mod
# PHONY targets
# -------------
.PHONY: all clean realclean $(MASTER_RULES) gray
# default target
# --------------
all:
@($(MAKE) -C ../ all) || exit $$?
# Set rules passed to top-level Makefile
# --------------------------------------
$(MASTER_RULES):
@($(MAKE) -C ../ $@) || exit $$?
# rule for libgray.a
# --------------------
$(LIBNAME): $(FOBJ)
ar vr $(LIBNAME) $?
# synonym for libgray.a
# -----------------------
gray: $(LIBNAME)
# create rule for compiling f90 files
# -----------------------------------
%.o: %.f90
$(FC) -c $(FFLAGS) $(INC) $<
# create rule for compiling f files
# ---------------------------------
%.o: %.f
$(FC) -c $(FFLAGS) $(INC) $<
# make 'realclean' option
# -----------------------
realclean:
rm -f *.o *.mod $(LIBNAME)
# make 'clean' option
# -------------------
clean:
rm -f *.o
# Dependencies
# ------------
gray_main.o: gray-externals.o itm_types.o
gray-externals.o: green_func_p.o reflections.o
green_func_p.o: const_and_precisions.o
const_and_precisions.o: itm_types.o itm_constants.o
itm_constants.o: itm_types.o
# General object compilation command
%.o: %.f90
$(FC) $(FFLAGS) -c $<
# Special rule to preprocess source file and include svn revision
# ---------------------------------------------------------------
DIRECTIVES = -DREVISION="'$(shell svnversion)'"
gray-externals.o:gray-externals.f
$(FC) -cpp $(DIRECTIVES) $(FFLAGS) -c $<
$(FC) -c -Mpreprocess $(DIRECTIVES) $(FFLAGS) $(INC) $<
grayl.o:grayl.f
$(FC) $(FFLAGS) -c $<
.PHONY: library clean install
library: $(LIBFILE)
# Remove output files
clean:
rm -rf *.o *.mod $(EXE)
install:
@if [ -f $(EXE) ]; then \
cp $(EXE) ~/bin/; \
else \
echo File $(EXE) does not exist. Run \'make\' first; \
fi

61
Makefile.standalone Normal file
View File

@ -0,0 +1,61 @@
# Executable name
EXE=gray
LIBFILE=lib$(EXE).a
# Objects list
OBJ=gray_main.o gray-externals.o grayl.o reflections.o green_func_p.o \
const_and_precisions.o itm_constants.o itm_types.o
# Alternative search paths
vpath %.f90 src
vpath %.f src
# Fortran compiler name and flags
FC=gfortran
FFLAGS=-O0 -g -fbounds-check -Wall
#FFLAGS=-O3
DIRECTIVES = -DREVISION="'$(shell svnversion)'"
all: library
# Build executable from object files
$(EXE): main.o $(OBJ)
$(FC) $(FFLAGS) -o $@ $^
$(LIBFILE): $(OBJ)
rm -f $@
ar -rv $@ $^
# Dependencies on modules
main.o: gray_main.o
gray_main.o: gray-externals.o itm_types.o
gray-externals.o: green_func_p.o reflections.o
green_func_p.o: const_and_precisions.o
const_and_precisions.o: itm_types.o itm_constants.o
itm_constants.o: itm_types.o
# General object compilation command
%.o: %.f90
$(FC) $(FFLAGS) -c $<
gray-externals.o:gray-externals.f
$(FC) -cpp $(DIRECTIVES) $(FFLAGS) -c $<
grayl.o:grayl.f
$(FC) $(FFLAGS) -c $<
.PHONY: library clean install
library: $(LIBFILE)
# Remove output files
clean:
rm -rf *.o *.mod $(EXE)
install:
@if [ -f $(EXE) ]; then \
cp $(EXE) ~/bin/; \
else \
echo File $(EXE) does not exist. Run \'make\' first; \
fi

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
subroutine locate(xx,n,x,j)
subroutine vlocate(xx,n,x,j)
implicit real*8(a-h,o-z)
dimension xx(n)
c
@ -260,25 +260,25 @@ c
c spline routines: begin
c
c
function spli(cspli,n,k,dx)
function fspli(cspli,n,k,dx)
implicit real*8(a-h,o-z)
dimension cspli(n,4)
spli=cspli(k,1)+dx*(cspli(k,2)+dx*(cspli(k,3)+dx*cspli(k,4)))
fspli=cspli(k,1)+dx*(cspli(k,2)+dx*(cspli(k,3)+dx*cspli(k,4)))
return
end
c
c
c
function splid(cspli,n,k,dx)
function fsplid(cspli,n,k,dx)
implicit real*8(a-h,o-z)
dimension cspli(n,4)
splid=cspli(k,2)+dx*(2.0d0*cspli(k,3)+3.0d0*dx*cspli(k,4))
fsplid=cspli(k,2)+dx*(2.0d0*cspli(k,3)+3.0d0*dx*cspli(k,4))
return
end
c
c
c
subroutine difcs(x,y,n,iopt,c,ier)
subroutine difcsg(x,y,n,iopt,c,ier)
implicit real*8(a-h,o-z)
dimension x(n),y(n),c(n*4)
jmp =1
@ -383,7 +383,7 @@ c
c
subroutine difcsn(xx,yy,nmx,n,iopt,cc,ier)
c
c same as difcs but with dimension(xx,yy) = nmx > n
c same as difcsg but with dimension(xx,yy) = nmx > n
c
implicit real*8(a-h,o-z)
c
@ -689,7 +689,7 @@ c
t(1)=acos(x)
h(1)=tau*t(1)
b0=besi0(h(1))
b1=besi1(h(1))
b1=besi1g(h(1))
z=-1.0d0
go to 3
c
@ -1220,7 +1220,7 @@ c
e=.true.
go to 2
c
entry besi1(x)
entry besi1g(x)
c
e=.false.
2 l=.true.
@ -8485,13 +8485,13 @@ c error codes and messages.
c
c
c
subroutine splder(t,n,c,k,nu,x,y,m,wrk,ier)
c subroutine splder evaluates in a number of points x(i),i=1,2,...,m
subroutine gsplder(t,n,c,k,nu,x,y,m,wrk,ier)
c subroutine gsplder evaluates in a number of points x(i),i=1,2,...,m
c the derivative of order nu of a spline s(x) of degree k,given in
c its b-spline representation.
c
c calling sequence:
c call splder(t,n,c,k,nu,x,y,m,wrk,ier)
c call gsplder(t,n,c,k,nu,x,y,m,wrk,ier)
c
c input parameters:
c t : array,length n, which contains the position of the knots.
@ -8907,15 +8907,15 @@ c the zeros of s(x) are arranged in increasing order.
end
c
subroutine profil(iopt,tx,nx,ty,ny,c,kx,ky,u,nu,cu,ier)
c if iopt=0 subroutine profil calculates the b-spline coefficients of
subroutine sprofil(iopt,tx,nx,ty,ny,c,kx,ky,u,nu,cu,ier)
c if iopt=0 subroutine sprofil calculates the b-spline coefficients of
c the univariate spline f(y) = s(u,y) with s(x,y) a bivariate spline of
c degrees kx and ky, given in the b-spline representation.
c if iopt = 1 it calculates the b-spline coefficients of the univariate
c spline g(x) = s(x,u)
c
c calling sequence:
c call profil(iopt,tx,nx,ty,ny,c,kx,ky,u,nu,cu,ier)
c call sprofil(iopt,tx,nx,ty,ny,c,kx,ky,u,nu,cu,ier)
c
c input parameters:
c iopt : integer flag, specifying whether the profile f(y) (iopt=0)