Writes Lagrangian mesh attributes.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(silo_obj), | intent(inout) | :: | this |
A silo object |
||
| real(kind=wp), | intent(in) | :: | x1(:) |
x1-coordinates |
||
| real(kind=wp), | intent(in) | :: | x2(:) |
x2-coordinates |
||
| real(kind=wp), | intent(in) | :: | x3(:) |
x3-coordinates |
||
| integer, | intent(in) | :: | iter |
Iteration at write |
||
| real(kind=wp), | intent(in) | :: | time |
Time at write |
impure subroutine silo_obj_WriteLagrangianMesh(this,x1,x2,x3,iter,time) !> Writes Lagrangian mesh attributes. implicit none class(silo_obj), intent(inout) :: this !! A silo object real(wp), intent(in) :: x1(:) !! x1-coordinates real(wp), intent(in) :: x2(:) !! x2-coordinates real(wp), intent(in) :: x3(:) !! x3-coordinates integer, intent(in) :: iter !! Iteration at write real(wp), intent(in) :: time !! Time at write ! Work variables integer :: ierr,status character(len=SILOstr), allocatable :: names(:) integer, allocatable :: lnames(:),types(:) integer :: i,n,optlist character(len=7) :: mesh(1) ! Mesh name mesh(1)="LagMesh" ! Write using poor man's IO: sequential (serial) writes among a silo group do n=1,this%nproc_node if (n.eq.this%silo_rank) then ! Open database ierr=DBopen(this%siloname,len_trim(this%siloname),SILOdriver,DB_APPEND,this%fid_DAT) if (ierr.ne.0) call this%parallel%Stop('Error opening SILO file') ! Switch to appropriate directory ierr = DBsetdir(this%fid_DAT,this%dirname,len_trim(this%dirname)) ! Write your portion of data ierr = dbputpm(this%fid_DAT,mesh(1),len_trim(mesh(1)),3, & real(x1,leapSP),real(x2,leapSP),real(x3,leapSP), & size(x1),DB_FLOAT, DB_F77NULL, status) ! Close file so that next silo_rank can open it ierr =DBclose(this%fid_DAT) if (ierr.ne.0) call this%parallel%Stop('Error closing SILO file') end if ! Synchronize SILO ranks call MPI_BARRIER(this%silo_comm) end do ! Add mesh meta data allocate (names(this%parallel%nproc)) allocate (lnames(this%parallel%nproc)) allocate (types(this%parallel%nproc)) if (this%parallel%RankIsRoot()) then do n=1,size(mesh) do i=1,this%parallel%nproc write(names(i), '(2A,I5.5,2A,I5.5,2A)') trim(adjustl(this%filename)),'_g_',& this%group_ids(i),SILO_EXTENSION,':',mod(i-1,this%nproc_node)+1,'/',mesh(n) lnames(i)=len_trim(names(i)) types(i)=DB_POINTMESH end do ierr = DBmkoptlist(2,optlist) ierr = DBaddiopt(optlist,DBOPT_DTIME,time) ierr = DBaddiopt(optlist,DBOPT_CYCLE,iter) ierr = DBputmmesh(this%fid_VDB, mesh(n), len_trim(mesh(n)), this%parallel%nproc,names,lnames,types,optlist,ierr) ierr = DBfreeoptlist(optlist) end do end if return end subroutine silo_obj_WriteLagrangianMesh