1 p
=> grid
%head_statevars
%next
2 DO
WHILE ( ASSOCIATED( p
) )
3 IF ( p
%ProcOrient
.NE
. 'X' .AND
. p
%ProcOrient
.NE
. 'Y' ) THEN
4 IF ( INDEX(TRIM(p
%Stagger
),'X') .GT
. 0 ) THEN
9 IF ( p
%Ndim
.EQ
. 2 ) THEN
10 IF ( p
%MemoryOrder(1:1) .EQ
. 'X' .AND
. p
%MemoryOrder(2:2) .EQ
. 'Y' ) THEN
11 IF ( p
%Type
.EQ
. 'r' ) THEN
12 IF ( SIZE(p
%rfield_2d
,1)*SIZE(p
%rfield_2d
,2) .GT
. 1 ) THEN
13 p
%rfield_2d(ips
:ipf
,jms
:jme
) = p
%rfield_2d(ips
+px
:ipf
+px
,jms
:jme
)
15 ELSE
IF ( p
%Type
.EQ
. 'd' ) THEN
16 IF ( SIZE(p
%dfield_2d
,1)*SIZE(p
%dfield_2d
,2) .GT
. 1 ) THEN
17 p
%dfield_2d(ips
:ipf
,jms
:jme
) = p
%dfield_2d(ips
+px
:ipf
+px
,jms
:jme
)
19 ELSE
IF ( TRIM(p
%Type
) .EQ
. 'i' ) THEN
20 IF ( SIZE(p
%ifield_2d
,1)*SIZE(p
%ifield_2d
,2) .GT
. 1 ) THEN
21 p
%ifield_2d(ips
:ipf
,jms
:jme
) = p
%ifield_2d(ips
+px
:ipf
+px
,jms
:jme
)
23 ELSE
IF ( p
%Type
.EQ
. 'l' ) THEN
24 IF ( SIZE(p
%lfield_2d
,1)*SIZE(p
%lfield_2d
,2) .GT
. 1 ) THEN
25 p
%lfield_2d(ips
:ipf
,jms
:jme
) = p
%lfield_2d(ips
+px
:ipf
+px
,jms
:jme
)
29 ELSE
IF ( p
%Ndim
.EQ
. 3 ) THEN
30 IF ( p
%MemoryOrder(1:1) .EQ
. 'X' .AND
. p
%MemoryOrder(3:3) .EQ
. 'Y' ) THEN
31 IF ( p
%Type
.EQ
. 'r' ) THEN
32 IF ( SIZE(p
%rfield_3d
,1)*SIZE(p
%rfield_3d
,3) .GT
. 1 ) THEN
33 p
%rfield_3d(ips
:ipf
,:,jms
:jme
) = p
%rfield_3d(ips
+px
:ipf
+px
,:,jms
:jme
)
35 ELSE
IF ( p
%Type
.EQ
. 'd' ) THEN
36 IF ( SIZE(p
%dfield_3d
,1)*SIZE(p
%dfield_3d
,3) .GT
. 1 ) THEN
37 p
%dfield_3d(ips
:ipf
,:,jms
:jme
) = p
%dfield_3d(ips
+px
:ipf
+px
,:,jms
:jme
)
39 ELSE
IF ( p
%Type
.EQ
. 'i' ) THEN
40 IF ( SIZE(p
%ifield_3d
,1)*SIZE(p
%ifield_3d
,3) .GT
. 1 ) THEN
41 p
%ifield_3d(ips
:ipf
,:,jms
:jme
) = p
%ifield_3d(ips
+px
:ipf
+px
,:,jms
:jme
)
43 ELSE
IF ( p
%Type
.EQ
. 'l' ) THEN
44 CALL
wrf_error_fatal( '3D logical arrays cannot be shifted for moving nests' )
46 ELSE
IF ( p
%MemoryOrder(1:2) .EQ
. 'XY' ) THEN
47 IF ( p
%Type
.EQ
. 'r' ) THEN
48 IF ( SIZE(p
%rfield_3d
,1)*SIZE(p
%rfield_3d
,2) .GT
. 1 ) THEN
49 p
%rfield_3d(ips
:ipf
,jms
:jme
,:) = p
%rfield_3d(ips
+px
:ipf
+px
,jms
:jme
,:)
51 ELSE
IF ( p
%Type
.EQ
. 'd' ) THEN
52 IF ( SIZE(p
%dfield_3d
,1)*SIZE(p
%dfield_3d
,2) .GT
. 1 ) THEN
53 p
%dfield_3d(ips
:ipf
,jms
:jme
,:) = p
%dfield_3d(ips
+px
:ipf
+px
,jms
:jme
,:)
55 ELSE
IF ( p
%Type
.EQ
. 'i' ) THEN
56 IF ( SIZE(p
%ifield_3d
,1)*SIZE(p
%ifield_3d
,2) .GT
. 1 ) THEN
57 p
%ifield_3d(ips
:ipf
,jms
:jme
,:) = p
%ifield_3d(ips
+px
:ipf
+px
,jms
:jme
,:)
59 ELSE
IF ( p
%Type
.EQ
. 'l' ) THEN
60 CALL
wrf_error_fatal( '3D logical arrays cannot be shifted for moving nests' )
63 ELSE
IF ( p
%Ndim
.EQ
. 4 ) THEN
64 IF ( p
%MemoryOrder(1:1) .EQ
. 'X' .AND
. p
%MemoryOrder(3:3) .EQ
. 'Y' ) THEN
65 IF ( p
%Type
.EQ
. 'r' ) THEN
66 IF ( SIZE(p
%rfield_4d
,1)*SIZE(p
%rfield_4d
,3) .GT
. 1 ) THEN
67 IF ( p
%scalar_array
) THEN
68 DO itrace
= PARAM_FIRST_SCALAR
, p
%num_table(grid
%id
)
69 p
%rfield_4d(ips
:ipf
,:,jms
:jme
,itrace
) = p
%rfield_4d(ips
+px
:ipf
+px
,:,jms
:jme
,itrace
)
72 p
%rfield_4d(ips
:ipf
,:,jms
:jme
,:) = p
%rfield_4d(ips
+px
:ipf
+px
,:,jms
:jme
,:)
75 ELSE
IF ( p
%Type
.EQ
. 'd' ) THEN
76 IF ( SIZE(p
%dfield_4d
,1)*SIZE(p
%dfield_4d
,3) .GT
. 1 ) THEN
77 IF ( p
%scalar_array
) THEN
78 DO itrace
= PARAM_FIRST_SCALAR
, p
%num_table(grid
%id
)
79 p
%dfield_4d(ips
:ipf
,:,jms
:jme
,itrace
) = p
%dfield_4d(ips
+px
:ipf
+px
,:,jms
:jme
,itrace
)
82 p
%dfield_4d(ips
:ipf
,:,jms
:jme
,:) = p
%dfield_4d(ips
+px
:ipf
+px
,:,jms
:jme
,:)
85 ELSE
IF ( p
%Type
.EQ
. 'i' ) THEN
86 IF ( SIZE(p
%ifield_4d
,1)*SIZE(p
%ifield_4d
,3) .GT
. 1 ) THEN
87 IF ( p
%scalar_array
) THEN
88 DO itrace
= PARAM_FIRST_SCALAR
, p
%num_table(grid
%id
)
89 p
%ifield_4d(ips
:ipf
,:,jms
:jme
,itrace
) = p
%ifield_4d(ips
+px
:ipf
+px
,:,jms
:jme
,itrace
)
92 p
%ifield_4d(ips
:ipf
,:,jms
:jme
,:) = p
%ifield_4d(ips
+px
:ipf
+px
,:,jms
:jme
,:)
95 ELSE
IF ( p
%Type
.EQ
. 'l' ) THEN
96 CALL
wrf_error_fatal( '4D logical arrays cannot be shifted for moving nests' )
98 ELSE
IF ( p
%MemoryOrder(1:2) .EQ
. 'XY' ) THEN
99 IF ( p
%Type
.EQ
. 'r' ) THEN
100 IF ( SIZE(p
%rfield_4d
,1)*SIZE(p
%rfield_4d
,2) .GT
. 1 ) THEN
101 IF ( p
%scalar_array
) THEN
102 DO itrace
= PARAM_FIRST_SCALAR
, p
%num_table(grid
%id
)
103 p
%rfield_4d(ips
:ipf
,jms
:jme
,:,itrace
) = p
%rfield_4d(ips
+px
:ipf
+px
,jms
:jme
,:,itrace
)
106 p
%rfield_4d(ips
:ipf
,jms
:jme
,:,:) = p
%rfield_4d(ips
+px
:ipf
+px
,jms
:jme
,:,:)
109 ELSE
IF ( p
%Type
.EQ
. 'd' ) THEN
110 IF ( SIZE(p
%dfield_4d
,1)*SIZE(p
%dfield_4d
,2) .GT
. 1 ) THEN
111 IF ( p
%scalar_array
) THEN
112 DO itrace
= PARAM_FIRST_SCALAR
, p
%num_table(grid
%id
)
113 p
%dfield_4d(ips
:ipf
,jms
:jme
,:,itrace
) = p
%dfield_4d(ips
+px
:ipf
+px
,jms
:jme
,:,itrace
)
116 p
%dfield_4d(ips
:ipf
,jms
:jme
,:,:) = p
%dfield_4d(ips
+px
:ipf
+px
,jms
:jme
,:,:)
119 ELSE
IF ( p
%Type
.EQ
. 'i' ) THEN
120 IF ( SIZE(p
%ifield_4d
,1)*SIZE(p
%ifield_4d
,2) .GT
. 1 ) THEN
121 IF ( p
%scalar_array
) THEN
122 DO itrace
= PARAM_FIRST_SCALAR
, p
%num_table(grid
%id
)
123 p
%ifield_4d(ips
:ipf
,jms
:jme
,:,itrace
) = p
%ifield_4d(ips
+px
:ipf
+px
,jms
:jme
,:,itrace
)
126 p
%ifield_4d(ips
:ipf
,jms
:jme
,:,:) = p
%ifield_4d(ips
+px
:ipf
+px
,jms
:jme
,:,:)
129 ELSE
IF ( p
%Type
.EQ
. 'l' ) THEN
130 CALL
wrf_error_fatal( '4D logical arrays cannot be shifted for moving nests' )