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.

Procédures internes 166<br />

subroutine conversion( chaine )<br />

implicit none<br />

character(len=*) :: chaine<br />

integer i<br />

do i=1,len(chaine)<br />

if( ichar( chaine(i:i) ) < 97 .or.<br />

ichar( chaine(i:i) ) > 122 ) cycle<br />

chaine(i:i) = car_majuscule( chaine(i:i) )<br />

end do<br />

CONTAINS<br />

function car_majuscule( c )<br />

character(len=1) :: c, car_majuscule<br />

integer<br />

:: i<br />

i = ichar( c ) - (ichar(’a’) - ichar( ’A’ ))<br />

car_majuscule = achar( i )<br />

end function car_majuscule<br />

end subroutine conversion<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!