program rtopo2 c c read formatted version of etopo2 c Rows of data (latitude lines) are read one by c one starting at 89 58' North and stepping southward c by 2'. There are 5400 latitude lines. The 89 58' c South line is not given, elevation 2810 meters can c be assumed. c There are 10800 longitude points along each latitude c line. The first is 180 West, second 179 58' West, etc. c c Depth and elevations are in meters parameter (ilon=10800,ilat=5400) dimension itopo(ilon) c dimension idepth(ilon,ilat) open(20,file='etopo2.dat') c specific region to be printed alonl = -90.0 alonr = -60.0 alatt = 60.0 alatb = 30.0 if(alonl.lt.-180..or.alonr.gt.180.)then print*,' longitude specification error +- 180' print*,' alonl, alonr : ',alonl,alonr stop endif if(alatt.gt.90..or.alatb.lt.-90.)then print*,' latitude specification error +- 90' print*,' alatt, alatb : ',alatt,alatb stop endif write(*,49)alatb,alonl,alatt,alonr 49 format('Sample Data :'/, * 'Column and Row spacing : 2.0 degrees'/, * 'SW corner (lat/lon) :',2f6.0/, * 'NE corner (lat/lon) :',2f6.0) ilonl = nint(alonl + 180.)*30 + 1 ilonr = nint(alonr + 180.)*30 + 1 ilatb = nint(90.- alatb)*30 + 1 ilatt = nint(90.- alatt)*30 + 1 if(ilonr.eq.ilon+1)ilonr=ilon if(ilatb.eq.ilat+1)ilatb=ilat do j=1,ilat read(20,'(15i6)')(itopo(i),i=1,ilon) if(j.gt.ilatb)go to 60 !stop read data once min. latitude found c print some data on a 2 degree grid if(j.ge.ilatt.and.j.le.ilatb.and.mod(j,60).eq.0)then write(*,'(24i6)')(itopo(i),i=ilonl,ilonr,60) endif c move latitude line data into depth 2-d array c uncomment 'dimension depth (i,j)' above to use this feature c c do i=1,ilon c idepth(i,j)=itopo(i) c enddo enddo 60 print*,'Processing completed: ' stop end