
FC  =  ifort # gfortran # pgf90
Inc = "/work/apps/intel_2016/netcdf/4.3.3.1/"

########## Compile pdsi from pdsi.cpp ##########

EXPENDABLES = pdsi.exe
LFLAGS = -mno-align-stringops # -mno-cygwin

#pdsicc: pdsi.cpp 
#	g++ $(LFLAGS) -O pdsi.cpp -g -o pdsi

#clean:
#	rm -f $(EXPENDABLES)
#	g++ $(LFLAGS) -O pdsi.cpp -g -o pdsi

pdsi_exe: pdsi.cpp
	rm -f $(EXPENDABLES)
	g++ $(LFLAGS) -O pdsi.cpp -g -o pdsi.exe

############# Compile Fortran Prog ############

.SUFFIXES: .f90 .o

.f90.o:
	$(FC) -c $*.f90

# Chuong trinh tinh Dought Index theo ca 3 chi so PDSI, SPI va SPEI su dung SL APHRODITE giai doan 1976-2005:
# SL Aphrodite (1976-2005):

cru: Dr_Grd_GPCC_CRU_2021-Sep.f90
	$(FC) -o cru.exe Dr_Grd_GPCC_CRU_2021-Sep.f90 -L ${Inc}lib/ -lnetcdff -I ${Inc}include/

reg: Dr_Grd_GPCC_CRU_2021-Sep_Reg.f90
	$(FC) -o cru.exe Dr_Grd_GPCC_CRU_2021-Sep_Reg.f90 -L ${Inc}lib/ -lnetcdff -I ${Inc}include/

clean:
	rm -f *.exe

