Fortran

array uygulamasi

array uygulamasi program av2 implicit none real ,dimension(10) :: x real :: average,sum integer :: i print *, 'enter 10 numbers' sum=0.0 do i=1,10 read *, x(i) sum=sum+x(i) end do average=sum/10 print *, 'the average is ',average print *, 'the numbers are' print *,x end program av2 »

do loop

do loop program loop implicit none integer :: i do i=0,20 print *,i end do end program loop »

dynamic allocation

dynamic allocation program alloc implicit none integer, allocatable,dimension(:):: vector !note syntax - dimension(:) integer :: elements,i print *,'enter the number of elements in the vector' read *,elements allocate(vector(elements)) !allocates the correct amount of memory print *,' your vector is of size ',elements,'. Now enter each element' do i=1,elements read *,vector(i) end do print *,'This is your vector' do i=1,elements print *,vector(i) end do deallocate(vector) !tidies up the memory end program alloc »

exiting loops on condition

exiting loops program whileloop implicit none integer, parameter :: ikind=selected_real_kind(p=15) real (kind=ikind) :: sum,previoussum,x,smallnumber,error integer :: i sum = 0.0 previoussum = 0.0 smallnumber = 10.0_ikind**(-15.0) do i=1,1000 x=i sum = sum + 1.0 /(x**6) error=abs(sum-previoussum) if (error<smallnumber) then print *,'sum ',sum,' number of loops ',i exit end if previoussum = sum end do end program whileloop »

format islemleri

format islemleri integer :: a = 123, b = -456, c = 123456 write(*,"(I5)") a !ekranda 5 birimlik yere a integer'ini bas. a'yi bu 5 birimden saga dayali olarak yaz. write(*,"(I4)") b write(*,"(I7)") c write(*,*) ! 1 satir bosluk write(*,"(I5.2)") a !ekranda 5 birimlik yere a integer'ini bas. bu 5 birimlik yerden en az 2 birimine digit bas. write(*,"(I5.4)") b write(*,"(I10.7)") c end program !cikti: ! 123 !-456 ! 123456 ! »

fortran compiler

fortran 95 compiler i buradan indirilebilir kurulumun atildigi path: C:\Program Files (x86)\Silverfrost\FTN95 ide ismi plato.exe. asagidaki dizinde. C:\Program Files (x86)\Silverfrost\FTN95 »

fortran to matlab

yuksek lisans dersi elektromagnetik uyumluluk dersi projesi. buradaki pdf’teki C3 probleminin cozumu. fortran kodlari icin input dosyalari: PCB.IN dosyasi yukaridaki input dosyalarina gore elde edilmesi gereken cikti dosyasi: PUL.DAT dosyasi asagidaki fortran kodlari matlab kodlarina donusturuldu. matlab‘a donusturulmus kodlar da burada C******PROGRAM PCB.FOR************************************************* C To Determine the NxN Generalized Capacitance Matrix C of a N-Conductor Printed Circuit Board. The (N-1)x(N-1) Transmission C Line Capacitance and Inductance Matrices are also Computed from C these Results. »

function subroutine farki

function’lar tek bir deger return ederler, subroutine’ler birden cok deger return edebilirler. bir function ornegi REAL FUNCTION PHI(D) COMMON DELTA,T DP=D+T+DELTA/2. DM=D-DELTA/2. PHIB=DP+DM RETURN ! PHIB degerini return ediyor. END bir subroutine ornegi SUBROUTINE GAUSSJ(INDXR,INDXC) INDXR=3+5 INDXC=1/7 RETURN ! INDXR ve INDXC degerlerini return ediyor. END »