diff --git a/Preprocessing_tools/Bio/add_dic.m b/Preprocessing_tools/Bio/add_dic.m index 88cace3b106ac0c03ad8d15ac36017d6784d1bb0..7796c218a157c6c7ce7870eba5db7ae256c56877 100644 --- a/Preprocessing_tools/Bio/add_dic.m +++ b/Preprocessing_tools/Bio/add_dic.m @@ -1,5 +1,5 @@ function add_dic(oafile,climfile,inifile,gridfile,seas_datafile,... - ann_datafile,cycle,makeoa,makeclim); + ann_datafile,cycle,makeoa,makeclim,makeini); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % function [longrd,latgrd,dic]=add_dic(climfile,gridfile,... @@ -124,21 +124,23 @@ if (makeclim) end % % Same thing for the Initial file +if (makeini) % -%disp('Add_no3: creating variables and attributes for the Initial file') +disp('Add_dic: creating variables and attributes for the Initial file') % % open the clim file % -%nc=netcdf(inifile,'write'); -%redef(nc); -%nc{'NO3'} = ncdouble('time','s_rho','eta_rho','xi_rho') ; -% -%nc{'NO3'}.long_name = ncchar('Nitrate'); -%nc{'NO3'}.long_name = 'Nitrate'; -%nc{'NO3'}.units = ncchar('mMol N m-3'); -%nc{'NO3'}.units = 'mMol N m-3'; -% -%endef(nc); -%close(nc) +nc=netcdf(inifile,'write'); +redef(nc); +nc{'DIC'} = ncdouble('time','s_rho','eta_rho','xi_rho') ; +% +nc{'DIC'}.long_name = ncchar('DIC'); +nc{'DIC'}.long_name = 'DIC'; +nc{'DIC'}.units = ncchar('mMol C m-3'); +nc{'DIC'}.units = 'mMol C m-3'; +end + +endef(nc); +close(nc) return diff --git a/Preprocessing_tools/Bio/add_doc.m b/Preprocessing_tools/Bio/add_doc.m index d8c3e30f31aeb9f79c2853481b422cc8b3c20ac6..2a101b7aeb28c0b5dca4f9b0f2af18f1892b568f 100644 --- a/Preprocessing_tools/Bio/add_doc.m +++ b/Preprocessing_tools/Bio/add_doc.m @@ -1,5 +1,5 @@ function add_doc(oafile,climfile,inifile,gridfile,seas_datafile,... - ann_datafile,cycle,makeoa,makeclim); + ann_datafile,cycle,makeoa,makeclim,makeini); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % function [longrd,latgrd,doc]=add_doc(climfile,gridfile,... @@ -125,20 +125,22 @@ end % % Same thing for the Initial file % -%disp('Add_doc: creating variables and attributes for the Initial file') +if (makeini) +disp('Add_doc: creating variables and attributes for the Initial file') % % open the clim file % -%nc=netcdf(inifile,'write'); -%redef(nc); -%nc{'DOC'} = ncdouble('time','s_rho','eta_rho','xi_rho') ; +nc=netcdf(inifile,'write'); +redef(nc); +nc{'DOC'} = ncdouble('time','s_rho','eta_rho','xi_rho') ; % -%nc{'DOC'}.long_name = ncchar('Nitrate'); -%nc{'DOC'}.long_name = 'Nitrate'; -%nc{'DOC'}.units = ncchar('mMol N m-3'); -%nc{'DOC'}.units = 'mMol N m-3'; +nc{'DOC'}.long_name = ncchar('DOC'); +nc{'DOC'}.long_name = 'DOC'; +nc{'DOC'}.units = ncchar('mMol C m-3'); +nc{'DOC'}.units = 'mMol C m-3'; % -%endef(nc); -%close(nc) +endef(nc); +close(nc) +end return diff --git a/Preprocessing_tools/Bio/add_don.m b/Preprocessing_tools/Bio/add_don.m index 7618b93feb932f0101249b56252b5b5604c2540e..4d76919366b5a422ea9b65063569a5f010706a2d 100644 --- a/Preprocessing_tools/Bio/add_don.m +++ b/Preprocessing_tools/Bio/add_don.m @@ -1,5 +1,5 @@ function add_don(oafile,climfile,inifile,gridfile,seas_datafile,... - ann_datafile,cycle,makeoa,makeclim,makequota); + ann_datafile,cycle,makeoa,makeclim,makequota,makeini); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % function [longrd,latgrd,doc]=add_doc(climfile,gridfile,... @@ -166,20 +166,22 @@ end % % Same thing for the Initial file % -%disp('Add_doc: creating variables and attributes for the Initial file') +if (makeini) +disp('Add_don: creating variables and attributes for the Initial file') % % open the clim file % -%nc=netcdf(inifile,'write'); -%redef(nc); -%nc{'DOC'} = ncdouble('time','s_rho','eta_rho','xi_rho') ; +nc=netcdf(inifile,'write'); +redef(nc); +nc{'DON'} = ncdouble('time','s_rho','eta_rho','xi_rho') ; % -%nc{'DOC'}.long_name = ncchar('Nitrate'); -%nc{'DOC'}.long_name = 'Nitrate'; -%nc{'DOC'}.units = ncchar('mMol N m-3'); -%nc{'DOC'}.units = 'mMol N m-3'; +nc{'DON'}.long_name = ncchar('DON'); +nc{'DON'}.long_name = 'DON'; +nc{'DON'}.units = ncchar('mMol C m-3'); +nc{'DON'}.units = 'mMol C m-3'; % -%endef(nc); -%close(nc) +endef(nc); +close(nc) +end return diff --git a/Preprocessing_tools/Bio/add_dop.m b/Preprocessing_tools/Bio/add_dop.m index bfb63a43ab7b30c697ea2fb3feb2c8b44fa99078..8c9900870ca84146078f9aaa332efc8e0970b2f1 100644 --- a/Preprocessing_tools/Bio/add_dop.m +++ b/Preprocessing_tools/Bio/add_dop.m @@ -1,5 +1,5 @@ function add_dop(oafile,climfile,inifile,gridfile,seas_datafile,... - ann_datafile,cycle,makeoa,makeclim,makequota); + ann_datafile,cycle,makeoa,makeclim,makequota,makeini); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % function [longrd,latgrd,dop]=add_dop(climfile,gridfile,... @@ -163,23 +163,22 @@ if (makeclim) nc{'dop_time'}(:)=t*30; % if time in month in the dataset !!! close(nc) end +if (makeini) +disp('Add_dop: creating variables and attributes for the Initial file') % -% Same thing for the Initial file +% open the clim file % -%disp('Add_dop: creating variables and attributes for the Initial file') +nc=netcdf(inifile,'write'); +redef(nc); +nc{'DOP'} = ncdouble('time','s_rho','eta_rho','xi_rho') ; % -% open the clim file -% -%nc=netcdf(inifile,'write'); -%redef(nc); -%nc{'DOP'} = ncdouble('time','s_rho','eta_rho','xi_rho') ; -% -%nc{'DOP'}.long_name = ncchar('Nitrate'); -%nc{'DOP'}.long_name = 'Nitrate'; -%nc{'DOP'}.units = ncchar('mMol N m-3'); -%nc{'DOP'}.units = 'mMol N m-3'; +nc{'DOP'}.long_name = ncchar('DOP'); +nc{'DOP'}.long_name = 'DOP'; +nc{'DOP'}.units = ncchar('mMol C m-3'); +nc{'DOP'}.units = 'mMol C m-3'; % -%endef(nc); -%close(nc) +endef(nc); +close(nc) +end return diff --git a/Preprocessing_tools/Bio/add_fer.m b/Preprocessing_tools/Bio/add_fer.m index 339cd1307b58552de93796f6d96d3c3ce44dc70a..086a18798aebfbf060134c5429012d6a6e898ade 100644 --- a/Preprocessing_tools/Bio/add_fer.m +++ b/Preprocessing_tools/Bio/add_fer.m @@ -1,5 +1,5 @@ function add_fer(oafile,climfile,inifile,gridfile,seas_datafile,... - ann_datafile,cycle,makeoa,makeclim); + ann_datafile,cycle,makeoa,makeclim,makeini); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % function [longrd,latgrd,fer]=add_fer(climfile,gridfile,... @@ -122,4 +122,21 @@ if (makeclim) nc{'fer_time'}(:)=t*30; % if time in month in the dataset !!! close(nc) end +if (makeini) +disp('Add_fer: creating variables and attributes for the Initial file') +% +% open the clim file +% +nc=netcdf(inifile,'write'); +redef(nc); +nc{'FER'} = ncdouble('time','s_rho','eta_rho','xi_rho') ; +% +nc{'FER'}.long_name = ncchar('FER'); +nc{'FER'}.long_name = 'FER'; +nc{'FER'}.units = ncchar('uMol Fe m-3'); +nc{'FER'}.units = 'uMol Fe m-3'; +% +endef(nc); +close(nc) +end return diff --git a/Preprocessing_tools/Bio/add_no3.m b/Preprocessing_tools/Bio/add_no3.m index 1670583bdf5cf7dc921e87a1e6867b62b187d7ef..ac708dae042bee5fd8874e34ffcf8324ad56593d 100644 --- a/Preprocessing_tools/Bio/add_no3.m +++ b/Preprocessing_tools/Bio/add_no3.m @@ -1,5 +1,5 @@ function add_no3(oafile,climfile,inifile,gridfile,seas_datafile,... - ann_datafile,cycle,makeoa,makeclim); + ann_datafile,cycle,makeoa,makeclim,makeini); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % function [longrd,latgrd,no3]=add_no3(climfile,gridfile,... @@ -164,22 +164,24 @@ if (makeclim) close(nc) end % +if (makeini) % Same thing for the Initial file % -%disp('Add_no3: creating variables and attributes for the Initial file') +disp('Add_no3: creating variables and attributes for the Initial file') % % open the clim file -% -%nc=netcdf(inifile,'write'); -%redef(nc); -%nc{'NO3'} = ncdouble('time','s_rho','eta_rho','xi_rho') ; -% -%nc{'NO3'}.long_name = ncchar('Nitrate'); -%nc{'NO3'}.long_name = 'Nitrate'; -%nc{'NO3'}.units = ncchar('mMol N m-3'); -%nc{'NO3'}.units = 'mMol N m-3'; -% -%endef(nc); -%close(nc) + +nc=netcdf(inifile,'write'); +redef(nc); +nc{'NO3'} = ncdouble('time','s_rho','eta_rho','xi_rho') ; + +nc{'NO3'}.long_name = ncchar('Nitrate'); +nc{'NO3'}.long_name = 'Nitrate'; +nc{'NO3'}.units = ncchar('mMol N m-3'); +nc{'NO3'}.units = 'mMol N m-3'; + +endef(nc); +close(nc) +end return diff --git a/Preprocessing_tools/Bio/add_o2.m b/Preprocessing_tools/Bio/add_o2.m index 86321ce18c0748ff3c8890c64cbcb0c51bf6e57d..7a2665258244aeab23b18c5d70acdcdacdd98714 100644 --- a/Preprocessing_tools/Bio/add_o2.m +++ b/Preprocessing_tools/Bio/add_o2.m @@ -1,5 +1,5 @@ function add_o2(oafile,climfile,inifile,gridfile,month_datafile,... - ann_datafile,cycle,makeoa,makeclim); + ann_datafile,cycle,makeoa,makeclim,makeini); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % function [longrd,latgrd,o2]=add_o2(climfile,gridfile,... @@ -122,5 +122,24 @@ if (makeclim) nc{'o2_time'}(:,:)=t*30; % if time in month in the dataset !!! close(nc) end +if (makeini) +% Same thing for the Initial file +% +disp('Add_o2: creating variables and attributes for the Initial file') +% +% open the clim file + +nc=netcdf(inifile,'write'); +redef(nc); +nc{'O2'} = ncdouble('time','s_rho','eta_rho','xi_rho') ; + +nc{'O2'}.long_name = ncchar('Oxygen'); +nc{'O2'}.long_name = 'Oxygen'; +nc{'O2'}.units = ncchar('mMol O m-3'); +nc{'O2'}.units = 'mMol O m-3'; + +endef(nc); +close(nc) +end return diff --git a/Preprocessing_tools/Bio/add_po4.m b/Preprocessing_tools/Bio/add_po4.m index 04e03fa8664d17e46c224ca16d19c9612eb0a383..b495f53fcd9a275660b05c93577d37a29ec2d30c 100644 --- a/Preprocessing_tools/Bio/add_po4.m +++ b/Preprocessing_tools/Bio/add_po4.m @@ -1,5 +1,5 @@ function add_po4(oafile,climfile,inifile,gridfile,seas_datafile,... - ann_datafile,cycle,makeoa,makeclim); + ann_datafile,cycle,makeoa,makeclim,makeini); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % function [longrd,latgrd,po4]=add_po4(climfile,gridfile,... @@ -122,4 +122,23 @@ if (makeclim) nc{'po4_time'}(:)=t*30; % if time in month in the dataset !!! close(nc) end +if (makeini) +% Same thing for the Initial file +% +disp('Add_po4: creating variables and attributes for the Initial file') +% +% open the clim file + +nc=netcdf(inifile,'write'); +redef(nc); +nc{'PO4'} = ncdouble('time','s_rho','eta_rho','xi_rho') ; + +nc{'PO4'}.long_name = ncchar('Phosphate'); +nc{'PO4'}.long_name = 'Phosphate'; +nc{'PO4'}.units = ncchar('mMol P m-3'); +nc{'PO4'}.units = 'mMol P m-3'; + +endef(nc); +close(nc) +end return diff --git a/Preprocessing_tools/Bio/add_sio3.m b/Preprocessing_tools/Bio/add_sio3.m index e50aac1bdbe047498dd738c03f57f372b13a3303..b7ad50531ac2479e3017c256398903aeb1be4dba 100644 --- a/Preprocessing_tools/Bio/add_sio3.m +++ b/Preprocessing_tools/Bio/add_sio3.m @@ -1,5 +1,5 @@ function add_sio3(oafile,climfile,inifile,gridfile,seas_datafile,... - ann_datafile,cycle,makeoa,makeclim); + ann_datafile,cycle,makeoa,makeclim,makeini); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % function [longrd,latgrd,sio3]=add_sio3(climfile,gridfile,... @@ -122,4 +122,23 @@ if (makeclim) nc{'si_time'}(:)=t*30; % if time in month in the dataset !!! close(nc) end +if (makeini) +% Same thing for the Initial file +% +disp('Add_si: creating variables and attributes for the Initial file') +% +% open the clim file + +nc=netcdf(inifile,'write'); +redef(nc); +nc{'Si'} = ncdouble('time','s_rho','eta_rho','xi_rho') ; + +nc{'Si'}.long_name = ncchar('Silicate'); +nc{'Si'}.long_name = 'Silicate'; +nc{'Si'}.units = ncchar('mMol Si m-3'); +nc{'Si'}.units = 'mMol Si m-3'; + +endef(nc); +close(nc) +end return diff --git a/Preprocessing_tools/Bio/add_talk.m b/Preprocessing_tools/Bio/add_talk.m index 1bdf16b7b2e8c3b401de164b2626551db2b3dbb3..41f56e0c8fdce67244599f039d4ae836b4f0493c 100644 --- a/Preprocessing_tools/Bio/add_talk.m +++ b/Preprocessing_tools/Bio/add_talk.m @@ -1,5 +1,5 @@ function add_talk(oafile,climfile,inifile,gridfile,seas_datafile,... - ann_datafile,cycle,makeoa,makeclim); + ann_datafile,cycle,makeoa,makeclim,makeini); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % function [longrd,latgrd,talk]=add_talk(climfile,gridfile,... @@ -125,20 +125,22 @@ end % % Same thing for the Initial file % -%disp('Add_no3: creating variables and attributes for the Initial file') +if (makeini) +disp('Add_talk: creating variables and attributes for the Initial file') % % open the clim file % -%nc=netcdf(inifile,'write'); -%redef(nc); -%nc{'NO3'} = ncdouble('time','s_rho','eta_rho','xi_rho') ; +nc=netcdf(inifile,'write'); +redef(nc); +nc{'TALK'} = ncdouble('time','s_rho','eta_rho','xi_rho') ; % -%nc{'NO3'}.long_name = ncchar('Nitrate'); -%nc{'NO3'}.long_name = 'Nitrate'; -%nc{'NO3'}.units = ncchar('mMol N m-3'); -%nc{'NO3'}.units = 'mMol N m-3'; +nc{'TALK'}.long_name = ncchar('TALK'); +nc{'TALK'}.long_name = 'TALK'; +nc{'TALK'}.units = ncchar('mMol C m-3'); +nc{'TALK'}.units = 'mMol C m-3'; % -%endef(nc); -%close(nc) +endef(nc); +close(nc) +end return diff --git a/Preprocessing_tools/Bio/make_biol.m b/Preprocessing_tools/Bio/make_biol.m index 0e22f38d6b86efe0810c7de8446c49d7ac184190..32968ef015261ab73ae2a49af45f1e2040f711ed 100644 --- a/Preprocessing_tools/Bio/make_biol.m +++ b/Preprocessing_tools/Bio/make_biol.m @@ -62,6 +62,12 @@ if (makeclim) disp('========================') disp('Climatology for PISCES variables') make_clim_pisces + disp('------------------------') + disp('Iron deposition file') + make_dust + disp('------------------------') + disp('Nitrogen deposition') + make_ndepo end if (makebioebus) disp('========================') @@ -106,17 +112,6 @@ if (makeini) disp('Initial NPZD variables') make_ini_npzd end - if (makepisces) - disp('========================') - disp('Initial PISCES variables') - make_ini_pisces - disp('------------------------') - disp('Iron deposition file') - make_dust - disp('------------------------') - disp('Nitrogen deposition') - make_ndepo - end if (makebioebus) disp('========================') disp('Initial BioEBUS variables') diff --git a/Preprocessing_tools/Bio/make_clim_pisces.m b/Preprocessing_tools/Bio/make_clim_pisces.m index 4cd0afe9d136b60f7459e85a08a3812a06aed880..51342d1a064762eb52ee8ef1805954fd4014255b 100644 --- a/Preprocessing_tools/Bio/make_clim_pisces.m +++ b/Preprocessing_tools/Bio/make_clim_pisces.m @@ -63,35 +63,35 @@ disp('=> You need the croco_oa.nc file created by make_clim.m ') disp('=> with makeoa=1 from crocotools_param.m ') disp('====================================================== ') add_no3(oaname,clmname,ininame,grdname,no3_seas_data,... - no3_ann_data,cycle,makeoa,makeclim) + no3_ann_data,cycle,makeoa,makeclim,makeini) + +add_dic(oaname,clmname,ininame,grdname,dic_seas_data,... + dic_ann_data,cycle,makeoa,makeclim,makeini) add_po4(oaname,clmname,ininame,grdname,po4_seas_data,... - po4_ann_data,cycle,makeoa,makeclim) + po4_ann_data,cycle,makeoa,makeclim,makeini) add_sio3(oaname,clmname,ininame,grdname,sio3_seas_data,... - sio3_ann_data,cycle,makeoa,makeclim) + sio3_ann_data,cycle,makeoa,makeclim,makeini) add_o2(oaname,clmname,ininame,grdname,o2_seas_data,... - o2_ann_data,cycle,makeoa,makeclim) - -add_dic(oaname,clmname,ininame,grdname,dic_seas_data,... - dic_ann_data,cycle,makeoa,makeclim) + o2_ann_data,cycle,makeoa,makeclim,makeini) add_talk(oaname,clmname,ininame,grdname,talk_seas_data,... - talk_ann_data,cycle,makeoa,makeclim) + talk_ann_data,cycle,makeoa,makeclim,makeini) add_doc(oaname,clmname,ininame,grdname,doc_seas_data,... - doc_ann_data,cycle,makeoa,makeclim) + doc_ann_data,cycle,makeoa,makeclim,makeini) if makequota add_don(oaname,clmname,ininame,grdname,doc_seas_data,... - doc_ann_data,cycle,makeoa,makeclim) + doc_ann_data,cycle,makeoa,makeclim,makequota,makeini) add_dop(oaname,clmname,ininame,grdname,doc_seas_data,... - doc_ann_data,cycle,makeoa,makeclim) + doc_ann_data,cycle,makeoa,makeclim,makequota,makeini) end add_fer(oaname,clmname,ininame,grdname,fer_seas_data,... - fer_ann_data,cycle,makeoa,makeclim) + fer_ann_data,cycle,makeoa,makeclim,makeini) % % Horizontal extrapolation @@ -218,6 +218,95 @@ end vinterp_clm(clmname,grdname,oaname,'FER','fer_time','Zfer',0,'r'); end +%---------------------------------------------------------------------------- +% Initial file +%---------------------------------------------------------------------------- +if (makeini) +% +% NO3 +% + disp(' ') + disp(' Vertical interpolations') + disp(' ') + disp(' NO3...') + vinterp_clm(ininame,grdname,oaname,'NO3','no3_time','Zno3',tini,'r',1); +% +% DIC +% + disp(' ') + disp(' Vertical interpolations') + disp(' ') + disp(' DIC...') + vinterp_clm(ininame,grdname,oaname,'DIC','dic_time','Zdic',tini,'r',1); +% +% PO4 +% + disp(' ') + disp(' Vertical interpolations') + disp(' ') + disp(' PO4...') + vinterp_clm(ininame,grdname,oaname,'PO4','po4_time','Zpo4',tini,'r',1); + % + % Si + % + disp(' ') + disp(' Vertical interpolations') + disp(' ') + disp(' Si...') + vinterp_clm(ininame,grdname,oaname,'Si','si_time','Zsi',tini,'r',1); +% +% O2 +% + disp(' ') + disp(' Vertical interpolations') + disp(' ') + disp(' O2...') + vinterp_clm(ininame,grdname,oaname,'O2','o2_time','Zo2',tini,'r',1); +% +% TALK +% + disp(' ') + disp(' Vertical interpolations') + disp(' ') + disp(' TALK...') + vinterp_clm(ininame,grdname,oaname,'TALK','talk_time','Ztalk',tini,'r',1); +% +% DOC +% + disp(' ') + disp(' Vertical interpolations') + disp(' ') + disp(' DOC...') + vinterp_clm(ininame,grdname,oaname,'DOC','doc_time','Zdoc',tini,'r',1); + +if makequota +% +% DON +% + disp(' ') + disp(' Vertical interpolations') + disp(' ') + disp(' DON...') + vinterp_clm(ininame,grdname,oaname,'DON','don_time','Zdon',tini,'r',1); +% +% DOP +% + disp(' ') + disp(' Vertical interpolations') + disp(' ') + disp(' DOP...') + vinterp_clm(ininame,grdname,oaname,'DOP','dop_time','Zdop',tini,'r',1); +end + +% +% FER +% + disp(' ') + disp(' Vertical interpolations') + disp(' ') + disp(' FER...') + vinterp_clm(ininame,grdname,oaname,'FER','fer_time','Zfer',tini,'r',1); +end if (makeplot) disp(' ')