diff --git a/CHANGELOG.md b/CHANGELOG.md index a288e5807a2c..55796ff4f4c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] ### Added +- Added procedures to remove an attribute from a FileMetadata object and from a Variable object in PFIO - Add per-collection timer output for History - Add python utilities to split and recombine restarts - Add a new "SPLIT\_CHECKPOINT:" option that has replaced the write-by-face option. This will write a file per writer wit the base checkpoint name being a control file that tells how many files were written to. On reading if this control file is provided as the restart file name, it will automatically trigger reading the individual files diff --git a/pfio/FileMetadata.F90 b/pfio/FileMetadata.F90 index b453fcbb30af..d90d7ede533a 100644 --- a/pfio/FileMetadata.F90 +++ b/pfio/FileMetadata.F90 @@ -44,6 +44,7 @@ module pFIO_FileMetadataMod procedure :: add_attribute_1d procedure :: get_attribute procedure :: has_attribute + procedure :: remove_attribute procedure :: get_variable procedure :: get_coordinate_variable @@ -87,7 +88,7 @@ function new_FileMetadata(unusable, dimensions, global, variables, order) result type (StringVector), optional, intent(in) :: order - + fmd%dimensions = StringIntegerMap() if (present(dimensions)) fmd%dimensions = dimensions @@ -235,6 +236,14 @@ logical function has_attribute(this, attr_name) end function has_attribute + subroutine remove_attribute(this, attr_name) + class (FileMetadata), target, intent(inout) :: this + character(len=*), intent(in) :: attr_name + + call this%global_var%remove_attribute(attr_name) + + end subroutine + function get_attributes(this, rc ) result(attributes) type (StringAttributeMap), pointer :: attributes diff --git a/pfio/Variable.F90 b/pfio/Variable.F90 index 326fbfbd27bd..ae6a5c7bcafb 100644 --- a/pfio/Variable.F90 +++ b/pfio/Variable.F90 @@ -43,6 +43,7 @@ module pFIO_VariableMod generic :: add_attribute => add_attribute_1d procedure :: add_attribute_0d procedure :: add_attribute_1d + procedure :: remove_attribute procedure :: add_const_value procedure :: get_chunksizes @@ -182,6 +183,17 @@ function get_attributes(this) result(attributes) end function get_attributes + subroutine remove_attribute(this,attr_name,rc) + class (Variable), target, intent(inout) :: this + character(len=*), intent(in) :: attr_name + integer, optional, intent(out) :: rc + type(StringAttributeMapIterator) :: iter + integer :: status + + iter = this%attributes%find(attr_name) + call this%attributes%erase(iter) + _RETURN(_SUCCESS) + end subroutine subroutine add_attribute_0d(this, attr_name, attr_value, rc) class (Variable), target, intent(inout) :: this