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

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

EXPENDABLES = pdsi
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

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

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

.SUFFIXES: .f90 .o

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

Stn: PDSI_Calculate_Stn.f90
	$(FC) -o Stn.exe PDSI_Calculate_Stn.f90 -L ${Inc}lib/ -lnetcdff -I ${Inc}include/

VnGP_APH: PDSI_Grd_BL_VnGP_APH.f90
	$(FC) -o VnGP_APH.exe PDSI_Grd_BL_VnGP_APH.f90 -L ${Inc}lib/ -lnetcdff -I ${Inc}include/

Scenario: PDSI_Grd_SCENARIOS.f90
	$(FC) -o Scenario.exe PDSI_Grd_SCENARIOS.f90 -L ${Inc}lib/ -lnetcdff -I ${Inc}include/

Sce_Ens: PDSI_Grd_SCENARIOS_Ens.f90
	$(FC) -o Sce_Ens.exe PDSI_Grd_SCENARIOS_Ens.f90 -L ${Inc}lib/ -lnetcdff -I ${Inc}include/


clean:
	rm -f *.exe

