Skip to content

Commit 511dad3

Browse files
committed
Merge branch 'hexagon_projections' (PR #626)
This merge removes an instance of a hard-wired earth radius in project_hexes, addressing a potential inconsistency that could lead to Cartesian coordiantes of elements that do not lie on the surface of the unit sphere. In turn, this could lead, for example, to failures when processing static fields in the MPAS-Model init_atmosphere core. Now, the user-specified earth_radius_km value is used consistently throughout the code where a sphere radius value is required.
2 parents 57cd039 + 5f8a830 commit 511dad3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

mesh_tools/hex_projection/project_hexes.f90

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ program project_hexes
5757
integer, allocatable, dimension(:) :: indexToCellID, indexToVertexID, indexToEdgeID
5858

5959
real(dp), allocatable, dimension(:) :: dcEdge, dvEdge
60-
real(dp), parameter :: earth_radius = 6378.14_dp*1000.0_dp ! meters
60+
real(dp) :: earth_radius
6161
real(dp) :: invRadius, invRadius2
6262

6363
real(dp) :: nominalMinDc
@@ -878,6 +878,7 @@ program project_hexes
878878

879879
! set mesh on a unit sphere - this is what init_atmosphere expects - it will expand it to the full sphere.
880880

881+
earth_radius = 1000.0_dp*earth_radius_km
881882
invRadius = 1.0_dp/earth_radius
882883
invRadius2 = invRadius*invRadius
883884

0 commit comments

Comments
 (0)