@jcompile('<STR_LIT>',<EOL>nopython=True)<EOL>def julian_day_dt(year, month, day, hour, minute, second, microsecond):
if month <= <NUM_LIT:2>:<EOL><INDENT>year = year-<NUM_LIT:1><EOL>month = month+<NUM_LIT:12><EOL><DEDENT>a = int(year/<NUM_LIT:100>)<EOL>b = <NUM_LIT:2> - a + int(a * <NUM_LIT>)<EOL>frac_of_day = (microsecond + (second + minute * <NUM_LIT> + hour * <NUM_LIT>)<EOL>) * <NUM_LIT:1.0> / (<NUM_LIT>*<NUM_LIT>)<EOL>d = day + frac_of_day<EOL>jd = (int(<NUM_LIT> * (year + <NUM_LIT>)) + int(<NUM_LIT> * (month + <NUM_LIT:1>)) + d +<EOL>b - <NUM_LIT>)<EOL>return jd<EOL>
This is the original way to calculate the julian day from the NREL paper.
    However, it is much faster to convert to unix/epoch time and then convert
    to julian day. Note that the date must be UTC.