Skip to content

Commit

Permalink
buble up error from MAPL_getHorzIJindex function
Browse files Browse the repository at this point in the history
  • Loading branch information
weiyuan-jiang committed May 28, 2024
1 parent 4b30c9d commit 7a97944
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- Propgated the error message from MAPL_Horzijindex function
- fixed a bug in generate_newnxy in MAPL_SwathGridFactory.F90 (NX*NY=Ncore)
- pFIO Clients don't send "Done" message when there is no request
- Update `components.yaml`
Expand Down
7 changes: 5 additions & 2 deletions base/Base/Base_Base_implementation.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2629,7 +2629,7 @@ module subroutine MAPL_GetHorzIJIndex(npts,II,JJ,lon,lat,lonR8,latR8,Grid, rc)
call ESMF_AttributeGet(grid, name='GridType', value=grid_type, _RC)
if(trim(grid_type) == "Cubed-Sphere") then

call MAPL_GetGlobalHorzIJIndex(npts, II, JJ, lon=lon, lat=lat, lonR8=lonR8, latR8=latR8, Grid=Grid, rc=rc)
call MAPL_GetGlobalHorzIJIndex(npts, II, JJ, lon=lon, lat=lat, lonR8=lonR8, latR8=latR8, Grid=Grid, _RC)

call MAPL_Grid_Interior(Grid,i1,i2,j1,j2)
! convert index to local, if it is not in domain, set it to -1 just as the legacy code
Expand Down Expand Up @@ -2770,7 +2770,10 @@ module subroutine MAPL_GetGlobalHorzIJIndex(npts,II,JJ,lon,lat,lonR8,latR8,Grid,

! make sure the grid can be used in this subroutine
good_grid = grid_is_ok(grid)
_ASSERT( good_grid, "MAPL_GetGlobalHorzIJIndex cannot handle this grid")

if ( .not. good_grid ) then
_FAIL( "MAPL_GetGlobalHorzIJIndex cannot handle this grid")
endif

allocate(lons(npts),lats(npts))
if (present(lon) .and. present(lat)) then
Expand Down

0 comments on commit 7a97944

Please sign in to comment.