

FC  =  ifort # gfortran # pgf90
#FCFLAGS = -parallel -g -qopenmp -recursive -debug extended -O0 -m64 -align all 
FCFLAGS = # -mcmodel=medium -shared-intel -O2 -pc 32 -convert big_endian
Inc = "/work/apps/intel_2016/netcdf/4.3.3.1/"

.SUFFIXES: .f90 .o

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

# XX(t,s) = EOF(t)*PCA(s)
1: Convert_sw_to_percentile.f90 
	$(FC) -o 1.exe Convert_sw_to_percentile.f90 -L ${Inc}lib/ -lnetcdff -I ${Inc}include/ ${FCFLAGS}

11: Convert_sw_to_percentile_2023-Jun.f90
	$(FC) -o 1.exe Convert_sw_to_percentile_2023-Jun.f90 -L ${Inc}lib/ -lnetcdff -I ${Inc}include/ ${FCFLAGS}

2: Convert_Pentad_sw_to_percentile.f90 
	$(FC) -o 1.exe Convert_Pentad_sw_to_percentile.f90 -L ${Inc}lib/ -lnetcdff -I ${Inc}include/ ${FCFLAGS}

#  Tinh characteristics cho ca chuoi pentad 60 nam:
3: Chars_Flash_Dr_60y.f90 
	$(FC) -o 1.exe Chars_Flash_Dr_60y.f90 -L ${Inc}lib/ -lnetcdff -I ${Inc}include/ ${FCFLAGS}

#  Tinh characteristics cho chuoi pentad tung 5 nam: 
4: Chars_Flash_Dr_1.f90
	$(FC) -o 1.exe Chars_Flash_Dr_1.f90 -L ${Inc}lib/ -lnetcdff -I ${Inc}include/ ${FCFLAGS}

#  Tinh characteristics cho chuoi daily (tung 1 hoac 5 nam) bang phuong phap moi:
5: Chars_Flash_Dr_Tan.f90
	$(FC) -o 1.exe Chars_Flash_Dr_Tan.f90 -L ${Inc}lib/ -lnetcdff -I ${Inc}include/ ${FCFLAGS}

6: Chars_Flash_Dr_Tan_New.f90
	$(FC) -o 1.exe Chars_Flash_Dr_Tan_New.f90 -L ${Inc}lib/ -lnetcdff -I ${Inc}include/ ${FCFLAGS}

7: Chars_Flash_Dr_Tan_New_2023_May.f90
	$(FC) -o 1.exe Chars_Flash_Dr_Tan_New_2023_May.f90 -L ${Inc}lib/ -lnetcdff -I ${Inc}include/ ${FCFLAGS}

clean:
	rm *.exe  # *.o  *.mod
