77 行
4.7 KiB
Fortran
77 行
4.7 KiB
Fortran
!Copyright (c) 2013 by tdem.org under guide of Xiu Li(lixiu@chd.edu.cn)
|
||
!written by Huaifeng Sun(sunhuaifeng@gmail.com) and Xushan Lu(luxushan@gmail.com)
|
||
!Code distribution @ tdem.org or sunhuaifeng.com
|
||
|
||
! This is a finite difference time domain (FDTD) code for the simulation of transient electromagnetic (TEM);
|
||
! This code is designed to be used in semi_airborne TEM with a loop source;
|
||
! This code is written by Huaifeng Sun (sunhuaifeng@gmail.com) and Xushan Lu (luxushan@gmail.com), The conformal mesh part is written by Xinyu Li (202335098@mail.sdu.edu.cn) and Qi Zhao(zhaoqi_326326@163.com);
|
||
! OpenACC API is used in this code for the acceleration with GPU device; therefore, you are recommended to compile this code with --
|
||
! --PGI Accelerator Fortran Workstation compiler. A Nvidia GPU card with CUDA capability is required if you want to run this code in parallel mode.
|
||
! Nobody is allowed to copy or distribute this code to people outside of TDEM.org group without the permission from Prof. Xiu Li (lixiu@chd.edu.cn)--
|
||
! --or you will be
|
||
! Contact the author for more detailed information.
|
||
|
||
!------------------------------------------------Instruction part--------------------------------------------------!
|
||
! This module is used to declare most of the parameters which are used in the entire code.
|
||
!-----------------------------------------------------------------------------------------------------------------------!
|
||
!==========================The main program begins==============================
|
||
PROGRAM MAIN
|
||
USE OMP_LIB
|
||
USE CONSTANTPARAMETERS
|
||
USE ELECTROMAGNETIC_VARIABLES
|
||
USE RES_MODEL_PARAMETER
|
||
USE TIME_PARAMETER
|
||
IMPLICIT none
|
||
CHARACTER*20, XSTRING
|
||
CHARACTER*20, SYS_TIME
|
||
OPEN(10005,FILE='logfile.log',STATUS='UNKNOWN')
|
||
!CALL GET_SYS_TIMEDATA(SYS_TIME)
|
||
WRITE(10005,*)'----------------------',SYS_TIME,'----------------------'
|
||
CALL GETDATA !This subroutine is used to input all the needed parameter of each calculation from 'input.dat' file.
|
||
CALL CHECKPARAMETERS !This subroutine is used to chech the correctness of input
|
||
WRITE (XSTRING,'(I3)') NX
|
||
XSTRING = '('//TRIM(ADJUSTL(XSTRING))//'E28.16E3)'
|
||
XSTRING = TRIM(ADJUSTL(XSTRING))
|
||
CALL MEMORY_USE_ESTIMATION !This subroutine is used to estimate the total memory usage according to the input,
|
||
CALL ALLOCATEMEMORY !This subroutine is used to allocate the memory in Host.
|
||
WRITE(*,*)'Preparing the grid.. .. .. ..'
|
||
IF(Logic_PML==1)THEN
|
||
WRITE(*,*)'Boundary condition: CPML absorbing boundary -> uniform grid meshing'
|
||
CALL GET_UNIFORM_GRID !CPML 吸收边界:采用均匀网格剖分(与参考实现 tem3dfdtd_第二版 的组合一致)
|
||
ELSE
|
||
WRITE(*,*)'Boundary condition: Dirichlet (zero-field) boundary -> non-uniform grid meshing'
|
||
CALL GET_NON_UNIFORMGRID !Dirichlet 边界:采用非均匀网格剖分(原版方式)
|
||
ENDIF
|
||
WRITE(*,*)'Initializing the parameters.. .. ..'
|
||
CALL ZERO !This subroutine is used to initialize the value of array.
|
||
WRITE(*,*)'Creating resistivity model.. .. ..'
|
||
CALL GET_COORDINATES
|
||
CALL Get_Receiver_Gridlabel !This subroutine is used to calculate the global coordinates and grid dispersion at the receiving point
|
||
CALL RES_CONFIGURE !This subroutine is used to distribute the resistivity (or conductivity) of the geology model to each grid
|
||
WRITE(*,*)'Creating computing time series.. .. ..'
|
||
CALL TIME_SERIOUS !This subroutine is used to creat the time series of the entire computation
|
||
WRITE(*,*)'Preparing array receiver points.. .. ..'
|
||
WRITE(*,*)'Starting computing.. .. ..'
|
||
!CALL GET_SYS_TIMEDATA(SYS_TIME)
|
||
WRITE(10005,*)'----------------------',SYS_TIME,'----------------------'
|
||
call Get_eps_r !This subroutine is used to get the fictitious dielectric constant
|
||
IF(Logic_PML==1)THEN
|
||
call Get_pml_parameters !This subroutine is used to get the CPML sigma/alpha/kappa profiles and the den_* scaling arrays
|
||
ENDIF
|
||
call Get_mstop !This subroutine is used to cut the entire computation process into computation fractions
|
||
call GetSourcePosition !This subroutine is used to get the source position in the model.
|
||
IF(Logic_PML==1)THEN
|
||
WRITE(*,*)'Starting CPML iteration (Iteration_cpml) .. .. .. ..'
|
||
call Iteration_cpml !CPML 吸收边界迭代子程序
|
||
ELSE
|
||
WRITE(*,*)'Starting Dirichlet iteration (Iteration) .. .. .. ..'
|
||
call Iteration !Dirichlet 边界迭代子程序(原版)
|
||
ENDIF
|
||
CALL FREE_MEMORY !This subroutine is used to deallocate all the memory allocated before iteration
|
||
!CALL GET_SYS_TIMEDATA(SYS_TIME)
|
||
WRITE(10005,*)'----------------------',SYS_TIME,'----------------------'
|
||
WRITE(10005,*)'Computation finished!'
|
||
CLOSE(10005)
|
||
END PROGRAM MAIN
|
||
|