Initialises weights structure.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(array2d), | intent(inout), | allocatable | :: | dw(:) | ||
| integer(kind=ik), | intent(in) | :: | dims(:) |
pure subroutine dw_init(dw, dims)
!! Initialises weights structure.
type(array2d), allocatable, intent(in out) :: dw(:)
integer(ik), intent(in) :: dims(:)
integer(ik) :: n, nm
nm = size(dims)
allocate(dw(nm))
do n = 1, nm - 1
dw(n) = array2d(dims(n:n+1))
end do
dw(n) = array2d([dims(n), 1])
end subroutine dw_init