source: Roms_tools/Preprocessing_tools/getpot.m @ 1

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

import Roms_Agrif

File size: 1.7 KB
Line 
1function getpot(clmname,grdname);
2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3%
4%  Get potential temperature of seawater from insitu
5%
6%  Further Information: 
7%  http://www.brest.ird.fr/Roms_tools/
8
9%  This file is part of ROMSTOOLS
10%
11%  ROMSTOOLS is free software; you can redistribute it and/or modify
12%  it under the terms of the GNU General Public License as published
13%  by the Free Software Foundation; either version 2 of the License,
14%  or (at your option) any later version.
15%
16%  ROMSTOOLS is distributed in the hope that it will be useful, but
17%  WITHOUT ANY WARRANTY; without even the implied warranty of
18%  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19%  GNU General Public License for more details.
20%
21%  You should have received a copy of the GNU General Public License
22%  along with this program; if not, write to the Free Software
23%  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
24%  MA  02111-1307  USA
25%
26%  Copyright (c) 2004-2006 by Pierrick Penven
27%  e-mail:Pierrick.Penven@ird.fr 
28%
29%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
30%
31% open the grid file 
32%
33nc=netcdf(grdname);
34h=nc{'h'}(:);
35close(nc);
36%
37% open the clim file 
38%
39nc=netcdf(clmname,'write');
40theta_s = nc{'theta_s'}(:);
41theta_b =  nc{'theta_b'}(:);
42hc  =  nc{'hc'}(:);
43N =  length(nc('s_rho'));
44tlen =  length(nc('tclm_time'));
45if tlen==0
46  tlen=1;
47end
48%
49% Get the sigma depths
50%
51P=-1e-4*1025*9.81*zlevs(h,0.*h,theta_s,theta_b,hc,N,'r');
52%
53% loop on time
54%
55for l=1:tlen
56  disp(['   getpot: Time index: ',num2str(l),' of total: ',num2str(tlen)])
57  T=squeeze(nc{'temp'}(l,:,:,:));
58  S=squeeze(nc{'salt'}(l,:,:,:));
59  nc{'temp'}(l,:,:,:)=theta(S,T,P);
60end
61close(nc);
62return
Note: See TracBrowser for help on using the repository browser.