reshape_up Subroutine

public subroutine reshape_up(data, cube, dim_data, dim_cube)

Reshape the data in a grid of

Arguments

Type IntentOptional AttributesName
real(kind=xp), intent(in), dimension(:,:,:), allocatable:: data

original cube

real(kind=xp), intent(inout), dimension(:,:,:), allocatable:: cube

reshape cube

integer, intent(in), dimension(3):: dim_data

original cube dimension

integer, intent(in), dimension(3):: dim_cube

new cube dimension


Called by

proc~~reshape_up~~CalledByGraph proc~reshape_up reshape_up proc~main_rohsa main_rohsa proc~main_rohsa->proc~reshape_up program~rohsa ROHSA program~rohsa->proc~main_rohsa

Contents

Source Code


Source Code

  subroutine reshape_up(data, cube, dim_data, dim_cube)
  !! Reshape the data in a grid of \( 2^{nside} \)
    implicit none
    
    real(xp), intent(in), dimension(:,:,:), allocatable    :: data !! original cube
    real(xp), intent(inout), dimension(:,:,:), allocatable :: cube !! reshape cube
    integer, intent(in), dimension(3) :: dim_data !! original cube dimension
    integer, intent(in), dimension(3) :: dim_cube !! new cube dimension
 
    integer :: offset_w, offset_h
 
    offset_w = (dim_cube(2) - dim_data(2)) / 2
    offset_h = (dim_cube(3) - dim_data(3)) / 2
    cube(:, offset_w+1:offset_w+dim_data(2), offset_h+1:offset_h+dim_data(3)) = data
  end subroutine reshape_up