

#   Makefile for BARBI
#   for specific architectures the variables from F90 to LIBS
#   have to be redefined. Two examples are given below.
#
#          C.Eden Feb. 2002 (mailto ceden@phys.ocean.dal.ca)


#Example for IRIX/SGI 64 

F90 = f90      # Fortran 90 compiler, e.g. f90
F90_OPTS = -O2 # compiler switches for f90
CPP = f90 -E   # preprocessor, e.g. cpp
CPP_OPTS =     # prepocessor options, not used 
LIB_PATHS = -L/usr/freeware/lib     # Library paths (NetCDF only)
INC_PATHS = -I/usr/freeware/include # Paths for include files
LIBS= -lnetcdf                      # Libraries to be linked, 

# Example for Linux and vast f90 compiler

#F90 = f90 
#F90_OPTS = -fno-globals -w -O2
#CPP = g77 -E
#CPP_OPTS =
#LIB_PATHS = -L.
#INC_PATHS = -I.
#LIBS = /usr/lib/libnetcdf.a

# Example for SunOS 5.6

#F90 = f90 
#F90_OPTS = -O2
#CPP = f90 -F
#CPP_OPTS =
#LIB_PATHS = -L/usr/local/lib
#INC_PATHS = -I/usr/local/include
#LIBS = -lnetcdf

# Example for Compaq Tru64 UNIX V5.1

#F90 = f90 
#F90_OPTS = -O2
#CPP = cpp -C
#CPP_OPTS =
#LIB_PATHS = -L/usr/local/lib
#INC_PATHS = -I/usr/local/include
#LIBS = -lnetcdf





# Rules

.F.o: 
	$(CPP) $(CPP_OPTS) $(INC_PATHS) $< > $*.f
	${F90} ${F90_OPTS}  $(INC_PATHS) -c $*.f
.f.o:
	${F90} ${F90_OPTS} $(INC_PATHS) -c $<
.F.f: 
	$(CPP) $(CPP_OPTS) $(INC_PATHS) $< > $@
# Files

OBJ_FILES = barbi.o        barbi_clinic.o barbi_tropic.o \
            barbi_setup.o  barbi_diag.o   barbi_template.o
FOR_FILES = barbi.F        barbi_clinic.F barbi_tropic.F \
            barbi_setup.F  barbi_diag.F   barbi_template.F
MOD_FOR_FILES = barbi_module.F congrad_module.F tmngr.F \
                island_module.F time_type.F
MOD_OBJ_FILES = barbi_module.o congrad_module.o tmngr.o \
                island_module.o time_type.o

# Targets

all: ${OBJ_FILES}
	$(F90) $(F90_OPTS) ${OBJ_FILES} $(MOD_OBJ_FILES) \
          -o barbi.x $(LIB_PATHS) $(LIBS)

clean:
	rm -f *.o *.f *~ *.mod *.vo V*.inc

archive:
	tar cvf barbi.tar Makefile $(FOR_FILES) $(MOD_FOR_FILES) \
            README namelist

# Dependencies

island_module.o: 
time_type.o: 
tmngr.o:          time_type.o
congrad_module.o: island_module.o 
barbi_module.o:   tmngr.o
barbi.o:          barbi_module.o
barbi_clinic.o:   barbi_module.o
barbi_tropic.o:   barbi_module.o congrad_module.o
barbi_setup.o:    barbi_module.o congrad_module.o
barbi_diag.o:     barbi_module.o
barbi_template.o: barbi_module.o


