0001 function example_FVCOM_river()
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021 t1 = 0;
0022 t2 = 31;
0023 time = t1:1:t2;
0024 nTimes = prod(size(time));
0025
0026
0027 tmid = mean(time);
0028 c = .1*(tmid-time(1));
0029 flux = 400+300*exp(-(time-tmid).^2/(2.*c^2));
0030 plot(time,flux);
0031 ylabel('flux m^3/s')
0032 xlabel('time')
0033 title('river flux')
0034 sedload = .030*(flux.^1.40)/1000.;
0035
0036 temp = 20*ones(nTimes,1);
0037 salt = zeros(nTimes,1);
0038 RiverFile = 'tst_riv.nc';
0039 nRivnodes = 3;
0040 RiverInfo1 = 'idealized estuary river';
0041 RiverInfo2 = 'event profile';
0042 RiverName = 'tstRiver';
0043
0044
0045 write_FVCOM_river(RiverFile,RiverName,nRivnodes,time,flux,temp,salt,RiverInfo1,RiverInfo2)
0046
0047
0048 VarName = 'fine_sand';
0049 VarLongName = 'concentration of fine sand';
0050 VarUnits = 'kgm^-3';
0051 VarData = .333*sedload;
0052 add_var_FVCOM_river(RiverFile,VarName,VarLongName,VarUnits,VarData)
0053
0054 VarName = 'coarse_silt';
0055 VarLongName = 'concentration of coarse silt';
0056 VarUnits = 'kgm^-3';
0057 VarData = .333*sedload;
0058 add_var_FVCOM_river(RiverFile,VarName,VarLongName,VarUnits,VarData)
0059
0060 VarName = 'fine_silt';
0061 VarLongName = 'concentration of fine silt';
0062 VarUnits = 'kgm^-3';
0063 VarData = .333*sedload;
0064 add_var_FVCOM_river(RiverFile,VarName,VarLongName,VarUnits,VarData)