Skip to content

Fix HorzIJ in MAPL3G to get local indices#4960

Open
bena-nasa wants to merge 5 commits into
developfrom
feature/bmauer/mapl3_horzij_local_fix
Open

Fix HorzIJ in MAPL3G to get local indices#4960
bena-nasa wants to merge 5 commits into
developfrom
feature/bmauer/mapl3_horzij_local_fix

Conversation

@bena-nasa
Copy link
Copy Markdown
Collaborator

@bena-nasa bena-nasa commented May 22, 2026

This fixes the "hozij" routines in MAPL3 so that they now have an option to return the local indices. When they were ported from MAPL2 they were erroneously implement to only give global coordinates. This did require passing the GEOM down to the layer that computes the indices as I need to know the global bounds of the domain to compute the local from the global

I add an option (local_indices, default false) so the user can control which they get. If not passed it still returns the global indices

I added unit tests.

Types of change(s)

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Trivial change (affects only documentation or cleanup)
  • Refactor (no functional changes, no api changes)

Checklist

  • Tested this change with a run of GEOSgcm
  • Ran the Unit Tests (make tests)

Description

Related Issue

@bena-nasa bena-nasa requested a review from tclune May 22, 2026 14:42
@bena-nasa bena-nasa requested a review from a team as a code owner May 22, 2026 14:42
@bena-nasa bena-nasa added 🎁 New Feature This is a new feature 0 Diff The changes in this pull request have verified to be zero-diff with the target branch. 📈 MAPL3 MAPL 3 Related Changelog Skip Skips the Changelog Enforcer labels May 22, 2026
@mathomp4
Copy link
Copy Markdown
Member

Looks like GNU is unhappy:

/__w/MAPL/MAPL/build/infrastructure/geom/geom/XY/XYGeomSpec_SMOD_get_horz_ij_index.F90:3:26:

    3 | submodule (mapl_XYGeomSpec) get_horz_ij_index_smod
      |                          1
    4 |    use mapl_ErrorHandlingMod
    5 |    use ESMF, only: ESMF_Geom
      |                            2
Error: Symbol 'esmf_geom' at (1) conflicts with the symbol at (2)
gmake[2]: *** [infrastructure/geom/geom/CMakeFiles/MAPL.geom.dir/build.make:1778: infrastructure/geom/geom/CMakeFiles/MAPL.geom.dir/XY/XYGeomSpec_SMOD_get_horz_ij_index.F90.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
gmake[1]: *** [CMakeFiles/Makefile2:7764: infrastructure/geom/geom/CMakeFiles/MAPL.geom.dir/all] Error 2
gmake: *** [Makefile:166: all] Error 2

@bena-nasa
Copy link
Copy Markdown
Collaborator Author

Looks like GNU is unhappy:

/__w/MAPL/MAPL/build/infrastructure/geom/geom/XY/XYGeomSpec_SMOD_get_horz_ij_index.F90:3:26:

    3 | submodule (mapl_XYGeomSpec) get_horz_ij_index_smod
      |                          1
    4 |    use mapl_ErrorHandlingMod
    5 |    use ESMF, only: ESMF_Geom
      |                            2
Error: Symbol 'esmf_geom' at (1) conflicts with the symbol at (2)
gmake[2]: *** [infrastructure/geom/geom/CMakeFiles/MAPL.geom.dir/build.make:1778: infrastructure/geom/geom/CMakeFiles/MAPL.geom.dir/XY/XYGeomSpec_SMOD_get_horz_ij_index.F90.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
gmake[1]: *** [CMakeFiles/Makefile2:7764: infrastructure/geom/geom/CMakeFiles/MAPL.geom.dir/all] Error 2
gmake: *** [Makefile:166: all] Error 2

ok, I'll try the GNU build, had not tried that

@bena-nasa
Copy link
Copy Markdown
Collaborator Author

Looks like GNU is unhappy:

/__w/MAPL/MAPL/build/infrastructure/geom/geom/XY/XYGeomSpec_SMOD_get_horz_ij_index.F90:3:26:

    3 | submodule (mapl_XYGeomSpec) get_horz_ij_index_smod
      |                          1
    4 |    use mapl_ErrorHandlingMod
    5 |    use ESMF, only: ESMF_Geom
      |                            2
Error: Symbol 'esmf_geom' at (1) conflicts with the symbol at (2)
gmake[2]: *** [infrastructure/geom/geom/CMakeFiles/MAPL.geom.dir/build.make:1778: infrastructure/geom/geom/CMakeFiles/MAPL.geom.dir/XY/XYGeomSpec_SMOD_get_horz_ij_index.F90.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
gmake[1]: *** [CMakeFiles/Makefile2:7764: infrastructure/geom/geom/CMakeFiles/MAPL.geom.dir/all] Error 2
gmake: *** [Makefile:166: all] Error 2

ok, I'll try the GNU build, had not tried that

Fixed I think

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

0 Diff The changes in this pull request have verified to be zero-diff with the target branch. Changelog Skip Skips the Changelog Enforcer 📈 MAPL3 MAPL 3 Related 🎁 New Feature This is a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants