Merge remote-tracking branch 'origin/release-v4.5.2'
[WRF.git] / var / convertor / kma_wave2grid / RADB3M.inc
blob2b3eee6a9284dcdc9efd23458a4795c82c2051f2
1 C***********************************************************************
2       SUBROUTINE RADB3M (INC,LOT,IDO,L1,CC,CH,WA1,WA2)
3       DIMENSION  CC(INC,IDO,3,L1)  ,CH(INC,IDO,L1,3)  ,WA1(*)  ,WA2(*)
4       DATA TAUR,TAUI /-.5,.8660254037844390/
6       DO 101 K=1,L1
7 *VOPTION NOFVAL
8         DO 101 L=1,LOT
9           TR2         = CC(L,IDO,2,K)+CC(L,IDO,2,K)
10           CR2         = CC(L,  1,1,K)+TAUR*TR2
11           CI3         = TAUI*(CC(L,1,3,K)+CC(L,1,3,K))
12           CH(L,1,K,1) = CC(L,  1,1,K)+TR2
13           CH(L,1,K,2) = CR2-CI3
14           CH(L,1,K,3) = CR2+CI3
15   101   CONTINUE
16       IF (IDO .GT. 1) THEN
17           IDP2 = IDO+2
18         DO 103 K=1,L1
19 *VOPTION NOFVAL
20         DO 103 I=3,IDO,2
21             IC = IDP2-I
22 *VOPTION NOFVAL
23           DO 102 L=1,LOT
24             TR2           = CC(L,I-1,3,K)+CC(L,IC-1,2,K)
25             TI2           = CC(L,I  ,3,K)-CC(L,IC  ,2,K)
26             CR2           = CC(L,I-1,1,K)+TAUR*TR2
27             CI2           = CC(L,I  ,1,K)+TAUR*TI2
28             CR3           = TAUI*(CC(L,I-1,3,K)-CC(L,IC-1,2,K))
29             CI3           = TAUI*(CC(L,I  ,3,K)+CC(L,IC  ,2,K))
30             CH(L,I-1,K,1) = CC(L,I-1,1,K)+TR2
31             CH(L,I  ,K,1) = CC(L,I  ,1,K)+TI2
32             DR2           = CR2-CI3
33             DI2           = CI2+CR3
34             DR3           = CR2+CI3
35             DI3           = CI2-CR3
36             CH(L,I-1,K,2) = WA1(I-2)*DR2-WA1(I-1)*DI2
37             CH(L,I  ,K,2) = WA1(I-2)*DI2+WA1(I-1)*DR2
38             CH(L,I-1,K,3) = WA2(I-2)*DR3-WA2(I-1)*DI3
39             CH(L,I  ,K,3) = WA2(I-2)*DI3+WA2(I-1)*DR3
40   102     CONTINUE
41   103   CONTINUE
42       END IF
43       RETURN
44       END SUBROUTINE RADB3M