Commit 79d3f6bd authored by Carsten Lemmen's avatar Carsten Lemmen
Browse files

Added preliminary SCHISM infrastructure

parent 138943ef
# This Makefile is part of MOSSCO
#
# @copyright (C) 2022 Helmholtz-Zentrum Hereon
# @author Carsten Lemmen <carsten.lemmen@hereon.de>
#
# MOSSCO is free software: you can redistribute it and/or modify it under the
# terms of the GNU General Public License v3+. MOSSCO is distributed in the
# hope that it will be useful, but WITHOUT ANY WARRANTY. Consult the file
# LICENSE.GPL or www.gnu.org/licenses/gpl-3.0.txt for the full license terms.
#
.PHONY: schism schism-esmf
schism:
ifeq ($(wildcard $(SCHISM_DIR)/src/Hydro/schism_step.F90),)
@mkdir -p schism
export SCHISM_DIR=$(MOSSCO_DIR)/external/schism/schism
@$(GIT_CLONE) https://github.com/schism-dev/schism.git $(SCHISM_DIR)
else
@( cd $(SCHISM_DIR) && $(GIT) pull origin master)
endif
schism-esmf:
ifeq ($(wildcard $(SCHISM_ESMF_DIR)/src/schism/schism_esmf_cap.F90),)
@mkdir -p schism
export SCHISM_ESMF_DIR=$(MOSSCO_DIR)/external/schism/schism-esmf
@$(GIT_CLONE) https://github.com/schism-dev/schism.git $(SCHISM_ESMF_DIR)
else
@( cd $(SCHISM_ESMF_DIR) && $(GIT) pull origin master )
endif
# This Makefile snippet is part of MOSSCO; definition of MOSSCO-wide
# make rules
#
# @copyright (C) 2013--2021 Helmholtz-Zentrum Geesthacht
# @author Carsten Lemmen <carsten.lemmen@hzg.de>
# @copyright (C) 2021-2022 Helmholtz-Zentrum Hereon
# @copyright (C) 2013-2021 Helmholtz-Zentrum Geesthacht
# @author Carsten Lemmen <carsten.lemmen@hereon.de>
#
# MOSSCO is free software: you can redistribute it and/or modify it under the
# terms of the GNU General Public License v3+. MOSSCO is distributed in the
......@@ -29,6 +30,7 @@ AWK:=$(shell which awk 2> /dev/null)
endif
ifneq ($(strip $(AWK)),)
export AWK:=$(basename $(AWK))
$(info Using awk ... $(AWK))
endif
CMAKE:=$(shell which cmake3 2> /dev/null)
......@@ -37,6 +39,7 @@ CMAKE:=$(shell which cmake 2> /dev/null)
endif
ifneq ($(strip $(CMAKE)),)
export CMAKE:=$(basename $(CMAKE))
$(info Using cmake ... $(CMAKE))
endif
export MOSSCO_OBJC=false
......@@ -49,8 +52,12 @@ OBJC=$(shell which objcopy 2> /dev/null)
endif
ifneq ($(strip $(OBJC)),)
MOSSCO_OBJC=$(shell basename $(OBJC))
$(info Using objcopy ... $(MOSSCO_OBJC))
else
$(info Using objcopy ... no)
endif
export MOSSCO_GIT=false
ifneq ($(wildcard $(shell which git)),)
MOSSCO_GIT=true
......@@ -62,6 +69,7 @@ endif
else
$(warning Consider installing git)
endif
$(info Using git ... $(shell which git) ($(MOSSCO_GIT_VERSION)))
# System-dependent flags
ifeq ($(shell hostname),rznp0023)
......@@ -75,6 +83,7 @@ ifeq ($(shell hostname),KSEZ8002)
export AR=ar
$(warning use changed ARFLAGS=rvU)
endif
$(info Using ar ... $(AR) -$(ARFLAGS))
export MOSSCO_INSTALL_PREFIX?=$(MOSSCO_DIR)
......@@ -101,9 +110,14 @@ else
include $(ESMFMKFILE)
MOSSCO_ESMF=true
$(info Using ESMFMKFILE ... $(ESMFMKFILE))
# Find the communicator and determine whether this is parallel device, this
# is still buggy with mpiifort and needs improvement
ESMF_COMM = $(strip $(shell grep "\# ESMF_COMM:" $(ESMFMKFILE) | cut -d':' -f2-))
$(info Using ESMF_COMM ... $(ESMF_COMM))
$(info Using ESMF_F90COMPILER ... $(ESMF_F90COMPILER))
ifeq ("$(ESMF_COMM)","mpiuni")
export MOSSCO_MPI ?= false
else
......@@ -232,7 +246,7 @@ endif
export MOSSCO_CCOMPILER
# 3. Checking for the either FABM, GOTM, or GETM. Set the MOSSCO_XXXX variables
# 3. Checking for the either FABM, GOTM, GETM, SCHISM. Set the MOSSCO_XXXX variables
# of these three components to process them later
MOSSCO_FABM=false
......@@ -321,6 +335,22 @@ ifneq ($(GOTM_PREFIX),)
endif
export MOSSCO_GOTM
# 3bb SCHISM
export MOSSCO_SCHISM=false
ifdef SCHISM_ESMF_DIR
ifdef SCHISM_DIR
MOSSCO_SCHISM=true
endif
endif
# ifeq($(MOSSCO_SCHISM),true)
# export MOSSCO_SCHISM_CMAKE="-DOLDIO=ON"
# ifeq($(MOSSCO_FABM),true)
# MOSSCO_SCHISM_CMAKE="$(MOSSCO_SCHISM_CMAKE) -DUSE_FABM=ON"
# MOSSCO_SCHISM_CMAKE="$(MOSSCO_SCHISM_CMAKE) -DFABM_BASE=$(MOSSCO_FABMDIR)"
# endif
# endif
# 3c. GETM
MOSSCO_GETM=false
......@@ -366,7 +396,6 @@ ifdef GETMDIR
endif
endif
export MOSSCO_GETM
# 3d JSON library
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment