Skip to content

Commit

Permalink
updates and added capability to select precision from Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
maul1609 committed Jun 20, 2023
1 parent 698a216 commit 79897be
Show file tree
Hide file tree
Showing 18 changed files with 252 additions and 6,868 deletions.
77 changes: 37 additions & 40 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
OSNF_DIR = osnf

.PHONY: osnf cleanall
CLEANDIRS = $(OSNF_DIR) ./


DEBUG = -fbounds-check -g
OPT =-O3

Expand All @@ -21,57 +27,48 @@ RANLIB = ranlib
OBJ = o
FFLAGS = $(OPT) $(DEBUG) -w -o
FFLAGS2 = $(DEBUG) -w -O3 -o
VAR_TYPE = 1 # 0 single, 1 double

main.exe : model_lib.a main.$(OBJ) variables.$(OBJ) initialisation.$(OBJ) \
mpi_module.$(OBJ) driver_code.$(OBJ) advection.$(OBJ)
$(FOR2) $(FFLAGS2)main.exe main.$(OBJ) variables.$(OBJ) initialisation.$(OBJ) \
mpi_module.$(OBJ) driver_code.$(OBJ) advection.$(OBJ) -lm model_lib.a \
${NETCDFLIB} -I ${NETCDFMOD} ${NETCDF_LIB} $(DEBUG)
model_lib.a : nrtype.$(OBJ) nr.$(OBJ) nrutil.$(OBJ) locate.$(OBJ) polint.$(OBJ) \
rkqs.$(OBJ) rkck.$(OBJ) odeint.$(OBJ) zbrent.$(OBJ) \
hygfx.$(OBJ) random.$(OBJ)
$(AR) rc model_lib.a nrutil.$(OBJ) locate.$(OBJ) polint.$(OBJ) \
rkqs.$(OBJ) rkck.$(OBJ) odeint.$(OBJ) zbrent.$(OBJ) \
hygfx.$(OBJ) random.$(OBJ)
locate.$(OBJ) : locate.f90
$(FOR) locate.f90 $(FFLAGS)locate.$(OBJ)
polint.$(OBJ) : polint.f90
$(FOR) polint.f90 $(FFLAGS)polint.$(OBJ)
nrtype.$(OBJ) : nrtype.f90
$(FOR) nrtype.f90 $(FFLAGS)nrtype.$(OBJ)
nr.$(OBJ) : nr.f90
$(FOR) nr.f90 $(FFLAGS)nr.$(OBJ)
nrutil.$(OBJ) : nrutil.f90
$(FOR) nrutil.f90 $(FFLAGS)nrutil.$(OBJ)
rkqs.$(OBJ) : rkqs.f90
$(FOR) rkqs.f90 $(FFLAGS)rkqs.$(OBJ)
rkck.$(OBJ) : rkck.f90
$(FOR) rkck.f90 $(FFLAGS)rkck.$(OBJ)
odeint.$(OBJ) : odeint.f90
$(FOR) odeint.f90 $(FFLAGS)odeint.$(OBJ)
zbrent.$(OBJ) : zbrent.f90
$(FOR) zbrent.f90 $(FFLAGS2)zbrent.$(OBJ)
hygfx.$(OBJ) : hygfx.for
$(FOR) hygfx.for $(FFLAGS)hygfx.$(OBJ)
random.$(OBJ) : random.f90
$(FOR) random.f90 $(FFLAGS)random.$(OBJ)
variables.$(OBJ) : variables.f90
$(FOR) variables.f90 $(FFLAGS)variables.$(OBJ)
mpi_module.$(OBJ) : mpi_module.f90
$(FOR) mpi_module.f90 $(FFLAGS)mpi_module.$(OBJ)
initialisation.$(OBJ) : initialisation.f90 random.$(OBJ) mpi_module.$(OBJ)
model_lib.a : osnf_code
$(AR) rc model_lib.a \
$(OSNF_DIR)/numerics.$(OBJ) $(OSNF_DIR)/zeroin.$(OBJ) $(OSNF_DIR)/sfmin.$(OBJ) \
$(OSNF_DIR)/fmin.$(OBJ) $(OSNF_DIR)/r1mach.$(OBJ) \
$(OSNF_DIR)/d1mach.$(OBJ) $(OSNF_DIR)/dfsid1.$(OBJ) \
$(OSNF_DIR)/poly_int.$(OBJ) $(OSNF_DIR)/find_pos.$(OBJ) \
$(OSNF_DIR)/svode.$(OBJ) \
$(OSNF_DIR)/slinpk.$(OBJ) $(OSNF_DIR)/vode.$(OBJ) \
$(OSNF_DIR)/dlinpk.$(OBJ) $(OSNF_DIR)/vode_integrate.$(OBJ) \
$(OSNF_DIR)/erfinv.$(OBJ) $(OSNF_DIR)/tridiagonal.$(OBJ) \
$(OSNF_DIR)/hygfx.$(OBJ) $(OSNF_DIR)/random.$(OBJ)
variables.$(OBJ) : variables.f90 osnf_code
$(FOR) variables.f90 -I$(OSNF_DIR) $(FFLAGS)variables.$(OBJ)
mpi_module.$(OBJ) : mpi_module.f90 osnf_code
$(FOR) mpi_module.f90 -cpp -DVAR_TYPE=$(VAR_TYPE) -I$(OSNF_DIR) $(FFLAGS)mpi_module.$(OBJ)
initialisation.$(OBJ) : initialisation.f90 mpi_module.$(OBJ) osnf_code
$(FOR) initialisation.f90 -I ${NETCDFMOD} \
$(FFLAGS)initialisation.$(OBJ)
driver_code.$(OBJ) : driver_code.f90 advection.$(OBJ) mpi_module.$(OBJ)
$(FOR) driver_code.f90 -I ${NETCDFMOD} \
$(FFLAGS)driver_code.$(OBJ)
advection.$(OBJ) : advection.f90
$(FOR) advection.f90 $(FFLAGS)advection.$(OBJ)
-I$(OSNF_DIR) $(FFLAGS)initialisation.$(OBJ)
driver_code.$(OBJ) : driver_code.f90 advection.$(OBJ) mpi_module.$(OBJ) osnf_code
$(FOR) driver_code.f90 -I$(OSNF_DIR) -I ${NETCDFMOD} $(FFLAGS)driver_code.$(OBJ)
advection.$(OBJ) : advection.f90 osnf_code
$(FOR) advection.f90 -I$(OSNF_DIR) $(FFLAGS)advection.$(OBJ)
main.$(OBJ) : main.f90 variables.$(OBJ) mpi_module.$(OBJ) initialisation.$(OBJ) \
driver_code.$(OBJ) advection.$(OBJ)
$(FOR) main.f90 -I ${NETCDFMOD} $(FFLAGS)main.$(OBJ)

clean :
osnf_code:
$(MAKE) -C $(OSNF_DIR)

clean:
rm *.exe *.o *.mod *~ \
model_lib.a

cleanall:
for i in $(CLEANDIRS); do \
$(MAKE) -C $$i clean; \
done

Loading

0 comments on commit 79897be

Please sign in to comment.