When using “declare” in a module, the device variables are created when the device is initialize. In this case, the initialization occurs upon entering the “parallel loop”. Though while a, b, c, and N are initialized on the device, you’re getting wrong answers since you need and “update self©” to update the host values of “c”.
Note that I would recommend using “declare create” instead of “declare copyin”, and then add an “update device(a,b,N)” after you initialize the variables on the host. My assumption is that as you write more programs, you may include other compute or data regions before initializing the host data. Since they get created at device initialization, they could be copied in before you initialize the host variables. Explicitly updating the variables on the device will cause less issues for you later.
% cat test.F90
!$acc declare create(a(100),b(100),c(100),N)
!$acc routine seq
!$acc routine(add1,add2,add3) seq
!$acc update device(a,b,N)
!$acc parallel loop
!$acc update self(c)
% pgfortran -ta=tesla test.F90 ; a.out
Hope this helps,