/scilab-master-1333395999/modules/scicos_blocks/src/fortran/logblk.f

# · FORTRAN Legacy · 53 lines · 23 code · 5 blank · 25 comment · 4 complexity · 6d051a94b612edd413b260897a1193b6 MD5 · raw file

  1. c Scicos
  2. c
  3. c Copyright (C) INRIA - METALAU Project <scicos@inria.fr>
  4. c
  5. c This program is free software; you can redistribute it and/or modify
  6. c it under the terms of the GNU General Public License as published by
  7. c the Free Software Foundation; either version 2 of the License, or
  8. c (at your option) any later version.
  9. c
  10. c This program is distributed in the hope that it will be useful,
  11. c but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. c MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. c GNU General Public License for more details.
  14. c
  15. c You should have received a copy of the GNU General Public License
  16. c along with this program; if not, write to the Free Software
  17. c Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  18. c
  19. c See the file ./license.txt
  20. c
  21. subroutine logblk(flag,nevprt,t,xd,x,nx,z,nz,tvec,ntvec,
  22. & rpar,nrpar,ipar,nipar,u,nu,y,ny)
  23. c Copyright INRIA
  24. c Scicos block simulator
  25. c y=log(u)/log(rpar(1))
  26. c
  27. double precision t,xd(*),x(*),z(*),tvec(*),rpar(*),u(*),y(*)
  28. integer flag,nevprt,nx,nz,ntvec,nrpar,ipar(*)
  29. integer nipar,nu,ny
  30. c
  31. if(flag.eq.1) then
  32. do 15 i=1,nu
  33. if(u(i).gt.0.0d0) then
  34. y(i)=log(u(i))/log(rpar(1))
  35. else
  36. flag=-2
  37. return
  38. endif
  39. 15 continue
  40. endif
  41. if(flag.eq.6) then
  42. do 20 i=1,nu
  43. if(u(i).gt.0.0d0) then
  44. y(i)=log(u(i))/log(rpar(1))
  45. endif
  46. 20 continue
  47. endif
  48. end