00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 subroutine psmile_locations_alloc (send_info, ierror)
00012
00013
00014
00015 use PRISM_constants
00016
00017 use PSMILe, dummy_interface => PSMILe_Locations_alloc
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 Integer, parameter :: nerrp = 2
00048 Integer :: ierrp (nerrp)
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067 Character(len=len_cvs_string), save :: mycvs =
00068 '$Id: psmile_locations_alloc.F90 2936 2011-02-03 09:36:47Z hanke $'
00069
00070
00071
00072
00073
00074 #ifdef VERBOSE
00075 print 9990, trim(ch_id)
00076
00077 call psmile_flushstd
00078 #endif /* VERBOSE */
00079
00080 ierror = 0
00081
00082 nvec = send_info%nvec
00083 nparts = send_info%nparts
00084
00085 #ifdef PRISM_ASSERTION
00086 if ( min (nvec, nparts) <= 0 ) then
00087 print *, trim(ch_id), ', nvec, nparts', nvec, nparts
00088 call psmile_assert (__FILE__, __LINE__, "nvec or nparts <= 0")
00089 endif
00090 #endif
00091
00092
00093
00094 Allocate (send_info%npoints(nvec, nparts), &
00095 send_info%nars (nvec, nparts), &
00096 send_info%srcars (nvec, nparts), &
00097 send_info%srclocs(nvec, nparts), &
00098 send_info%msklocs(nvec, nparts), STAT = ierror)
00099
00100 if ( ierror > 0 ) then
00101 ierrp (1) = ierror
00102 ierrp (2) = nvec * nparts * 5
00103
00104 ierror = PRISM_Error_Alloc
00105 call psmile_error ( ierror, 'send_info%{npoints,nars,srcars,srclocs,msklocs}', &
00106 ierrp, 2, __FILE__, __LINE__ )
00107 return
00108 endif
00109
00110
00111
00112 send_info%npoints = 0
00113 send_info%nars = 0
00114
00115 do j = 1, nparts
00116 do i = 1, nvec
00117 Nullify (send_info%msklocs(i, j)%vector)
00118 Nullify (send_info%srclocs(i, j)%vector)
00119 Nullify (send_info%srcars (i, j)%vector)
00120 end do
00121 end do
00122
00123 Nullify (send_info%virtual)
00124 Nullify (send_info%dstijk)
00125 Nullify (send_info%list_entries)
00126
00127
00128
00129 #ifdef VERBOSE
00130 print 9980, trim(ch_id), ierror
00131
00132 call psmile_flushstd
00133 #endif /* VERBOSE */
00134
00135
00136
00137
00138 #ifdef VERBOSE
00139
00140 9990 format (1x, a, ': psmile_locations_alloc:')
00141 9980 format (1x, a, ': psmile_locations_alloc: eof ierror =', i3)
00142
00143 #endif /* VERBOSE */
00144
00145 end subroutine PSMILe_Locations_alloc