source: trunk/SRC/Obsolete/juldate.pro @ 114

Last change on this file since 114 was 114, checked in by smasson, 18 years ago

new compilation options (compile_opt idl2, strictarrsubs) in each routine

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 1.9 KB
Line 
1;------------------------------------------------------------
2;------------------------------------------------------------
3;------------------------------------------------------------
4;+
5; @file_comments you better use date2jul
6; @obsolete
7;
8; @file_comments  gives julian date equivalent of a date in vairmer
9;           ( yymmdd or yyyymmdd ) format
10;           sets month, day and year to the corresp values
11;
12; @categories calendar
13;
14; @param vvdate {in} date de la forme yymmdd ou yyyymmdd
15;
16; @uses common.pro vraidate
17;
18; @returns date en jour julien
19;   l'annee 0 n'existant pas, qd year est nulle on calcule le
20;     jour julien de l'annee -1.
21;   COMPATIBLE AVEC L'AN 2000 !!!: une date de la forme yymmdd est
22;    donvertit sous la forme yyyymmdd a l''aide de vraidate.
23;   Attention, les variables globales year, month day sont attribuees
24;
25; @examples
26; IDL> date = juldate(930124)
27;
28; @history Jerome Vialard  (jv\@lodyc.jussieu.fr)
29; 2/7/98
30;-
31;------------------------------------------------------------
32;------------------------------------------------------------
33;------------------------------------------------------------
34function juldate, vvdate, _EXTRA = ex
35;
36  compile_opt idl2, strictarrsubs, obsolete
37;
38vdate = vvdate
39vdate = vraidate(vdate, _EXTRA = ex)
40@common
41;------------------------------------------------------------
42   year=vdate/10000
43   month=vdate/100 - year*100
44   day=abs(vdate - year*10000 - month*100)
45   month = abs(month)
46;
47   mm = month & dd = day & yy = year
48;------------------------------------------------------------
49   ndate = n_elements(vdate)
50   if total(mm EQ 0) EQ ndate then mm[*] = 6
51   if total(dd EQ 0) EQ ndate then dd[*] = 15
52   if total(yy EQ 0) EQ ndate THEN yy[*] = -1
53;------------------------------------------------------------
54   return, julday(mm,dd,yy, _EXTRA = ex)
55;------------------------------------------------------------
56   return, -1
57end
58;------------------------------------------------------------
Note: See TracBrowser for help on using the repository browser.