genrep Subroutine

private subroutine genrep(me, ip, ph, newph)

Full generational replacement: accumulate offspring into new population array

Type Bound

pikaia_class

Arguments

Type IntentOptional 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

Called by

proc~~genrep~~CalledByGraph proc~genrep pikaia_module::pikaia_class%genrep proc~pikaia pikaia_module::pikaia_class%pikaia proc~pikaia->proc~genrep proc~solve_with_pikaia pikaia_module::pikaia_class%solve_with_pikaia proc~solve_with_pikaia->proc~pikaia

Source Code

    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