source: Roms_tools/Preprocessing_tools/make_clim_romspacific.m @ 2

Last change on this file since 2 was 1, checked in by cholod, 13 years ago

import Roms_Agrif

File size: 4.3 KB
Line 
1%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2%
3%  Build a ROMS climatology file
4%
5%  Extrapole and interpole temperature and salinity from a
6%  Climatology to get boundary and initial conditions for
7%  ROMS (climatology and initial netcdf files) .
8%  Get the velocities and sea surface elevation via a
9%  geostrophic computation.
10%
11%  Data input format (netcdf):
12%     temperature(T, Z, Y, X)
13%     T : time [Months]
14%     Z : Depth [m]
15%     Y : Latitude [degree north]
16%     X : Longitude [degree east]
17%
18%  Data source : IRI/LDEO Climate Data Library (World Ocean Atlas 1998)
19%    http://ingrid.ldgo.columbia.edu/
20%    http://iridl.ldeo.columbia.edu/SOURCES/.NOAA/.NODC/.WOA98/
21%
22%  Pierrick Penven, IRD, 2002.
23%
24%  Version of 10-Oct-2002
25%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
26clear all
27close all
28%%%%%%%%%%%%%%%%%%%%% USERS DEFINED VARIABLES %%%%%%%%%%%%%%%%%%%%%%%%
29%
30% Common parameters
31%
32romstools_param
33%
34%  Title
35%
36title='Climatology';
37%
38%  Switches for selecting what to process (1=ON)
39%
40makeclim=1; %1: process boundary data
41makeoa=1;   %1: process oa data
42makeini=1;  %1: process initial data
43%
44%  Grid file name - Climatology file name
45%  Initial file name - OA file name
46%
47grdname='roms_grd.nc';
48clmname='roms_clm.nc';
49ininame='roms_ini.nc';
50oaname ='roms_oa.nc';
51%
52%  Day of initialisation
53%
54tini=15;
55%
56% Set times and cycles: monthly climatology for all data
57%
58time=[15:30:345];    % time
59cycle=360;           % cycle
60%
61%  Data climatologies file names:
62%
63%    monthtemp : monthly temperature climatology
64%    monthsalt : monthly salinity climatology
65%
66monthtemp='../Roms_Pacifico/roms_pacific_temp.nc';
67monthsalt='../Roms_Pacifico/roms_pacific_salt.nc';
68monthu='../Roms_Pacifico/roms_pacific_u.nc';
69monthv='../Roms_Pacifico/roms_pacific_v.nc';
70%
71%
72%%%%%%%%%%%%%%%%%%% END USERS DEFINED VARIABLES %%%%%%%%%%%%%%%%%%%%%%%
73%
74% Title
75%
76disp(' ')
77disp([' Making the clim: ',clmname])
78disp(' ')
79disp([' Title: ',title])
80%
81% Read in the grid
82%
83disp(' ')
84disp(' Read in the grid...')
85nc=netcdf(grdname);
86Lp=length(nc('xi_rho'));
87Mp=length(nc('eta_rho'));
88hmax=max(max(nc{'h'}(:)));
89result=close(nc);
90%
91% Create the climatology file
92%
93if (makeclim)
94  disp(' ')
95  disp(' Create the climatology file...')
96  create_climfile(clmname,grdname,title,...
97                  theta_s,theta_b,hc,N,...
98                  time,cycle,'clobber');
99end
100%
101% Create the OA file
102%
103if (makeoa)
104  disp(' ')
105  disp(' Create the OA file...')
106  nc=netcdf(monthtemp);
107  Z=nc{'DEPTH'}(1:30);
108  close(nc)
109  create_oafile(oaname,grdname,title,Z,...
110                time,cycle,'clobber');
111%
112% Horizontal extrapolations
113%
114  disp(' ')
115  disp(' Horizontal extrapolations')
116  disp(' ')
117  disp(' Temperature...')
118  ext_romspacific(oaname,monthtemp,'TEMP','temp','tclm_time','r');
119  disp(' ')
120  disp(' Salinity...')
121  ext_romspacific(oaname,monthsalt,'SALT','salt','sclm_time','r');
122  disp(' ')
123  disp(' U...')
124  ext_romspacific(oaname,monthu,'U','u','uclm_time','u');
125  disp(' ')
126  disp(' V...')
127  ext_romspacific(oaname,monthv,'V','v','vclm_time','v');
128end
129%
130% Vertical interpolations
131%
132if (makeclim)
133  disp(' ')
134  disp(' Vertical interpolations')
135  disp(' ')
136  disp(' Temperature...')
137  vinterp_clm(clmname,grdname,oaname,'temp','tclm_time','Z',0,'r');
138  disp(' ')
139  disp(' Salinity...')
140  vinterp_clm(clmname,grdname,oaname,'salt','sclm_time','Z',0,'r');
141  disp(' ')
142  disp(' U...')
143  vinterp_clm(clmname,grdname,oaname,'u','uclm_time','Z',0,'u');
144  disp(' ')
145  disp(' V...')
146  vinterp_clm(clmname,grdname,oaname,'v','vclm_time','Z',0,'v');
147%
148% Compute barotropic currents
149%
150  disp(' ')
151  disp(' Compute barotropic currents')
152  barotropic_currents(clmname,grdname,obc)
153end
154%
155% Initial file
156%
157if (makeini)
158  disp(' ')
159  disp(' Initial')
160  create_inifile(ininame,grdname,title,...
161                 theta_s,theta_b,hc,N,...
162                 tini,'clobber');
163  disp(' ')
164  disp(' Temperature...')
165  vinterp_clm(ininame,grdname,oaname,'temp','tclm_time','Z',tini,'r',1);
166  disp(' ')
167  disp(' Salinity...')
168  vinterp_clm(ininame,grdname,oaname,'salt','sclm_time','Z',tini,'r',1);
169end             
170%
171% Make a few plots
172%
173disp(' ')
174disp(' Make a few plots...')
175test_clim(clmname,grdname,'temp',1)
176figure
177test_clim(clmname,grdname,'salt',1)
178figure
179test_clim(clmname,grdname,'temp',6)
180figure
181test_clim(clmname,grdname,'salt',6)
182%
183% End
184%
185%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Note: See TracBrowser for help on using the repository browser.