0001 function example_FVCOM_wind_ts_speed
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028 subname = 'example_FVCOM_wind_ts';
0029 fprintf('\n')
0030 fprintf(['begin : ' subname '\n'])
0031
0032
0033
0034
0035
0036
0037
0038
0039 tbeg = 0;
0040 tend = 31;
0041 time = tbeg:1:tend;
0042 nTimes = numel(time);
0043
0044
0045 u10 = 10*ones(nTimes,1);
0046 v10 = zeros(nTimes,1);
0047
0048
0049
0050
0051 fvcom_forcing_file = 'tst_wind.nc';
0052 nc = netcdf(fvcom_forcing_file, 'clobber');
0053 nc.references = 'http://fvcom.smast.umassd.edu';
0054 nc.source = 'single-point time-dependent surface forcing';
0055 nc.institution = 'School for Marine Science and Technology' ;
0056 nc.history = 'generated using the fvcom-toolbox';
0057
0058
0059
0060
0061 nc('time') = 0;
0062
0063
0064 nc{'time'} = ncfloat('time');
0065 nc{'time'}.long_name = 'time';
0066 nc{'time'}.units = 'days since 1858-11-17 00:00:00';
0067 nc{'time'}.format = 'modified julian day (MJD)';
0068 nc{'time'}.time_zone = 'UTC';
0069
0070 nc{'Itime'} = ncint('time');
0071 nc{'Itime'}.units = 'days since 1858-11-17 00:00:00';
0072 nc{'Itime'}.format = 'modified julian day (MJD)';
0073 nc{'Itime'}.time_zone = 'UTC';
0074
0075 nc{'Itime2'} = ncint('time');
0076 nc{'Itime2'}.units = 'msec since 00:00:00';
0077 nc{'Itime2'}.time_zone = 'UTC';
0078
0079
0080 nc{'U10'} = ncfloat('time');
0081 nc{'U10'}.long_name = 'Eastward Wind Velocity';
0082 nc{'U10'}.standard_name = 'Wind Velocity';
0083 nc{'U10'}.units = 'm/s';
0084 nc{'U10'}.type = 'data';
0085
0086 nc{'V10'} = ncfloat('time');
0087 nc{'V10'}.long_name = 'Northward Wind Velocity';
0088 nc{'V10'}.standard_name = 'Wind Velocity';
0089 nc{'V10'}.units = 'm/s';
0090 nc{'V10'}.type = 'data';
0091
0092
0093 nc{'time'}(1:nTimes) = time;
0094 nc{'Itime'}(1:nTimes) = floor(time);
0095 nc{'Itime2'}(1:nTimes) = mod(time,1)*24*3600*1000.;
0096
0097 nc{'U10'}(1:nTimes) = u10;
0098 nc{'V10'}(1:nTimes) = v10;
0099
0100 ierr = close(nc);
0101
0102 fprintf(['end : ' subname '\n'])
0103
0104
0105