Calculate the dimensions of the workspace arrays.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | n |
Number of observations. |
||
integer, | intent(in) | :: | m |
Number of columns of data in the independent variable. |
||
integer, | intent(in) | :: | np |
Number of function parameters. |
||
integer, | intent(in) | :: | nq |
Number of responses per observation. |
||
logical, | intent(in) | :: | isodr |
The variable designating whether the solution is by ODR ( |
||
integer, | intent(out) | :: | lwork |
Length of |
||
integer, | intent(out) | :: | liwork |
Length of |
pure subroutine workspace_dimensions(n, m, np, nq, isodr, lwork, liwork) !! Calculate the dimensions of the workspace arrays. integer, intent(in) :: n !! Number of observations. integer, intent(in) :: m !! Number of columns of data in the independent variable. integer, intent(in) :: np !! Number of function parameters. integer, intent(in) :: nq !! Number of responses per observation. logical, intent(in) :: isodr !! The variable designating whether the solution is by ODR (`isodr = .true.`) !! or by OLS (`isodr = .false.`). integer, intent(out) :: lwork !! Length of `work` array. integer, intent(out) :: liwork !! Length of `iwork` array. if(isodr) then lwork = 18 + 13*np + np**2 + m + m**2 + 4*n*nq + 6*n*m + 2*n*nq*np + & 2*n*nq*m + nq**2 + 5*nq + nq*(np + m) + n*nq*nq else lwork = 18 + 13*np + np**2 + m + m**2 + 4*n*nq + 2*n*m + 2*n*nq*np + & 5*nq + nq*(np + m) + n*nq*nq end if liwork = 20 + 2*np + nq*(np + m) end subroutine workspace_dimensions