Hi David
I never knew that one can if an array as in your example! Anyway, I tried it as shown below - parsing an array in (/ ... /). This is real cool ans saves a lot of time when connecting nodes. You can image how many lines I wasted doing it the 'old' way.
It always pays off keeping an eye in the forum 😄
call add_bc(srg,14,201,(/-2,-1,11,-7/))
call add_bc(srg,17, 0,(/-17,-16,-31,-18/))
subroutine add_bc(srg,pos,mat,ivrt)
implicit none
integer,dimension(:) :: ivrt
type(srg_type) :: srg
integer :: pos,mat
integer :: n,i,k
n = size(ivrt)
srg%nvbc(pos) = n
srg%itype(pos) = mat
if (pos == 1) then
k = 1
else
k = sum(srg%nvbc(1:pos-1))+1
endif
do i=1,n
srg%ivrt(k) = ivrt(i)
k = k+1
enddo
return
end subroutine