ESCOMP / ESCOMP/CMEPS

use ESMF_Version_* to get version dependent differences in CMEPS

Open
#74 2 comments 0 reactions 1 assignee Claimed by @jedwards4b View on GitHub
enhancement
Dominant language
Fortran
Stars
35
Forks
106
Avg merge
6d 5h
Merged PRs (30d)
4

Description

All of the ESMF_VERSION_* symbols are available as parameters via
"use ESMF" in Fortran code. This is documented under
https://esmf-org.github.io/dev_docs/ESMF_refdoc/node9.html#SECTION090161000000000000000.

Using the above Fortran named constants is the most portable way to code
version dependent differences in code because it does not require the
build system to get involved. I think this approach should be used
inside the CMEPS code for (ESMF_VERSION_MAJOR==8 .and.
ESMF_VERSION_MINOR>0), and it should replace the CPP #if based code.

There are cases where the CPP based #if approach is necessary -
basically for when API changes between ESMF versions will not allow
compilation under different versions. This is not the case here, and
therefore it will be much simpler to just use Fortran level logic based
on the named constants. The problem with the CPP macro based approach is
that it requires that the build system gets the variables from the
esmf.mk and then pass them in via -D option to the compiler. The NEMS
build system does this e.g. for module_EARTH_GRID_COMP.F90 and
module_MEDIATOR.F90, but not for CMEPS, which would need a change in the
CMEPS Makefile.

Again, my recommendation is to change the CMEPS version logic code to
using the ESMF_VERSION_* named constants defined by "use ESMF".

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.