#= Makefile for dcpam/execsrc/all-in
#
# Authors::   Yasuhiro MORIKAWA, Shin-ichi Takehiro
# Version::   $Id: Makefile,v 1.10 2025/09/18 10:00:00 takepiro Exp $
# Tag Name::  $Name:  $
# Copyright:: Copyright (C) GFD Dennou Club, 2004-2025. All rights reserved.
# License::   See COPYRIGHT[link:../../COPYRIGHT]
#
######################################################################
#
#== Settings

DIRDEPTH=../..
INCLUDEFILE = $(DIRDEPTH)/Config.mk
include $(INCLUDEFILE)

# TARGETS = sltt_extarr_test
# TARGETS_ZONAL	= sltt_extarr_test_zonal
# TARGETS_MPI	= sltt_extarr_test_mpi

TARGETS = sltt_extarr_test dcpam_main_sltt_test_dp dcpam_main_sltt_horadv dcpam_main_sltt_veradv dcpam_main_sltt_meridadv dcpam_main_sltt_zonaladv dcpam_main_spml_meridadv dcpam_main_spml_zonaladv
TARGETS_ZONAL	= $(patsubst %, %_zonal, $(TARGETS))
TARGETS_MPI	= $(patsubst %, %_mpi, $(TARGETS))

LIBSRCS    = 

# End Settings
######################################################################

######################################################################
#== Rules

all: serial zonal mpi

include $(DIRDEPTH)/rules.make

include depend

serial: $(TARGETS)

zonal: $(TARGETS_ZONAL)

mpi: $(TARGETS_MPI)

clean.local:
	-@$(RM) *.o *.mod *~ *.bak

clean.all: clean.local
	-@$(RM) $(TARGETS) $(TARGETS_ZONAL) $(TARGETS_MPI) *.nc

%o: %.f90
	$(BINDIR)/dcpamfrt -c $< -o $@

%.o: %.F90
	$(BINDIR)/dcpamfrt -c $< -o $@

%: %.f90
	$(BINDIR)/dcpamfrt $(LIBSRCS) $< -o $@

%: %.o
	$(BINDIR)/dcpamfrt $(LIBSRCS) $< -o $@

%_zonal: %.f90
	$(BINDIR)/dcpamfrt --zonal $(LIBSRCS) $< -o $@

%_zonal: %.F90
	$(BINDIR)/dcpamfrt --zonal $(LIBSRCS) $< -o $@

%_mpi: %.f90
	$(BINDIR)/dcpamfrt --mpi $(LIBSRCS) $< -o $@

%_mpi: %.F90
	$(BINDIR)/dcpamfrt --mpi $(LIBSRCS) $< -o $@

# sltt_extarr_test: $(LIBSRCS) sltt_extarr_test.f90
# 	  $(BINDIR)/dcpamfrt $^ -o $@

# sltt_extarr_test_zonal: $(LIBSRCS) sltt_extarr_test.f90
# 	  $(BINDIR)/dcpamfrt --zonal $^ -o $@

# sltt_extarr_test_mpi: $(LIBSRCS) sltt_extarr_test.f90
# 	  $(BINDIR)/dcpamfrt --mpi $^ -o $@

# dcpam_main_sltt_test_dp: $(LIBSRCS) dcpam_main_sltt_test_dp.f90
# 	  $(BINDIR)/dcpamfrt $^ -o $@

# dcpam_main_sltt_test_dp_zonal: $(LIBSRCS) dcpam_main_sltt_test_dp.f90
# 	  $(BINDIR)/dcpamfrt --zonal $^ -o $@

# dcpam_main_sltt_test_dp_mpi: $(LIBSRCS) dcpam_main_sltt_test_dp.f90
# 	  $(BINDIR)/dcpamfrt --mpi $^ -o $@

# dcpam_main_sltt_test_horadv: $(LIBSRCS) dcpam_main_sltt_test_horadv.f90
# 	  $(BINDIR)/dcpamfrt $^ -o $@

# dcpam_main_sltt_test_horadv_zonal: $(LIBSRCS) dcpam_main_sltt_test_horadv.f90
# 	  $(BINDIR)/dcpamfrt --zonal $^ -o $@

# dcpam_main_sltt_test_horadv_mpi: $(LIBSRCS) dcpam_main_sltt_test_horadv.f90
# 	  $(BINDIR)/dcpamfrt --mpi $^ -o $@

# dcpam_main_sltt_test: $(LIBSRCS) dcpam_main_sltt_test.f90
# 	  $(BINDIR)/dcpamfrt $^ -o $@

# dcpam_main_sltt_test_zonal: $(LIBSRCS) dcpam_main_sltt_test.f90
# 	  $(BINDIR)/dcpamfrt --zonal $^ -o $@

# dcpam_main_sltt_test_mpi: $(LIBSRCS) dcpam_main_sltt_test.f90
# 	  $(BINDIR)/dcpamfrt --mpi $^ -o $@

# dcpam_main_sltt: $(LIBSRCS) dcpam_main_sltt.f90
# 	  $(BINDIR)/dcpamfrt $^ -o $@

# dcpam_main_sltt_zonal: $(LIBSRCS) dcpam_main_sltt.f90
# 	  $(BINDIR)/dcpamfrt --zonal $^ -o $@

# dcpam_main_sltt_mpi: $(LIBSRCS) dcpam_main_sltt.f90
# 	  $(BINDIR)/dcpamfrt --mpi $^ -o $@

