Skip to content

Commit

Permalink
Merge pull request #2689 from GEOS-ESM/merge/handmerge/r21c-into-mapldev
Browse files Browse the repository at this point in the history
Merge R21C into develop: Compress lats and lons in CS output if deflate requested
  • Loading branch information
tclune authored Mar 28, 2024
2 parents 486b72f + b1a7a3a commit a9aa9d7
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

- Fix inconsistency in History output so that multi-dimensional coordinate variables are also compressed if requested in the collection
- Minor workaround to enable NAG 7.2.01 to compile. (Reproducer submitted to NAG.)
- Fixed bug with split restart files
- Removed unnecessary memory allocation for tile reads. This is critical for high res runs on SCU17
Expand Down
9 changes: 9 additions & 0 deletions griddedio/GriddedIO.F90
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ subroutine CreateFileMetaData(this,items,bundle,timeInfo,vdata,ogrid,global_attr
integer :: metadataVarsSize
type(StringStringMapIterator) :: s_iter
character(len=:), pointer :: attr_name, attr_val
class(Variable), pointer :: coord_var
integer :: status

if ( allocated (this%metadata) ) deallocate(this%metadata)
Expand Down Expand Up @@ -164,6 +165,14 @@ subroutine CreateFileMetaData(this,items,bundle,timeInfo,vdata,ogrid,global_attr
factory => get_factory(this%output_grid,rc=status)
_VERIFY(status)
call factory%append_metadata(this%metadata)
coord_var => this%metadata%get_variable('lons')
if (associated(coord_var)) call coord_var%set_deflation(this%deflateLevel)
coord_var => this%metadata%get_variable('lats')
if (associated(coord_var)) call coord_var%set_deflation(this%deflateLevel)
coord_var => this%metadata%get_variable('corner_lons')
if (associated(coord_var)) call coord_var%set_deflation(this%deflateLevel)
coord_var => this%metadata%get_variable('corner_lats')
if (associated(coord_var)) call coord_var%set_deflation(this%deflateLevel)


if (present(vdata)) then
Expand Down
7 changes: 7 additions & 0 deletions pfio/Variable.F90
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ module pFIO_VariableMod

procedure :: get_chunksizes
procedure :: get_deflation
procedure :: set_deflation
procedure :: get_quantize_algorithm
procedure :: get_quantize_level
procedure :: is_attribute_present
Expand Down Expand Up @@ -292,6 +293,12 @@ function get_deflation(this) result(deflateLevel)
deflateLevel=this%deflation
end function get_deflation

subroutine set_deflation(this,deflate_level)
class (Variable), target, intent(inout) :: this
integer, intent(in) :: deflate_level
this%deflation = deflate_level
end subroutine

function get_quantize_algorithm(this) result(quantizeAlgorithm)
class (Variable), target, intent(In) :: this
integer :: quantizeAlgorithm
Expand Down

0 comments on commit a9aa9d7

Please sign in to comment.