02.05.2014 Views

Patrick Corde & Anne Fouilloux

Patrick Corde & Anne Fouilloux

Patrick Corde & Anne Fouilloux

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Corrigés 244<br />

60 ! Procédure de transformation.<br />

61 subroutine transform( t, n, m, f )<br />

62 implicit none<br />

63 integer :: n, m, i, j<br />

64 real, dimension(n,m) :: t<br />

65 real :: f<br />

66<br />

67 do i=1,n<br />

68 do j=1,m<br />

69 t(i,j) = f(t(i,j))<br />

70 end do<br />

71 end do<br />

72 end subroutine transform<br />

73 ! Définitions des fonctions de transformation.<br />

74 function identite(x)<br />

75 implicit none<br />

76 real x, identite<br />

77 identite = x<br />

78 end function identite<br />

79<br />

80 function carre(x)<br />

81 implicit none<br />

82 real x, carre<br />

83 carre = x*x<br />

84 end function carre<br />

85<br />

86 function logarithme(x)<br />

87 implicit none<br />

88 real x, logarithme<br />

89 logarithme = log(x)<br />

90 end function logarithme<br />

INSTITUT DU DÉVELOPPEMENT<br />

ET DES RESSOURCES<br />

EN INFORMATIQUE SCIENTIFIQUE<br />

Cours langage Fortran – 27 janvier 2006<br />

<strong>Patrick</strong> <strong>Corde</strong> et <strong>Anne</strong> <strong>Fouilloux</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!