1 | function 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 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
28 | disp(' ') |
---|
29 | disp([' Adding PISCES data in file : ',inifile]) |
---|
30 | % |
---|
31 | % Create the initial file |
---|
32 | % |
---|
33 | nc = netcdf(inifile,clobber); |
---|
34 | result = redef(nc); |
---|
35 | % |
---|
36 | % Create variables |
---|
37 | % |
---|
38 | nc{'NO3'} = ncdouble('time','s_rho','eta_rho','xi_rho') ; |
---|
39 | nc{'PO4'} = ncdouble('time','s_rho','eta_rho','xi_rho') ; |
---|
40 | nc{'Si'} = ncdouble('time','s_rho','eta_rho','xi_rho') ; |
---|
41 | nc{'O2'} = ncdouble('time','s_rho','eta_rho','xi_rho') ; |
---|
42 | nc{'DIC'} = ncdouble('time','s_rho','eta_rho','xi_rho') ; |
---|
43 | nc{'TALK'} = ncdouble('time','s_rho','eta_rho','xi_rho') ; |
---|
44 | nc{'DOC'} = ncdouble('time','s_rho','eta_rho','xi_rho') ; |
---|
45 | nc{'FER'} = ncdouble('time','s_rho','eta_rho','xi_rho') ; |
---|
46 | |
---|
47 | % |
---|
48 | % Create attributes |
---|
49 | % |
---|
50 | nc{'NO3'}.long_name = ncchar('NO3'); |
---|
51 | nc{'NO3'}.long_name = 'NO3'; |
---|
52 | nc{'NO3'}.units = ncchar('mMol N m-3'); |
---|
53 | nc{'NO3'}.units = 'mMol N m-3'; |
---|
54 | % |
---|
55 | % |
---|
56 | nc{'PO4'}.long_name = ncchar('PO4'); |
---|
57 | nc{'PO4'}.long_name = 'PO4'; |
---|
58 | nc{'PO4'}.units = ncchar('mMol P m-3'); |
---|
59 | nc{'PO4'}.units = 'mMol P m-3'; |
---|
60 | % |
---|
61 | % |
---|
62 | nc{'Si'}.long_name = ncchar('Si'); |
---|
63 | nc{'Si'}.long_name = 'Si'; |
---|
64 | nc{'Si'}.units = ncchar('mMol Si m-3'); |
---|
65 | nc{'Si'}.units = 'mMol Si m-3'; |
---|
66 | % |
---|
67 | % |
---|
68 | nc{'O2'}.long_name = ncchar('O2'); |
---|
69 | nc{'O2'}.long_name = 'O2'; |
---|
70 | nc{'O2'}.units = ncchar('mMol O m-3'); |
---|
71 | nc{'O2'}.units = 'mMol O m-3'; |
---|
72 | % |
---|
73 | % |
---|
74 | nc{'DIC'}.long_name = ncchar('DIC'); |
---|
75 | nc{'DIC'}.long_name = 'DIC'; |
---|
76 | nc{'DIC'}.units = ncchar('mMol C m-3'); |
---|
77 | nc{'DIC'}.units = 'mMol C m-3'; |
---|
78 | % |
---|
79 | % |
---|
80 | nc{'TALK'}.long_name = ncchar('TALK'); |
---|
81 | nc{'TALK'}.long_name = 'TALK'; |
---|
82 | nc{'TALK'}.units = ncchar('mMol C m-3'); |
---|
83 | nc{'TALK'}.units = 'mMol C m-3'; |
---|
84 | % |
---|
85 | % |
---|
86 | nc{'DOC'}.long_name = ncchar('DOC'); |
---|
87 | nc{'DOC'}.long_name = 'DOC'; |
---|
88 | nc{'DOC'}.units = ncchar('mMol C m-3'); |
---|
89 | nc{'DOC'}.units = 'mMol C m-3'; |
---|
90 | % |
---|
91 | % |
---|
92 | nc{'FER'}.long_name = ncchar('FER'); |
---|
93 | nc{'FER'}.long_name = 'FER'; |
---|
94 | nc{'FER'}.units = ncchar('mMol Fe m-3'); |
---|
95 | nc{'FER'}.units = 'mMol Fe m-3'; |
---|
96 | % |
---|
97 | % Leave define mode |
---|
98 | % |
---|
99 | result = endef(nc); |
---|
100 | % |
---|
101 | % Write variables |
---|
102 | % |
---|
103 | nc{'NO3'}(:) = 0; |
---|
104 | nc{'PO4'}(:) = 0; |
---|
105 | nc{'Si'}(:) = 0; |
---|
106 | nc{'O2'}(:) = 0; |
---|
107 | nc{'DIC'}(:) = 0; |
---|
108 | nc{'TALK'}(:) = 0; |
---|
109 | nc{'DOC'}(:) = 0; |
---|
110 | nc{'FER'}(:) = 0; |
---|
111 | % |
---|
112 | % Synchronize on disk |
---|
113 | % |
---|
114 | close(nc); |
---|
115 | return |
---|
116 | |
---|
117 | |
---|