NCEPLIBS-ip 5.2.0
Loading...
Searching...
No Matches
splaplac.f
Go to the documentation of this file.
1C> @file
2C> @brief Compute laplacian in spectral space.
3C> @author Iredell @date 92-10-31
4
5C> Computes the laplacian or the inverse laplacian
6C> of a scalar field in spectral space.
7C>
8C> Subprogram speps() should be called already.
9C>
10C> The Laplacian of Q(L,N) is simply -N*(N+1)/A**2*Q(L,N)
11C>
12C> @param I spectral domain shape
13C> (0 for triangular, 1 for rhomboidal)
14C> @param M spectral truncation
15C> @param ENN1 N*(N+1)/A**2
16C> @param[out] Q if IDIR > 0, scalar field
17C> (Q(0,0) is not computed)
18C> @param[out] QD2 if IDIR < 0, Laplacian
19C> @param IDIR flag
20C> - IDIR > 0 to take Laplacian
21C> - IDIR < 0 to take inverse Laplacian
22C>
23C> @author Iredell @date 92-10-31
24 SUBROUTINE splaplac(I,M,ENN1,Q,QD2,IDIR)
25
26 REAL ENN1((M+1)*((I+1)*M+2)/2)
27 REAL Q((M+1)*((I+1)*M+2))
28 REAL QD2((M+1)*((I+1)*M+2))
29
30C TAKE LAPLACIAN
31 IF(idir.GT.0) THEN
32 k=1
33 qd2(2*k-1)=0.
34 qd2(2*k)=0.
35 DO k=2,(m+1)*((i+1)*m+2)/2
36 qd2(2*k-1)=q(2*k-1)*(-enn1(k))
37 qd2(2*k)=q(2*k)*(-enn1(k))
38 ENDDO
39
40C TAKE INVERSE LAPLACIAN
41 ELSE
42 DO k=2,(m+1)*((i+1)*m+2)/2
43 q(2*k-1)=qd2(2*k-1)/(-enn1(k))
44 q(2*k)=qd2(2*k)/(-enn1(k))
45 ENDDO
46 ENDIF
47
48 RETURN
49 END
subroutine splaplac(i, m, enn1, q, qd2, idir)
Computes the laplacian or the inverse laplacian of a scalar field in spectral space.
Definition splaplac.f:25