NEMO, the Nucleus for European Modelling of the Ocean, is a state-of-the-art modelling framework for research and forecasting activities in ocean and climate sciences, developed since 2008 by a European consortium formed by CMCC 🇮🇹, CNRS and MOi 🇫🇷, and the Met Office and NERC 🇬🇧.
install/get_nemo.sh
is an installation script for GNU/Linux machines which prepares a building environment around the NVIDIA HPC SDK. It tries to minimise the amount of external, globally installed packages by compiling a large part of NEMO's dependences from source.
tools/Makefile
is, you guessed it, a makefile for NEMO. By default, it creates a custom configuration based on the reference SPITZ12 configuration. This new configuration includes the OPA ocean dynamical core module (OCE) but not the SI3 sea ice module (ICE), XIOS support, or MPI partitioning. There are three main targets:
SC
which builds a sequential program for single-core processors and serves as a numerical reference;MC
which builds a parallel program for multi-core processors from an OpenACC specification generated by PSyclone;GPU
which builds a GPU-ready program from the same OpenACC specification generated by PSyclone.
The original code should compile and run with -fdefault-real-8 -Ofast -ffree-line-length-none -fcray-pointer -funroll-all-loops -fmax-stack-var-size=0
. The
last option forces all arrays to be placed in static memory, aka the heap, avoiding runtime segmentation faults.
Targeting GPUs via OpenACC using gfortran should be possible but seems considerably harder. You'll need nvptx-tools and to build GCC twice, as an accelerator compiler and as an host compiler... Read more about GCC's implementation of the OpenACC specification here.