⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 test_checkpoint_mpiio.f90

📁 做网格的好程序
💻 F90
📖 第 1 页 / 共 4 页
字号:
      call mpi_amr_comm_setup(mype,nprocs, &      &                        lguard,lprolong,lflux,ledge, &      &                        lrestrict,lfulltree, &      &                        iopt,lcc,lfc,lec,lnc,tag_offset)      write(*,*) 'pe ',mype,' exiting 1blk_guardcell_setup in main'      endif                     ! no_permanent_guardcells!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!      if(mype.eq.0) write(*,*) 'Start of automatic testing.'      Call MPI_BARRIER(MPI_COMM_WORLD, ierr)!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! test of unk communications      do ii=0,nprocs-1      if(mype.eq.ii) then      do l=1,lnblocks      if (no_permanent_guardcells) then      iopt = 1      nlayers = nguard       lcc = .true.      lfc = .false.      lec = .false.      lnc = .false.      l_srl_only = .false.      icoord = 0      ldiag = .false.      ldiag = diagonals      if(nodetype(l).eq.1 .or. advance_all_levels) then      call amr_1blk_guardcell(mype,iopt,nlayers,l,mype, &      &                        lcc,lfc,lec,lnc, &      &                        l_srl_only,icoord,ldiag)      endif      else                      ! no_permanent_guardcells#ifndef NO_PERMANENT_GUARDCELLS      unk1(:,:,:,:,1) = unk(:,:,:,:,l)#endif      endif                     ! no_permanent_guardcells      if(nodetype(l).eq.1 .or. advance_all_levels) then      ilbnd=il_bnd1      iubnd=iu_bnd1      jlbnd=jl_bnd1      jubnd=ju_bnd1      klbnd=kl_bnd1      kubnd=ku_bnd1      if(neigh(1,1,l).le.-20) ilbnd=1+nguard      if(neigh(1,2,l).le.-20) iubnd=nxb+nguard      if(neigh(1,3,l).le.-20) jlbnd=1+nguard      if(neigh(1,4,l).le.-20) jubnd=nyb+nguard      if(ndim.eq.3) then      if(neigh(1,5,l).le.-20) klbnd=1+nguard      if(neigh(1,6,l).le.-20) kubnd=nzb+nguard      endif      if (.not.l_with_guardcells) then         ilbnd = 1+nguard         iubnd = nxb+nguard         jlbnd = 1+nguard         jubnd = nyb+nguard         if (ndim == 3) then            klbnd = 1+nguard            kubnd = nzb+nguard         end if      end if      if(ndim.eq.3) dz = bsize(3,l)/real(nzb)      dy = bsize(2,l)/real(nyb)      dx = bsize(1,l)/real(nxb)      if(mod(nxb,2).eq.1) then       if(ndim.eq.3) dz = bsize(3,l)/real(nzb-k3d)       dy = bsize(2,l)/real(nyb-1)       dx = bsize(1,l)/real(nxb-1)      endif      do k=klbnd,kubnd      if(ndim.eq.3) then       z0 = coord(3,l)-.5*(bsize(3,l)+dz)       if(mod(nxb,2).eq.1) z0 = coord(3,l)-(.5*bsize(3,l)+dz)      endif      zk = z0 + dz*real(k-nguard)       do j=jlbnd,jubnd       y0 = coord(2,l)-.5*(bsize(2,l)+dy)       if(mod(nxb,2).eq.1) y0 = coord(2,l)-(.5*bsize(2,l)+dy)       yj = y0 + dy*real(j-nguard)       do i=ilbnd,iubnd       x0 = coord(1,l)-.5*(bsize(1,l)+dx)       if(mod(nxb,2).eq.1) x0 =  &      &       coord(1,l)-(.5*bsize(1,l)+dx)       xi = x0 + dx*real(i-nguard)       value = ax*xi+ay*yj+az*zk       do ivar=1,nvar       v0 = value*real(ivar)       if(abs(v0-unk1(ivar,i,j,k,1))>accuracy) then         write(*,998) ii,l,ivar,i,j,k,unk1(ivar,i,j,k,1),v0         ierror_sum = ierror_sum + 1       endif       enddo       enddo       enddo      enddo      endif      enddo      endif      Call MPI_BARRIER(MPI_COMM_WORLD, ierr)      enddo      Call MPI_BARRIER(MPI_COMM_WORLD, ierr)      if(mype.eq.0) write(*,*) 'unk test complete.'      call amr_1blk_guardcell_reset      Call MPI_BARRIER(MPI_COMM_WORLD, ierr)! Delayed copying work from unk until unk had good restricted data on parent blocks! set up data in work      noff = (nguard_work - nguard)*npgs      if(noff.ge.0) then        work(il_bnd+noff:iu_bnd+noff,jl_bnd+noff*k2d:ju_bnd+noff*k2d, &      &       kl_bnd+noff*k3d:ku_bnd+noff*k3d,:,ioptw-1) = &      &   unk(1,il_bnd:iu_bnd,jl_bnd:ju_bnd,kl_bnd:ku_bnd,:)      else        work(ilw:iuw,jlw:juw,klw:kuw,:,ioptw-1) = &      &   unk(1,il_bnd-noff:iu_bnd+noff, &      &         jl_bnd-noff*k2d:ju_bnd+noff*k2d, &      &         kl_bnd-noff*k3d:ku_bnd+noff*k3d,:)      endif!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! test of work communications      iopt = ioptw      lcc = .true.      lfc = .false.      lec = .false.      lnc = .false.       tag_offset = 100      lguard    = .true.      lprolong  = .false.      lflux     = .false.      ledge     = .false.      lrestrict = .false.      lfulltree = .false.      call mpi_amr_comm_setup(mype,nprocs, &      &                        lguard,lprolong,lflux,ledge, &      &                        lrestrict,lfulltree, &      &                        iopt,lcc,lfc,lec,lnc,tag_offset)      do ii=0,nprocs-1      if(mype.eq.ii) then      do l=1,lnblocks      if (no_permanent_guardcells) then      iopt = ioptw      nlayers = nguard_work      lcc = .true.      lfc = .false.      lec = .false.      lnc = .false.      l_srl_only = .false.      icoord = 0      ldiag = .false.      ldiag = diagonals      if(nodetype(l).eq.1 .or. advance_all_levels) then      call amr_1blk_guardcell(mype,iopt,nlayers,l,mype, &      &                        lcc,lfc,lec,lnc, &      &                        l_srl_only,icoord,ldiag)      endif      else                      ! no_permanent_guardcells#ifndef NO_PERMANENT_GUARDCELLS      work1(:,:,:,1) = work(:,:,:,l,ioptw-1)#endif      endif                     ! no_permanent_guardcells      if(nodetype(l).eq.1 .or. advance_all_levels) then      ilbnd=ilw1      iubnd=iuw1      jlbnd=jlw1      jubnd=juw1      klbnd=klw1      kubnd=kuw1      if(neigh(1,1,l).le.-20) ilbnd=1+nguard_work      if(neigh(1,2,l).le.-20) iubnd=nxb+nguard_work      if(neigh(1,3,l).le.-20) jlbnd=1+nguard_work      if(neigh(1,4,l).le.-20) jubnd=nyb+nguard_work      if(ndim.eq.3) then      if(neigh(1,5,l).le.-20) klbnd=1+nguard_work      if(neigh(1,6,l).le.-20) kubnd=nzb+nguard_work      endif      if (.not.l_with_guardcells) then         ilbnd = 1+nguard         iubnd = nxb+nguard         jlbnd = 1+nguard         jubnd = nyb+nguard         if (ndim == 3) then            klbnd = 1+nguard            kubnd = nzb+nguard         end if      end if      if(ndim.eq.3) dz = bsize(3,l)/real(nzb)      dy = bsize(2,l)/real(nyb)      dx = bsize(1,l)/real(nxb)      if(mod(nxb,2).eq.1) then       if(ndim.eq.3) dz = bsize(3,l)/real(nzb-k3d)       dy = bsize(2,l)/real(nyb-1)       dx = bsize(1,l)/real(nxb-1)      endif      do k=klbnd,kubnd      if(ndim.eq.3) then       z0 = coord(3,l)-.5*(bsize(3,l)+dz)       if(mod(nxb,2).eq.1) z0 = coord(3,l)-(.5*bsize(3,l)+dz)      endif      zk = z0 + dz*real(k-nguard_work)       do j=jlbnd,jubnd       y0 = coord(2,l)-.5*(bsize(2,l)+dy)       if(mod(nxb,2).eq.1) y0 = coord(2,l)-(.5*bsize(2,l)+dy)       yj = y0 + dy*real(j-nguard_work)       do i=ilbnd,iubnd       x0 = coord(1,l)-.5*(bsize(1,l)+dx)       if(mod(nxb,2).eq.1) x0 =  &      &       coord(1,l)-(.5*bsize(1,l)+dx)       xi = x0 + dx*real(i-nguard_work)       value = ax*xi+ay*yj+az*zk       if(abs(value-work1(i,j,k,1))>accuracy) then         write(*,997) ii,l,i,j,k,work1(i,j,k,1),value         ierror_sum = ierror_sum + 1       endif       enddo       enddo      enddo      endif      enddo      endif      Call MPI_BARRIER(MPI_COMM_WORLD, ierr)      enddo      Call MPI_BARRIER(MPI_COMM_WORLD, ierr)      if(mype.eq.0) write(*,*) 'work test complete.'      Call MPI_BARRIER(MPI_COMM_WORLD, ierr)      call amr_1blk_guardcell_reset      Call MPI_BARRIER(MPI_COMM_WORLD, ierr)!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! test of unk_n communications      if (nvarcorn > 0) then      iopt = 1      nlayers = nguard      lcc = .false.      lfc = .false.      lec = .false.      lnc = .true.      tag_offset = 100      lguard    = .true.      lprolong  = .false.      lflux     = .false.      ledge     = .false.      lrestrict = .false.      lfulltree = .false.      call mpi_amr_comm_setup(mype,nprocs, &      &                        lguard,lprolong,lflux,ledge, &      &                        lrestrict,lfulltree, &      &                        iopt,lcc,lfc,lec,lnc,tag_offset)       do ii=0,nprocs-1      if(mype.eq.ii) then       do l=1,lnblocks      if(nodetype(l).eq.1 .or. advance_all_levels) then       if (no_permanent_guardcells) then      iopt = 1      nlayers = nguard      lcc = .false.      lfc = .false.      lec = .false.      lnc = .true.      l_srl_only = .false.      icoord = 0      ldiag = .false.      ldiag = diagonals       call amr_1blk_guardcell(mype,iopt,nlayers,l,mype, &      &                        lcc,lfc,lec,lnc, &      &                        l_srl_only,icoord,ldiag)       else                      ! no_permanent_guardcells#ifndef NO_PERMANENT_GUARDCELLS      unk_n1(:,:,:,:,1) = unk_n(:,:,:,:,l)#endif      end if                    ! no_permanent_guardcells         ilbnd=il_bnd1        iubnd=iu_bnd1        jlbnd=jl_bnd1        jubnd=ju_bnd1        klbnd=kl_bnd1        kubnd=ku_bnd1         if(neigh(1,1,l).le.-20) ilbnd=1+nguard        if(neigh(1,2,l).le.-20) iubnd=nxb+nguard        if(neigh(1,3,l).le.-20) jlbnd=1+nguard        if(neigh(1,4,l).le.-20) jubnd=nyb+nguard        if(ndim.eq.3) then          if(neigh(1,5,l).le.-20) klbnd=1+nguard          if(neigh(1,6,l).le.-20) kubnd=nzb+nguard        endif        if (.not.l_with_guardcells) then           ilbnd = 1+nguard           iubnd = nxb+nguard           jlbnd = 1+nguard           jubnd = nyb+nguard           if (ndim == 3) then              klbnd = 1+nguard              kubnd = nzb+nguard           end if        end if         if(ndim.eq.3) dz = bsize(3,l)/real(nzb)        dy = bsize(2,l)/real(nyb)        dx = bsize(1,l)/real(nxb)        if(mod(nxb,2).eq.1) then                if(ndim.eq.3) dz = bsize(3,l)/real(nzb-k3d)                dy = bsize(2,l)/real(nyb-1)                dx = bsize(1,l)/real(nxb-1)        endif                                                                        do k=klbnd,kubnd+k3d        if(ndim.eq.3) z0 = coord(3,l)-.5*bsize(3,l)-dz        zk = z0 + dz*real(k-nguard)        do j=jlbnd,jubnd+k2d          y0 = coord(2,l)-.5*bsize(2,l)-dy          yj = y0 + dy*real(j-nguard)          do i=ilbnd,iubnd+1            x0 = coord(1,l)-.5*bsize(1,l)-dx            xi = x0 + dx*real(i-nguard)            value = ax*xi+ay*yj+az*zk            do ivar=1,nvarcorn              v0 = value*real(ivar)              if(abs(unk_n1(ivar,i,j,k,1)-v0)>accuracy) then                      write(*,993) mype,l,ivar,i,j,k, &      &                             unk_n1(ivar,i,j,k,1),v0                      ierror_sum = ierror_sum + 1                      endif            enddo          enddo        enddo      enddo      endif      enddo       endif      Call MPI_BARRIER(MPI_COMM_WORLD, ierr)      enddo       Call MPI_BARRIER(MPI_COMM_WORLD, ierr)      if(mype.eq.0) write(*,*) 'unk_n test complete.'      call amr_1blk_guardcell_reset      Call MPI_BARRIER(MPI_COMM_WORLD, ierr)      end if !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!#ifdef FACE      if (nfacevar > 0) then! test of guardcell for facevar's (if appropriate)      if(mod(nxb,2).eq.0) then      iopt = 1      lcc = .false.      lfc = .true.      lec = .false.      lnc = .false.      tag_offset = 100      lguard    = .true.      lprolong  = .false.      lflux     = .false.      ledge     = .false.      lrestrict = .false.      lfulltree = .false.      call mpi_amr_comm_setup(mype,nprocs, &      &                        lguard,lprolong,lflux,ledge, &      &                        lrestrict,lfulltree, &      &                        iopt,lcc,lfc,lec,lnc,tag_offset)! test values        do ii=0,nprocs-1        if(mype.eq.ii) then        do l=1,lnblocks      if (no_permanent_guardcells) then      iopt = 1      nlayers = nguard      lcc = .false.      lfc = .true.      lec = .false.      lnc = .false.      l_srl_only = .false.      icoord = 0      ldiag = .false.      ldiag = diagonals      if(nodetype(l).eq.1 .or. advance_all_levels) then

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -