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

Fix for mesh check in CESM driver #830

Merged
merged 5 commits into from
Jun 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions cicecore/drivers/nuopc/cmeps/ice_mesh_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ subroutine ice_mesh_check(gcomp, ice_mesh, rc)

! Check CICE mesh

use ice_constants, only : c1,c0,c360
use ice_constants, only : c1,c0,c180,c360
use ice_grid , only : tlon, tlat, hm

! input/output parameters
Expand All @@ -583,7 +583,7 @@ subroutine ice_mesh_check(gcomp, ice_mesh, rc)
real(dbl_kind) :: diff_lon
real(dbl_kind) :: diff_lat
real(dbl_kind) :: rad_to_deg
real(dbl_kind) :: tmplon, eps_imesh
real(dbl_kind) :: eps_imesh
logical :: isPresent, isSet
logical :: mask_error
integer :: mask_internal
Expand Down Expand Up @@ -637,19 +637,19 @@ subroutine ice_mesh_check(gcomp, ice_mesh, rc)
lon(n) = tlon(i,j,iblk)*rad_to_deg
lat(n) = tlat(i,j,iblk)*rad_to_deg

tmplon = lon(n)
if(tmplon < c0)tmplon = tmplon + c360

! error check differences between internally generated lons and those read in
diff_lon = abs(mod(lonMesh(n) - tmplon,360.0))
if (diff_lon > eps_imesh ) then
write(6,100)n,lonMesh(n),tmplon, diff_lon
!call abort_ice(error_message=subname, file=__FILE__, line=__LINE__)
diff_lon = mod(abs(lonMesh(n) - lon(n)),360.0)
if (diff_lon > c180) then
diff_lon = diff_lon - c360
endif
if (abs(diff_lon) > eps_imesh ) then
write(6,100)n,lonMesh(n),lon(n), diff_lon
call abort_ice(error_message=subname, file=__FILE__, line=__LINE__)
end if
diff_lat = abs(latMesh(n) - lat(n))
if (diff_lat > eps_imesh) then
write(6,101)n,latMesh(n),lat(n), diff_lat
!call abort_ice(error_message=subname, file=__FILE__, line=__LINE__)
call abort_ice(error_message=subname, file=__FILE__, line=__LINE__)
end if
enddo
enddo
Expand Down