1 | !WRF:MODEL_LAYER:DYNAMICS |
---|
2 | ! |
---|
3 | |
---|
4 | MODULE module_exp |
---|
5 | |
---|
6 | USE module_state_description |
---|
7 | |
---|
8 | CONTAINS |
---|
9 | |
---|
10 | !------------------------------------------------------------------------ |
---|
11 | |
---|
12 | SUBROUTINE relax_1_into_2 ( x1, x2, & |
---|
13 | ids, ide, jds, jde, kds, kde, & |
---|
14 | ims, ime, jms, jme, kms, kme, & |
---|
15 | its, ite, jts, jte, kts, kte ) |
---|
16 | |
---|
17 | IMPLICIT NONE |
---|
18 | |
---|
19 | |
---|
20 | ! Input data. |
---|
21 | |
---|
22 | INTEGER , INTENT(IN ) :: ids, ide, jds, jde, kds, kde, & |
---|
23 | ims, ime, jms, jme, kms, kme, & |
---|
24 | its, ite, jts, jte, kts, kte |
---|
25 | |
---|
26 | REAL , DIMENSION( ims:ime , kms:kme, jms:jme ) , & |
---|
27 | INTENT(IN ) :: x1 |
---|
28 | |
---|
29 | REAL , DIMENSION( ims:ime , kms:kme , jms:jme ) , & |
---|
30 | INTENT( OUT) :: x2 |
---|
31 | |
---|
32 | integer :: k, i, j |
---|
33 | |
---|
34 | |
---|
35 | DO j = jts, jte |
---|
36 | IF ( j > jds .AND. j < jde-1 ) THEN ! jde-1 because x is not staggered in Y |
---|
37 | DO k = kts, kte |
---|
38 | DO i = its, ite |
---|
39 | IF ( i > ids .AND. i < ide-1 ) THEN ! ide-1 because x is not staggered in X |
---|
40 | x2(i,k,j) = 0.25*(x1(i+1,k,j)+x1(i-1,k,j)+x1(i,k,j+1)+x1(i,k,j-1)) |
---|
41 | ENDIF |
---|
42 | ENDDO |
---|
43 | ENDDO |
---|
44 | ENDIF |
---|
45 | ENDDO |
---|
46 | |
---|
47 | END SUBROUTINE relax_1_into_2 |
---|
48 | |
---|
49 | !------------------------------------------------------------------------------- |
---|
50 | |
---|
51 | SUBROUTINE copy_2_into_1 ( x2, x1, & |
---|
52 | ids, ide, jds, jde, kds, kde, & |
---|
53 | ims, ime, jms, jme, kms, kme, & |
---|
54 | its, ite, jts, jte, kts, kte ) |
---|
55 | |
---|
56 | IMPLICIT NONE |
---|
57 | |
---|
58 | |
---|
59 | ! Input data. |
---|
60 | |
---|
61 | INTEGER , INTENT(IN ) :: ids, ide, jds, jde, kds, kde, & |
---|
62 | ims, ime, jms, jme, kms, kme, & |
---|
63 | its, ite, jts, jte, kts, kte |
---|
64 | |
---|
65 | REAL , DIMENSION( ims:ime , kms:kme, jms:jme ) , & |
---|
66 | INTENT(IN ) :: x2 |
---|
67 | |
---|
68 | REAL , DIMENSION( ims:ime , kms:kme , jms:jme ) , & |
---|
69 | INTENT( OUT) :: x1 |
---|
70 | |
---|
71 | integer :: k, i, j |
---|
72 | |
---|
73 | DO j = jts, jte |
---|
74 | IF ( j > jds .AND. j < jde-1 ) THEN |
---|
75 | DO k = kts, kte |
---|
76 | DO i = its, ite |
---|
77 | IF ( i > ids .AND. i < ide-1 ) THEN |
---|
78 | x1(i,k,j) = x2(i,k,j) |
---|
79 | ENDIF |
---|
80 | ENDDO |
---|
81 | ENDDO |
---|
82 | ENDIF |
---|
83 | ENDDO |
---|
84 | |
---|
85 | END SUBROUTINE copy_2_into_1 |
---|
86 | |
---|
87 | !------------------------------------------------------------------------------- |
---|
88 | |
---|
89 | END MODULE module_exp |
---|
90 | |
---|