@@ -81,7 +81,11 @@ subroutine gather_data_bc_2d(fileobj, vdata, bc_info)
8181 i1=1; i2=1; j1=1; j2=1
8282 else
8383 !! In this case there is data in fileobj's root, so there is no need for the dummy data
84- if(fileobj%is_root) allocate(global_buf_r4_kind(i_glob, j_glob))
84+ if(fileobj%is_root) then
85+ allocate(global_buf_r4_kind(i_glob, j_glob))
86+ else
87+ allocate(global_buf_r4_kind(1, 1))
88+ endif
8589 allocate(local_buf_r4_kind(size(vdata,1), size(vdata,2)))
8690 local_buf_r4_kind = vdata
8791 endif
@@ -112,7 +116,11 @@ subroutine gather_data_bc_2d(fileobj, vdata, bc_info)
112116 i1=1; i2=1; j1=1; j2=1
113117 else
114118 !! In this case there is data in fileobj's root, so there is no need for the dummy data
115- if (fileobj%is_root) allocate (global_buf_r8_kind (i_glob, j_glob))
119+ if(fileobj%is_root) then
120+ allocate(global_buf_r8_kind(i_glob, j_glob))
121+ else
122+ allocate(global_buf_r8_kind(1, 1))
123+ endif
116124 allocate(local_buf_r8_kind(size(vdata,1), size(vdata,2)))
117125 local_buf_r8_kind = vdata
118126 endif
@@ -203,7 +211,11 @@ subroutine gather_data_bc_3d(fileobj, vdata, bc_info)
203211 i1=1; i2=1; j1=1; j2=1
204212 else
205213 !! In this case there is data in fileobj's root, so there is no need for the dummy data
206- if (fileobj%is_root) allocate (global_buf_r4_kind (i_glob, j_glob, k_glob))
214+ if(fileobj%is_root) then
215+ allocate(global_buf_r4_kind(i_glob, j_glob, k_glob))
216+ else
217+ allocate(global_buf_r4_kind(1, 1, 1))
218+ endif
207219 allocate(local_buf_r4_kind(size(vdata,1), size(vdata,2), size(vdata,3)))
208220 local_buf_r4_kind = vdata
209221 endif
@@ -233,7 +245,11 @@ subroutine gather_data_bc_3d(fileobj, vdata, bc_info)
233245 i1=1; i2=1; j1=1; j2=1
234246 else
235247 !! In this case there is data in fileobj's root, so there is no need for the dummy data
236- if(fileobj%is_root) allocate(global_buf_r8_kind(i_glob, j_glob, k_glob))
248+ if(fileobj%is_root) then
249+ allocate(global_buf_r8_kind(i_glob, j_glob, k_glob))
250+ else
251+ allocate(global_buf_r8_kind(1, 1, 1))
252+ endif
237253 allocate(local_buf_r8_kind(size(vdata,1), size(vdata,2), size(vdata,3)))
238254 local_buf_r8_kind = vdata
239255 endif
0 commit comments