Sie sind auf Seite 1von 4

c c c

++++++++++++++++++++++++++++++++++++++++++++++++++++++ deklarasi awal ++++++++++++++++++++++++++++++++++++++++++++++++++++++ logical used,here parameter (ivol=100) dimension volume(0:ivol,ivol) dimension load(0:ivol,ivol) dimension conc(0:ivol,ivol) integer h character*15 vfile,wfile,cfile,outsegfil,outtsfil Data data data data data v/2/ w/3/ c/4/ outseg/5/ outts/6/

27 37 7 c c c

format(4x,'File ',a15,' not exist',//) format(4x,'Your answer is wrong. Try again!') format(a15) +++++++++++++++++++++++++++++++++++++++++++++++++++++ jumlah segmen dan time step +++++++++++++++++++++++++++++++++++++++++++++++++++++ write(*,'(a\)')' Jumlah segmen= ' read(*,*) nseg write(*,'(a\)')' Jumlah time step= ' read(*,*) ndat

c c c c 17 c

+++++++++++++++++++++++++++++++++++++++++++++++++++++ input file +++++++++++++++++++++++++++++++++++++++++++++++++++++ enter the volume file write(*,'(a\)')' Enter input "volume file" name >' read(*,7)vfile check whether the file is exist or not inquire(file=vfile,exist=here) if(.not.here) then write(*,27)vfile goto 17 else open(v,file=vfile,form='formatted',status='old') endif read volume file do 30 it=1,ndat do 33 ms=1,nseg read(v,*) volume(it,ms) continue continue read(v,*) volume(it,ms) ------------------------------------------------------

33 30 c c

c 11 c

enter the load file write(*,'(a\)')' Enter input "load file" name >' read(*,7)wfile check whether the file is exist or not inquire(file=wfile,exist=here) if(.not.here) then write(*,27)wfile goto 17 else open(w,file=wfile,form='formatted',status='old') endif read load file read(w,*) load(it,ms) ------------------------------------------------------enter the concentration file write(*,'(a\)')' Enter input "concentration file" name >' read(*,7)cfile check whether the file is exist or not inquire(file=cfile,exist=here) if(.not.here) then write(*,27)cfile goto 17 else open(c,file=cfile,form='formatted',status='old') endif read concentration file read(c,*) conc(it,ms) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ pilih segmen dan time step ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ write(*,'(a\)')' Kelipatan segmen yang akan ditampilkan= ' read(*,*)seg write(*,'(a\)')' Kelipatan time step yang akan ditampilkan= ' read(*,*)ts

c c c 16 c

c c c c

c c c c 42 c

++++++++++++++++++++++++++++++++++++++++++++++++++++++++ output file ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ enter file name for selected segment write(*,'(a\)')' Enter "selected segment" name >' read(*,7)outsegfil check whether the file is exist or not inquire(file=outsegfil,exist=used) if(.not.used) then open(outseg,file=outsegfil,form='formatted',status='new') else write(*,*)' the file already exist!' write(*,'(a\)')' overwrite(y/n)> ' read(*,7)ops

43

if(ops.ne.'y'.and.ops.ne.'n'.and.ops.ne.'Y'.and.ops.ne.'N') then write(*,37) goto 43 else if(ops.eq.'y'.or.ops.eq.'Y') then open(outseg,file=outsegfil,form='formatted',status='old') else if(ops.eq.'n'.or.ops.eq.'N') then goto 42 endif endif c c 47 c ----------------------------------------------------------enter file name for selected time step write(*,'(a\)')' Enter "selected time step" name >' read(*,7)outtsfil check whether the file is exist or not inquire(file=outtsfil,exist=used) if(.not.used) then open(outts,file=outtsfil,form='formatted',status='new') else write(*,*)' the file already exist!' write(*,'(a\)')' overwrite(y/n)> ' read(*,7)ops if(ops.ne.'y'.and.ops.ne.'n'.and.ops.ne.'Y'.and.ops.ne.'N') then write(*,37) goto 49 else if(ops.eq.'y'.or.ops.eq.'Y') then open(outts,file=outtsfil,form='formatted',status='old') else if(ops.eq.'n'.or.ops.eq.'N') then goto 47 endif endif ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ write topic in output file ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ kelipatan segmen Do 5 h=1,36 continue ks=h*seg kt=h*ts 1 2 3 c format(2x,40F18.3) format(1x,'Segmen kelipatan ',I6) format(1x,'time step kelipatan ',I6) segmen write(outseg,2)seg Do 100 ms=ks,nseg write(v,1) volume(it,ms) write(w,1) load(it,ms) write(c,1) conc(it,ms) continue time step

49

c c c c 5

100 c

110

write(outts,3)ts Do 110 it=kt,ndat write(v,1) volume(it,ms) write(w,1) load(it,ms) write(c,1) conc(it,ms) continue end

Das könnte Ihnen auch gefallen