Determine the Jacobian matrix of f
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=I4), | intent(in) | :: | long |
number of points along x |
||
integer(kind=I4), | intent(in) | :: | larg |
number of points along y |
||
integer(kind=I4), | intent(in) | :: | nb_var |
number of parameters to be determined |
||
real(kind=R8), | intent(in), | dimension(1:long * larg, 1:2) | :: | vec_xy |
x and y coordinates of evaluation points |
|
real(kind=R8), | intent(inout), | dimension(1:nb_var) | :: | var |
parameters vector |
|
real(kind=R8), | intent(out), | dimension(1:long * larg, 1:nb_var) | :: | Jf |
Jacobian matrix |
subroutine calc_Jf(long, larg, nb_var, vec_xy, var, Jf) !! Determine the Jacobian matrix of f implicit none integer(kind=I4), intent(in) :: long !! *number of points along x* integer(kind=I4), intent(in) :: larg !! *number of points along y* integer(kind=I4), intent(in) :: nb_var !! *number of parameters to be determined* real (kind=R8), intent(in ), dimension(1:long * larg, 1:2) :: vec_xy !! *x and y coordinates of evaluation points* real (kind=R8), intent(out ), dimension(1:long * larg, 1:nb_var) :: Jf !! *Jacobian matrix* real (kind=R8), intent(inout), dimension(1:nb_var) :: var !! *parameters vector* integer(kind=I4) :: i, j, k, ivar k = 0 do j = 1, larg do i = 1, long k = k + 1 do ivar = 1, nb_var Jf(k, ivar) = df( xi = vec_xy(k, 1), & ! yi = vec_xy(k, 2), & ! var = var(1:3), & ! nb_var = 3, & ! ivar = ivar, & ! typ = "no_type") ! enddo enddo enddo return endsubroutine calc_Jf