This is a static copy of a profile report

Home

greg2 (1 call, 0.000 sec)
Generated 05-Aug-2011 13:03:56 using cpu time.
function in file /home/LeechJ/cbass_analysis/matutils/dateconv/greg2.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
soradna1function1
Lines where the most time was spent
No measurable time spent in this function

Line NumberCodeCallsTotal Time% TimeTime Plot
51
gtime=[yr(:) mo(:) d(:) hour(:...
10 s0%
50
[hour,min,sec]=s2hms(secs);
10 s0%
49
yr(i)=y(i);
10 s0%
48
mo(i)=m(i)+3;
10 s0%
47
i=(m<10);
10 s0%
All other lines  0 s0%
Totals  0 s0% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
s2hmsfunction10 s0%
julianmdfunction10 s0%
Self time (built-ins, overhead, etc.)  0 s0%
Totals  0 s0% 
Code Analyzer results
No Code Analyzer messages.
Coverage results
[ Show coverage for parent directory ]
Total lines in function51
Non-code lines (comments, blank lines)28
Code lines (lines that can run)23
Code lines that did run23
Code lines that did not run0
Coverage (did run/can run)100.00 %
Function listing
   time   calls  line
1 function [gtime]=greg2(yd,yr)
2 % GREG2: converts decimal yearday to standard Gregorian time.
3 % [gtime]=GREG2(yd,yr) converts decimal yearday to corresponding
4 % Gregorian calendar dates. In this convention, Julian day 2440000
5 % begins at 0000 UT May 23 1968.
6 %
7 % INPUT: yd - decimal yearday (e.g., 0000 UT Jan 1 is 0.0)
8 % yr - year (e.g., 1995)
9 %
10 % OUTPUT: gtime is a six component Gregorian time vector
11 % gtime=[year mo da hr mi sec]
12 %
13 % Example: [1995 01 01 12 00 00] = greg2(0.5, 1995)
14 %University of Maine Ocean Modelling Group http://rocky.umeoce.maine.edu/hjx/courses/SMS585/my2.5/air_sea/
15 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
16 % 3/10/97: version 1.0
17 % 4/7/99: version 1.2 (simplified by AA)
18 % 8/5/99: version 2.0
19 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
20
1 21 js = julianmd(yr,01,01,00);
1 22 julian = js + yd;
1 23 julian=julian+5.e-9; % kludge to prevent roundoff error on seconds
24
25 % if you want Julian Days to start at noon...
26 % h=rem(julian,1)*24+12;
27 % i=(h >= 24);
28 % julian(i)=julian(i)+1;
29 % h(i)=h(i)-24; Otherwise,....
30
1 31 secs=rem(julian,1)*24*3600;
32
1 33 j = floor(julian) - 1721119;
1 34 in = 4*j -1;
1 35 y = floor(in/146097);
1 36 j = in - 146097*y;
1 37 in = floor(j/4);
1 38 in = 4*in +3;
1 39 j = floor(in/1461);
1 40 d = floor(((in - 1461*j) +4)/4);
1 41 in = 5*d -3;
1 42 m = floor(in/153);
1 43 d = floor(((in - 153*m) +5)/5);
1 44 y = y*100 +j;
1 45 mo=m-9;
1 46 yr=y+1;
1 47 i=(m<10);
1 48 mo(i)=m(i)+3;
1 49 yr(i)=y(i);
1 50 [hour,min,sec]=s2hms(secs);
1 51 gtime=[yr(:) mo(:) d(:) hour(:) min(:) sec(:)];

Other subfunctions in this file are not included in this listing.