Home > fvcom_prepro > example_FVCOM_river.m

example_FVCOM_river

PURPOSE ^

example file for dumping an FVCOM river file and adding sediment concentration

SYNOPSIS ^

function example_FVCOM_river()

DESCRIPTION ^

 example file for dumping an FVCOM river file and adding sediment concentration

 function example_FVCOM_river()

 DESCRIPTION:
    Setup a sample FVCOM river file

 INPUT
   
 OUTPUT:
    FVCOM RiverFile with flux,temp,salt,sediment

 Author(s):  
    Geoff Cowles (University of Massachusetts Dartmouth)

 Revision history
   
==============================================================================

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function example_FVCOM_river()
0002 % example file for dumping an FVCOM river file and adding sediment concentration
0003 %
0004 % function example_FVCOM_river()
0005 %
0006 % DESCRIPTION:
0007 %    Setup a sample FVCOM river file
0008 %
0009 % INPUT
0010 %
0011 % OUTPUT:
0012 %    FVCOM RiverFile with flux,temp,salt,sediment
0013 %
0014 % Author(s):
0015 %    Geoff Cowles (University of Massachusetts Dartmouth)
0016 %
0017 % Revision history
0018 %
0019 %==============================================================================
0020 
0021 t1 = 0; %greg2mjulian(2007,1,1,0,0,0);
0022 t2 = 31; %greg2mjulian(2007,2,1,0,0,0);
0023 time = t1:1:t2;
0024 nTimes = prod(size(time));
0025 
0026 % setup an event using Gaussian function
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.; %sed conc in g/l
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 % add sediment to the file
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)

Generated on Thu 19-Mar-2015 12:20:56 by m2html © 2005