Quantcast
Channel: Fortran
Viewing all articles
Browse latest Browse all 3108

"exited with code 0" using UNLSF Solver

$
0
0

Hello!

I have some issues using the UNLSF Solver. When I´m debugging the program stops giving me error "..XXX.exe: Native' has exited with code o (0x0)" when it is calling DUNLSF. So its not even jumping into the objective function subroutine.

Like it is described here i set IPARAM = 0, so default values should be used for IPARAM and RPARAM. Trying to CALL U4LSF to set parameters instead, didn't help either.

You can see the code below. I had to change it a little bit, so you can't see the equations in the objective functions. But i think it's not important in this case.

Fortran 77, Visual Studio 8

Any ideas, what the problem can be?

 

Thanks in advance!

 

      SUBROUTINE SUB1()
      INCLUDE 'Declaration.inc'

      INTEGER M_sp, N_sp
      PARAMETER (M_sp = 6, N_sp = 2)
      INTEGER NOUT, LDFJAC

      INTEGER IPARAM(6)


      DOUBLE PRECISION x_init_guess(N_spec),
     &                   x_init_var(N_Spec)

      DOUBLE PRECISION FVEC(M_sp), FJAC(M_sp,N_sp)
      DOUBLE PRECISION XSCALE(N_sp), FSCALE(M_sp)
      REAL RPARAM(7)

      EXTERNAL OBJECTIVE_FUNCTION



      x_init_guess(1) = x_sp_(4)                !x_sp_ = global var.
      x_init_guess(2) = x_sp_(6)


      IPARAM(1) = 0

      !CALL U4LSF (IPARAM, RPARAM)
      CALL DUNLSF (OBJECTIVE_FUNCTION, M_sp, N_sp, x_init_guess
     &              ,XSCALE, FSCALE, IPARAM, RPARAM, x_init_var,&                                               FVEC, FJAC, LDFJAC)

      CALL UMACH (2, NOUT)

      END SUBROUTINE SUB1






      !CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC!
      !!!!!!!!!!!OBJECTIVE FUNCTION!!!!!!!!

      SUBROUTINE OBJECTIVE_FUNCTION(M_sp_2, N_sp_2,
     &                           x_init_var_2, F_)
      INCLUDE 'Declaration.inc'

      INTEGER M_sp_2, N_sp_2
      DOUBLE PRECISION x_init_var_2(N_sp_2), F_(M_sp_2)



      x_sp_(1) = ...
        .
        .
        .
      x_sp_(9) = ....
      !x_sp_(1:9) = f(x_init_var_2(1) and x_init_var_2(2))



      F_(1) = ...
        .
        .
        .
      F_(6) = ...
      !F_(1:6) = f(x_init_var_2(1) and x_init_var_2(2) and x_sp_(1:9))


      END SUBROUTINE OBJECTIVE_FUNCTION



     

 


Viewing all articles
Browse latest Browse all 3108

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>