19 |
|
!! @author J. Daniel Gezelter |
20 |
|
!! @author Charles F. Vardeman II |
21 |
|
!! @author Matthew Meineke |
22 |
< |
!! @version $Id: vector_class.F90,v 1.7 2003-03-14 18:34:39 chuckv Exp $, $Date: 2003-03-14 18:34:39 $, $Name: not supported by cvs2svn $, $Revision: 1.7 $ |
22 |
> |
!! @version $Id: vector_class.F90,v 1.8 2003-03-14 19:51:11 chuckv Exp $, $Date: 2003-03-14 19:51:11 $, $Name: not supported by cvs2svn $, $Revision: 1.8 $ |
23 |
|
|
24 |
|
module Vector_class |
25 |
|
|
445 |
|
|
446 |
|
whichprop = getPropertyIndex(this, PropName) |
447 |
|
if (whichprop .eq. 0 ) then |
448 |
< |
write(*,*) 'unknown property! ', PropName |
448 |
> |
write(*,*) 'unknown property: ', PropName |
449 |
|
pv = 0.0 |
450 |
|
else |
451 |
|
if (this%PropertyDataType(whichprop) .ne. real_data_type) then |
452 |
< |
write(*,*) 'Property! ', PropName, " is not real data type." |
452 |
> |
write(*,*) 'Property: ', PropName, " is not real data type." |
453 |
|
pv = 0.0 |
454 |
|
else |
455 |
|
pv = this%realElementProperties(id, whichprop) |
516 |
|
integer, intent(in) :: minCapacity, minPropCap |
517 |
|
integer :: oldCapacity, oldPropCap |
518 |
|
integer :: newCapacity, newPropCap |
519 |
< |
logical :: resizeFlag = .false. |
519 |
> |
logical :: resizeFlag |
520 |
|
|
521 |
+ |
resizeFlag = .false. |
522 |
|
|
523 |
|
! first time: allocate a new vector with default size |
524 |
+ |
|
525 |
|
if (.not. associated(this)) then |
526 |
|
this => initialize() |
527 |
|
endif |
528 |
|
|
529 |
|
oldCapacity = size(this%ElementData) |
530 |
|
oldPropCap = size(this%PropertyDescriptions) |
529 |
– |
|
531 |
|
|
532 |
|
if (minCapacity > oldCapacity) then |
533 |
|
if (this%capacityIncrement .gt. 0) then |
539 |
|
newCapacity = minCapacity |
540 |
|
endif |
541 |
|
resizeFlag = .true. |
542 |
+ |
else |
543 |
+ |
newCapacity = oldCapacity |
544 |
|
endif |
545 |
|
|
546 |
|
!!! newCapacity is not set..... |
554 |
|
newPropCap = minPropCap |
555 |
|
endif |
556 |
|
resizeFlag = .true. |
557 |
+ |
else |
558 |
+ |
newPropCap = oldPropCap |
559 |
|
endif |
560 |
|
|
561 |
|
if (resizeFlag) then |
557 |
– |
write(*,*) "Resizing to new capacity: ",newCapacity |
562 |
|
that => initialize(newCapacity, newPropCap, & |
563 |
|
this%capacityIncrement, this%PropertyIncrement) |
564 |
|
call copyAllData(this, that) |
576 |
|
v2%elementData(i) = v1%elementData(i) |
577 |
|
do j = 1, v1%propertyCount |
578 |
|
|
579 |
< |
if (v1%PropertyDataType(j) .eq. integer_data_type) & |
579 |
> |
if (v1%PropertyDataType(j) .eq. integer_data_type) & |
580 |
|
v2%integerElementProperties(i,j) = & |
581 |
|
v1%integerElementProperties(i,j) |
582 |
|
|
741 |
|
write(*,*) 'Could not allocate Vector!' |
742 |
|
return |
743 |
|
end if |
744 |
+ |
|
745 |
+ |
this%initialCapacity = cap |
746 |
+ |
this%initialProperties = nprop |
747 |
+ |
this%capacityIncrement = capinc |
748 |
+ |
this%propertyIncrement = propinc |
749 |
|
|
750 |
|
allocate(this%elementData(this%initialCapacity), stat=error) |
751 |
|
if(error /= 0) write(*,*) 'Could not allocate elementData!' |
771 |
|
this%initialProperties), stat=error) |
772 |
|
if(error .ne. 0) write(*,*) 'Could not allocate logicalElementProperties!' |
773 |
|
|
765 |
– |
|
766 |
– |
|
767 |
– |
|
768 |
– |
this%initialCapacity = cap |
769 |
– |
this%initialProperties = nprop |
770 |
– |
this%capacityIncrement = capinc |
771 |
– |
this%propertyIncrement = propinc |
772 |
– |
|
773 |
– |
|
774 |
|
end function initialize_4i |
775 |
|
|
776 |
|
|