00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 subroutine psmile_store_faces_irreg2_real (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_irreg2_real
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 Real, Intent (In) :: tgt_coords1 (ncpl)
00063 Real, Intent (In) :: tgt_coords2 (ncpl)
00064 Real, Intent (In) :: tgt_coords3 (ncpl)
00065
00066
00067
00068 Real, Intent (In) ::
00069 corners1 (corner_shape(1,1):corner_shape(2,1),
00070 corner_shape(1,2):corner_shape(2,2), nbr_corners/2)
00071
00072 Real, Intent (In) ::
00073 corners2 (corner_shape(1,1):corner_shape(2,1),
00074 corner_shape(1,2):corner_shape(2,2), nbr_corners/2)
00075
00076 Real, Intent (In) ::
00077 corners3 (corner_shape(1,3):corner_shape(2,3), 2)
00078
00079
00080
00081 Logical, Intent (In) :: send_mask (nreq)
00082
00083
00084
00085 Integer, Intent (In) :: ndibuf
00086
00087
00088
00089 Integer, Intent (In) :: srcloc_ind (ndim_3d, ndibuf)
00090
00091
00092
00093 Integer, Intent (In) :: len_item
00094
00095
00096
00097
00098
00099
00100 Integer, Intent (In) :: ndrbuf
00101
00102
00103
00104 Integer, Intent (In) :: len_rtem
00105
00106
00107
00108
00109
00110
00111
00112
00113 Real, Intent (InOut) :: buf (len_rtem, ndrbuf)
00114
00115
00116
00117 Integer, Intent (InOut) :: ipa
00118
00119
00120
00121
00122 Integer, Intent (InOut) :: ibuf (len_item, ndibuf)
00123
00124
00125
00126 Integer, Intent (InOut) :: ipia
00127
00128
00129
00130
00131 Integer, Intent (Out) :: ierror
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141 Integer, Parameter :: nc_reg = 2
00142
00143
00144
00145
00146
00147 Integer :: j, n
00148
00149 Integer :: nbc
00150
00151
00152
00153 Integer :: ip, ipb, ipi
00154 Integer :: ind (ndim_3d, ipa+1:ipa+nreq)
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
00183 Character(len=len_cvs_string), save :: mycvs =
00184 '$Id: psmile_store_faces_irreg2_real.F90 2082 2009-10-21 13:31:19Z hanke $'
00185
00186
00187
00188
00189
00190 #ifdef VERBOSE
00191 print 9990, trim(ch_id), nreq
00192
00193 call psmile_flushstd
00194 #endif /* VERBOSE */
00195
00196 ierror = 0
00197
00198 nbc = nbr_corners / nc_reg
00199
00200 #ifdef PRISM_ASSERTION
00201 do j = 1, nreq
00202 if (send_mask(j)) then
00203 if (required(j) == 0) exit
00204 endif
00205 end do
00206
00207 if (j < nreq) then
00208 print *, 'j, required', j, required (j)
00209 call psmile_assert (__FILE__, __LINE__, &
00210 "No points required")
00211 endif
00212
00213 if (len_item < ndim_3d + 2) then
00214 print *, 'len_item', len_item, ndim_3d + 2
00215 call psmile_assert (__FILE__, __LINE__, &
00216 "len_item is insufficicent")
00217 endif
00218
00219 if (len_rtem < ndim_3d + nbc*ndim_2d + ndim_2d) then
00220 print *, 'len_rtem', len_rtem, ndim_3d + nbc*ndim_2d + ndim_2d
00221 call psmile_assert (__FILE__, __LINE__, &
00222 "len_rtem is insufficicent")
00223 endif
00224
00225 ip = count(send_mask)
00226 if (ipa+ip > ndrbuf) then
00227 print *, 'ndrbuf, ip, ipa, nreq', &
00228 ndrbuf, ip, ipa, nreq
00229 call psmile_assert (__FILE__, __LINE__, &
00230 "ndrbuf is not sufficient")
00231 endif
00232
00233 if (ipia+ip > ndibuf) then
00234 print *, 'ndibuf, ip, ipia, nreq', &
00235 ndibuf, ip, ipia, nreq
00236 call psmile_assert (__FILE__, __LINE__, &
00237 "ndrbuf is not sufficient")
00238 endif
00239 #endif
00240
00241 ipi = ipia
00242 ip = ipa
00243
00244
00245
00246
00247
00248
00249 do j = 1, nreq
00250 if (send_mask(j)) then
00251 ip = ip + 1
00252 ind (:, ip) = max (srcloc_ind(:,ip), grid_valid_shape (1,:))
00253 ind (:, ip) = min (ind(:, ip), grid_valid_shape (2,:))
00254 endif
00255 end do
00256
00257 ip = ipa
00258
00259
00260
00261 do j = 1, nreq
00262 if (send_mask(j)) then
00263
00264
00265
00266
00267
00268
00269
00270
00271
00272 ip = ip + 1
00273
00274 buf (1, ip) = tgt_coords1 (indices_req(j))
00275 buf (2, ip) = tgt_coords2 (indices_req(j))
00276 buf (3, ip) = tgt_coords3 (indices_req(j))
00277
00278
00279
00280 do n = 1, nbc
00281 buf (ndim_3d+(n-1)*ndim_2d+1, ip) = &
00282 corners1 (ind(1,ip), ind (2,ip), n)
00283 buf (ndim_3d+(n-1)*ndim_2d+2, ip) = &
00284 corners2 (ind(1,ip), ind (2,ip), n)
00285 end do
00286
00287 ipb = ndim_3d + nbc * ndim_2d
00288 buf (ipb+1, ip) = corners3 (ind(3, ip), 1)
00289 buf (ipb+2, ip) = corners3 (ind(3, ip), 2)
00290
00291
00292
00293
00294
00295
00296
00297
00298
00299
00300
00301 ipi = ipi + 1
00302
00303 ibuf (1, ipi) = srcloc_ind (1, ip)
00304 ibuf (2, ipi) = srcloc_ind (2, ip)
00305 ibuf (3, ipi) = srcloc_ind (3, ip)
00306
00307 ibuf (4, ipi) = j
00308 ibuf (5, ipi) = required (j)
00309
00310 endif
00311 end do
00312
00313
00314
00315 ipia = ipi
00316 ipa = ip
00317
00318 #ifdef VERBOSE
00319 print 9980, trim(ch_id), ierror
00320
00321 call psmile_flushstd
00322 #endif /* VERBOSE */
00323
00324
00325
00326
00327 #ifdef VERBOSE
00328
00329 9990 format (1x, a, ': psmile_store_faces_irreg2_real: nreq ', i5)
00330 9980 format (1x, a, ': psmile_store_faces_irreg2_real: eof ierror =', i3)
00331
00332 #endif /* VERBOSE */
00333
00334 #ifdef DEBUG
00335 #endif
00336
00337 end subroutine PSMILe_Store_faces_irreg2_real