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
),'Y') .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(ims
:ime
,jps
:jpf
) = p
%rfield_2d(ims
:ime
,jps
+py
:jpf
+py
)
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(ims
:ime
,jps
:jpf
) = p
%dfield_2d(ims
:ime
,jps
+py
:jpf
+py
)
19 ELSE
IF ( p
%Type
.EQ
. 'i' ) THEN
20 IF ( SIZE(p
%ifield_2d
,1)*SIZE(p
%ifield_2d
,2) .GT
. 1 ) THEN
21 p
%ifield_2d(ims
:ime
,jps
:jpf
) = p
%ifield_2d(ims
:ime
,jps
+py
:jpf
+py
)
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(ims
:ime
,jps
:jpf
) = p
%lfield_2d(ims
:ime
,jps
+py
:jpf
+py
)
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(ims
:ime
,:,jps
:jpf
) = p
%rfield_3d(ims
:ime
,:,jps
+py
:jpf
+py
)
36 ELSE
IF ( p
%Type
.EQ
. 'd' ) THEN
37 IF ( SIZE(p
%dfield_3d
,1)*SIZE(p
%dfield_3d
,3) .GT
. 1 ) THEN
38 p
%dfield_3d(ims
:ime
,:,jps
:jpf
) = p
%dfield_3d(ims
:ime
,:,jps
+py
:jpf
+py
)
40 ELSE
IF ( p
%Type
.EQ
. 'i' ) THEN
41 IF ( SIZE(p
%ifield_3d
,1)*SIZE(p
%ifield_3d
,3) .GT
. 1 ) THEN
42 p
%ifield_3d(ims
:ime
,:,jps
:jpf
) = p
%ifield_3d(ims
:ime
,:,jps
+py
:jpf
+py
)
44 ELSE
IF ( p
%Type
.EQ
. 'l' ) THEN
45 CALL
wrf_error_fatal( '3D logical arrays cannot be shifted for moving nests' )
47 ELSE
IF ( p
%MemoryOrder(1:2) .EQ
. 'XY' ) THEN
48 IF ( p
%Type
.EQ
. 'r' ) THEN
49 IF ( SIZE(p
%rfield_3d
,1)*SIZE(p
%rfield_3d
,2) .GT
. 1 ) THEN
50 p
%rfield_3d(ims
:ime
,jps
:jpf
,:) = p
%rfield_3d(ims
:ime
,jps
+py
:jpf
+py
,:)
52 ELSE
IF ( p
%Type
.EQ
. 'd' ) THEN
53 IF ( SIZE(p
%dfield_3d
,1)*SIZE(p
%dfield_3d
,2) .GT
. 1 ) THEN
54 p
%dfield_3d(ims
:ime
,jps
:jpf
,:) = p
%dfield_3d(ims
:ime
,jps
+py
:jpf
+py
,:)
56 ELSE
IF ( p
%Type
.EQ
. 'i' ) THEN
57 IF ( SIZE(p
%ifield_3d
,1)*SIZE(p
%ifield_3d
,2) .GT
. 1 ) THEN
58 p
%ifield_3d(ims
:ime
,jps
:jpf
,:) = p
%ifield_3d(ims
:ime
,jps
+py
:jpf
+py
,:)
60 ELSE
IF ( p
%Type
.EQ
. 'l' ) THEN
61 CALL
wrf_error_fatal( '3D logical arrays cannot be shifted for moving nests' )
64 ELSE
IF ( p
%Ndim
.EQ
. 4 ) THEN
65 IF ( p
%MemoryOrder(1:1) .EQ
. 'X' .AND
. p
%MemoryOrder(3:3) .EQ
. 'Y' ) THEN
66 IF ( p
%Type
.EQ
. 'r' ) THEN
67 IF ( SIZE(p
%rfield_4d
,1)*SIZE(p
%rfield_4d
,3) .GT
. 1 ) THEN
68 IF ( p
%scalar_array
) THEN
69 DO itrace
= PARAM_FIRST_SCALAR
, p
%num_table(grid
%id
)
70 p
%rfield_4d(ims
:ime
,:,jps
:jpf
,itrace
) = p
%rfield_4d(ims
:ime
,:,jps
+py
:jpf
+py
,itrace
)
73 p
%rfield_4d(ims
:ime
,:,jps
:jpf
,:) = p
%rfield_4d(ims
:ime
,:,jps
+py
:jpf
+py
,:)
76 ELSE
IF ( p
%Type
.EQ
. 'd' ) THEN
77 IF ( SIZE(p
%dfield_4d
,1)*SIZE(p
%dfield_4d
,3) .GT
. 1 ) THEN
78 IF ( p
%scalar_array
) THEN
79 DO itrace
= PARAM_FIRST_SCALAR
, p
%num_table(grid
%id
)
80 p
%dfield_4d(ims
:ime
,:,jps
:jpf
,itrace
) = p
%dfield_4d(ims
:ime
,:,jps
+py
:jpf
+py
,itrace
)
83 p
%dfield_4d(ims
:ime
,:,jps
:jpf
,:) = p
%dfield_4d(ims
:ime
,:,jps
+py
:jpf
+py
,:)
86 ELSE
IF ( p
%Type
.EQ
. 'i' ) THEN
87 IF ( SIZE(p
%ifield_4d
,1)*SIZE(p
%ifield_4d
,3) .GT
. 1 ) THEN
88 IF ( p
%scalar_array
) THEN
89 DO itrace
= PARAM_FIRST_SCALAR
, p
%num_table(grid
%id
)
90 p
%ifield_4d(ims
:ime
,:,jps
:jpf
,itrace
) = p
%ifield_4d(ims
:ime
,:,jps
+py
:jpf
+py
,itrace
)
93 p
%ifield_4d(ims
:ime
,:,jps
:jpf
,:) = p
%ifield_4d(ims
:ime
,:,jps
+py
:jpf
+py
,:)
96 ELSE
IF ( p
%Type
.EQ
. 'l' ) THEN
97 CALL
wrf_error_fatal( '4D logical arrays cannot be shifted for moving nests' )
99 ELSE
IF ( p
%MemoryOrder(1:2) .EQ
. 'XY' ) THEN
100 IF ( p
%Type
.EQ
. 'r' ) THEN
101 IF ( SIZE(p
%rfield_4d
,1)*SIZE(p
%rfield_4d
,2) .GT
. 1 ) THEN
102 IF ( p
%scalar_array
) THEN
103 DO itrace
= PARAM_FIRST_SCALAR
, p
%num_table(grid
%id
)
104 p
%rfield_4d(ims
:ime
,jps
:jpf
,:,itrace
) = p
%rfield_4d(ims
:ime
,jps
+py
:jpf
+py
,:,itrace
)
107 p
%rfield_4d(ims
:ime
,jps
:jpf
,:,:) = p
%rfield_4d(ims
:ime
,jps
+py
:jpf
+py
,:,:)
110 ELSE
IF ( p
%Type
.EQ
. 'd' ) THEN
111 IF ( SIZE(p
%dfield_4d
,1)*SIZE(p
%dfield_4d
,2) .GT
. 1 ) THEN
112 IF ( p
%scalar_array
) THEN
113 DO itrace
= PARAM_FIRST_SCALAR
, p
%num_table(grid
%id
)
114 p
%dfield_4d(ims
:ime
,jps
:jpf
,:,itrace
) = p
%dfield_4d(ims
:ime
,jps
+py
:jpf
+py
,:,itrace
)
117 p
%dfield_4d(ims
:ime
,jps
:jpf
,:,:) = p
%dfield_4d(ims
:ime
,jps
+py
:jpf
+py
,:,:)
120 ELSE
IF ( p
%Type
.EQ
. 'i' ) THEN
121 IF ( SIZE(p
%ifield_4d
,1)*SIZE(p
%ifield_4d
,2) .GT
. 1 ) THEN
122 IF ( p
%scalar_array
) THEN
123 DO itrace
= PARAM_FIRST_SCALAR
, p
%num_table(grid
%id
)
124 p
%ifield_4d(ims
:ime
,jps
:jpf
,:,itrace
) = p
%ifield_4d(ims
:ime
,jps
+py
:jpf
+py
,:,itrace
)
127 p
%ifield_4d(ims
:ime
,jps
:jpf
,:,:) = p
%ifield_4d(ims
:ime
,jps
+py
:jpf
+py
,:,:)
130 ELSE
IF ( p
%Type
.EQ
. 'l' ) THEN
131 CALL
wrf_error_fatal( '4D logical arrays cannot be shifted for moving nests' )