source: Roms_tools/Preprocessing_tools/add_ini_pisces.m @ 2

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

import Roms_Agrif

File size: 3.8 KB
Line 
1function add_ini_pisces(inifile,clobber)
2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3% Copyright (c) 2000 IRD                                          %
4%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5%                                                                 %
6%                                                                 %
7%  function nc=add_ini_pisces(inifile,clobber)                    %
8%                                                                 %
9%   This function create the header of a Netcdf climatology       %
10%   file.                                                         %
11%                                                                 %
12%   Input:                                                        %
13%                                                                 %
14%   inifile      Netcdf initial file name (character string).     %
15%   clobber      Switch to allow or not writing over an existing  %
16%                file.(character string)                          %
17%                                                                 %
18%   Output                                                        %
19%                                                                 %
20%   nc       Output netcdf object.                                %
21%                                                                 %
22%   Pierrick Penven, IRD, 2005.                                   %
23%   Olivier Aumont, IRD, 2006.                                    %
24%   Patricio Marchesiello, IRD 2007                               %
25%   Christophe Eugene Raoul Menkes, IRD 2007                      %
26%                                                                 %
27%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
28disp(' ')
29disp([' Adding PISCES data in file : ',inifile])
30%
31%  Create the initial file
32%
33nc = netcdf(inifile,clobber);
34result = redef(nc);
35%
36%  Create variables
37%
38nc{'NO3'} = ncdouble('time','s_rho','eta_rho','xi_rho') ;
39nc{'PO4'} = ncdouble('time','s_rho','eta_rho','xi_rho') ;
40nc{'Si'} = ncdouble('time','s_rho','eta_rho','xi_rho') ;
41nc{'O2'} = ncdouble('time','s_rho','eta_rho','xi_rho') ;
42nc{'DIC'} = ncdouble('time','s_rho','eta_rho','xi_rho') ;
43nc{'TALK'} = ncdouble('time','s_rho','eta_rho','xi_rho') ;
44nc{'DOC'} = ncdouble('time','s_rho','eta_rho','xi_rho') ;
45nc{'FER'} = ncdouble('time','s_rho','eta_rho','xi_rho') ;
46
47%
48%  Create attributes
49%
50nc{'NO3'}.long_name = ncchar('NO3');
51nc{'NO3'}.long_name = 'NO3';
52nc{'NO3'}.units = ncchar('mMol N m-3');
53nc{'NO3'}.units = 'mMol N m-3';
54%
55%
56nc{'PO4'}.long_name = ncchar('PO4');
57nc{'PO4'}.long_name = 'PO4';
58nc{'PO4'}.units = ncchar('mMol P m-3');
59nc{'PO4'}.units = 'mMol P m-3';
60%
61%
62nc{'Si'}.long_name = ncchar('Si');
63nc{'Si'}.long_name = 'Si';
64nc{'Si'}.units = ncchar('mMol Si m-3');
65nc{'Si'}.units = 'mMol Si m-3';
66%
67%
68nc{'O2'}.long_name = ncchar('O2');
69nc{'O2'}.long_name = 'O2';
70nc{'O2'}.units = ncchar('mMol O m-3');
71nc{'O2'}.units = 'mMol O m-3';
72%
73%
74nc{'DIC'}.long_name = ncchar('DIC');
75nc{'DIC'}.long_name = 'DIC';
76nc{'DIC'}.units = ncchar('mMol C m-3');
77nc{'DIC'}.units = 'mMol C m-3';
78%
79%
80nc{'TALK'}.long_name = ncchar('TALK');
81nc{'TALK'}.long_name = 'TALK';
82nc{'TALK'}.units = ncchar('mMol C m-3');
83nc{'TALK'}.units = 'mMol C m-3';
84%
85%
86nc{'DOC'}.long_name = ncchar('DOC');
87nc{'DOC'}.long_name = 'DOC';
88nc{'DOC'}.units = ncchar('mMol C m-3');
89nc{'DOC'}.units = 'mMol C m-3';
90%
91%
92nc{'FER'}.long_name = ncchar('FER');
93nc{'FER'}.long_name = 'FER';
94nc{'FER'}.units = ncchar('mMol Fe m-3');
95nc{'FER'}.units = 'mMol Fe m-3';
96%
97% Leave define mode
98%
99result = endef(nc);
100%
101% Write variables
102%
103nc{'NO3'}(:)  =  0;
104nc{'PO4'}(:)  =  0;
105nc{'Si'}(:) =  0;
106nc{'O2'}(:)   =  0;
107nc{'DIC'}(:)  =  0;
108nc{'TALK'}(:) =  0;
109nc{'DOC'}(:)  =  0;
110nc{'FER'}(:)  =  0;
111%
112% Synchronize on disk
113%
114close(nc);
115return
116
117
Note: See TracBrowser for help on using the repository browser.