forked from jedokaplan/BIOME4
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
59 lines (42 loc) · 1.38 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
FC = $(CONDA_PREFIX)/bin/gfortran
FCFLAGS = -v # Verbose output
# Use the paths from your Conda environment
# Replace <conda_env_path> with the actual path from nf-config --all
netcdf = $(CONDA_PREFIX)
# should not need to modify anything below this line
#---------------------------------------------
NC_LIB = $(netcdf)/lib
NC_INC = $(netcdf)/include
CPPFLAGS = -I$(NC_INC)
LDFLAGS = -L$(NC_LIB)
LIBS = -L/opt/homebrew/Caskroom/miniforge/base/envs/biome4 -lnetcdff -lcurl
#---------------------------------------------
OBJS = parametersmod.o \
netcdfmod.o \
coordsmod.o \
biome4.o \
biome4driver.o
#---------------------------------------------
.SUFFIXES: .o .f90 .f .mod
%.o : %.c
$(CC) $(CFLAGS) -c -o $(*F).o $(CPPFLAGS) $<
%.o : %.f
$(FC) $(FCFLAGS) -c -o $(*F).o $(CPPFLAGS) $<
%.o : %.f90
$(FC) $(FCFLAGS) -c -o $(*F).o $(CPPFLAGS) $<
all:: biome4
biome4: $(OBJS)
$(FC) $(FCFLAGS) -o biome4 $(OBJS) $(LDFLAGS) $(LIBS)
clean::
-rm *.o *.mod
# Debugging print statements
debug::
@echo "NetCDF Library Path: $(NC_LIB)"
@echo "NetCDF Include Path: $(NC_INC)"
@echo "CPPFLAGS: $(CPPFLAGS)"
@echo "LDFLAGS: $(LDFLAGS)"
@echo "LIBS: $(LIBS)"
# Check for netcdf.mod file
check::
@echo "Checking for netcdf.mod in $(NC_INC)"
@if [ -f "$(NC_INC)/netcdf.mod" ]; then echo "netcdf.mod found"; else echo "netcdf.mod not found"; fi