!************************************************************************************
!——————————————————————————————————–
!程序功能:多层网格剖分(直立六面体)
!——————————————————————————————————–
!——————————————————————————————————–
!参数说明:
! n_source:场源直立体单元的个数
! x_source:为存放场源ξ(i)、ξ(i+1)的数组
! y_source:为存放场源η(i)、η(i+1)的数组
! z_source:为存放场源ζ(i)、ζ(i+1)的数组
! n_coordinate:为计算点的个数
! x_coordinate:为存放计算点x方向的坐标
! x_coordinate:为存放计算点y方向的坐标
! z_coordinate:为存放计算点z方向的坐标
! filed:为存放迭代之后的计算所得的重力异常值
! G:为存放核函数值的数组
! X:为存放迭代场源剩余密度值
! D1:为存放迭代之前传输的重力异常值(二维数组,按照工区网格计算点存放数据)
! D:为存放迭代时所需的每一个计算点的重力异常
! M,N:为工区网格剖分的行和列的数值
!——————————————————————————————————–
PROGRAM GRAVITY_FORWARD_3D_INVERSION
implicit none
integer::n_coordinate,M,N,cengshu,n_source
REAL xmin,xmax,ymin,ymax
real,allocatable::x_source(:,:),y_source(:,:),z_source(:,:)
real,allocatable::x_coordinate(:),y_coordinate(:),z_coordinate(:)
real,allocatable::G(:,:)
integer,allocatable::n_source1(:)
real,allocatable::x1(:),x(:),y(:)
!!!读入基本参数
CALL INPUT_canshu(xmin,xmax,ymin,ymax,M,N,cengshu)
call read_mn(M,N,n_coordinate)
allocate(x_coordinate(1:N_COORDINATE),y_coordinate(1:N_COORDINATE),z_coordinate(1:n_coordinate),n_source1(1:cengshu))
call read_n_source(cengshu,n_source,n_source1)
allocate(G(1:N_COORDINATE,1:N_SOURCE))
allocate(x_source(1:n_source,1:2),y_source(1:n_source,1:2),z_source(1:n_source,1:2))
allocate(x1(1:n_source),x(1:n_source),y(1:n_source))
!!!计算核函数
!读入计算点的坐标
call input_coordinate_3d_vertical_reg(x_coordinate,y_coordinate,z_coordinate,n_coordinate)
!读入参数并计算场源的坐标(网格剖分)
call input_source_3d_vertical(n_source,cengshu,n_source1,x_source,y_source,z_source,M,N)
!计算核函数
call forward_3d_vertical_G(n_source,x_source,y_source,z_source,n_coordinate,x_coordinate,&
&y_coordinate,z_coordinate,G)
!pause
call zuobiao(n_source,x1,x,y,cengshu,n_source1)
!call zuobiao11(n_source)
END PROGRAM
!———————————————-
!功能:从参数文件中读取有关参数
!———————————————–
SUBROUTINE INPUT_canshu(xmin,xmax,ymin,ymax,M,N,cengshu)
implicit none
REAL xmin,xmax,ymin,ymax
INTEGER M,N,cengshu
open(12,file='poufen_parameter.txt')
READ(12,*)M,N
read(12,*)xmin,xmax
read(12,*)ymin,ymax
read(12,*)cengshu
close(12)
END SUBROUTINE
!—————————————————-
!功能:读取规则网(.grd)(平面)计算点数据的个数
!—————————————————-
subroutine read_mn(M,N,n_coordinate)
implicit none
integer::M,N,n_coordinate
n_coordinate=n*m
End subroutine read_mn
!—————————————————-
!功能:读取场源个数
!—————————————————-
subroutine read_n_source(cengshu,N_source,n_source1)
implicit none
integer::cengshu,N_source,I
integer