%modifies the "reference" iron deposition by doubling it in 50 years south of 44S
%This is motivated by Krishnamurty  who sets 2.4x10^9 mol Fe/a for the preindustrial and 5.5x10^9 mol Fe/a  for the modern world
%as total iron supply


%define input files
 infil_iron = '/Users/hdietze/mom4p1_pubrel_18dec2009/exp/mom_sis_bling_template/INPUT/Soluble_Fe_Flux_PI.nc'

%some ini
 addpath('/usr/local/mbib/netcdf/matlab_netCDF_OPeNDAP/')
 !rm -f ../dat/*

%get grid
 x = ncread(infil_iron,'grid_x_T');
 y = ncread(infil_iron,'grid_y_T');

%define region of increase
 southof = -44; %south of this Latitude iron deposition will be increased
 Iy      = find(y<southof);

%define amplitude of yearly increase
 incpye = 100./50 %[percent/year]

 
for i=1:50
 %create output file
  outfil_iron = ['../dat/Soluble_Fe_Flux_PI.' num2str(i+1000) '.nc'];
  eval(['!ncks -v FLUX ' infil_iron ' ' outfil_iron]);
 %get original wind field (read in everytime to check copy)
  f = ncread(outfil_iron,'FLUX');
 %increase the wind speed
  f(:,Iy,:) = f(:,Iy,:).* (i*incpye+100)/100;
 %save increased wind speed
  ncwrite(outfil_iron,'FLUX',f);
end

