Create cxcx for a given stencil
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_stencilHeader_type) | :: | me |
stencil |
subroutine tem_stencil_createCxcx( me )
! -------------------------------------------------------------------- !
!> stencil
type(tem_stencilHeader_type) :: me
! -------------------------------------------------------------------- !
me%cxcx = 0.0_rk
! allocate cxcx according to dimension and compute cxcx using cxDir
select case(me%nDims)
case (3)
! create cxcx for 3D, xx, yy, zz, xy, yz, xz
me%cxcx(1,:) = real(me%cxDir(1,:) * me%cxDir(1,:), rk)
me%cxcx(2,:) = real(me%cxDir(2,:) * me%cxDir(2,:), rk)
me%cxcx(3,:) = real(me%cxDir(3,:) * me%cxDir(3,:), rk)
me%cxcx(4,:) = real(me%cxDir(1,:) * me%cxDir(2,:), rk)
me%cxcx(5,:) = real(me%cxDir(2,:) * me%cxDir(3,:), rk)
me%cxcx(6,:) = real(me%cxDir(1,:) * me%cxDir(3,:), rk)
case (2)
! create cxcx for 2D, xx, yy, xy
me%cxcx(1,:) = real(me%cxDir(1,:) * me%cxDir(1,:), rk)
me%cxcx(2,:) = real(me%cxDir(2,:) * me%cxDir(2,:), rk)
me%cxcx(3,:) = real(me%cxDir(1,:) * me%cxDir(2,:), rk)
case (1)
! create cxcx for 1D, xx
me%cxcx(1,:) = real(me%cxDir(1,:) * me%cxDir(1,:), rk)
case default
write( logUnit(1), "(A)" ) " Can't create cxcx for stencil " &
& // trim(me%label) &
& // ", as dimension not defined!"
end select
end subroutine tem_stencil_createCxcx