📄 plot_visual3.f90
字号:
! SEM2DPACK version 2.2.11 -- A Spectral Element Method for 2D wave propagation and fracture dynamics,! with emphasis on computational seismology and earthquake source dynamics.! ! Copyright (C) 2003-2007 Jean-Paul Ampuero! All Rights Reserved! ! Jean-Paul Ampuero! ! ETH Zurich (Swiss Federal Institute of Technology)! Institute of Geophysics! Seismology and Geodynamics Group! ETH H鰊ggerberg HPP O 13.1! CH-8093 Z黵ich! Switzerland! ! ampuero@erdw.ethz.ch! +41 44 633 2197 (office)! +41 44 633 1065 (fax)! ! http://www.sg.geophys.ethz.ch/geodynamics/ampuero/! ! ! This software is freely available for scientific research purposes. ! If you use this software in writing scientific papers include proper ! attributions to its author, Jean-Paul Ampuero.! ! This program is free software; you can redistribute it and/or! modify it under the terms of the GNU General Public License! as published by the Free Software Foundation; either version 2! of the License, or (at your option) any later version.! ! This program is distributed in the hope that it will be useful,! but WITHOUT ANY WARRANTY; without even the implied warranty of! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the! GNU General Public License for more details.! ! You should have received a copy of the GNU General Public License! along with this program; if not, write to the Free Software! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.! module plot_visual3 implicit nonecontains! routine sauvegarde fichier Visual3 subroutine plotvisual3(field,grid,elast,it) use spec_grid, only : sem_grid_type use stdio, only : IO_new_unit use elastic, only : elast_type,ELAST_inquire type (sem_grid_type), intent(in) :: grid type (elast_type) , intent(in) :: elast double precision , intent(in) :: field(:,:) integer , intent(in) :: it double precision rmaxnorm,zoffset,xdiff,zdiff double precision :: celem(grid%ngll,grid%ngll) integer :: icell,i,j,e,iout,ip character(50) :: name print *,'Entering Visual3 file generation...' iout = IO_new_unit() write(name,"('Visual3_',i5.5,'_sem2d.inp')") it open(unit=iout,file=trim(name),status='unknown') ! dummy thickness = size of first element xdiff = grid%coord(1,grid%ibool(grid%ngll,1,1)) - grid%coord(1,grid%ibool(1,1,1)) zdiff = grid%coord(2,grid%ibool(grid%ngll,1,1)) - grid%coord(2,grid%ibool(1,1,1)) zoffset = sqrt(xdiff**2 + zdiff**2) ! number of nodes, cells, data per cell !write(iout,180) 2*grid%npoin,grid%nelem*(grid%ngll-1)*(grid%ngll-1),zoffset write(iout,180) size(field,2)*grid%npoin & ,grid%nelem*(grid%ngll-1)*(grid%ngll-1),zoffset ! index and coordinates of nodes do ip=1,grid%npoin write(iout,200) ip,grid%coord(:,ip) enddo ! index and topology of the cells icell = 0 do e=1,grid%nelem call ELAST_inquire(elast,e,cp=celem) do i=1,grid%ngll-1 do j=1,grid%ngll-1 icell = icell + 1 write(iout,210) icell,celem(i,j), & grid%ibool(i,j,e),grid%ibool(i+1,j,e), & grid%ibool(i+1,j+1,e),grid%ibool(i,j+1,e) enddo enddo enddo ! normalized node data rmaxnorm = maxval(abs(field)) do ip=1,grid%npoin write(iout,205) ip,field(ip,:)/rmaxnorm enddo print *,'Max norm in output Visual3 = ',rmaxnorm close(iout) print *,'End of Visual3 file generation...'180 format(I0,1x,I0,1x,e12.5)200 format(I0,1x,e12.5,1x,e12.5)205 format(I0,1x,e12.5,1x,e12.5)210 format(I0,1x,e12.5,1x,I0,1x,I0,1x,I0,1x,I0) end subroutine plotvisual3end module plot_visual3
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -