Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 6dfb120c authored by Renaud Person's avatar Renaud Person Committed by Gildas Cambon
Browse files

Resolve "Avoid negative values for dust and nitrogen deposition and correct ndepo typo"

parent 1186d120
No related branches found
No related tags found
1 merge request!14Resolve "Avoid negative values for dust and nitrogen deposition and correct ndepo typo"
......@@ -152,16 +152,16 @@ nc=netcdf(bioname,'write');
%
for tindex=1:length(time)
time=nc{'dust_time'}(tindex);
nc{'dust'}(tindex,:,:)=ext_data(dust_file,'dust',tindex,...
lon,lat,time,Roa,1);
nc{'dustfer'}(tindex,:,:)=ext_data(dust_file,'dustfer',tindex,...
lon,lat,time,Roa,1);
nc{'dustpo4'}(tindex,:,:)=ext_data(dust_file,'dustpo4',tindex,...
lon,lat,time,Roa,1);
nc{'dustsi'}(tindex,:,:)=ext_data(dust_file,'dustsi',tindex,...
lon,lat,time,Roa,1);
nc{'solubility2'}(tindex,:,:)=ext_data(dust_file,'solubility2',tindex,...
lon,lat,time,Roa,1);
nc{'dust'}(tindex,:,:)=max(0.,ext_data(dust_file,'dust',tindex,...
lon,lat,time,Roa,1));
nc{'dustfer'}(tindex,:,:)=max(0.,ext_data(dust_file,'dustfer',tindex,...
lon,lat,time,Roa,1));
nc{'dustpo4'}(tindex,:,:)=max(0.,ext_data(dust_file,'dustpo4',tindex,...
lon,lat,time,Roa,1));
nc{'dustsi'}(tindex,:,:)=max(0.,ext_data(dust_file,'dustsi',tindex,...
lon,lat,time,Roa,1));
nc{'solubility2'}(tindex,:,:)=max(0.,ext_data(dust_file,'solubility2',tindex,...
lon,lat,time,Roa,1));
end
close(nc)
if (makeplot)
......
......@@ -76,26 +76,26 @@ nc('eta_u') = Mp;
nc('eta_v') = M;
nc('eta_rho') = Mp;
%
nc('ndep_time') = length(time);
nc{'ndep_time'} = ncdouble('ndep_time') ;
nc{'ndep'} = ncdouble('ndep_time','eta_rho','xi_rho') ;
nc{'noyndepo'} = ncdouble('ndep_time','eta_rho','xi_rho') ;
nc{'nhxndepo'} = ncdouble('ndep_time','eta_rho','xi_rho') ;
%
nc{'ndep_time'}.long_name = ncchar('time for nitrogen deposition');
nc{'ndep_time'}.long_name = 'time for nitrogen deposition';
nc{'ndep_time'}.units = ncchar('day');
nc{'ndep_time'}.units = 'day';
nc('ndepo_time') = length(time);
nc{'ndepo_time'} = ncdouble('ndepo_time') ;
nc{'ndepo'} = ncdouble('ndepo_time','eta_rho','xi_rho') ;
nc{'noyndepo'} = ncdouble('ndepo_time','eta_rho','xi_rho') ;
nc{'nhxndepo'} = ncdouble('ndepo_time','eta_rho','xi_rho') ;
%
nc{'ndepo_time'}.long_name = ncchar('time for nitrogen deposition');
nc{'ndepo_time'}.long_name = 'time for nitrogen deposition';
nc{'ndepo_time'}.units = ncchar('day');
nc{'ndepo_time'}.units = 'day';
if cycle~=0
nc{'ndep_time'}.cycle_length = cycle;
nc{'ndepo_time'}.cycle_length = cycle;
end
%
nc{'ndep'}.long_name = ncchar('Nitrogen Deposition');
nc{'ndep'}.long_name = 'Nitrogen Deposition';
nc{'ndep'}.units = ncchar('KgN m-2 s-1');
nc{'ndep'}.units = 'KgN m-2 s-1';
nc{'ndep'}.fields = ncchar('ndep, scalar, series');
nc{'ndep'}.fields = 'ndep, scalar, series';
nc{'ndepo'}.long_name = ncchar('Nitrogen Deposition');
nc{'ndepo'}.long_name = 'Nitrogen Deposition';
nc{'ndepo'}.units = ncchar('KgN m-2 s-1');
nc{'ndepo'}.units = 'KgN m-2 s-1';
nc{'ndepo'}.fields = ncchar('ndepo, scalar, series');
nc{'ndepo'}.fields = 'ndepo, scalar, series';
%
nc{'noyndepo'}.long_name = ncchar('NOy Deposition');
nc{'noyndepo'}.long_name = 'NOy Deposition';
......@@ -124,7 +124,7 @@ nc.type = ncchar('CROCO biology forcing file');
nc.type = 'CROCO biology forcing file';
% Write time variable
nc{'ndep_time'}(:)=time.*30; % if time in month in the dataset !!!
nc{'ndepo_time'}(:)=time.*30; % if time in month in the dataset !!!
close(nc)
......@@ -132,13 +132,13 @@ nc=netcdf(bioname,'write');
%
% Loop on time
for tindex=1:length(time)
time=nc{'ndep_time'}(tindex);
nc{'ndep'}(tindex,:,:)=ext_data(ndep_file,'ndep',tindex,...
lon,lat,time,Roa,1);
nc{'noyndepo'}(tindex,:,:)=ext_data(ndep_file,'noyndepo',tindex,...
lon,lat,time,Roa,1);
nc{'nhxndepo'}(tindex,:,:)=ext_data(ndep_file,'nhxndepo',tindex,...
lon,lat,time,Roa,1);
time=nc{'ndepo_time'}(tindex);
nc{'ndepo'}(tindex,:,:)=max(0.,ext_data(ndep_file,'ndep',tindex,...
lon,lat,time,Roa,1));
nc{'noyndepo'}(tindex,:,:)=max(0.,ext_data(ndep_file,'noyndepo',tindex,...
lon,lat,time,Roa,1));
nc{'nhxndepo'}(tindex,:,:)=max(0.,ext_data(ndep_file,'nhxndepo',tindex,...
lon,lat,time,Roa,1));
end
%
close(nc)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment