previous up next print clean
Next: CHANGES FROM RATFOR77 Up: Clapp & Claerbout: RATional Previous: INTRODUCTION

RATFOR BASICS

You should be able to read Ratfor if you already know Fortran, C, or any similar computer language. The Ratfor processor is not a compiler but a simple word-processing program that converts the Ratfor dialect to Fortran. To maximize your use of Ratfor, you will need to know its rules:

Function Ratfor Fortran90 C
multiple statements May be separated by ``;''. Equivalent Equivalent
on one line      
do Multi-line statements DO/ END DO construct, Equivalent
  bracketed with { }. may be named.  
if Multi-line statements Multi-line require THEN/ Equivalent
  bracketed { } END IF.  
else/ Multiple statements in { } Requires THEN/ELSE Equivalent
else if single statements per THEN/ END IF construct  
  construct do not require {}.    
while while() {} DO WHILE()/END DO Equivalent
break if/while break exit Equivalent
iterate do next CYCLE continue
relation operators ==, !=, >, .eq. or ==, /= or .ne. Equivalent
  <, >=, > .gt. or >, < or .lt.,  
    .ge. or >=, .le. or <=  
Comments #, to the end of the is a Same functionality enclosed by
  comment with !. /* */
and and or && , || .and., .or. Equivalent
line _ & end of line
continuation     delineated
      with ``;''
for statement for(initial; end; update) Some of the functionality Equivalent
    possible with DO.  


previous up next print clean
Next: CHANGES FROM RATFOR77 Up: Clapp & Claerbout: RATional Previous: INTRODUCTION
Stanford Exploration Project
10/9/1997