/[MITgcm]/MITgcm/verification/seaice_obcs/input.tides/mk_tides.m
ViewVC logotype

Annotation of /MITgcm/verification/seaice_obcs/input.tides/mk_tides.m

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (hide annotations) (download)
Thu Nov 15 20:46:52 2012 UTC (11 years, 6 months ago) by dimitri
Branch: MAIN
CVS Tags: checkpoint64y, checkpoint64x, checkpoint64z, checkpoint64o, checkpoint64a, checkpoint64q, checkpoint64p, checkpoint64s, checkpoint64r, checkpoint64u, checkpoint64t, checkpoint64w, checkpoint64v, checkpoint66g, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint64n, checkpoint66o, checkpoint66n, checkpoint66m, checkpoint66l, checkpoint66k, checkpoint66j, checkpoint66i, checkpoint66h, checkpoint64b, checkpoint64e, checkpoint64d, checkpoint64c, checkpoint64g, checkpoint64f, checkpoint65z, checkpoint65x, checkpoint65y, checkpoint65r, checkpoint65s, checkpoint65p, checkpoint65q, checkpoint65v, checkpoint65w, checkpoint65t, checkpoint65u, checkpoint65j, checkpoint65k, checkpoint65h, checkpoint65i, checkpoint65n, checkpoint65o, checkpoint65l, checkpoint65m, checkpoint65b, checkpoint65c, checkpoint65a, checkpoint65f, checkpoint65g, checkpoint65d, checkpoint65e, checkpoint64i, checkpoint64h, checkpoint64k, checkpoint65, checkpoint64j, checkpoint64m, checkpoint64l, HEAD
Changes since 1.1: +6 -6 lines
fixing some bugs for recent obcs_add_tides commit

1 dimitri 1.1 % Generate example tidal input files.
2    
3     % Tidal input files are real*4 IEEE big-endian binary
4     % with dimenstion OBlength * tidalComponents,
5     % where OBlength is the length of the open boundary
6     % and tidalComponents is the number of tidal components
7     % specified in OBCS_PARAMS.h.
8    
9     % OB[N,S,E,W][am,ph]File :: Files with boundary conditions,
10     % the letter combinations mean:
11     % N/S/E/W :: northern/southern/eastern/western boundary
12     % am/ph :: tidal amplitude (m/s) / phase (s)
13    
14     % Tidal periods are specified using variable tidalPeriod in data.obcs
15     % Tidal amplitude is the maximum tidal velocity in m/s.
16     % Tidal phase indicates time in s of maximum positive tide relative
17     % to model startTime=0.
18    
19     % readbin.m and writebin.m are in MITgcm/utils/matlab/cs_grid/read_cs
20    
21     % create tidal input files
22     nx=10; ny=8;
23     tidalComponents=10;
24     for ob={'N','S','E','W'}
25     OBlength=ny;
26     if any(strcmp(ob,{'N','S'}))
27     OBlength=nx;
28     end
29     for fld={'am','ph'}
30     fnm=['OB' ob{1} fld{1} '.seaice_obcs'];
31     tmp=randn(OBlength,tidalComponents)/1000;
32    
33     % specify (0.1 m/s, 2 hr) for North boundary tidal component 1
34     if strcmp(ob,'N')
35     if strcmp(fld,'am')
36     tmp(:,1) = tmp(:,1) + 0.1;
37     else
38     tmp(:,1) = tmp(:,1) + 2 * 3600;
39     end
40     end
41    
42 dimitri 1.2 % specify (0.1 m/s, 4 hr) for South boundary tidal component 2
43 dimitri 1.1 if strcmp(ob,'S')
44     if strcmp(fld,'am')
45 dimitri 1.2 tmp(:,2) = tmp(:,2) + 0.1;
46 dimitri 1.1 else
47     tmp(:,2) = tmp(:,2) + 4 * 3600;
48     end
49     end
50    
51 dimitri 1.2 % specify (0.1 m/s, 6 hr) for East boundary tidal component 3
52 dimitri 1.1 if strcmp(ob,'E')
53     if strcmp(fld,'am')
54 dimitri 1.2 tmp(:,3) = tmp(:,3) + 0.1;
55 dimitri 1.1 else
56     tmp(:,3) = tmp(:,3) + 6 * 3600;
57     end
58     end
59    
60 dimitri 1.2 % specify (0.1 m/s, 8 hr) for West boundary tidal component 4
61 dimitri 1.1 if strcmp(ob,'W')
62     if strcmp(fld,'am')
63 dimitri 1.2 tmp(:,4) = tmp(:,4) + 0.1;
64 dimitri 1.1 else
65     tmp(:,4) = tmp(:,4) + 8 * 3600;
66     end
67     end
68    
69     writebin(fnm,tmp)
70     end
71     end

  ViewVC Help
Powered by ViewVC 1.1.22