ground_write_data Subroutine

private subroutine ground_write_data(this, file_id, group_name, error)

Writes the state of the ground object to an HDF file in the specified group.

Arguments

Type IntentOptional AttributesName
class(ground), intent(in) :: this
integer(kind=hid_t), intent(in) :: file_id

The identifier for the HDF5 file/group in which this data is meant to be written.

character(len=*), intent(in) :: group_name

The name to give the group in the HDF5 file storing the ground's data.

integer, intent(out) :: error

Flag indicating whether routine ran without error. If no error occurs then has value 0.


Calls

proc~~ground_write_data~~CallsGraph proc~ground_write_data ground_write_data h5gclose_f h5gclose_f proc~ground_write_data->h5gclose_f h5gcreate_f h5gcreate_f proc~ground_write_data->h5gcreate_f

Contents

Source Code


Source Code

  subroutine ground_write_data(this,file_id,group_name,error)
    !* Author: Chris MacMackin
    !  Date: November 2016
    !
    ! Writes the state of the ground object to an HDF file in the
    ! specified group.
    !
    class(ground), intent(in)    :: this
    integer(hid_t), intent(in)   :: file_id
      !! The identifier for the HDF5 file/group in which this data is
      !! meant to be written.
    character(len=*), intent(in) :: group_name
      !! The name to give the group in the HDF5 file storing the
      !! ground's data.
    integer, intent(out)         :: error
      !! Flag indicating whether routine ran without error. If no
      !! error occurs then has value 0.
    integer(hid_t) :: group_id
    call h5gcreate_f(file_id, group_name, group_id, error)
    if (error /= 0) then
      write(*,*) 'WARNING: Error code',error,' returned when creating HDF '// &
                 'group', group_name
      write(*,*) '         Data IO not performed for ice shelf'
      return
    end if

    call h5gclose_f(group_id, error)
    if (error /= 0) then
      write(*,*) 'WARNING: Error code',error,' returned when closing HDF '// &
                 'group', group_name
      write(*,*) '         Possible bad IO'
    end if
  end subroutine ground_write_data