! Calculeaza:
! Functii: f(u); g(u,u'); p(t);
! Jacobieni: jf = df/du; jg = dg/du; jg1 =dg/du1;
! Derivata: dp;
!
! Ex3 General_R. Excitatie armonica.
! ngl =3

subroutine fgp_j(t, uu, v)
use work

implicit real(8) (a-h, o-z)
real(8) uu(ngl), v(ngl)

real(8) KK(ngl,ngl)		!, PP(ngl)



zeta =e

! Define KK:
KK =0.

kk(1,:) =(/3_8, -1_8, 0_8/)

kk(2,:) =(/-1_8, 2_8, -1_8/)

kk(3,:) =(/0_8, -1_8, 1_8/)


! f(u) =K*U
f =matmul(KK,UU)


! Jacobianul lui f:
JF =KK

! g(u,u'):
g =0.

! Jacobianul Dg/Du:
jg =0.

! Jacobianul Dg/Du':
jg1 =0.


! p(t):
pp(1) =25_8; pp(2:3) =0.;

omp =0.3032848300909196_8		!omp =1.1*om(1)

p =pp*sin(omp*t)

! P derivat:
dp =omp*pp*cos(omp*t)

END subroutine FGP_J
