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

Changes needed to allow GNU build of wave GEOS #4

Closed

Conversation

mathomp4
Copy link
Member

@mathomp4 mathomp4 commented Jan 5, 2024

Working off of the components in GEOS-ESM/GEOSgcm#724, this PR along with GEOS-ESM/GEOSgcm_GridComp#876 contains changes needed to allow Wave GEOS to build with GNU.

The change is a small one in wmmaplmd.ftn:

diff --git a/model/ftn/wmmaplmd.ftn b/model/ftn/wmmaplmd.ftn
index 218a927a..c0f3347a 100644
--- a/model/ftn/wmmaplmd.ftn
+++ b/model/ftn/wmmaplmd.ftn
@@ -144,7 +144,10 @@
       use WMWAVEMD, only: WMWAVE
       use WMFINLMD, only: WMFINL
       use WMMDATMD
-      use W3GDATMD
+      ! We rename the derived type GRID from W3GDATMD to W3GRID to avoid
+      ! a name clash with an ESMF_Grid called "grid" declared below.
+      ! This was detected by GNU
+      use W3GDATMD, W3GRID => GRID
       use W3IDATMD
       use W3ODATMD
       use W3WDATMD

GNU was erroring out with:

/discover/swdev/mathomp4/Models/GEOSgcm-AntonWave-GNU/GEOSgcm/build-Release/src/Components/@GEOSgcm_GridComp/GEOSwgcm_GridComp/GEOSwavewatch_GridComp/ww3_multi_esmf/wmmaplmd.F90:2156:37:

 2156 |       call ESMF_GridCompGet(gc, grid=grid, __RC__)
      |                                     1
Error: Derived type 'grid' is used as an actual argument at (1)
/discover/swdev/mathomp4/Models/GEOSgcm-AntonWave-GNU/GEOSgcm/build-Release/src/Components/@GEOSgcm_GridComp/GEOSwgcm_GridComp/GEOSwavewatch_GridComp/ww3_multi_esmf/wmmaplmd.F90:2157:30:

 2157 |       call MAPL_Grid_Interior(grid, i1, in, j1, jn)
      |                              1
Error: Derived type 'grid' is used as an actual argument at (1)

This is because the use W3GDATMD was bringing in a GRID derived type. So, in consult with @tclune we just rename the GRID coming from W3GDATMD to W3GRID so there is no conflict. (The other way around is to rename the ESMF_Grid...)

@mathomp4 mathomp4 requested a review from adarmenov January 5, 2024 18:57
@mathomp4 mathomp4 closed this Jan 5, 2024
@mathomp4 mathomp4 deleted the bugfix/mathomp4/gnu-cmake-fixes-whitespace branch January 5, 2024 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant