mirror of
https://github.com/sfilippone/psblas3.git
synced 2026-10-15 18:39:10 +00:00
Fix realloc for 2D arrays.
This commit is contained in:
@@ -1329,13 +1329,15 @@ Contains
|
||||
end if
|
||||
else if (allocated(vin)) then
|
||||
if (.not.allocated(vout)) then
|
||||
allocate(vout(size(vin,1),size(vin,2)),stat=info)
|
||||
allocate(vout(lbound(vin,1):ubound(vin,1),&
|
||||
& lbound(vin,2):ubound(vin,2)),stat=info)
|
||||
if (info /= 0) return
|
||||
else
|
||||
if (size(vout) /= size(vin)) then
|
||||
deallocate(vout,stat=info)
|
||||
if (info /= 0) return
|
||||
allocate(vout(size(vin,1),size(vin,2)),stat=info)
|
||||
allocate(vout(lbound(vin,1):ubound(vin,1),&
|
||||
& lbound(vin,2):ubound(vin,2)),stat=info)
|
||||
if (info /= 0) return
|
||||
end if
|
||||
end if
|
||||
@@ -1401,13 +1403,15 @@ Contains
|
||||
end if
|
||||
else if (allocated(vin)) then
|
||||
if (.not.allocated(vout)) then
|
||||
allocate(vout(size(vin,1),size(vin,2)),stat=info)
|
||||
allocate(vout(lbound(vin,1):ubound(vin,1),&
|
||||
& lbound(vin,2):ubound(vin,2)),stat=info)
|
||||
if (info /= 0) return
|
||||
else
|
||||
if (size(vout) /= size(vin)) then
|
||||
deallocate(vout,stat=info)
|
||||
if (info /= 0) return
|
||||
allocate(vout(size(vin,1),size(vin,2)),stat=info)
|
||||
allocate(vout(lbound(vin,1):ubound(vin,1),&
|
||||
& lbound(vin,2):ubound(vin,2)),stat=info)
|
||||
if (info /= 0) return
|
||||
end if
|
||||
end if
|
||||
@@ -1474,13 +1478,15 @@ Contains
|
||||
end if
|
||||
else if (allocated(vin)) then
|
||||
if (.not.allocated(vout)) then
|
||||
allocate(vout(size(vin,1),size(vin,2)),stat=info)
|
||||
allocate(vout(lbound(vin,1):ubound(vin,1),&
|
||||
& lbound(vin,2):ubound(vin,2)),stat=info)
|
||||
if (info /= 0) return
|
||||
else
|
||||
if (size(vout) /= size(vin)) then
|
||||
deallocate(vout,stat=info)
|
||||
if (info /= 0) return
|
||||
allocate(vout(size(vin,1),size(vin,2)),stat=info)
|
||||
allocate(vout(lbound(vin,1):ubound(vin,1),&
|
||||
& lbound(vin,2):ubound(vin,2)),stat=info)
|
||||
if (info /= 0) return
|
||||
end if
|
||||
end if
|
||||
|
||||
Reference in New Issue
Block a user