Initialize axis.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(axis_obj), | intent(inout) | :: | this |
A axis object |
||
| integer, | intent(in) | :: | lo |
Array lower bound |
||
| integer, | intent(in) | :: | hi |
Array higher bound |
||
| integer, | intent(in) | :: | ngc |
Number of ghost cells |
pure subroutine axis_obj_Init(this,lo,hi,ngc) !> Initialize axis. class(axis_obj), intent(inout) :: this !! A axis object integer, intent(in) :: lo !! Array lower bound integer, intent(in) :: hi !! Array higher bound integer, intent(in) :: ngc !! Number of ghost cells this%lo = lo this%hi = hi this%ngc = ngc ! Allocate arrays if (associated(this%x )) deallocate(this%x ) if (associated(this%xm )) deallocate(this%xm ) if (associated(this%dxm)) deallocate(this%dxm) allocate(this%x (lo-ngc:hi+1+ngc)); this%x = 0.0_wp allocate(this%xm (lo-ngc:hi +ngc)); this%xm = 0.0_wp allocate(this%dxm(lo-ngc:hi +ngc)); this%dxm = 0.0_wp return end subroutine axis_obj_Init