Compact Module

This module handles the generation of tridiagonal/pentadiagonal matrices, LU decomposition calculations, and tridiagonal solver operations (such as stdlu, ptdlu, etc.) for periodic and non-periodic boundary conditions. Since compact finite difference schemes are implicit, these solvers are implemented internally to perform numerical differentiation by solving the implicit relations efficiently.



Variables

Type Visibility Attributes Name Initial
real(kind=real64), public, DIMENSION(:), ALLOCATABLE :: lxf
real(kind=real64), public, DIMENSION(:), ALLOCATABLE :: lxs
real(kind=real64), public, DIMENSION(:), ALLOCATABLE :: wxf
real(kind=real64), public, DIMENSION(:), ALLOCATABLE :: wxs
real(kind=real64), public, DIMENSION(:), ALLOCATABLE :: lyf
real(kind=real64), public, DIMENSION(:), ALLOCATABLE :: lys
real(kind=real64), public, DIMENSION(:), ALLOCATABLE :: wyf
real(kind=real64), public, DIMENSION(:), ALLOCATABLE :: wys
real(kind=real64), public, DIMENSION(:), ALLOCATABLE :: lzf
real(kind=real64), public, DIMENSION(:), ALLOCATABLE :: lzs
real(kind=real64), public, DIMENSION(:), ALLOCATABLE :: wzf
real(kind=real64), public, DIMENSION(:), ALLOCATABLE :: wzs
integer, public :: nxc
integer, public :: nyc
integer, public :: nzc
real(kind=real64), public, parameter :: ezero = 1.0e-14

Subroutines

public subroutine ludcmp(nx, ny, nz, xp, yp, zp)

Entry point for LU decomposition calculations.

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nx

Grid size in x-direction.

integer, intent(in) :: ny

Grid size in x-direction. Grid size in y-direction.

integer, intent(in) :: nz

Grid size in x-direction. Grid size in y-direction. Grid size in z-direction.

integer, intent(in) :: xp

Periodic flag for x-direction (0 = periodic, other = non-periodic).

integer, intent(in) :: yp

Periodic flag for x-direction (0 = periodic, other = non-periodic). Periodic flag for y-direction (0 = periodic, other = non-periodic).

integer, intent(in) :: zp

Periodic flag for x-direction (0 = periodic, other = non-periodic). Periodic flag for y-direction (0 = periodic, other = non-periodic). Periodic flag for z-direction (0 = periodic, other = non-periodic).

public subroutine ludcmp_allocate(nx, ny, nz, xp, yp, zp)

LU 분해를 위한 포트란 workspace 배열 메모리를 동적 할당하는 서브루틴입니다.

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nx

Grid size in x-direction.

integer, intent(in) :: ny

Grid size in x-direction. Grid size in y-direction.

integer, intent(in) :: nz

Grid size in x-direction. Grid size in y-direction. Grid size in z-direction.

integer, intent(in) :: xp

Periodic flag for x-direction (0 = periodic, other = non-periodic).

integer, intent(in) :: yp

Periodic flag for x-direction (0 = periodic, other = non-periodic). Periodic flag for y-direction (0 = periodic, other = non-periodic).

integer, intent(in) :: zp

Periodic flag for x-direction (0 = periodic, other = non-periodic). Periodic flag for y-direction (0 = periodic, other = non-periodic). Periodic flag for z-direction (0 = periodic, other = non-periodic).

public subroutine ludcmp_deallocate(xp, yp, zp)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: xp
integer, intent(in) :: yp
integer, intent(in) :: zp

public subroutine ludcmp_testalloc()

Arguments

None

public subroutine ludcmp_calculate(nx, ny, nz, xp, yp, zp)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nx
integer, intent(in) :: ny
integer, intent(in) :: nz
integer, intent(in) :: xp
integer, intent(in) :: yp
integer, intent(in) :: zp

public subroutine test_nonp_lud1(xx, coef)

Arguments

Type IntentOptional Attributes Name
integer :: xx
real(kind=real64), intent(out), DIMENSION(xx) :: coef

public subroutine test_nonp_lud2(xx, coef)

Arguments

Type IntentOptional Attributes Name
integer :: xx
real(kind=real64), intent(out), DIMENSION(xx) :: coef

public subroutine test_p_lud1(xx, coef1, coef2)

Arguments

Type IntentOptional Attributes Name
integer :: xx
real(kind=real64), intent(out), DIMENSION(xx) :: coef1
real(kind=real64), intent(out), DIMENSION(xx) :: coef2

public subroutine test_p_lud2(xx, coef1, coef2)

Arguments

Type IntentOptional Attributes Name
integer :: xx
real(kind=real64), intent(out), DIMENSION(xx) :: coef1
real(kind=real64), intent(out), DIMENSION(xx) :: coef2

public subroutine nonp_lud(xyz, xx)

Arguments

Type IntentOptional Attributes Name
integer :: xyz
integer :: xx

public subroutine p_lud(xyz, xx)

Arguments

Type IntentOptional Attributes Name
integer :: xyz
integer :: xx

public subroutine stdlu(a, n, l)

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(in) :: a(n)
integer :: n
real(kind=real64), intent(out) :: l(n)

public subroutine ptdlu(a, n, l, w)

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(in) :: a
integer :: n
real(kind=real64), intent(out) :: l(n)
real(kind=real64), intent(out) :: w(n)

public subroutine rhs1np(n, h, x, dx, nd)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: n
real(kind=real64), intent(in) :: h
real(kind=real64), intent(in), DIMENSION(nd,n) :: x
real(kind=real64), intent(out), DIMENSION(nd,n) :: dx
integer, intent(in) :: nd

public subroutine dfnonp(n, h, x, dx, nd, dir)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: n
real(kind=real64), intent(in) :: h
real(kind=real64), intent(in), DIMENSION(nd,n) :: x
real(kind=real64), intent(out), DIMENSION(nd,n) :: dx
integer, intent(in) :: nd
integer, intent(in) :: dir

public subroutine dfp(n, h, x, dx, nd, dir)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: n
real(kind=real64), intent(in) :: h
real(kind=real64), intent(in), DIMENSION(nd,n) :: x
real(kind=real64), intent(out), DIMENSION(nd,n) :: dx
integer, intent(in) :: nd
integer, intent(in) :: dir

public subroutine ptdslv(r, n, l, w, nd)

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(inout), DIMENSION(nd,n) :: r
integer, intent(in) :: n
real(kind=real64), intent(in), DIMENSION(n) :: l
real(kind=real64), intent(in), DIMENSION(n) :: w
integer, intent(in) :: nd

public subroutine d2fp(n, h, x, dx, nd, dir)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: n
real(kind=real64), intent(in) :: h
real(kind=real64), intent(in), DIMENSION(nd,n) :: x
real(kind=real64), intent(out), DIMENSION(nd,n) :: dx
integer, intent(in) :: nd
integer, intent(in) :: dir

public subroutine tdslv(r, n, l, nd)

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(inout), DIMENSION(nd,n) :: r
integer, intent(in) :: n
real(kind=real64), intent(in), DIMENSION(n) :: l
integer, intent(in) :: nd

public subroutine d2fnonp(n, h, x, dx, nd, dir)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: n
real(kind=real64), intent(in) :: h
real(kind=real64), intent(in), DIMENSION(nd,n) :: x
real(kind=real64), intent(out), DIMENSION(nd,n) :: dx
integer, intent(in) :: nd
integer, intent(in) :: dir