[Fortran] 纯文本查看 复制代码
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! 文件名称 : m_npod_norm_info.f90
! 功 能 : 存储法矩阵信息
! 调用模块 :
! use m_olibtype
!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
module m_npod_norm_info
use m_olibtype
implicit none
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! rnorm 法矩阵
! rh 偏导数
! rwy 右函数
! rx 改进参数
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
type t_npod_norm_info
logical :: l_init = .false.
integer(kind=i4b) :: ndim = 0
real(kind=dp),allocatable :: rnorm(:,:), rnorm_inv(:,:)
real(kind=dp),allocatable :: rh(:), rwy(:), rx(:)
contains
procedure,pass :: init
procedure,pass :: reset
final :: clean
end type t_npod_norm_info
type(t_npod_norm_info),save :: snorm
private :: init, reset, clean
contains
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
subroutine init(this, ndim, is)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! 功 能 : t_npod_norm_info结构体初始化
!
!
! 输 入 :
! this t(t_npod_norm_info) 结构体
! ndim I*i4b 初始化维数
!
! 输 出 :
! is I*i4b 返回状态
!
! 输入输出 :
!
! 其它接口 :
! 调用模块 :
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! ====变量声明====
implicit none
class(t_npod_norm_info),intent(inout) :: this
integer(kind=i4b),intent(in) :: ndim
integer(kind=i4b),intent(out) :: is
! ====执行代码====
this%ndim = ndim
if ( this%l_init ) then
deallocate(this%rnorm, this%rnorm_inv, this%rh, this%rwy, this%rx, stat=is)
end if
allocate( this%rnorm(ndim,ndim), this%rnorm_inv(ndim,ndim), &
this%rh(ndim), this%rwy(ndim), this%rx(ndim), stat=is)
this%l_init = .true.
end subroutine init
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
subroutine reset(this)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! 功 能 : t_npod_norm_info结构体重置
!
! 输 入 :
! this t(t_npod_norm_info) 结构体
!
! 输 出 :
!
! 输入输出 :
!
! 其它接口 :
! 调用模块 :
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! ====变量声明====
implicit none
class(t_npod_norm_info),intent(inout) :: this
integer(kind=i4b) :: is
! ====执行代码====
this%ndim = 0
if ( this%l_init ) then
this%l_init = .false.
if ( allocated(this%rnorm) ) deallocate(this%rnorm, stat=is)
if ( allocated(this%rnorm_inv) ) deallocate(this%rnorm_inv, stat=is)
if ( allocated(this%rwy) ) deallocate(this%rwy, stat=is)
if ( allocated(this%rx) ) deallocate(this%rx, stat=is)
if ( allocated(this%rh) ) deallocate(this%rh, stat=is)
end if
end subroutine reset
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
subroutine clean(this)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! 功 能 : t_npod_norm_info结构体释放
!
! 输 入 :
! this t(t_npod_norm_info) 结构体
!
! 输 出 :
!
! 输入输出 :
!
! 其它接口 :
! 调用模块 :
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! ====变量声明====
implicit none
type(t_npod_norm_info),intent(inout) :: this
integer(kind=i4b) :: is
! ====执行代码====
this%ndim = 0
if ( this%l_init ) then
this%l_init = .false.
if ( allocated(this%rnorm) ) deallocate(this%rnorm, stat=is)
if ( allocated(this%rnorm_inv) ) deallocate(this%rnorm_inv, stat=is)
if ( allocated(this%rh) ) deallocate(this%rh, stat=is)
if ( allocated(this%rwy) ) deallocate(this%rwy, stat=is)
if ( allocated(this%rx) ) deallocate(this%rx, stat=is)
end if
end subroutine clean
end module m_npod_norm_info