00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 subroutine psmile_locations_dealloc (send_info, ierror)
00012
00013
00014
00015 use PRISM_constants
00016
00017 use PSMILe, dummy_interface => PSMILe_Locations_dealloc
00018
00019 implicit none
00020
00021
00022
00023 Type(Send_information), Intent(Inout) :: send_info
00024
00025
00026
00027
00028
00029 Integer, Intent (Out) :: ierror
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039 Integer :: nvec, nparts
00040
00041
00042
00043 Integer :: i, j
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068 Character(len=len_cvs_string), save :: mycvs =
00069 '$Id: psmile_locations_dealloc.F90 2938 2011-02-03 10:23:22Z hanke $'
00070
00071
00072
00073
00074
00075 #ifdef VERBOSE
00076 print 9990, trim(ch_id)
00077
00078 call psmile_flushstd
00079 #endif /* VERBOSE */
00080
00081 ierror = 0
00082
00083 nvec = send_info%nvec
00084 nparts = send_info%nparts
00085
00086 #ifdef PRISM_ASSERTION
00087 if ( min (nvec, nparts) <= 0 ) then
00088 print *, trim(ch_id), ', nvec, nparts', nvec, nparts
00089 call psmile_assert (__FILE__, __LINE__, "nvec or nparts <= 0")
00090 endif
00091
00092 if ( .not. Associated (send_info%srclocs) ) then
00093 call psmile_assert (__FILE__, __LINE__, &
00094 "send_info%srclocs is not allocated")
00095
00096 endif
00097
00098 if ( .not. Associated (send_info%msklocs) ) then
00099 call psmile_assert (__FILE__, __LINE__, &
00100 "send_info%msklocs is not allocated")
00101
00102 endif
00103
00104
00105
00106
00107
00108
00109
00110 if ( .not. Associated (send_info%srcars) ) then
00111 call psmile_assert (__FILE__, __LINE__, &
00112 "send_info%srcars is not allocated")
00113
00114 endif
00115
00116 if ( .not. Associated (send_info%nars) ) then
00117 call psmile_assert (__FILE__, __LINE__, &
00118 "send_info%nars is not allocated")
00119
00120 endif
00121
00122 if ( .not. Associated (send_info%npoints) ) then
00123 call psmile_assert (__FILE__, __LINE__, &
00124 "send_info%npoints is not allocated")
00125
00126 endif
00127 #endif
00128
00129
00130
00131
00132
00133 do j = 1, nparts
00134
00135 if (Associated(send_info%virtual)) then
00136 if (Associated(send_info%virtual(1, j)%vector) ) &
00137 Deallocate (send_info%virtual(1, j)%vector)
00138 endif
00139
00140 do i = 1, nvec
00141
00142 if (Associated(send_info%msklocs(i, j)%vector) ) &
00143 Deallocate (send_info%msklocs(i, j)%vector)
00144
00145 if (Associated(send_info%srclocs(i, j)%vector) ) &
00146 Deallocate (send_info%srclocs(i, j)%vector)
00147
00148 if (Associated(send_info%srcars(i, j)%vector) ) &
00149 Deallocate (send_info%srcars(i, j)%vector)
00150 end do
00151 end do
00152
00153 Deallocate (send_info%virtual, STAT = ierror)
00154
00155 Deallocate (send_info%msklocs, STAT = ierror)
00156
00157 Deallocate (send_info%srclocs, STAT = ierror)
00158
00159 Deallocate (send_info%srcars, STAT = ierror)
00160
00161 Deallocate (send_info%nars, STAT = ierror)
00162
00163 Deallocate (send_info%npoints, STAT = ierror)
00164
00165
00166
00167 send_info%nvec = 0
00168 send_info%nparts = 0
00169
00170
00171
00172 #ifdef VERBOSE
00173 print 9980, trim(ch_id), ierror
00174
00175 call psmile_flushstd
00176 #endif /* VERBOSE */
00177
00178
00179
00180
00181 #ifdef VERBOSE
00182
00183 9990 format (1x, a, ': psmile_locations_dealloc:')
00184 9980 format (1x, a, ': psmile_locations_dealloc: eof ierror =', i3)
00185
00186 #endif /* VERBOSE */
00187
00188 end subroutine PSMILe_Locations_dealloc