00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 subroutine psmile_store_faces_3d_dble (indices_req, &
00012 required, nreq, &
00013 tgt_coords1, tgt_coords2, tgt_coords3, ncpl, &
00014 corners1, corners2, corners3, &
00015 corner_shape, nbr_corners, grid_valid_shape, &
00016 send_mask, srcloc_ind, &
00017 ibuf, len_item, ndibuf, ipia, &
00018 buf, len_rtem, ndrbuf, ipa, ierror)
00019
00020
00021
00022 use PRISM
00023
00024 use PSMILe, dummy_interface => PSMILe_Store_faces_3d_dble
00025
00026 Implicit none
00027
00028
00029
00030 Integer, Intent (In) :: nreq
00031
00032
00033
00034
00035 Integer, Intent (In) :: indices_req (nreq)
00036
00037
00038
00039
00040 Integer, Intent (In) :: required (nreq)
00041
00042
00043
00044 Integer, Intent (In) :: corner_shape (2, ndim_3d)
00045
00046
00047
00048 Integer, Intent (In) :: nbr_corners
00049
00050
00051
00052
00053 Integer, Intent (In) :: grid_valid_shape (2, ndim_3d)
00054
00055
00056
00057 Integer, Intent (In) :: ncpl
00058
00059
00060
00061
00062 Double Precision, Intent (In) :: tgt_coords1 (ncpl)
00063 Double Precision, Intent (In) :: tgt_coords2 (ncpl)
00064 Double Precision, Intent (In) :: tgt_coords3 (ncpl)
00065
00066
00067
00068 Double Precision, Intent (In) ::
00069 corners1 (corner_shape(1,1):corner_shape(2,1),
00070 corner_shape(1,2):corner_shape(2,2),
00071 corner_shape(1,3):corner_shape(2,3), nbr_corners)
00072
00073 Double Precision, Intent (In) ::
00074 corners2 (corner_shape(1,1):corner_shape(2,1),
00075 corner_shape(1,2):corner_shape(2,2),
00076 corner_shape(1,3):corner_shape(2,3), nbr_corners)
00077
00078 Double Precision, Intent (In) ::
00079 corners3 (corner_shape(1,1):corner_shape(2,1),
00080 corner_shape(1,2):corner_shape(2,2),
00081 corner_shape(1,3):corner_shape(2,3), nbr_corners)
00082
00083
00084
00085 Logical, Intent (In) :: send_mask (nreq)
00086
00087
00088
00089 Integer, Intent (In) :: ndibuf
00090
00091
00092
00093 Integer, Intent (In) :: srcloc_ind (ndim_3d, ndibuf)
00094
00095
00096
00097 Integer, Intent (In) :: len_item
00098
00099
00100
00101
00102
00103
00104 Integer, Intent (In) :: ndrbuf
00105
00106
00107
00108 Integer, Intent (In) :: len_rtem
00109
00110
00111
00112
00113
00114
00115
00116
00117 Double Precision, Intent (InOut) :: buf (len_rtem, ndrbuf)
00118
00119
00120
00121 Integer, Intent (InOut) :: ipa
00122
00123
00124
00125
00126 Integer, Intent (InOut) :: ibuf (len_item, ndibuf)
00127
00128
00129
00130 Integer, Intent (InOut) :: ipia
00131
00132
00133
00134
00135 Integer, Intent (Out) :: ierror
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148 Integer :: j, n
00149
00150
00151
00152 Integer :: ip, ipi
00153 Integer :: ind (ndim_3d, ipa+1:ipa+nreq)
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182 Character(len=len_cvs_string), save :: mycvs =
00183 '$Id: psmile_store_faces_3d_dble.F90 2082 2009-10-21 13:31:19Z hanke $'
00184
00185
00186
00187
00188
00189 #ifdef VERBOSE
00190 print 9990, trim(ch_id), nreq
00191
00192 call psmile_flushstd
00193 #endif /* VERBOSE */
00194
00195 ierror = 0
00196
00197 #ifdef PRISM_ASSERTION
00198
00199 do j = 1, nreq
00200 if (send_mask(j)) then
00201 if (required(j) == 0) exit
00202 endif
00203 end do
00204
00205 if (j < nreq) then
00206 print *, 'j, required', j, required (j)
00207 call psmile_assert (__FILE__, __LINE__, &
00208 "No points required")
00209 endif
00210
00211 if (len_item < ndim_3d + 2) then
00212 print *, 'len_item', len_item, ndim_3d + 2
00213 call psmile_assert (__FILE__, __LINE__, &
00214 "len_item is insufficicent")
00215 endif
00216
00217 if (len_rtem < ndim_3d * (nbr_corners+1)) then
00218 print *, 'len_rtem', len_rtem, ndim_3d * (nbr_corners + 1)
00219 call psmile_assert (__FILE__, __LINE__, &
00220 "len_rtem is insufficicent")
00221 endif
00222
00223 ip = count(send_mask)
00224 if (ipa+ip > ndrbuf) then
00225 print *, 'ndrbuf, ip, ipa, nreq', &
00226 ndrbuf, ip, ipa, nreq
00227 call psmile_assert (__FILE__, __LINE__, &
00228 "ndrbuf is not sufficient")
00229 endif
00230
00231 if (ipia+ip > ndibuf) then
00232 print *, 'ndibuf, ip, ipia, nreq', &
00233 ndibuf, ip, ipia, nreq
00234 call psmile_assert (__FILE__, __LINE__, &
00235 "ndrbuf is not sufficient")
00236 endif
00237 #endif
00238
00239 ipi = ipia
00240 ip = ipa
00241
00242
00243
00244
00245
00246
00247 do j = 1, nreq
00248 if (send_mask(j)) then
00249 ip = ip + 1
00250 ind (:, ip) = max (srcloc_ind(:,ip), grid_valid_shape (1,:))
00251 ind (:, ip) = min (ind(:, ip), grid_valid_shape (2,:))
00252 endif
00253 end do
00254
00255 ip = ipa
00256
00257
00258
00259 do j = 1, nreq
00260 if (send_mask(j)) then
00261
00262
00263
00264
00265
00266
00267
00268
00269
00270 ip = ip + 1
00271
00272 buf (1, ip) = tgt_coords1 (indices_req(j))
00273 buf (2, ip) = tgt_coords2 (indices_req(j))
00274 buf (3, ip) = tgt_coords3 (indices_req(j))
00275
00276
00277
00278 do n = 1, nbr_corners
00279 buf (n*ndim_3d+1, ip) = corners1 (ind(1,ip), &
00280 ind(2,ip), &
00281 ind(3,ip), n)
00282 buf (n*ndim_3d+2, ip) = corners2 (ind(1,ip), &
00283 ind(2,ip), &
00284 ind(3,ip), n)
00285 buf (n*ndim_3d+3, ip) = corners3 (ind(1,ip), &
00286 ind(2,ip), &
00287 ind(3,ip), n)
00288 end do
00289
00290
00291
00292
00293
00294
00295
00296
00297
00298
00299
00300 ipi = ipi + 1
00301
00302 ibuf (1, ipi) = srcloc_ind (1, ip)
00303 ibuf (2, ipi) = srcloc_ind (2, ip)
00304 ibuf (3, ipi) = srcloc_ind (3, ip)
00305
00306 ibuf (4, ipi) = j
00307 ibuf (5, ipi) = required (j)
00308
00309 endif
00310 end do
00311
00312
00313
00314 ipia = ipi
00315 ipa = ip
00316
00317 #ifdef VERBOSE
00318 print 9980, trim(ch_id), ierror
00319
00320 call psmile_flushstd
00321 #endif /* VERBOSE */
00322
00323
00324
00325
00326 #ifdef VERBOSE
00327
00328 9990 format (1x, a, ': psmile_store_faces_3d_dble: nreq ', i5)
00329 9980 format (1x, a, ': psmile_store_faces_3d_dble: eof ierror =', i3)
00330
00331 #endif /* VERBOSE */
00332
00333 #ifdef DEBUG
00334 #endif
00335
00336 end subroutine PSMILe_Store_faces_3d_dble