@@ -388,23 +388,16 @@ subroutine HA_solver(ha1, nc, FtF, x)
388
388
type (HA_type), pointer , intent (in ) :: ha1 ! < Control structure for the current field
389
389
integer , intent (in ) :: nc ! < Number of harmonic constituents
390
390
real , dimension (:,:), intent (in ) :: FtF ! < Accumulator of (F' * F) for all fields [nondim]
391
- real , dimension (:,:,:), allocatable , intent (out ) :: x ! < Solution vector of harmonic constants [A]
391
+ real , dimension (ha1% is:ha1% ie,ha1% js:ha1% je,2 * nc+1 ), &
392
+ intent (out ) :: x ! < Solution vector of harmonic constants [A]
392
393
393
394
! Local variables
394
395
real :: tmp0 ! < Temporary variable for Cholesky decomposition [nondim]
395
- real , dimension (:,:), allocatable :: L ! < Lower triangular matrix of Cholesky decomposition [nondim]
396
- real , dimension (:), allocatable :: tmp1 ! < Inverse of the diagonal entries of L [nondim]
397
- real , dimension (:,:), allocatable :: tmp2 ! < 2D temporary array involving FtSSH [A]
398
- real , dimension (:,:,:), allocatable :: y ! < 3D temporary array, i.e., L' * x [A]
399
- integer :: k, m, n, is, ie, js, je
400
-
401
- is = ha1% is ; ie = ha1% ie ; js = ha1% js ; je = ha1% je
402
-
403
- allocate (L(1 :2 * nc+1 ,1 :2 * nc+1 ), source= 0.0 )
404
- allocate (tmp1(1 :2 * nc+1 ), source= 0.0 )
405
- allocate (tmp2(is:ie,js:je), source= 0.0 )
406
- allocate (x(is:ie,js:je,2 * nc+1 ), source= 0.0 )
407
- allocate (y(is:ie,js:je,2 * nc+1 ), source= 0.0 )
396
+ real , dimension (2 * nc+1 ,2 * nc+1 ) :: L ! < Lower triangular matrix of Cholesky decomposition [nondim]
397
+ real , dimension (2 * nc+1 ) :: tmp1 ! < Inverse of the diagonal entries of L [nondim]
398
+ real , dimension (ha1% is:ha1% ie,ha1% js:ha1% je) :: tmp2 ! < 2D temporary array involving FtSSH [A]
399
+ real , dimension (ha1% is:ha1% ie,ha1% js:ha1% je,2 * nc+1 ) :: y ! < 3D temporary array, i.e., L' * x [A]
400
+ integer :: k, m, n
408
401
409
402
! Cholesky decomposition
410
403
do m= 1 ,2 * nc+1
@@ -445,11 +438,6 @@ subroutine HA_solver(ha1, nc, FtF, x)
445
438
x(:,:,k) = (y(:,:,k) - tmp2(:,:)) * tmp1(k)
446
439
enddo
447
440
448
- deallocate (tmp1)
449
- deallocate (tmp2)
450
- deallocate (L)
451
- deallocate (y)
452
-
453
441
end subroutine HA_solver
454
442
455
443
! > \namespace harmonic_analysis
0 commit comments