फ़ोरट्रान

प्रोग्रामिंग भाषा

फोरट्रान (अंग्रेज़ी: Fortran/पहले FORTRAN) एक प्रोग्रामन भाषा है जिसका विकास 1950 के दशक में हुआ था। तब से लेकर अबतक इस भाषा के कई संस्करण निकल चुके हैं यथा - FORRTAN66, Fortran77, Fortran90 और Fortran95। इसका विकास आईबीएम में सूत्र अनुकूटक (Formula Translater) के रूप में हुआ था। आज यह गणकीय तरल यांत्रिकी में बहुत प्रयुक्त होता है।

इसके कई कंपाइलर लिखे गए हैं, जैसे आईबीएम (मूल), एचपी, जीएनयू तथा अन्य कई। इसकी एक पंक्ति में 72 से अधिक वर्ण नहीं लिखे जा सकते हैं। पंक्ति के अंत में अर्धविराम नहीं लगता है। इस संदर्भ में इसकी तुलना C/C++ जैसी भाषाओं से की जा सकती है जिसमें अनुदेश खत्म होने के बाद एक अर्धविराम लगाना आवश्यक होता है।

फोर्ट्रान के विभिन्न संस्करण संपादित करें

  • 1956. Fortran I
  • 1958. Fortran II[1]
  • 1959. Fortran III
  • 1962. Fortran IV
  • 1964. Fortran V
  • 1965। standard ECMA Fortran[2]
  • 1966. Fortran 66 (USASI X3.9-1966)[3]
  • 1978. Fortran 77 (ANSI X3.9-1978)[4] · [5]
  • 1991. Fortran 90 (ISO/IEC 1539:1991 फिर ANSI X3.198-1992)[6]
  • 1992 IEEE 1003.9-1992, Fortran 77 of the POSIX standard[7].
  • 1994 ISO/IEC 1539-2:1994
  • 1997. Fortran 95 (ISO/CEI 1539-1:1997)[8]
  • 1999 ISO/IEC 1539-3:1999
  • 2004. Fortran 2003 (ISO/CEI 1539-1:2004)[9]
  • 2010. Fortran 2008 (ISO/CEI 1539-1:2010)[10].
  • अगला संस्करण « Fortran 2015 », होगा, जो मामूली परिवर्तनों के साथ होगा।[11] · [12].

फोरट्रान कोड के उदाहरण संपादित करें

निम्नलिखित प्रोग्राम, इन्टरैक्टिव रूप से इन्टर किये गये डेटा का औसत (average) निकालता है। इस प्रोग्राम में Fortran 90 के दो विशेष गुणों- डायनेमिक मेमोरी अल्लोकेशन तथा अर्रे-आधारित-संक्रियाएँ को दर्शाता है। ध्यान दीजिये कि इसमें DO लूप तथा IF/THEN का उपयोग करके अर्रे (array) को किस प्रकार परिवर्तित किया गया है।

program average

 ! Read in some numbers and take the average
 ! As written, if there are no data points, an average of zero is returned
 ! While this may not be desired behavior, it keeps this example simple

 implicit none

 real, dimension(:), allocatable :: points
 integer             :: number_of_points
 real              :: average_points=0., positive_average=0., negative_average=0.

 write (*,*) "Input number of points to average:"
 read (*,*) number_of_points

 allocate (points(number_of_points))

 write (*,*) "Enter the points to average:"
 read (*,*) points

 ! Take the average by summing points and dividing by number_of_points
 if (number_of_points > 0) average_points = sum(points) / number_of_points

 ! Now form average over positive and negative points only
 if (count(points > 0.) > 0) then
   positive_average = sum(points, points > 0.) / count(points > 0.)
 end if

 if (count(points < 0.) > 0) then
   negative_average = sum(points, points < 0.) / count(points < 0.)
 end if

 deallocate (points)

 ! Print result to terminal
 write (*,'(a,g12.4)') 'Average = ', average_points
 write (*,'(a,g12.4)') 'Average of positive points = ', positive_average
 write (*,'(a,g12.4)') 'Average of negative points = ', negative_average

end program average


  1. साँचा:Article
  2. साँचा:Pdf Standard ECMA Fortran Archived 2011-10-18 at the वेबैक मशीन
  3. साँचा:Pdf Standard Fortran 66 Archived 2011-05-15 at the वेबैक मशीन
  4. साँचा:Pdf Standard Fortran 77 Archived 2011-06-15 at the वेबैक मशीन
  5. साँचा:Article
  6. साँचा:Pdf Standard Fortran 90[मृत कड़ियाँ]
  7. "IEEE 1003.9-1992 - POSIX(R) FORTRAN 77 Language Interfaces - Part 1: Binding for System Application Program Interface (API)". मूल से 6 दिसंबर 2010 को पुरालेखित. अभिगमन तिथि 19 दिसंबर 2016.
  8. साँचा:Pdf Standard Fortran 95 Archived 2011-08-18 at the वेबैक मशीन
  9. साँचा:Pdf Standard Fortran 2003 Archived 2005-05-04 at the वेबैक मशीन
  10. साँचा:Pdf Standard Fortran 2008 Archived 2015-05-13 at the वेबैक मशीन
  11. "Doctor Fortran Goes Dutch: Fortran 2015". मूल से 24 फ़रवरी 2017 को पुरालेखित. अभिगमन तिथि 19 दिसंबर 2016.
  12. साँचा:Pdf F2015 Working Document Archived 2017-01-13 at the वेबैक मशीन, J3, 31