001 function wafoinit
002
003
004
005
006
007
008
009
010
011
012
013
014
015
016
017
018
019
020
021
022
023 global WAFOFIGNUM
024 if isempty(WAFOFIGNUM)
025 disp('You must start wafodemo in order to run this script')
026 clear global WAFOFIGNUM
027 return
028 end
029
030 global pwdstr wafomenulabels Jxn Nxr
031
032 if isempty(pwdstr)
033 pwdstr=pwd;
034 end
035 Nfigs=10;
036 if isempty(wafomenulabels)
037 cd(fullfile(waforoot,'papers','wafodemo'));
038 wafomenulabels=cell(Nfigs,1);
039 for ix=1:Nfigs
040 wafomenulabels{ix} = geth1line(['wafofig' num2str(ix)],1);
041 end
042 cd(pwdstr)
043 end
044
045 if isempty(Nxr)
046 Nxr=load('gfaksr89.dat');
047
048 end
049
050 if isempty(Jxn)
051 jfile='yura87.dat';
052 Jxn=load(jfile);
053 if strcmp(jfile,'yura87.dat'),
054 Jxn=Jxn(5000:55000,[1 3]);
055 Jxn(:,2)=detrendma(Jxn(:,2),1500);
056
057 end
058
059 end
060
061
062
063 if 0
064 if isempty(Jmap)
065 disp('Loading map over the Japan Sea...')
066 Jmap = load('japansea.dat');
067 end
068 if isempty(Nmap)
069 disp('Loading map over the North Sea...')
070 Nmap = load('northsea.dat');
071 end
072 end
073
074
075
076
077 global Fs
078 global St Hm0 Tp
079 global xt Nsim Iseed
080 global Ste L
081 global fTt fTte u Np nit speed
082 global Tt rate
083 global ma mb sp
084
085 global fTcfAc NNp Nh Nnit Nspeed
086 global NVcf NHd Nrate
087
088 global fTcfAcTc JNp Jh Jnit Jspeed
089 global JTcf JAc Jind Jrate
090
091 global kdeTt kernel hs L2
092 global kdeVcfHd Nkernel Nhs NL2
093 global kdeTcfAcTc Jkernel Jhs JL2
094
095
096
097 if isempty(Hm0), Hm0 = 6; end
098 if isempty(Tp), Tp = 8; end
099 if isempty(Fs), Fs = 0.95238095238095; end
100 w = linspace(0,pi*Fs,257).';
101
102 if isempty(sp), sp = 15; end
103 if isempty(ma), ma = 5; end
104 if isempty(mb), mb = -2.5; end
105
106
107
108
109 if isempty(Nsim), Nsim = 1000; end
110 if isempty(Iseed), Iseed = 1000; end
111 if isempty(L), L = 80; end
112
113
114
115 if isempty(rate), rate = 8;end
116 if isempty(Nrate), Nrate = 8;end
117 if isempty(Jrate), Jrate = 8;end
118
119
120
121
122 if isempty(u), u = 0; end
123 if isempty(Np), Np = 33; end
124 if isempty(nit), nit = 4; end
125 if isempty(speed), speed = 5; end
126
127 if isempty(NNp), NNp = 33; end
128 if isempty(Nnit), Nnit = -1; end
129 if isempty(Nspeed), Nspeed = 7; end
130 if isempty(Nh), Nh = linspace(0,8,31);;end
131
132 if isempty(JNp), JNp = 33; end
133 if isempty(Jnit), Jnit = 4; end
134 if isempty(Jspeed), Jspeed = 5; end
135 if isempty(Jh), Jh = linspace(0,6,31);end
136
137
138
139
140
141 if isempty(kernel), kernel = 'epan'; end
142 if isempty(L2), L2 = .5; end
143
144 if isempty(Nkernel), Nkernel = 'epan'; end
145 if isempty(NL2), NL2 = [.5 .5]; end
146
147 if isempty(Jkernel), Jkernel = 'epan'; end
148 if isempty(JL2), JL2 = [1 .5]; end
149
150
151
152
153
154
155
156
157 if isempty(St),
158 St=torsethaugen(w,[Hm0 ,Tp]);
159 end
160 if isempty(xt)
161 xt=spec2sdat(St,[Nsim,1],[],Iseed);
162 end
163 if isempty(Ste)
164 Ste=dat2spec(xt,L,[],[],0.95);
165 end
166
167
168
169
170
171
172