Creates silo files and their internal structure.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(silo_obj), | intent(inout) | :: | this |
A silo object |
||
| character(len=*), | intent(in) | :: | flag |
IO flag |
impure subroutine silo_obj_SetupGroupFiles(this,flag) !> Creates silo files and their internal structure. implicit none class(silo_obj), intent(inout) :: this !! A silo object character(len=*), intent(in) :: flag !! IO flag ! Work variables character(len=5) :: dirname integer :: n integer :: ntask integer :: status integer :: ierr ! Create SILO directories call MPI_COMM_SIZE(this%silo_comm,ntask,ierr) select case(trim(adjustl(flag))) case ("W") ! Group DB name write(this%siloname, '(3A,I5.5,A)') trim(adjustl(this%filepath)),trim(adjustl(this%filename)),'_g_',this%group_ids(this%parallel%rank%mine),SILO_EXTENSION ! Group root creates SILO database If (this%silo_rank.eq.1) then ! Create database ierr = DBcreate(this%siloname,len_trim(this%siloname),DB_CLOBBER,DB_LOCAL, & SILOinfo,len_trim(SILOinfo),SILOdriver,this%fid_DAT) if (this%fid_DAT.eq.-1) call this%parallel%Stop('Unable to create SILO file') ! Create directories for the different MPI tasks do n=1,ntask write(dirname, '(I5.5)') n ierr = DBmkdir(this%fid_DAT,dirname,len_trim(dirname),status) end do ! Close group file ierr =DBclose(this%fid_DAT) if (ierr.ne.0) call this%parallel%Stop('Error closing SILO file') end if ! Store directory name for this silo_rank write(this%dirname, '(I5.5)') this%silo_rank case default call this%parallel%Stop("SILO files can only be opened in W mode") end select ! Wait on all rank within this SILO group call MPI_BARRIER(this%silo_comm) return end subroutine silo_obj_SetupGroupFiles