Write_DGModel2D_t Subroutine

public subroutine Write_DGModel2D_t(this, fileName)

Arguments

TypeIntentOptionalAttributesName
class(DGModel2D_t), intent(inout) :: this
character, intent(in), optional :: fileName

Calls

proc~~write_dgmodel2d_t~~CallsGraph proc~write_dgmodel2d_t Write_DGModel2D_t interface~open_hdf5 Open_HDF5 proc~write_dgmodel2d_t->interface~open_hdf5 proc~close_hdf5 Close_HDF5 proc~write_dgmodel2d_t->proc~close_hdf5 proc~creategroup_hdf5 CreateGroup_HDF5 proc~write_dgmodel2d_t->proc~creategroup_hdf5 proc~open_hdf5_parallel Open_HDF5_parallel interface~open_hdf5->proc~open_hdf5_parallel proc~open_hdf5_serial Open_HDF5_serial interface~open_hdf5->proc~open_hdf5_serial h5fclose_f h5fclose_f proc~close_hdf5->h5fclose_f h5close_f h5close_f proc~close_hdf5->h5close_f h5gcreate_f h5gcreate_f proc~creategroup_hdf5->h5gcreate_f h5lexists_f h5lexists_f proc~creategroup_hdf5->h5lexists_f h5gclose_f h5gclose_f proc~creategroup_hdf5->h5gclose_f h5open_f h5open_f proc~open_hdf5_parallel->h5open_f h5pset_fapl_mpio_f h5pset_fapl_mpio_f proc~open_hdf5_parallel->h5pset_fapl_mpio_f h5fcreate_f h5fcreate_f proc~open_hdf5_parallel->h5fcreate_f h5pcreate_f h5pcreate_f proc~open_hdf5_parallel->h5pcreate_f h5fopen_f h5fopen_f proc~open_hdf5_parallel->h5fopen_f h5pclose_f h5pclose_f proc~open_hdf5_parallel->h5pclose_f proc~open_hdf5_serial->h5open_f proc~open_hdf5_serial->h5fcreate_f proc~open_hdf5_serial->h5fopen_f

Contents

Source Code


Source Code

  subroutine Write_DGModel2D_t(this,fileName)
    implicit none
    class(DGModel2D_t),intent(inout) :: this
    character(*),optional,intent(in) :: fileName
    ! Local
    integer(HID_T) :: fileId
    character(LEN=self_FileNameLength) :: pickupFile
    character(13) :: timeStampString

    if(present(filename)) then
      pickupFile = filename
    else
      write(timeStampString,'(I13.13)') this%ioIterate
      pickupFile = 'solution.'//timeStampString//'.h5'
    endif

    print*,__FILE__//" : Writing pickup file : "//trim(pickupFile)
    call this%solution%UpdateHost()

    if(this%mesh%decomp%mpiEnabled) then

      call Open_HDF5(pickupFile,H5F_ACC_TRUNC_F,fileId,this%mesh%decomp%mpiComm)

      ! Write the interpolant to the file
      call this%solution%interp%WriteHDF5(fileId)

      ! In this section, we write the solution and geometry on the control (quadrature) grid
      ! which can be used for model pickup runs or post-processing
      ! Write the model state to file
      call CreateGroup_HDF5(fileId,'/controlgrid')
      print*," offset, nglobal_elem : ",this%mesh%decomp%offsetElem(this%mesh%decomp%rankId+1),this%mesh%decomp%nElem
      call this%solution%WriteHDF5(fileId,'/controlgrid/solution', &
                                   this%mesh%decomp%offsetElem(this%mesh%decomp%rankId+1),this%mesh%decomp%nElem)

      ! Write the geometry to file
      call this%geometry%x%WriteHDF5(fileId,'/controlgrid/geometry', &
                                     this%mesh%decomp%offsetElem(this%mesh%decomp%rankId+1),this%mesh%decomp%nElem)

      ! -- END : writing solution on control grid -- !

      call Close_HDF5(fileId)

    else

      call Open_HDF5(pickupFile,H5F_ACC_TRUNC_F,fileId)

      ! Write the interpolant to the file
      call this%solution%interp%WriteHDF5(fileId)

      ! In this section, we write the solution and geometry on the control (quadrature) grid
      ! which can be used for model pickup runs or post-processing

      ! Write the model state to file
      call CreateGroup_HDF5(fileId,'/controlgrid')
      call this%solution%WriteHDF5(fileId,'/controlgrid/solution')

      ! Write the geometry to file
      call this%geometry%x%WriteHDF5(fileId,'/controlgrid/geometry')
      ! -- END : writing solution on control grid -- !

      call Close_HDF5(fileId)

    endif

  endsubroutine Write_DGModel2D_t