00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 subroutine psmile_get_faces_virtual_ind (search, extra_search, &
00012 send_info, len_cpl, &
00013 send_mask, nreq, virtual_ind, n_send, &
00014 ierror)
00015
00016
00017
00018 use PRISM
00019
00020 use PSMILe, dummy_interface => PSMILe_Get_faces_virtual_ind
00021
00022 Implicit none
00023
00024
00025
00026 Type (Enddef_search), Intent (In) :: search
00027
00028
00029
00030 Type (Extra_search_info), Intent (In) :: extra_search
00031
00032
00033
00034
00035
00036 Type (Send_information), Intent (In) :: send_info
00037
00038
00039
00040 Integer, Intent (In) :: len_cpl (search%npart)
00041
00042
00043
00044 Integer, Intent (In) :: nreq
00045
00046
00047
00048
00049 Logical, Intent (In) :: send_mask (nreq)
00050
00051
00052
00053 Integer, Intent (In) :: n_send
00054
00055
00056
00057
00058
00059
00060 Integer, Intent (Out) :: virtual_ind (n_send)
00061
00062
00063
00064 Integer, Intent (Out) :: ierror
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076 Integer :: j, n
00077
00078
00079
00080 Integer :: ipart, nextra_prev, nprev
00081 Integer :: nvec
00082
00083 Integer, Pointer :: indices_req (:)
00084 Integer, Pointer :: len_req (:)
00085 Integer, Pointer :: virtual (:)
00086
00087
00088
00089 #ifdef PRISM_ASSERTION
00090 Integer :: nlast, ispart
00091 #endif
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117 Character(len=len_cvs_string), save :: mycvs =
00118 '$Id: psmile_get_faces_virtual_ind.F90 2897 2011-01-19 15:42:53Z hanke $'
00119
00120
00121
00122
00123
00124 #ifdef VERBOSE
00125 print 9990, trim(ch_id)
00126
00127 call psmile_flushstd
00128 #endif /* VERBOSE */
00129
00130 ierror = 0
00131
00132 len_req => extra_search%len_req
00133
00134 #ifdef PRISM_ASSERTION
00135 if (SUM(len_req(:)) > nreq) then
00136 print *, 'nreq, sum(len_req)', nreq, SUM(len_req(:))
00137 call psmile_assert ( __FILE__, __LINE__, &
00138 'nreq is too small (inconsistent data)')
00139 endif
00140 #endif
00141
00142
00143
00144
00145
00146
00147 n = 0
00148 nprev = 0
00149 nextra_prev = 0
00150
00151 nvec = send_info%nvec
00152 if (nvec == 1) then
00153
00154
00155 virtual => send_info%virtual(1, 1)%vector
00156 endif
00157
00158 do ipart = 1, search%npart
00159
00160 if (len_req (ipart) > 0) then
00161 indices_req => extra_search%indices_req(ipart)%vector
00162 if (nvec > 1) virtual => send_info%virtual(1, ipart)%vector
00163
00164 #ifdef PRISM_ASSERTION
00165 nlast = n
00166 ispart = min (ipart, nvec)
00167 #endif
00168
00169
00170 do j = 1, len_req (ipart)
00171 if (send_mask(nextra_prev+j)) then
00172
00173
00174
00175 n = n + 1
00176
00177 virtual_ind (n) = virtual (indices_req(j) - nprev)
00178 endif
00179 end do
00180
00181 #ifdef PRISM_ASSERTION
00182 do j = nlast+1, n
00183 if (virtual_ind (j) < 0 .or. &
00184 virtual_ind (j) >= send_info%npoints(1,ispart)) exit
00185 end do
00186
00187 if (j <= n) then
00188 print *, "j, ind", j, virtual_ind (j), &
00189 send_info%npoints(1,ispart)
00190 call psmile_assert (__FILE__, __LINE__, &
00191 "Incorrect index generated");
00192 endif
00193 #endif
00194
00195 nextra_prev = nextra_prev + len_req (ipart)
00196 endif
00197
00198 if (nvec > 1) nprev = nprev + len_cpl (ipart)
00199 end do
00200
00201 #ifdef PRISM_ASSERTION
00202 if (n /= n_send) then
00203 print *, 'n, n_send', n, n_send
00204 call psmile_assert ( __FILE__, __LINE__, &
00205 'All indices were NOT generated for virtual_ind')
00206 endif
00207 #endif
00208
00209
00210
00211 #ifdef VERBOSE
00212 print 9980, trim(ch_id), ierror
00213
00214 call psmile_flushstd
00215 #endif /* VERBOSE */
00216
00217
00218
00219 #ifdef VERBOSE
00220
00221 9990 format (1x, a, ': psmile_get_faces_virtual_ind:')
00222 9980 format (1x, a, ': psmile_get_faces_virtual_ind: eof ierror =', i3)
00223
00224 #endif /* VERBOSE */
00225
00226 #ifdef DEBUG
00227 #endif
00228
00229 end subroutine PSMILe_Get_faces_virtual_ind