standard_tpo_to_bssn Subroutine

subroutine standard_tpo_to_bssn(l, nx, ny, nz, dx, dy, dz, ngx, ngy, ngz, gxx, gxy, gxz, gyy, gyz, gzz, kxx, kxy, kxz, kyy, kyz, kzz, alp, betax, betay, betaz, dtalp, dtbetax, dtbetay, dtbetaz, r)

Uses

    • BSSN_refine
    • tensor
    • utility
    • McLachlan_refine
  • proc~~standard_tpo_to_bssn~~UsesGraph proc~standard_tpo_to_bssn standard_tpo_to_bssn BSSN_refine BSSN_refine proc~standard_tpo_to_bssn->BSSN_refine McLachlan_refine McLachlan_refine proc~standard_tpo_to_bssn->McLachlan_refine module~utility utility proc~standard_tpo_to_bssn->module~utility tensor tensor proc~standard_tpo_to_bssn->tensor constants constants module~utility->constants matrix matrix module~utility->matrix

Compute the BSSN variables starting from the standard 3+1 (aka ADM) variables This is basically a version of ADM_to_BSSN from MODULE McLachlan_refine that allows for array arguments.

FT 05.07.2022 FT 05.07.2022


$OMP PARALLEL DO DEFAULT( NONE ) & $OMP SHARED( Gamma_u, l ) & $OMP PRIVATE( i, j, k )

$OMP END PARALLEL DO

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: l
integer, intent(in) :: nx
integer, intent(in) :: ny
integer, intent(in) :: nz
double precision, intent(in) :: dx
double precision, intent(in) :: dy
double precision, intent(in) :: dz
integer, intent(in) :: ngx
integer, intent(in) :: ngy
integer, intent(in) :: ngz
double precision, intent(in) :: gxx(nx,ny,nz)
double precision, intent(in) :: gxy(nx,ny,nz)
double precision, intent(in) :: gxz(nx,ny,nz)
double precision, intent(in) :: gyy(nx,ny,nz)
double precision, intent(in) :: gyz(nx,ny,nz)
double precision, intent(in) :: gzz(nx,ny,nz)
double precision, intent(in) :: kxx(nx,ny,nz)
double precision, intent(in) :: kxy(nx,ny,nz)
double precision, intent(in) :: kxz(nx,ny,nz)
double precision, intent(in) :: kyy(nx,ny,nz)
double precision, intent(in) :: kyz(nx,ny,nz)
double precision, intent(in) :: kzz(nx,ny,nz)
double precision, intent(in) :: alp(nx,ny,nz)
double precision, intent(in) :: betax(nx,ny,nz)
double precision, intent(in) :: betay(nx,ny,nz)
double precision, intent(in) :: betaz(nx,ny,nz)
double precision, intent(in) :: dtalp(nx,ny,nz)
double precision, intent(in) :: dtbetax(nx,ny,nz)
double precision, intent(in) :: dtbetay(nx,ny,nz)
double precision, intent(in) :: dtbetaz(nx,ny,nz)
double precision, intent(in) :: r(nx,ny,nz)

Calls

proc~~standard_tpo_to_bssn~~CallsGraph proc~standard_tpo_to_bssn standard_tpo_to_bssn adm_to_bssn_everywhere adm_to_bssn_everywhere proc~standard_tpo_to_bssn->adm_to_bssn_everywhere adm_to_bssn_interior adm_to_bssn_interior proc~standard_tpo_to_bssn->adm_to_bssn_interior

Called by

proc~~standard_tpo_to_bssn~~CalledByGraph proc~standard_tpo_to_bssn standard_tpo_to_bssn proc~compute_and_print_bssn_variables compute_and_print_bssn_variables proc~compute_and_print_bssn_variables->proc~standard_tpo_to_bssn interface~compute_and_print_bssn_variables compute_and_print_bssn_variables interface~compute_and_print_bssn_variables->proc~compute_and_print_bssn_variables

Contents

Source Code


Variables

Type Visibility Attributes Name Initial
integer, private, DIMENSION(3) :: imax
integer, private, DIMENSION(3) :: imin
double precision, private, DIMENSION(:,:,:), ALLOCATABLE :: tmp1
double precision, private, DIMENSION(:,:,:), ALLOCATABLE :: tmp2
double precision, private, DIMENSION(:,:,:), ALLOCATABLE :: tmp3
double precision, private, DIMENSION(:,:,:), ALLOCATABLE :: tmp4

Source Code

  SUBROUTINE standard_tpo_to_bssn( l, nx, ny, nz, dx, dy, dz, ngx, ngy, ngz, &
    gxx, gxy, gxz, gyy, gyz, gzz, kxx, kxy, kxz, kyy, kyz, kzz, alp, betax, &
    betay, betaz, dtalp, dtbetax, dtbetay, dtbetaz, r )

    !************************************************
    !
    !# Compute the BSSN variables starting from the
    !  standard 3+1 (aka ADM) variables
    !  This is basically a version of ADM_to_BSSN
    !  from MODULE McLachlan_refine that allows for
    !  array arguments.
    !
    !  FT 05.07.2022
    !  FT 05.07.2022
    !
    !************************************************

    USE utility,          ONLY: zero
    USE tensor,           ONLY: jx, jy, jz, jxx, jxy, jxz, jyy, jyz, jzz
    USE BSSN_refine,      ONLY: g_BSSN3_ll, A_BSSN3_ll, lapse_A_BSSN, &
                                shift_B_BSSN_u, Theta_Z4, Gamma_u, phi, trK

    USE McLachlan_refine, ONLY: ADM_TO_BSSN_EVERYWHERE, ADM_TO_BSSN_INTERIOR

    IMPLICIT NONE

    !TYPE(bssn), INTENT(INOUT):: bssnf
    INTEGER,          INTENT(IN):: l, nx ,ny, nz, ngx, ngy, ngz
    DOUBLE PRECISION, INTENT(IN):: dx, dy, dz
    DOUBLE PRECISION, INTENT(IN):: gxx(nx,ny,nz), gxy(nx,ny,nz), &
                                   gxz(nx,ny,nz), gyy(nx,ny,nz), &
                                   gyz(nx,ny,nz), gzz(nx,ny,nz)
    DOUBLE PRECISION, INTENT(IN):: kxx(nx,ny,nz), kxy(nx,ny,nz), &
                                   kxz(nx,ny,nz), kyy(nx,ny,nz), &
                                   kyz(nx,ny,nz), kzz(nx,ny,nz)
    DOUBLE PRECISION, INTENT(IN):: alp(nx,ny,nz)
    DOUBLE PRECISION, INTENT(IN):: betax(nx,ny,nz), betay(nx,ny,nz), &
                                   betaz(nx,ny,nz)
    DOUBLE PRECISION, INTENT(IN):: dtalp(nx,ny,nz)
    DOUBLE PRECISION, INTENT(IN):: dtbetax(nx,ny,nz), dtbetay(nx,ny,nz), &
                                   dtbetaz(nx,ny,nz)
    DOUBLE PRECISION, INTENT(IN):: r(nx,ny,nz)

    !----------------------------------------------------------------!
    !-- It is assumed that the outer boundary width is the same as --!
    !-- the ghostsize                                              --!
    !----------------------------------------------------------------!
    INTEGER, DIMENSION(3) :: imin, imax
    DOUBLE PRECISION, DIMENSION(:,:,:), ALLOCATABLE :: tmp1, tmp2, tmp3, tmp4

    !--------------------------------------------------------------!
    !-- These are to be used in C, hence the zero based indexing --!
    !--------------------------------------------------------------!
    imin= 0
    imax(1)= nx - 1
    imax(2)= ny - 1
    imax(3)= nz - 1

    ALLOCATE( tmp1(nx,ny,nz), tmp2(nx,ny,nz), tmp3(nx,ny,nz), tmp4(nx,ny,nz) )

    CALL ADM_TO_BSSN_EVERYWHERE( nx, ny, nz, imin, imax, dx, dy, dz, &
                                 gxx, gxy, gxz, gyy, gyz, gzz, &
                                 kxx, kxy, kxz, kyy, kyz, kzz, &
                                 alp, betax, betay, betaz, &
                                 g_BSSN3_ll% levels(l)% var(:,:,:,jxx), &
                                 g_BSSN3_ll% levels(l)% var(:,:,:,jxy), &
                                 g_BSSN3_ll% levels(l)% var(:,:,:,jxz), &
                                 g_BSSN3_ll% levels(l)% var(:,:,:,jyy), &
                                 g_BSSN3_ll% levels(l)% var(:,:,:,jyz), &
                                 g_BSSN3_ll% levels(l)% var(:,:,:,jzz), &
                                 A_BSSN3_ll% levels(l)% var(:,:,:,jxx), &
                                 A_BSSN3_ll% levels(l)% var(:,:,:,jxy), &
                                 A_BSSN3_ll% levels(l)% var(:,:,:,jxz), &
                                 A_BSSN3_ll% levels(l)% var(:,:,:,jyy), &
                                 A_BSSN3_ll% levels(l)% var(:,:,:,jyz), &
                                 A_BSSN3_ll% levels(l)% var(:,:,:,jzz), &
                                 tmp1(:,:,:), tmp2(:,:,:), &
                                 tmp3(:,:,:), tmp4(:,:,:), &
                                 phi%levels(l)%var(:,:,:), &
                                 trK%levels(l)%var(:,:,:), &
                                 Theta_Z4%levels(l)%var(:,:,:) )

    DEALLOCATE( tmp1, tmp2, tmp3, tmp4 )

    imin = [ ngx, ngy, ngz ]
    imax(1) = nx - ngx - 1
    imax(2) = ny - ngy - 1
    imax(3) = nz - ngz - 1

   !!$OMP PARALLEL DO DEFAULT( NONE ) &
   !!$OMP             SHARED( Gamma_u, l ) &
   !!$OMP             PRIVATE( i, j, k )
   !DO k= 1, nz, 1
   !  DO j= 1, ny, 1
   !    DO i= 1, nx, 1
   !
   !      Gamma_u% levels(l)% var(i,j,k,jx)= zero
   !      Gamma_u% levels(l)% var(i,j,k,jy)= zero
   !      Gamma_u% levels(l)% var(i,j,k,jz)= zero
   !
   !    ENDDO
   !  ENDDO
   !ENDDO
   !!$OMP END PARALLEL DO
    Gamma_u% levels(l)% var= zero

    ! ADM_TO_BSSN_INTERIOR does not compute Gamma_u on the ghost zones,
    ! because it needs the BSSN right-hand-sides (RHS) to do that, and the RHS
    ! need the ID. Hence, we initialize Gamma_u to zero over the entire
    ! grid, included the ghost zones. It then stays zero on the ghost zones at
    ! the level of the ID.
    Gamma_u% levels(l)% var= zero

    CALL ADM_TO_BSSN_INTERIOR( nx, ny, nz, imin, imax, dx, dy, dz, &
                               gxx, gxy, gxz, gyy, gyz, gzz, &
                               kxx, kxy, kxz, kyy, kyz, kzz, &
                               alp, betax, betay, betaz, &
                               dtalp, dtbetax, dtbetay, dtbetaz, &
                               g_BSSN3_ll% levels(l)% var(:,:,:,jxx), &
                               g_BSSN3_ll% levels(l)% var(:,:,:,jxy), &
                               g_BSSN3_ll% levels(l)% var(:,:,:,jxz), &
                               g_BSSN3_ll% levels(l)% var(:,:,:,jyy), &
                               g_BSSN3_ll% levels(l)% var(:,:,:,jyz), &
                               g_BSSN3_ll% levels(l)% var(:,:,:,jzz), &
                               phi% levels(l)% var(:,:,:), &
                               r, &
                               lapse_A_BSSN% levels(l)% var(:,:,:), &
                               shift_B_BSSN_u% levels(l)% var(:,:,:,jx), &
                               shift_B_BSSN_u% levels(l)% var(:,:,:,jy), &
                               shift_B_BSSN_u% levels(l)% var(:,:,:,jz), &
                               Gamma_u% levels(l)% var(:,:,:,jx), &
                               Gamma_u% levels(l)% var(:,:,:,jy), &
                               Gamma_u% levels(l)% var(:,:,:,jz) )


  END SUBROUTINE standard_tpo_to_bssn