Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PaHM build files within NEMS #7

Merged
3 commits merged into from
Jun 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
226 changes: 0 additions & 226 deletions src/ENS_Cpl/ENS_CplComp_ESMFMod_STUB.f90

This file was deleted.

9 changes: 0 additions & 9 deletions src/ESMFVersionDefine.h

This file was deleted.

56 changes: 0 additions & 56 deletions src/conf/configure.nems

This file was deleted.

Empty file removed src/conf/externals.nems
Empty file.
Empty file removed src/conf/modules.nems
Empty file.
66 changes: 66 additions & 0 deletions src/incmake/component_PAHM.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
###########################################################################
### NUOPC GNUMake Macro File for the Parametric Hurricane Model (PaHM)
###
### Author: Panagiotis Velissariou <[email protected]>
### Date: June 25 2021
###########################################################################


########################################################################

# Location of the ESMF makefile fragment for this component:
pahm_mk = $(PAHM_BINDIR)/pahm.mk
all_component_mk_files+=$(pahm_mk)

# Location of source code and installation
PAHM_SRCDIR?=$(ROOTDIR)/PAHM
PAHM_BINDIR?=$(ROOTDIR)/PAHM_INSTALL

# Make sure the expected directories exist and are non-empty:
$(call require_dir,$(PAHM_SRCDIR),PAHM source directory)

########################################################################

# Rule for building this component:

build_PAHM: $(pahm_mk)

$(pahm_mk):
+cd $(PAHM_SRCDIR); exec ./build.sh --compiler=$(NEMS_COMPILER) --plat=$(NEMS_PLATFORM) \
--parallel=${NEMS_PARALLEL} --prefix=$(PAHM_BINDIR) --verbose=1
# +cd $(PAHM_SRCDIR); exec ./build.sh --compiler=$(NEMS_COMPILER) --plat=$(NEMS_PLATFORM) \
# --prefix=$(PAHM_BINDIR) --verbose=1
@if [ $$? -eq 0 ]; \
then \
cd $(PAHM_SRCDIR)/nuopc; exec $(MAKE) nuopcinstall \
DESTDIR=/ "INSTDIR=$(PAHM_BINDIR)"; \
echo ""; \
test -d "$(PAHM_BINDIR)"; \
echo ""; \
test -s $(pahm_mk); \
echo ""; \
else \
echo "ERROR: could not compile the NUOPC Cap due to PaHM build errors"; \
exit 1; \
fi

########################################################################

# Rule for cleaning the SRCDIR and BINDIR:

clean_PAHM_NUOPC:
+cd $(PAHM_SRCDIR)/nuopc; exec $(MAKE) nuopcclean
@echo ""

distclean_PAHM_NUOPC:
+cd $(PAHM_SRCDIR)/nuopc; exec $(MAKE) nuopcdistclean
@echo ""

clean_PAHM: clean_PAHM_NUOPC
+cd $(PAHM_SRCDIR); exec ./build.sh --clean=1
@echo ""

distclean_PAHM: distclean_PAHM_NUOPC
+cd $(PAHM_SRCDIR); exec ./build.sh --clean=2
rm -rf $(PAHM_BINDIR)
@echo ""
16 changes: 16 additions & 0 deletions src/module_EARTH_GRID_COMP.F90
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ MODULE module_EARTH_GRID_COMP
#endif
#ifdef FRONT_ATMESH
use FRONT_ATMESH, only: ATMESH_SS => SetServices
#endif
#ifdef FRONT_PAHM
use FRONT_PAHM, only: PAHM_SS => SetServices
#endif
! - Handle build time ICE options:
#ifdef FRONT_SICE
Expand Down Expand Up @@ -3944,6 +3947,19 @@ subroutine SetModelServices(driver, rc)
call ESMF_LogSetError(ESMF_RC_NOT_VALID, msg=msg, line=__LINE__, &
file=__FILE__, rcToReturn=rc)
return ! bail out
#endif
elseif (trim(model) == "pahm") then
#ifdef FRONT_PAHM
call NUOPC_DriverAddComp(driver, trim(prefix), PAHM_SS, &
petList=petList, comp=comp, rc=rc)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, &
line=__LINE__, file=trim(name)//":"//__FILE__)) return ! bail out
#else
write (msg, *) "Model '", trim(model), "' was requested, "// &
"but is not available in the executable!"
call ESMF_LogSetError(ESMF_RC_NOT_VALID, msg=msg, line=__LINE__, &
file=__FILE__, rcToReturn=rc)
return ! bail out
#endif
elseif (trim(model) == "nwm") then
#ifdef FRONT_NWM
Expand Down
Loading