You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: updatinit_coawst_mw.m
    path of file: ./repos/tracacode/1911-COAWST/script/mfiles/roms_clm
    
    the code of the file until where you have to start completion: function updatinit_coawst_mw(fn,gn,ini,wdr,T1)
% script create_roms_init
%
% Create a netcdf file that contains initialization data for ROMS.
% Initializes temp, salt, u, v, ubar, vbar, and 
% all sediment parameters.
%
% In cppdefs.h you should have 
% #undef ana_initial
% #undef ana_sediment
% This m file is set to work from roms_master_climatology.
%
% jcw 5-25-2005
% jcw 3-7-07 add L and M for get grid
% 28July2016 Big update to be consistent with create_roms_init.
%

%1) Enter name of netcdf initial file to be created.
%   If it already exists it will be overwritten!!.
    init_file=[ini];

%2) If you want to read the initial data from another netcdf file, then 
%   enter read_int=1 and provide a name of history or rst file to read data from.
%   Otherwise set read_int=0.
    read_init=1;
%   Use clm file to get the data
    nc_clm=netcdf.open(fn,'NC_NOWRITE');

%3) Enter start time of initial file, in seconds.
%   This time needs to be consistent with model time (ie dstart and time_ref).
%   See *.in files for more detail. 
    if (read_init)
      ocean_time=T1-datenum(1858,11,17,0,0,0);
    else
      ocean_time=0;
    end

%4) Set values of theta_s, theta_b, Tcline, and N from your *.in file.
    theta_s   = gn.theta_s;
    theta_b   = gn.theta_b;
    Tcline    = gn.Tcline;
    N         = gn.N;
    Vtransform= gn.Vtransform;
    Vstretching=gn.Vstretching;

%5) Obtain grid information.
   h=gn.h;
   hmin=min(h(:));
%  hc=min([hmin,Tcline]);
   hc=gn.hc;
   [LP,MP]=size(gn.lon_rho);
   L=LP-1;
   Lm=L-1;
   M=MP-1;
   Mm=M-1;
   L  = Lm+1;
   M  = Mm+1;
   xi_psi  = L;
   xi_rho  = LP;
   xi_u    = L;
   xi_v    = LP;
   eta_psi = M;
   eta_rho = MP;
   eta_u   = MP;
   eta_v   = M;
   s       = gn.N;
   Cs_r=gn.Cs_r;
   Cs_w=gn.Cs_w;
   sc_r=gn.s_rho;
   sc_w=gn.s_w;
    
%6) Initialize zeta, salt, temp, u, v, ubar, vbar.
%   moved this to fill part below
%% 
NAT=2;            % Number of active tracers. Usually 2 (temp + salt).

% 
%7) Enter number of mud sediments (NCS) and number of sand sediments (NNS).
%   These values should be the same as in mod_param.F
    NCS = 0;   %number of cohesive sed classes
    NNS = 1;   %number of non-cohesive sed classes
%
% calc sed parameters. Do not alter.
%
   NST = NCS + NNS;     % total number of sed tracers.
   NT = NAT+NST;        % total number of tracers.

%8) Enter number of bed layers
%   This value should be the same as in mod_param.F
    Nbed = 1;


    
function updatinit_coawst_mw(fn,gn,ini,wdr,T1)
% script create_roms_init
%
% Create a netcdf file that contains initialization data for ROMS.
% Initializes temp, salt, u, v, ubar, vbar, and 
% all sediment parameters.
%
% In cppdefs.h you should have 
% #undef ana_initial
% #undef ana_sediment
% This m file is set to work from roms_master_climatology.
%
% jcw 5-25-2005
% jcw 3-7-07 add L and M for get grid
% 28July2016 Big update to be consistent with create_roms_init.
%

%1) Enter name of netcdf initial file to be created.
%   If it already exists it will be overwritten!!.
    init_file=[ini];

%2) If you want to read the initial data from another netcdf file, then 
%   enter read_int=1 and provide a name of history or rst file to read data from.
%   Otherwise set read_int=0.
    read_init=1;
%   Use clm file to get the data
    nc_clm=netcdf.open(fn,'NC_NOWRITE');

%3) Enter start time of initial file, in seconds.
%   This time needs to be consistent with model time (ie dstart and time_ref).
%   See *.in files for more detail. 
    if (read_init)
      ocean_time=T1-datenum(1858,11,17,0,0,0);
    else
      ocean_time=0;
    end

%4) Set values of theta_s, theta_b, Tcline, and N from your *.in file.
    theta_s   = gn.theta_s;
    theta_b   = gn.theta_b;
    Tcline    = gn.Tcline;
    N         = gn.N;
    Vtransform= gn.Vtransform;
    Vstretching=gn.Vstretching;

%5) Obtain grid information.
   h=gn.h;
   hmin=min(h(:));
%  hc=min([hmin,Tcline]);
   hc=gn.hc;
   [LP,MP]=size(gn.lon_rho);
   L=LP-1;
   Lm=L-1;
   M=MP-1;
   Mm=M-1;
   L  = Lm+1;
   M  = Mm+1;
   xi_psi  = L;
   xi_rho  = LP;
   xi_u    = L;
   xi_v    = LP;
   eta_psi = M;
   eta_rho = MP;
   eta_u   = MP;
   eta_v   = M;
   s       = gn.N;
   Cs_r=gn.Cs_r;
   Cs_w=gn.Cs_w;
   sc_r=gn.s_rho;
   sc_w=gn.s_w;
    
%6) Initialize zeta, salt, temp, u, v, ubar, vbar.
%   moved this to fill part below
%% 
NAT=2;            % Number of active tracers. Usually 2 (temp + salt).

% 
%7) Enter number of mud sediments (NCS) and number of sand sediments (NNS).
%   These values should be the same as in mod_param.F
    NCS = 0;   %number of cohesive sed classes
    NNS = 1;   %number of non-cohesive sed classes
%
% calc sed parameters. Do not alter.
%
   NST = NCS + NNS;     % total number of sed tracers.
   NT = NAT+NST;        % total number of tracers.

%8) Enter number of bed layers
%   This value should be the same as in mod_param.F
    Nbed = 1;

%9) Sediment class properties (in order, mud first then sand).
%  These values should coincide with your sediment.in file.
  mud_Srho=ones(1,NCS)*2650;        %kg m-3, NCS values
  mud_Sd50=[0.01 0.06]/1000;        %m,      NCS values
  mud_Wsed=[0.10 1.0]/1000;         %m s-1,  NCS values
  mud_tau_ce=[0.05 0.05];           %N m-2,  NCS values
  mud_Erate=[5 5]*1e-5;             %kg m-2 s-1, NCS values
  sand_Srho=ones(1,NNS)*2650;       %kg m-3, NNS values
  sand_Sd50=[1.0]/1000;             %m,      NNS values
  sand_Wsed=[1.0]/1000;             %m s-1,  NNS values
  sand_tau_ce=[0.07];               %N m-2,  NNS values
  sand_Erate=[1]*1e-4;              %kg m-2 s-1, NNS values
%
% make some combined arrays.  Do not alter.
%
  Srho=  [mud_Srho,sand_Srho];
  Sd50=  [mud_Sd50,sand_Sd50];
  Wsed=  [mud_Wsed,sand_Wsed];
  tau_ce=[mud_tau_ce,sand_tau_ce];
  Erate= [mud_Erate,sand_Erate];


%9) Provide initial sediment properties in water column.
%
  display('Initializing suspend