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

mom5: use a more accurate name for an environment variable #169

Merged
merged 1 commit into from
Nov 21, 2024

Conversation

harshula
Copy link
Collaborator

While debugging an issue, I found that the variable name $SPACK_BUILD confusing because we use Spack to build MOM5 regardless of whether that variable is set to true of false.

@harshula harshula self-assigned this Nov 21, 2024
@harshula
Copy link
Collaborator Author

harshula commented Nov 21, 2024

Before merging this to main, I have to commit the following to MOM5's development branch:

diff --git a/exp/MOM_compile.csh b/exp/MOM_compile.csh
index b095b22..272054a 100755
--- a/exp/MOM_compile.csh
+++ b/exp/MOM_compile.csh
@@ -156,7 +156,7 @@ if ( $cosima_version ) then
     set cppDefs = "$cppDefs -DCOSIMA_VERSION"
 endif
 
-if ( ! $?SPACK_BUILD ) then
+if ( ! $?SPACK_FMS_EXTERNAL ) then
     echo "Building type=$type with internal FMS"
     source ./FMS_compile.csh
     set includes = "-I$code_dir/shared/include -I$executable:h:h/lib_FMS -I$executable:h:h/lib_ocean"
@@ -264,7 +264,7 @@ if( $type == ACCESS-OM || $type == ACCESS-ESM) then
     set srcList = ( $srcList access/shared )
 endif
 
-if ( ! $?SPACK_BUILD ) then
+if ( ! $?SPACK_FMS_EXTERNAL ) then
     set libs = "$libs $executable:h:h/lib_FMS/lib_FMS.a"
     if( $type == ACCESS-CM || $type == ACCESS-ESM || $type == ACCESS-OM || $type == ACCESS-OM-BGC) then
         set includes = "$includes -I$executable:h:h/lib_FMS"
diff --git a/exp/ocean_compile.csh b/exp/ocean_compile.csh
index fc17630..fda7bcf 100644
--- a/exp/ocean_compile.csh
+++ b/exp/ocean_compile.csh
@@ -10,7 +10,7 @@ if( $type == ACCESS-OM || $type == ACCESS-CM || $type == ACCESS-OM-BGC || $type
         set srcList = ( $srcList mom5/ocean_csiro_bgc )
     else if ( $type ==  ACCESS-OM || $type == ACCESS-ESM ) then
 
-        if ( ! $?SPACK_BUILD ) then
+        if ( ! $?SPACK_FMS_EXTERNAL ) then
             set srcList = ( $srcList mom5/ocean_bgc access/generic_tracers/generic_tracers access/generic_tracers/mocsy/src )
         else
             set srcList = ( $srcList mom5/ocean_bgc )

Copy link
Member

@aidanheerdegen aidanheerdegen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@harshula harshula merged commit ce7e176 into main Nov 21, 2024
1 check passed
harshula added a commit that referenced this pull request Nov 21, 2024
* The variable name $SPACK_BUILD is confusing because we use Spack to
  build MOM5 regardless of whether that variable is set to true or false.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Status: Done
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants