Skip to content

Commit

Permalink
ice_grid: do call 'gridbox_verts' for rectangular grids (#749)
Browse files Browse the repository at this point in the history
At the end of subroutine ice_grid::gridbox_corners, the arrays
'lont_bounds' and 'lonu_bounds', which contain the longitude of the
corners of each grid cell on the T and U grids, are converted to to the
[0, 360] range.

In the case of rectangular grids ('grid_type = rectangular'), at the
point where 'gridbox_corners' is called in 'init_grid2', 'lont_bounds'
is not initialized, causing the code to abort if compiling with NaN
initialization. This is due to the fact that 'gridbox_verts', which
initializes 'lont_bounds' and 'latt_bounds', is not called in
'rectgrid', whereas it is called in 'popgrid[_nc]'.

Do call 'gridbox_verts' in 'rectgrid', so that 'lont_bounds' and
'latt_bounds' are correctly initalized in that case also.

Note that these calls are also missing in 'latlongrid' and 'cpomgrid',
but since these two subroutines are not used in standalone
configuration, let's not bother for now.
  • Loading branch information
phil-blain authored Aug 12, 2022
1 parent 5a1701c commit 08c6b33
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cicecore/cicedynB/infrastructure/ice_grid.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1404,6 +1404,7 @@ subroutine rectgrid
enddo
work_g1(:,:) = work_g1(:,:) / rad_to_deg
endif
call gridbox_verts(work_g1,lont_bounds)
call scatter_global(ULON, work_g1, master_task, distrb_info, &
field_loc_NEcorner, field_type_scalar)
call ice_HaloExtrapolate(ULON, distrb_info, &
Expand All @@ -1423,6 +1424,7 @@ subroutine rectgrid
enddo
work_g1(:,:) = work_g1(:,:) / rad_to_deg
endif
call gridbox_verts(work_g1,latt_bounds)
call scatter_global(ULAT, work_g1, master_task, distrb_info, &
field_loc_NEcorner, field_type_scalar)
call ice_HaloExtrapolate(ULAT, distrb_info, &
Expand Down

0 comments on commit 08c6b33

Please sign in to comment.