@@ -1105,7 +1105,7 @@ subroutine eval_jac &
11051105 if (ifixb(1 ) < 0 ) then
11061106 do j = 1 , np
11071107 call scale_mat(n, nq, we1, ldwe, ld2we, &
1108- reshape (fjacb(:, j, :), [n, nq]), & ! this reshape should not be required. probably compiler bug
1108+ reshape (fjacb(:, j, :), [n, nq]), &
11091109 tempret(1 :n, 1 :nq))
11101110 fjacb(:, j, :) = tempret(1 :n, 1 :nq)
11111111 end do
@@ -1114,7 +1114,9 @@ subroutine eval_jac &
11141114 do j = 1 , np
11151115 if (ifixb(j) >= 1 ) then
11161116 j1 = j1 + 1
1117- call scale_mat(n, nq, we1, ldwe, ld2we, fjacb(:, j, :), tempret(1 :n, 1 :nq))
1117+ call scale_mat(n, nq, we1, ldwe, ld2we, &
1118+ reshape (fjacb(:, j, :), [n, nq]), &
1119+ tempret(1 :n, 1 :nq))
11181120 fjacb(:, j1, :) = tempret(1 :n, 1 :nq)
11191121 end if
11201122 end do
@@ -1123,7 +1125,9 @@ subroutine eval_jac &
11231125 ! Weight the Jacobian's wrt DELTA as appropriate
11241126 if (isodr) then
11251127 do j = 1 , m
1126- call scale_mat(n, nq, we1, ldwe, ld2we, fjacd(:, j, :), tempret(1 :n, 1 :nq))
1128+ call scale_mat(n, nq, we1, ldwe, ld2we, &
1129+ reshape (fjacd(:, j, :), [n, nq]), &
1130+ tempret(1 :n, 1 :nq))
11271131 fjacd(:, j, :) = tempret(1 :n, 1 :nq)
11281132 end do
11291133 end if
@@ -5369,17 +5373,17 @@ pure subroutine scale_mat(n, m, wt, ldwt, ld2wt, t, wtt)
53695373 integer , intent (in ) :: m
53705374 ! ! Number of columns of data in `t`.
53715375 real (wp), intent (in ), target :: wt(..)
5372- ! ! Array of shape `(ldwt,ld2wt,m)` holding the weights.
5376+ ! ! Array of shape conformable to `(ldwt,ld2wt,m)` holding the weights.
53735377 integer , intent (in ) :: ldwt
53745378 ! ! Leading dimension of array `wt`.
53755379 integer , intent (in ) :: ld2wt
53765380 ! ! Second dimension of array `wt`.
53775381 real (wp), intent (in ), target :: t(..)
5378- ! ! Array of shape `(n,m)` being scaled by `wt`.
5382+ ! ! Array of shape conformable to `(n,m)` being scaled by `wt`.
53795383 real (wp), intent (out ), target :: wtt(..)
5380- ! ! Array of shape `(n,m)` holding the result of weighting array `t` by `wt`. Array
5381- ! ! ` wtt` can be the same as `t` only if the arrays in `wt` are upper triangular with
5382- ! ! zeros below the diagonal.
5384+ ! ! Array of shape conformable to `(n,m)` holding the result of weighting array `t` by
5385+ ! ! array `wt`. Array ` wtt` can be the same as `t` only if the arrays in `wt` are upper
5386+ ! ! triangular with zeros below the diagonal.
53835387
53845388 ! Local scalars
53855389 integer :: i, j
@@ -5391,6 +5395,13 @@ pure subroutine scale_mat(n, m, wt, ldwt, ld2wt, t, wtt)
53915395
53925396 if (n == 0 .or. m == 0 ) return
53935397
5398+ select rank (wt)
5399+ rank (1 ); wt_(1 :ldwt, 1 :ld2wt, 1 :m) = > wt
5400+ rank (2 ); wt_(1 :ldwt, 1 :ld2wt, 1 :m) = > wt
5401+ rank (3 ); wt_(1 :ldwt, 1 :ld2wt, 1 :m) = > wt
5402+ rank default; error stop " Invalid rank of `wt`."
5403+ end select
5404+
53945405 select rank (t)
53955406 rank (1 ); t_(1 :n, 1 :m) = > t
53965407 rank (2 ); t_(1 :n, 1 :m) = > t
@@ -5400,14 +5411,7 @@ pure subroutine scale_mat(n, m, wt, ldwt, ld2wt, t, wtt)
54005411 select rank (wtt)
54015412 rank (1 ); wtt_(1 :n, 1 :m) = > wtt
54025413 rank (2 ); wtt_(1 :n, 1 :m) = > wtt
5403- rank default; error stop " Invalid rank of `wt`."
5404- end select
5405-
5406- select rank (wt)
5407- rank (1 ); wt_(1 :ldwt, 1 :ld2wt, 1 :m) = > wt
5408- rank (2 ); wt_(1 :ldwt, 1 :ld2wt, 1 :m) = > wt
5409- rank (3 ); wt_(1 :ldwt, 1 :ld2wt, 1 :m) = > wt
5410- rank default; error stop " Invalid rank of `wt`."
5414+ rank default; error stop " Invalid rank of `wtt`."
54115415 end select
54125416
54135417 if (wt_(1 , 1 , 1 ) >= zero) then
0 commit comments