00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 subroutine psmile_transform_coords (comp_info, search, ierror)
00012
00013
00014
00015 use prism_constants
00016 use psmile_common, only : enddef_comp, enddef_search, &
00017 len_cvs_string, ch_id, &
00018 MPI_REAL, MPI_DOUBLE_PRECISION
00019 use psmile, only : all_comp_infos
00020 use psmile_grid, dummy_interface => psmile_transform_coords
00021
00022 implicit none
00023
00024
00025
00026 Type (Enddef_comp), Intent (In) :: comp_info
00027
00028
00029
00030
00031
00032 Type (Enddef_search), Intent (InOut) :: search
00033
00034
00035
00036
00037
00038 integer, Intent (Out) :: ierror
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049 Integer :: ipart
00050
00051
00052
00053
00054
00055
00056 Integer :: igrid, sgrid
00057
00058
00059
00060 Integer :: tr_code, tr_code_search
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080 Character(len=len_cvs_string), save :: mycvs =
00081 '$Id: psmile_transform_coords.F90 2787 2010-11-29 16:51:32Z hanke $'
00082
00083
00084
00085
00086
00087 #ifdef VERBOSE
00088 print 9990, trim(ch_id), search%msg_intersections%src_comp_id
00089
00090 call psmile_flushstd
00091 #endif /* VERBOSE */
00092
00093 ierror = 0
00094
00095 do ipart = 1, search%npart
00096
00097 igrid = search%msg_intersections%intersections(ipart)%src_all_extents_grid_id
00098 sgrid = search%msg_intersections%intersections(ipart)%tgt_all_extents_grid_id
00099
00100
00101
00102
00103 tr_code = comp_info%all_extent_infos(3, igrid)
00104 tr_code_search = &
00105 all_comp_infos(search%msg_intersections%all_comp_infos_comp_idx)%all_extent_infos(3, sgrid)
00106
00107 #ifdef DEBUG
00108 print *, trim(ch_id), ': igrid, sgrid, codes,', &
00109 igrid, sgrid, tr_code, tr_code_search
00110 print *, trim(ch_id), ': range', &
00111 search%msg_intersections%intersections(ipart)%intersection
00112 #endif
00113
00114 if (tr_code /= tr_code_search) then
00115 select case (search%datatype)
00116 case (MPI_DOUBLE_PRECISION)
00117 call psmile_transform_coords_db_re (tr_code_to=tr_code, &
00118 tr_code_from=tr_code_search, &
00119 coords_data_dble=search%search_dble(1:ndim_3d, ipart), &
00120 coords_size=search%dims(1:ndim_3d, ipart), &
00121 datatype=search%datatype, ierror=ierror)
00122 case (MPI_REAL)
00123 call psmile_transform_coords_db_re (tr_code_to=tr_code, &
00124 tr_code_from=tr_code_search, &
00125 coords_data_real=search%search_real(1:ndim_3d, ipart), &
00126 coords_size=search%dims(1:ndim_3d, ipart), &
00127 datatype=search%datatype, ierror=ierror)
00128 case default
00129 ierror = ierror + 1
00130 end select
00131
00132 if (ierror > 0) return
00133
00134
00135
00136
00137
00138
00139 endif
00140 end do
00141
00142
00143
00144 #ifdef VERBOSE
00145 print 9980, trim(ch_id), search%msg_intersections%src_comp_id, ierror
00146
00147 call psmile_flushstd
00148 #endif /* VERBOSE */
00149
00150
00151
00152 #ifdef VERBOSE
00153
00154 9990 format (1x, a, ': psmile_transform_coords: comp_id =', i3)
00155 9980 format (1x, a, ': psmile_transform_coords: comp_id =', i3, &
00156 '; eof ierror =', i4)
00157
00158 #endif /* VERBOSE */
00159
00160 end subroutine PSMILe_Transform_coords