function add_po4(oafile,climfile,inifile,gridfile,seas_datafile,... ann_datafile,cycle,makeoa,makeclim); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % function [longrd,latgrd,po4]=add_po4(climfile,gridfile,... % seas_datafile,ann_datafile,... % cycle); % % pierrick 2001 % % Add phosphate (mMol P m-3) in a CROCO climatology file % take seasonal data for the upper levels and annual data for the % lower levels % % input: % % climfile : croco climatology file to process (netcdf) % gridfile : croco grid file (netcdf) % seas_datafile : regular longitude - latitude - z seasonal data % file used for the upper levels (netcdf) % ann_datafile : regular longitude - latitude - z annual data % file used for the lower levels (netcdf) % cycle : time length (days) of climatology cycle (ex:360 for % annual cycle) - 0 if no cycle. % % output: % % [longrd,latgrd,po4] : surface field to plot (as an illustration) % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Read in the grid % nc=netcdf(gridfile,'r'); hmax=max(max(nc{'h'}(:))); close(nc); % % read in the datafiles % nc=netcdf(seas_datafile,'r'); t=nc{'T'}(:); close(nc) nc=netcdf(ann_datafile,'r'); zpo4=nc{'Z'}(:); kmax=max(find(zpo4