From 4d88f8bf17aa0abd62e7578cc026c6f35aa86e13 Mon Sep 17 00:00:00 2001 From: Aidan Heerdegen Date: Fri, 4 Aug 2023 16:07:09 +1000 Subject: [PATCH] Add COSIMA_VERSION pre-processor flag for including version hash in build --- exp/MOM_compile.csh | 1 + src/mom5/ocean_core/ocean_model.F90 | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/exp/MOM_compile.csh b/exp/MOM_compile.csh index e4cd3e14d..40f6b3adf 100755 --- a/exp/MOM_compile.csh +++ b/exp/MOM_compile.csh @@ -151,6 +151,7 @@ if ( $cosima_version ) then echo "Including COSIMA version in build" # Build version. This prevents builds outside a git repo, so only enabled for COSIMA builds source ./version_compile.csh + set cppDefs = "$cppDefs -DCOSIMA_VERSION" endif # Build FMS. diff --git a/src/mom5/ocean_core/ocean_model.F90 b/src/mom5/ocean_core/ocean_model.F90 index 387515687..9942bb78e 100644 --- a/src/mom5/ocean_core/ocean_model.F90 +++ b/src/mom5/ocean_core/ocean_model.F90 @@ -334,7 +334,9 @@ module ocean_model_mod use ocean_drifters_mod, only: ocean_drifters_init, update_ocean_drifters, ocean_drifters_end use wave_types_mod, only: ocean_wave_type use ocean_wave_mod, only: ocean_wave_init, ocean_wave_end, ocean_wave_model -use version_mod, only: MOM_COMMIT_HASH +#if defined(COSIMA_VERSION) + use version_mod, only: MOM_COMMIT_HASH +#endif #if defined(ACCESS_CM) || defined(ACCESS_OM) use auscom_ice_mod, only: auscom_ice_init