This is a static copy of a profile reportHome
julianmd (3 calls, 0.000 sec)
Generated 05-Aug-2011 13:03:56 using cpu time.
function in file /home/LeechJ/cbass_analysis/matutils/dateconv/julianmd.m
Copy to new window for comparing multiple runs
Parents (calling functions)
Function Name | Function Type | Calls |
sunrise | function | 2 |
greg2 | function | 1 |
Lines where the most time was spent
No measurable time spent in this functionLine Number | Code | Calls | Total Time | % Time | Time Plot |
46 | j=j+h/24; | 3 | 0 s | 0% |  |
39 | j = floor((146097*c)/4) + floo... | 3 | 0 s | 0% |  |
38 | yr = yr - c*100; | 3 | 0 s | 0% |  |
37 | c = floor(yr/100); | 3 | 0 s | 0% |  |
36 | yr(i)=y(i); | 3 | 0 s | 0% |  |
All other lines | | | 0 s | 0% |  |
Totals | | | 0 s | 0% | |
Children (called functions)
No childrenCode Analyzer results
No Code Analyzer messages.Coverage results
[ Show coverage for parent directory ]
Total lines in function | 46 |
Non-code lines (comments, blank lines) | 29 |
Code lines (lines that can run) | 17 |
Code lines that did run | 11 |
Code lines that did not run | 6 |
Coverage (did run/can run) | 64.71 % |
Function listing
time calls line
1 function [j]=julianmd(y,m,d,h)
2 % JULIANMD: converts Gregorian calendar time to decimal Julian day.
3 % [j]=JULIANMD(y,m,d,h) converts Gregorian calendar dates to corresponding
4 % Julian day numbers. Although the formal definition holds that Julian
5 % days start and end at noon, here Julian days start and end at midnight.
6 % In this convention, Julian day 2440000 began at 0000 UT, May 23, 1968.
7 %
8 % INPUT: d - day (1-31) component of Gregorian date
9 % m - month (1-12) component
10 % y - year (e.g., 1979) component
11 % h - decimal hours (assumed 0 if absent)
12 %
13 % OUTPUT: j - decimal Julian day number (e.g., 0000 UT Jan 1 is 0.0)
14 %
15 % Usage: [j]=julianmd(y,m,d,h) (inputs scalars or matrices)
16 % or
17 % [j]=julianmd([y m d hr min sec]) (nx6 matrix input)
18 %University of Maine Ocean Modelling Group http://rocky.umeoce.maine.edu/hjx/courses/SMS585/my2.5/air_sea/
19 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
20 % 8/28/98: version 1.1 (vectorized by RP)
21 % 8/5/99: version 2.0
22 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
23
3 24 if nargin==3,
25 h=0.;
3 26 elseif nargin==1,
27 h=hms2h(y(:,4),y(:,5),y(:,6));
28 d=y(:,3);
29 m=y(:,2);
30 y=y(:,1);
31 end
3 32 mo=m+9;
3 33 yr=y-1;
3 34 i=(m>2);
3 35 mo(i)=m(i)-3;
3 36 yr(i)=y(i);
3 37 c = floor(yr/100);
3 38 yr = yr - c*100;
3 39 j = floor((146097*c)/4) + floor((1461*yr)/4) + ...
40 floor((153*mo +2)/5) +d +1721119;
41
42 % if you want Julian days to start and end at noon,
43 % replace the following line with:
44 % j=j+(h-12)/24;
45
3 46 j=j+h/24;
Other subfunctions in this file are not included in this listing.