Skip to content

Commit 5f8a830

Browse files
committed
Bugfix for project_hexes. There is a hardwired earth_radius in addition to
the earth_radius_km that users can set in the namelist. If the two are not the same then the x,y,z locations will not be exactly on the unit sphere, and this can cause problems in other utilities. The bugfix has the algortithm use the user-input earth_radius_km everywhere.
1 parent e33c870 commit 5f8a830

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)