Full generational replacement: accumulate offspring into new population array
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(pikaia_class), | intent(inout) | :: | me | |||
integer, | intent(in) | :: | ip | |||
real(kind=wp), | intent(in), | dimension(me%n,2) | :: | ph | ||
real(kind=wp), | intent(out), | dimension(me%n,me%np) | :: | newph |
subroutine genrep(me,ip,ph,newph) implicit none class(pikaia_class),intent(inout) :: me integer,intent(in) :: ip real(wp),dimension(me%n,2),intent(in) :: ph real(wp),dimension(me%n,me%np),intent(out) :: newph integer :: i1,i2,k !Insert one offspring pair into new population i1=2*ip-1 i2=i1+1 do k=1,me%n newph(k,i1)=ph(k,1) newph(k,i2)=ph(k,2) end do end subroutine genrep