1 | SUBROUTINE shift_domain_nmm ( grid , disp_x, disp_y & |
---|
2 | ! |
---|
3 | # include <dummy_new_args.inc> |
---|
4 | ! |
---|
5 | ) |
---|
6 | USE module_domain |
---|
7 | USE module_timing |
---|
8 | USE module_configure |
---|
9 | USE module_dm |
---|
10 | USE module_comm_dm |
---|
11 | USE module_timing |
---|
12 | IMPLICIT NONE |
---|
13 | ! Arguments |
---|
14 | INTEGER disp_x, disp_y ! number of parent domain points to move |
---|
15 | TYPE(domain) , POINTER :: grid |
---|
16 | |
---|
17 | ! Local |
---|
18 | INTEGER :: i, j, ii, ipf, jpf |
---|
19 | INTEGER :: px, py ! number and direction of nd points to move |
---|
20 | INTEGER :: ids , ide , jds , jde , kds , kde , & |
---|
21 | ims , ime , jms , jme , kms , kme , & |
---|
22 | ips , ipe , jps , jpe , kps , kpe |
---|
23 | TYPE (grid_config_rec_type) :: config_flags |
---|
24 | TYPE( fieldlist ), POINTER :: p |
---|
25 | |
---|
26 | LOGICAL :: E_BDY,N_BDY,S_BDY,W_BDY |
---|
27 | |
---|
28 | CHARACTER(LEN=255) :: message |
---|
29 | |
---|
30 | ! Definitions of dummy arguments to solve |
---|
31 | #include <dummy_new_decl.inc> |
---|
32 | |
---|
33 | !#define COPY_IN |
---|
34 | !#include <scalar_derefs.inc> |
---|
35 | |
---|
36 | #ifdef DM_PARALLEL |
---|
37 | # include <data_calls.inc> |
---|
38 | #endif |
---|
39 | |
---|
40 | CALL model_to_grid_config_rec ( grid%id , model_config_rec , config_flags ) |
---|
41 | |
---|
42 | CALL get_ijk_from_grid ( grid , & |
---|
43 | ids, ide, jds, jde, kds, kde, & |
---|
44 | ims, ime, jms, jme, kms, kme, & |
---|
45 | ips, ipe, jps, jpe, kps, kpe ) |
---|
46 | |
---|
47 | |
---|
48 | S_BDY=(JPS==JDS) |
---|
49 | N_BDY=(JPE==JDE) |
---|
50 | W_BDY=(IPS==IDS) |
---|
51 | E_BDY=(IPE==IDE) |
---|
52 | |
---|
53 | write(message,*)' S_BDY,N_BDY,W_BDY,E_BDY ', S_BDY,N_BDY,W_BDY,E_BDY |
---|
54 | CALL wrf_message(trim(message)) |
---|
55 | |
---|
56 | grid%imask_nostag=0 |
---|
57 | #if 1 |
---|
58 | IF ( disp_x > 0 ) THEN |
---|
59 | IF ( E_BDY ) THEN |
---|
60 | DO J=jps,min(jde-1,jpe) |
---|
61 | DO I=ips,min(ide-1,ipe-2-mod(j+1,2)) |
---|
62 | grid%imask_nostag(i,j) = 1 |
---|
63 | END DO |
---|
64 | END DO |
---|
65 | ELSE |
---|
66 | DO J=jps,min(jde-1,jpe) |
---|
67 | DO I=ips,min(ide-1,ipe) |
---|
68 | grid%imask_nostag(i,j) = 1 |
---|
69 | END DO |
---|
70 | END DO |
---|
71 | END IF |
---|
72 | END IF |
---|
73 | IF ( disp_x < 0 ) THEN |
---|
74 | IF ( W_BDY ) THEN |
---|
75 | DO J=jps,min(jde-1,jpe) |
---|
76 | DO I=ips+1,min(ide-1,ipe) |
---|
77 | grid%imask_nostag(i,j) = 1 |
---|
78 | END DO |
---|
79 | END DO |
---|
80 | ELSE |
---|
81 | DO J=jps,min(jde-1,jpe) |
---|
82 | DO I=ips,min(ide-1,ipe) |
---|
83 | grid%imask_nostag(i,j) = 1 |
---|
84 | END DO |
---|
85 | END DO |
---|
86 | END IF |
---|
87 | END IF |
---|
88 | IF ( disp_y > 0 ) THEN |
---|
89 | IF ( N_BDY ) THEN |
---|
90 | DO J=jps,min(jde-1,jpe-3) |
---|
91 | DO I=ips,min(ide-1,ipe) |
---|
92 | grid%imask_nostag(i,j) = 1 |
---|
93 | END DO |
---|
94 | END DO |
---|
95 | ELSE |
---|
96 | DO J=jps,min(jde-1,jpe) |
---|
97 | DO I=ips,min(ide-1,ipe) |
---|
98 | grid%imask_nostag(i,j) = 1 |
---|
99 | END DO |
---|
100 | END DO |
---|
101 | END IF |
---|
102 | END IF |
---|
103 | IF ( disp_y < 0 ) THEN |
---|
104 | IF ( S_BDY ) THEN |
---|
105 | DO J=jps+2,min(jde-1,jpe) |
---|
106 | DO I=ips,min(ide-1,ipe) |
---|
107 | grid%imask_nostag(i,j) = 1 |
---|
108 | END DO |
---|
109 | END DO |
---|
110 | ELSE |
---|
111 | DO J=jps,min(jde-1,jpe) |
---|
112 | DO I=ips,min(ide-1,ipe) |
---|
113 | grid%imask_nostag(i,j) = 1 |
---|
114 | END DO |
---|
115 | END DO |
---|
116 | END IF |
---|
117 | END IF |
---|
118 | #else |
---|
119 | grid%imask_nostag(ips:min(ide-4,ipe),jps:min(jde-1,jpe)) = 1 |
---|
120 | ! grid%imask_nostag(ips+1:min(ide-2,ipe),jps+1:min(jde-2,jpe)) = 1 |
---|
121 | ! grid%imask_nostag(ips+1:min(ide-1,ipe-1),jps+2:min(jde-1,jpe-2)) = 1 |
---|
122 | #endif |
---|
123 | |
---|
124 | px = isign(grid%parent_grid_ratio,disp_x) |
---|
125 | py = isign(grid%parent_grid_ratio,disp_y) |
---|
126 | |
---|
127 | #ifdef DM_PARALLEL |
---|
128 | ! shift the nest domain in x |
---|
129 | do ii = 1,abs(disp_x) |
---|
130 | #include <../inc/SHIFT_HALO_X_HALO.inc> |
---|
131 | #include <../frame/loop_based_x_shift_code.h> |
---|
132 | enddo |
---|
133 | |
---|
134 | ! shift the nest domain in y |
---|
135 | do ii = 1,abs(disp_y) |
---|
136 | #include <../inc/SHIFT_HALO_Y_HALO.inc> |
---|
137 | #include <../frame/loop_based_y_shift_code.h> |
---|
138 | enddo |
---|
139 | #endif |
---|
140 | |
---|
141 | !#define COPY_OUT |
---|
142 | !#include <scalar_derefs.inc> |
---|
143 | |
---|
144 | END SUBROUTINE shift_domain_nmm |
---|