Skip to content

Add support to build MOM5 with an external FMS and Generic Tracers using Spack #29

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

harshula
Copy link

  • Ideally we should use a better build system. However, this appears to be the
    least intrusive and simple way to introduce this feature.

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

FYI, I decided not to include this commit in this PR for the sake of simplicity:

commit a830e525565902b89faeb4d5fde65d187f7a3139 (dev_backup)
Author: Harshula Jayasuriya <harshula.jayasuriya@anu.edu.au>
Date:   Fri Nov 22 17:37:37 2024 +1100

    Ready for review

diff --git a/exp/MOM_compile.csh b/exp/MOM_compile.csh
index d72f477..8de451b 100755
--- a/exp/MOM_compile.csh
+++ b/exp/MOM_compile.csh
@@ -158,12 +158,14 @@ endif
 
 if ( ! $?SPACK_GTRACERS_EXTERNAL ) then
     echo "Building type=$type with internal FMS"
+    # Build FMS.
     source ./FMS_compile.csh
-    set includes = "-I$code_dir/shared/include -I$executable:h:h/lib_FMS -I$executable:h:h/lib_ocean"
+    set includes = "-I$executable:h:h/lib_FMS"
 else
     echo "Building type=$type with external FMS"
-    set includes = "-I$code_dir/shared/include -I$executable:h:h/lib_ocean"
+    set includes = ""
 endif
+set includes = "$includes -I$code_dir/shared/include -I$executable:h:h/lib_ocean"
 
 if ( $cosima_version ) then
     set includes = "$includes -I$executable:h:h/lib_version/"
diff --git a/exp/ocean_compile.csh b/exp/ocean_compile.csh
index 5eb000a..58f7887 100644
--- a/exp/ocean_compile.csh
+++ b/exp/ocean_compile.csh
@@ -9,13 +9,10 @@ if( $type == ACCESS-OM || $type == ACCESS-CM || $type == ACCESS-OM-BGC || $type
     if( $type ==  ACCESS-OM-BGC ) then
         set srcList = ( $srcList mom5/ocean_csiro_bgc )
     else if ( $type ==  ACCESS-OM || $type == ACCESS-ESM ) then
-
+        set srcList = ( $srcList mom5/ocean_bgc )
         if ( ! $?SPACK_GTRACERS_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 )
+            set srcList = ( $srcList access/generic_tracers/generic_tracers access/generic_tracers/mocsy/src )
         endif
-
     endif
     mkdir -p $executable:h:h/$type/$lib_name
     cd $executable:h:h/$type/$lib_name

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.

Line 150 sets lib_include_dirs which is used in all the component build scripts

set lib_include_dirs = "$root/include $code_dir/shared/include $code_dir/shared/mpp/include"

I think it should also be bracketed with logic to test for external FMS.

@dougiesquire
Copy link

dougiesquire commented Apr 24, 2025

What's holding up getting this merged @harshula? Is it just waiting for final review/approval?

@harshula
Copy link
Author

Hi @dougiesquire , Originally it was a hack in-order to test the generic tracers. I'm not happy with the changes that I made. Can you and @aidanheerdegen work on this and come up with a neater solution? I'll drop my commits in the development branch.

@harshula harshula removed their assignment Apr 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Status: No status
Status: No status
Development

Successfully merging this pull request may close these issues.

3 participants