NCCOOS Trac Projects: Top | Web | Platforms | Processing | Viz | Sprints | Sandbox | (Wind)

root/adcp/trunk/adcp/diwasp_1_1GD/readspec.f

Revision 168 (checked in by cbc, 16 years ago)

Adding diwasp customizations.

Line 
1 c skeleton subroutine to read directional wave spectra         
2                 subroutine readspec(filename,spden,spfreq,spdir,
3      &nspec,ndir,xd)
4
5                 integer nspec,ndir,iitemp
6                 real spden(100,100),spfreq(100),spdir(100),nd
7                 character*50 filename     
8
9      
10 c enter wave spectrum -ASCII format
11 c reads spectral density in variable "spden(f,d)" with indicies f and d corresponding to
12 c the frequencies and directions spfreq(f) and spdir(d) respectively
13
14
15                 open(11,file=filename)
16                 read(11,*) xd
17                 read(11,*) nspec
18                 read(11,*) ndir
19                 if((nspec.gt.100).OR.(ndir.GT.100))then
20                         write(*,*) 'wave spectrum dimensions too large'
21                         close(11)
22                         stop
23                 endif
24                 do i=1,nspec
25                         read(11,*) spfreq(i)
26                 enddo
27                 do j=1,ndir
28                         read(11,*) spdir(j)
29                 enddo
30                 read(11,*)iitemp
31                 if (iitemp.NE.999) then
32                         write(*,*)'wave spectrum:corrupt file header'
33                         close (11)
34                         stop
35                 endif
36                 do i=1,nspec
37                 do j=1,ndir
38                         read(11,*) spden(i,j)
39                 enddo
40                 enddo
41                 close(11)
42
43                 end
44
Note: See TracBrowser for help on using the browser.