solid_set_SetWriteFileName Subroutine

private pure subroutine solid_set_SetWriteFileName(this, name)

Sets the names of files to write.

Type Bound

solid_set

Arguments

Type IntentOptional Attributes Name
class(solid_set), intent(inout) :: this

A collection of solids

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

Name of file


Called by

proc~~solid_set_setwritefilename~~CalledByGraph proc~solid_set_setwritefilename solid_set%solid_set_SetWriteFileName proc~solid_set_init solid_set%solid_set_Init proc~solid_set_init->proc~solid_set_setwritefilename

Source Code

    pure subroutine solid_set_SetWriteFileName(this,name)
      !> Sets the names of files to write.
      implicit none
      class(solid_set), intent(inout) :: this                                  !! A collection of solids
      character(len=*), intent(in)    :: name                                  !! Name of file
      ! Work variables
      integer :: pos,n

      ! Store the base name with no extensions
      pos=scan(trim(adjustl(name)),".",BACK=.true.)
      if (pos.gt.0) then
        this%write_file=name(1:pos-1)
      else
        this%write_file=name
      end if

      do n=1,this%count
        write(this%p(n)%write_file,fmt='(a,i6.6,a)')trim(adjustl(this%write_file))//'_',n,'.h5'
      end do

      this%write_file=trim(adjustl(this%write_file))//'.h5'
      return
    end subroutine solid_set_SetWriteFileName