program read_ErsMhfRsd c c Peter M. Woiceshyn Oct 9, 1998 c c Sample program provides read statements to read in ESA Ers scatterometer c data of wind speed ( meters per second) and wind direction c using the oceanographic convention for direction (for example, C wind towards the north is 0 degrees, towards the east it is 90, C degrees, towards the south it is 180 degrees, and towards the C west it is 270 degrees. c c The wind speed data are on a 1080 X 540 element grid with the origin at c -89.83333 South latitude and 0.16667 degrees East longitude (i.e., C a one third by one third degree lat/lon grid resolution ranging from C -89.83333 (S) to 89.83333 (N) in latitude & from 0.16667 to 359.833333 C in East longitude). c c The wind direction data are on a 72 X 36 element grid with the origin at c -88.75 South latitude and 1.25 degrees East longitude (i.e., C a five by five degree lat/lon grid resolution ranging from C -88.75 (S) to 86.25 (N) in latitude & from 1.25 to 356.25 C in East longitude). The wind direction data, however, have been c computed on the basis of a 2.5 by 2.5 lat/lon degree average at c each grid point for each month c c There are 12 months of data for 1997. c c Note that the data for each month corresponds c to a calender month. c c Declarations: REAL del1, del2, spd(1080,540), dir(72,36) REAL lon2(1080), lat2(540) REAL lon1(72) , lat1(36) C INTEGER*2 nlon1, nlat1, nlon2, nlat2 c CHARACTER*3 c_mon(12) CHARACTER*2 yc CHARACTER*20 f_in CHARACTER*5 f_label CHARACTER*4 suff C----------------------------------------------------------------------C DATA c_mon/'Jan','Feb','Mar','Apr','May','Jun', & 'Jul','Aug','Sep','Oct','Nov','Dec'/ C----------------------------------------------------------------------C yc = '97' suff = '.dat' f_label = c_mon(1)//yc ! Jan97 f_in = 'ErsMhfRsd'//f_label//suff C----------------------------------------------------------------------C nlon1 = 72 nlat1 = 36 nlon2 = 1080 nlat2 = 540 del1 = 5.0 del2 = 1.0/3.0 PRINT *,' ' PRINT *,' longitude array dimension for spd = ',nlon2 PRINT *,' latitude array dimension for spd = ',nlat2 PRINT *,' delta lat/lon deg for spd = ',del2 PRINT *,' ' PRINT *,' longitude array dimension for dir = ',nlon1 PRINT *,' latitude array dimension for dir = ',nlat1 PRINT *,' delta lat/lon deg for dir = ',del1 PRINT *,' ' C----------------------------------------------------------------------C C Construct lat & lon arrays for speed DO jj = 0, nlat2 - 1 lat2(jj+1) = jj*del2 - 90.0 + del2/2.0 ccc IF (jj .LT. 6) PRINT *, ' lat2 = ',lat2(jj+1) END do DO ii = 0, nlon2 - 1 lon2(ii+1) = ii*del2 + del2/2.0 END do C Construct lat & lon arrays for direction DO jj = 0, nlat1 - 1 lat1(jj+1) = jj*del1 - 90.0 + 1.25 ccc IF (jj .LT. 6) PRINT *, ' lat1 = ',lat1(jj+1) END do DO ii = 0, nlon1 - 1 lon1(ii+1) = ii*del1 + 1.25 END do C----------------------------------------------------------------------C c FOR SPEED c c Lat range: -89.83333(S) to 89.83333(N) degrees c c Lon range: 0.16667(E) to 359.83333(E) degrees c c c FOR DIRECTION c c Lat range: -88.75(S) to 86.25(N) degrees c c Lon range: 1.25(E) to 356.25(E) degrees c c PRINT *,' ' PRINT *,' Reading file: ',f_in PRINT *,' ' OPEN(22,file=f_in,form='unformatted') read(22) spd read(22) dir CLOSE(22) PRINT *,' ' PRINT *,' Sample Wind Speed Data:' PRINT *,' ' DO j = 270, 271 DO i = 1, 5 WRITE (6,'(A7,I5,2x,A7,I5,2x,A7,F8.2,2X,A7,F8.2,2X,A7,F8.2)') & ' i = ', i,' j = ', j, & ' lat = ', lat2(j),' lon = ', lon2(i), & ' spd = ',spd(i,j) END DO WRITE (6,'(A2)') ' ' END DO WRITE (6,'(A2)') ' ' PRINT *,' ' PRINT *,' Sample Wind Direction Data:' PRINT *,' ' DO j = 18, 19 DO i = 1, 5 WRITE (6,'(A7,I5,2x,A7,I5,2x,A7,F8.2,2X,A7,F8.2,2X,A7,F8.2)') & ' i = ', i,' j = ', j, & ' lat = ', lat1(j),' lon = ', lon1(i), & ' dir = ',dir(i,j) END DO WRITE (6,'(A2)') ' ' END DO WRITE (6,'(A2)') ' ' C----------------------------------------------------------------------C STOP END C----------------------------------------------------------------------C C C Output from executing this program: C C host{wd21pw}432> read_ErsMhfRsd.x c c longitude array dimension for spd = 1080 c latitude array dimension for spd = 540 c delta lat/lon deg for spd = 0.333333 c c longitude array dimension for dir = 72 c latitude array dimension for dir = 36 c delta lat/lon deg for dir = 5.00000 c c c Reading file: ErsMhfRsdJan97.dat c c c Sample Wind Speed Data: c c i = 1 j = 270 lat = -0.17 lon = 0.17 spd = 3.85 c i = 2 j = 270 lat = -0.17 lon = 0.50 spd = 3.99 c i = 3 j = 270 lat = -0.17 lon = 0.83 spd = 3.28 c i = 4 j = 270 lat = -0.17 lon = 1.17 spd = 3.92 c i = 5 j = 270 lat = -0.17 lon = 1.50 spd = 3.12 c c i = 1 j = 271 lat = 0.17 lon = 0.17 spd = 3.50 c i = 2 j = 271 lat = 0.17 lon = 0.50 spd = 3.89 c i = 3 j = 271 lat = 0.17 lon = 0.83 spd = 3.55 c i = 4 j = 271 lat = 0.17 lon = 1.17 spd = 3.56 c i = 5 j = 271 lat = 0.17 lon = 1.50 spd = 3.85 c c c Sample Wind Direction Data: c c i = 1 j = 18 lat = -3.75 lon = 1.25 dir = 344.67 c i = 2 j = 18 lat = -3.75 lon = 6.25 dir = 351.16 c i = 3 j = 18 lat = -3.75 lon = 11.25 dir = 28.03 c i = 4 j = 18 lat = -3.75 lon = 16.25 dir = 0.00 c i = 5 j = 18 lat = -3.75 lon = 21.25 dir = 0.00 c c i = 1 j = 19 lat = 1.25 lon = 1.25 dir = 4.58 c i = 2 j = 19 lat = 1.25 lon = 6.25 dir = 6.18 c i = 3 j = 19 lat = 1.25 lon = 11.25 dir = 0.00 c i = 4 j = 19 lat = 1.25 lon = 16.25 dir = 0.00 c i = 5 j = 19 lat = 1.25 lon = 21.25 dir = 0.00 c c C host{wd21pw}433> C C----------------------------------------------------------------------C