source: issm/oecreview/Archive/24684-25833/ISSM-25313-25314.diff

Last change on this file was 25834, checked in by Mathieu Morlighem, 4 years ago

CHG: added 24684-25833

File size: 840 bytes
RevLine 
[25834]1Index: ../trunk-jpl/src/m/contrib/morlighem/ismip6/decyear2date.m
2===================================================================
3--- ../trunk-jpl/src/m/contrib/morlighem/ismip6/decyear2date.m (revision 25313)
4+++ ../trunk-jpl/src/m/contrib/morlighem/ismip6/decyear2date.m (revision 25314)
5@@ -7,6 +7,7 @@
6 % Example:
7 % dateout = decyear2date(2011.001)
8
9+decyear = decyear(:);
10
11 %Get year
12 year = floor(decyear);
13@@ -13,11 +14,11 @@
14 fraction = mod(decyear,1);
15
16 %Get date of beginning and end of year
17-date0 = datenum(num2str(year),'yyyy');
18-date1 = datenum(num2str(year+1),'yyyy');
19+date0 = datenum((num2str(year)),'yyyy');
20+date1 = datenum((num2str(year+1)),'yyyy');
21
22 %Compute number of days in year
23 numdays = date1 - date0;
24
25 %Compute date
26-dateout= date0 + fraction * numdays;
27+dateout= date0 + fraction .* numdays;
Note: See TracBrowser for help on using the repository browser.