diff --git a/CHANGELOG.md b/CHANGELOG.md index c77efa706ed0..5efacdf12349 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- Fixed GNU bug when defining file metadata in lat-lon grid factory + ### Added ### Changed diff --git a/base/MAPL_LatLonGridFactory.F90 b/base/MAPL_LatLonGridFactory.F90 index 37071162648e..9cf017f3784c 100644 --- a/base/MAPL_LatLonGridFactory.F90 +++ b/base/MAPL_LatLonGridFactory.F90 @@ -1825,6 +1825,7 @@ subroutine append_metadata(this, metadata) type (FileMetadata), intent(inout) :: metadata type (Variable) :: v + real(kind=REAL64), allocatable :: temp_coords(:) ! Horizontal grid dimensions call metadata%add_dimension('lon', this%im_world) @@ -1834,13 +1835,16 @@ subroutine append_metadata(this, metadata) v = Variable(type=PFIO_REAL64, dimensions='lon') call v%add_attribute('long_name', 'longitude') call v%add_attribute('units', 'degrees_east') - call v%add_const_value(UnlimitedEntity(this%get_longitudes_degrees())) + temp_coords = this%get_longitudes_degrees() + call v%add_const_value(UnlimitedEntity(temp_coords)) call metadata%add_variable('lon', v) + deallocate(temp_coords) v = Variable(type=PFIO_REAL64, dimensions='lat') call v%add_attribute('long_name', 'latitude') call v%add_attribute('units', 'degrees_north') - call v%add_const_value(UnlimitedEntity(this%get_latitudes_degrees())) + temp_coords=this%get_latitudes_degrees() + call v%add_const_value(UnlimitedEntity(temp_coords)) call metadata%add_variable('lat', v) end subroutine append_metadata