Subroutine callspecgeneration(nnode,x,y,eg,generation)

出自 DDCC Documentation
前往: 導覽搜尋

This function is activated by $usegenspecfunc. It is similar to Subroutine callgeneration(x,y,z,generation,ind)
However, it is sending the whole x,y, and generation matrix. Not the single value.


subroutine callspecgeneration(nnode,x,y,eg,generation) 
use nrtype ,only : dp,i4b,i8b
use global2d
implicit none
integer(i8b), intent(in) :: nnode  ! total node number
real(dp) , intent(inout) :: x(nnode),y(nnode),eg(nnode),generation(nnode)  ! matrix x, matrix y, Bandgap, and generation
real(dp) :: xp,yp,bandgap
integer :: i,j 
do i=1,nnode
   xp=x(i)
   yp=y(i)
   bandgap=eg(i)
   if(xp>2.0 .and. xp<3.0) then
      generation(i)=0.0_dp
   end if
end do
!print*, " This function usually for solar cell application where its generation rate will be related to the bandgap. 
!print*, "You should not call 2D-ddcc.exe  to run callspecgeneration. You should use 2D-ddcc-dyna.exe to run it."
!stop
end subroutine