program readascii c c This program has the FORTRAN codes to read FRF 8-m array directional c spectral ASCII output files. This program simply reads the ASCII file c and converts the normalized input frequency-direction spectrum (i.e., the c directional distribution function) to dimensional form (i.e., the c frequency-direction spectrum). You will have to tune the I/O statements c to your own system... c c Variable names, units and meanings are: c c======================================================================== c c datetime...[character*10] Date and Eastern Standard Time of c beginning of data collection in the order year, c month, day, hour, minute and in the form c yymmddhhmm (2-digit year, no blanks in any field) c Hmo...[m] Energy-based characteristic wave height = c 4*sigma, where sigma^2 is the variance of sea c surface displacement = volume under frequency- c direction (f-d) spectrum c fp...[Hz] Frequency at the peak of the frequency spectrum c thp...[deg] Direction at the peak of the directional c distribution at f=fp c c ifimle...Algorithm flag: [1]=IMLE estimate, [0]=MLE estimate c c istot...[sec] Length of time series processed c sfrq...[Hz] Data sampling frequency in time series c c ifwindo...Windowing flag: [0]=data segments not windowed, c [1]=data segments windowed (Kaiser-Bessel window) c ifdtrnd...Detrending flag: [0]=data segments not detrended, c [1]=data segments detrended (linear trend removed) c nfft...Number of data points in a data segment c nensb...Number of half-lapped segments analyzed c nband...Number of frequency bands averaged for frequency c smoothing c idgfr...Degrees of freedom of final frequency spectral c estimates c c nofrq...Number of output frequency bands c delfs...[Hz] Width of an output frequency band c noang...Number of output direction bins (arcs) c odelang...[deg] Width of an output direction bin c c dmin...[m] Minimum 17-min mean water depth during time c series at 8-m array reference gauge 'rname' c Set to -99. for data prior to 1 Sep 90 because c minimum water depth was not archived with spectra. c dbar...[m] Mean water depth during time series as an c average of mean depths at several gauges for data c prior to 1 Sep 90, and specifically at reference c gauge 'rname' for all subsequent cases. c dmax...[m] Maximum 17-min mean water depth during time c series at reference gauge. Set to -99. for data c prior to 1 Sep 90 because maximum water depth was c not archived with spectra. c rname...Reference gauge ID for mean water depths archived c after 1 Sep 90 (FRF gauge name - get help if you c need to know which 8-m array gauge it was). Set to c ' xxx' for data prior to 1 Sep 90, for which there c was no specific reference gauge. c c Anemometry: There is header space for data from two ane- c mometers. These have changed during the life of the 8-m c array. Prior to 1 Sep 90, anemometry was not archived c with spectral results. For those data the parameters s9b c and s6b were set to -3., and all other wind parameters c set to 0. The value -3. for s9b or s6b is used for cases c after 1 Sep 90 to flag bad or missing anemometry data. c c Wind parameters containing a '9' are all pier end results. c From 1 Sep 90 to 23 Jan 92 at 19.4 m above mean sea level c on the lightning rod tower, and from 24 Jan 92 to the pre- c sent at 19.3 m above mean sea level on a jack-up tower next c to the EOP instrumentation interface box. c c Wind parameters containing a '6' are winds at 19.4 m above c mean sea level on a tower atop the FRF lab building from c 1 Sep 90 to 1 Apr 94, and are winds at 19.3 m above MSL on c the north side of a cross tree on the pier-end jack-up tower c from 28 Sep 94 to the present. c c s9b or s6b...[m/sec] Mean wind speed during time series c s9s or s6s...[m/sec] Standard deviation of wind speed c s9m or s6m...[m/sec] Maximum wind speed c d9b or d6b...[deg] Vector averaged mean wind direction - c direction from which wind blows in wave direction c coordinates (degrees counter-clockwise from shore c normal) c d9s or d6s...[deg] Measure of variability of wind direction = c arctangent[(standard deviation of cross-mean-streamline c wind speed)/(mean wind speed)] c c oangle...[deg] Array of wave direction coordinates that c aligns with the f-d spectral array c c nof...(Within a loop) Frequency index c noa...(Within a loop) Direction index c of(nof)...[Hz] Frequency c osf(nof)...[m^2/Hz] Frequency spectral density at frequency c of(nof) c ogpat(nof)...[character*16] Encoded list of gauges used to compute c directional distribution of energy at this frequency c itero(nof)...Number of IMLE iterations used to compute directional c distribution of energy at this frequency. Set to -99 c for results prior to 1 Sep 90 because this parameter c was not archived with results until then. c ospc(nof,noa)...[1/deg] Normalized frequency-direction spectral den- c sity at frequency of(nof) and direction oangle(noa). c Dimensional frequency-direction spectrum spc(nof,noa) c [in m^2/(Hz deg)] is found from replacement statement: c c ospc(nof,noa) = osf(nof)*ospc(nof,noa) c c======================================================================== c c links: none c character*4 rname character*10 datetime character*16 ogpat(29) character*16 infile, outfile dimension of(29), osf(29), itero(29) dimension oangle(181), ospc(29,181) c c ask user for input and output file names c write(*,'(2x,''Enter input file name...: '')') read(*,'(a)') infile write(*,'(2x,''Enter output file name...: '')') read(*,'(a)') outfile c c open input file and read data c open(10,file=infile,status='unknown',access='sequential', & form='formatted') c read(10,'(a10,f10.2,f10.5,f10.1,2i10,f10.2,i10)') & datetime, Hmo, fp, thp, & ifimle, istot, sfrq, ifwindo c read(10,'(6i10,f10.5,i10)') & ifdtrnd, nfft, nensb, nband, & idgfr, nofrq, delfs, noang c read(10,'(4f10.2,6x,a4,3f10.2)') & odelang, dmin, dbar, dmax, & rname, s9b, s9s, s9m c read(10,'(2f10.1,3f10.2,2f10.1)') & d9b, d9s, s8b, s8s, & s8m, d8b, d8s c read(10,'(10f8.1)') (oangle(noa),noa=1,noang) c do 700 nof=1,nofrq c read(10,'(i10,f10.5,e20.7,4x,a16,i10)') & iof, of(nof), osf(nof), ogpat(nof), & itero(nof) c read(10,'(8f10.7)') (ospc(nof,noa),noa=1,noang) c 700 continue c close(10) c c convert ospc(nof,noa) from directional distribution form in units of c deg**-1 to dimensional form (the frequency-direction spectrum) in units c of m**2/Hz*deg c do 720 nof=1,nofrq do 740 noa=1,noang ospc(nof,noa)=ospc(nof,noa)*osf(nof) 740 continue 720 continue c end