Back to OASIS4 home

Routine psmile_find_intersect (comp_info, global_index, ninter, nmyint, nnull, lastag, ierror)
Subroutine "PSMILe_Find_intersect" looks for the intersections of the own grids with the grids of other components and sends the partner data on the extension of the intersection.

global_index, lasttag = in
comp_info, ninter, nmyint, nnul = inout
ierror = out

Examples :
here
here
here


Looks for the intersections of the own grids ("subgrids") of the processor of the component comp_id that calls psmile_find_intersect, with all the grids ("subgrids") of other components and sends the partner data on the extension of the intersection icomp.
Prepare search for remote grid with id "grid_id".

!  igrid_beg = Number of the first component grid located on this process
!  igrid_end = Number of the last  component grid located on this process
comp_id = comp_info%comp_id
rank    = Comps(comp_id)%rank
igrid_beg = SUM (comp_info%Number_of_grids_vector(1:rank)) + 1
igrid_end = igrid_beg + comp_info%Number_of_grids_vector(rank+1) - 1

n_in_fields  = Number of input  fields for this grid; i.e. number of fields which receive data from other applications.
n_out_fields = Number of output fields for this grid; i.e. number of fields for which data of other applications must be searched and interpolated.
mg_gen  = .false. : Multigrid sequence (need not be generated)
comp_id = comp_info%comp_id : local proc that calls psmile_find_intersect
rank    = Comps(comp_id)%rank : local proc that calls psmile_find_intersect
icomp = remote comp
dest = all_comp_infos(icomp)%psmile_ranks(i) : icomp is the remote proc with which found an intersection, psmile_rank its rank in the comm_psmile
extent_id = all_comp_infos(icomp)%all_extent_infos(1,jglob) : get number of (logical) partitions of global grid "jglob"
global_dest_grid_id = all_comp_infos(icomp)%all_extent_infos(4,jglob)
npart : number of intersections between grids on proc of comp_id and the grids on the proc i of the remote component
ninter : number of intersections that will be sent to the remote proc. Different from npart because it seems that at this point intersections are treated proc by proc.

Intersections of all the "subgrids" of the local proc are are founded with all the "subgrids" of concerned remote proc.

Send of all intersections of the "subgrids" contains on the local proc with all the "subgrids of the dest proc
               call psmile_bsend (field_list(1,2), (n_vars-1)*nd_field_list,
MPI_INTEGER, dest, vartag, comm_psmile, ierror)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Condition for generation of the multigrid (source side) :
npart > 0 means that there are intersection with the remote grids
n_out_fields > means that there is at least an output field for this component so it is a source.
if (n_out_fields > 0 .and. npart > 0.and.grid_type /= PRISM_Gridless) then
               if (.not. mg_gen (grid_id)) then
                  mg_gen (grid_id) = .true.
endif