matcoef.f 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. SUBROUTINE MATCOEF(TES,PROD,COEF,NOBS,NLD,DEBUG)
  2. * ***************************************************************
  3. * *
  4. * Summary: *
  5. * -------- *
  6. * Transforms an initial input-output table *
  7. * to a table of technical coefficients *
  8. * *
  9. * Variables: *
  10. * ---------- *
  11. * TES (input) : (NOBSxNOBS)-matrix of the input-output table *
  12. * PROD (input) : (1xNOBS)-vector of production values *
  13. * COEF (output) : the table of technical coefficients *
  14. * NOBS (input) : the number of obesrvations in the problem *
  15. * NLD (input) : the leading dimension of the tables *
  16. * DEBUG (input) : a binary variable that indicates whether *
  17. * intermediate computations are shown or not *
  18. * *
  19. * Author : Moez Kilani *
  20. * Date : April 2012; revised June 2012 *
  21. * *
  22. *****************************************************************
  23. IMPLICIT NONE
  24. INTEGER NOBS,NLD,DEBUG
  25. REAL*8 TES(NLD,*),PROD(*),COEF(NLD,*)
  26. C LOCAL VARIABLES
  27. INTEGER I,J
  28. REAL*8 TOT
  29. CHARACTER*10 FMT
  30. DO I=1,NOBS
  31. DO J=1,NOBS
  32. COEF(I,J)=TES(I,J)/PROD(J)
  33. ENDDO
  34. ENDDO
  35. IF(DEBUG.EQ.1)THEN
  36. WRITE(FMT,'("("I0,"F9.3)")') NOBS
  37. PRINT*,'TECHNICAL COEFICIENTS'
  38. DO I=1,NOBS
  39. WRITE(*,FMT),(COEF(I,J),J=1,NOBS)
  40. ENDDO
  41. ENDIF
  42. RETURN
  43. ENDSUBROUTINE