%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Build a CROCO boundary file % % Extrapole and interpole temperature and salinity from a % climatology to get boundary conditions for % CROCO (boundary netcdf file) . % Get the velocities and sea surface elevation via a % geostrophic computation. % % Data input format (netcdf): % temperature(T, Z, Y, X) % T : time [Months] % Z : Depth [m] % Y : Latitude [degree north] % X : Longitude [degree east] % % Data source : IRI/LDEO climate Data Library (World Ocean Atlas 1998) % http://ingrid.ldgo.columbia.edu/ % http://iridl.ldeo.columbia.edu/SOURCES/.NOAA/.NODC/.WOA98/ % % Further Information: % http://www.croco-ocean.org % % This file is part of CROCOTOOLS % % CROCOTOOLS is free software; you can redistribute it and/or modify % it under the terms of the GNU General Public License as published % by the Free Software Foundation; either version 2 of the License, % or (at your option) any later version. % % CROCOTOOLS is distributed in the hope that it will be useful, but % WITHOUT ANY WARRANTY; without even the implied warranty of % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % GNU General Public License for more details. % % You should have received a copy of the GNU General Public License % along with this program; if not, write to the Free Software % Foundation, Inc., 59 Temple Place, Suite 330, Boston, % MA 02111-1307 USA % % Copyright (c) 2005-2006 by Pierrick Penven % e-mail:Pierrick.Penven@ird.fr % % Updated 1-Sep-2006 by Pierrick Penven % Pierrick Penven, IRD, 2005. % % Olivier Aumont the master, IRD, 2006. % % Patricio Marchesiello, chief, IRD, 2007. % % Christophe Eugene Raoul Menkes, the slave, IRD, 2007. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % WARNING !!!!!! THIS ASSUMES THAT THE TIME FOR PISCES INITIAL. % IS THE SAME AS THE CLIM T AND S. ELSE, CHANGE THE PROGRAM % clear all close all %%%%%%%%%%%%%%%%%%%%% USERS DEFINED VARIABLES %%%%%%%%%%%%%%%%%%%%%%%% % % Common parameters % crocotools_param Roa; % % Set times and cycles: monthly climatology for all data % time=woa_time; % time cycle=woa_cycle; % cycle % % Data climatologies file names: % % no3_seas_data = [woapisces_dir,'no3_seas.cdf']; no3_ann_data = [woapisces_dir,'no3_ann.cdf']; po4_seas_data = [woapisces_dir,'po4_seas.cdf']; po4_ann_data = [woapisces_dir,'po4_ann.cdf']; o2_seas_data = [woapisces_dir,'o2_seas.cdf']; o2_ann_data = [woapisces_dir,'o2_ann.cdf']; sio3_seas_data = [woapisces_dir,'sio3_seas.cdf']; sio3_ann_data = [woapisces_dir,'sio3_ann.cdf']; dic_seas_data = [woapisces_dir,'dic_seas.cdf']; dic_ann_data = [woapisces_dir,'dic_ann.cdf']; talk_seas_data = [woapisces_dir,'talk_seas.cdf']; talk_ann_data = [woapisces_dir,'talk_ann.cdf']; doc_seas_data = [woapisces_dir,'doc_seas.cdf']; doc_ann_data = [woapisces_dir,'doc_ann.cdf']; fer_seas_data = [woapisces_dir,'fer_seas.cdf']; fer_ann_data = [woapisces_dir,'fer_ann.cdf']; dust_seas_data = [woapisces_dir,'dust_seas.cdf']; dust_ann_data = [woapisces_dir,'dust_ann.cdf']; if strcmp(climato_dir,cars2009_dir); err_msg=sprintf(['Error : you need to use woadir when creating the croco_oa.nc (Z) \n'... 'file to be compatible with PISCES']) error(err_msg) end % % %%%%%%%%%%%%%%%%%%% END USERS DEFINED VARIABLES %%%%%%%%%%%%%%%%%%%%%%% % % Title % disp(' ') disp([' Making the file: ',bryname]) disp([' Adding the PISCES variables']) disp(' ') disp([' Title: ',CROCO_title]) % % Read in the grid % disp(' ') disp(' Read in the grid...') nc=netcdf(grdname,'r'); lon=nc{'lon_rho'}(:); lat=nc{'lat_rho'}(:); Lp=length(nc('xi_rho')); Mp=length(nc('eta_rho')); hmax=max(max(nc{'h'}(:))); close(nc); % % Redefine the boundary file % if (makebry) disp(' ') disp(' Redefine the boundary file...') disp('') disp('======================================================== ') disp('=> You need the croco_bry_Z.nc file created by make_bry.m ') disp('======================================================== ') add_bry_pisces(bryname,obc,time,cycle,'write'); end % % Redefine the boundary file in Z-coordinates % if (makeZbry) disp(' ') disp(' Redefine the boundary Z-file...') % % get Z % nc=netcdf(no3_ann_data,'r'); Z=nc{'Z'}(:); kmax=max(find(Z