source: trunk/SRC/Obsolete/vairdate.pro @ 325

Last change on this file since 325 was 325, checked in by pinsard, 17 years ago

modification of some headers (+some corrections) to prepare usage of the new idldoc

  • Property svn:keywords set to Id
File size: 1.8 KB
Line 
1;+
2;
3; @file_comments
4; gives vairmer date equivalent of a date in julian format
5; sets month, day and year to the corresp values
6;
7; you better use <pro>jul2date</pro>
8;
9; @obsolete
10;
11; @examples
12; IDL> vdate = vairdate(1755087)
13;
14; @param jdate {in}{required}
15; date en jours juliens
16;
17; @keyword MENSUEL
18; a activer si on veut pour  que les dates dont le jour est
19;    15 deviennent avec un jour egale a 0. par ex:
20;    19990115   ->   19990100
21;
22; @keyword ANNUEL
23; a activer si on veut pour  que les dates dont le mois est
24;    6 et dont le jour est 1 deviennent avec un mois et jour egale a
25;    0. par ex:
26;    19990601   ->   19990000
27;
28; @keyword _EXTRA
29; Used to pass keywords
30;
31; @returns
32; vdate date vairmer plus year, month et day
33;
34; @uses
35; common
36;
37; @history
38; Jerome Vialard  (jv\@lodyc.jussieu.fr)
39;   2/7/98
40;                13/9/1999, Sebastien Masson (smasson\@lodyc.jussieu.fr)
41;                       ANNUEL,MENSUEL,_EXTRA et possibilite
42;                       d''utiliser vairdate avec des scalaire ou des
43;                       tableaux
44;
45; @version
46; $Id$
47;
48;-
49function vairdate, jdate,  ANNUEL = annuel, MENSUEL = mensuel, _EXTRA = ex
50;
51  compile_opt idl2, strictarrsubs, obsolete
52;
53@common
54   caldat, jdate, month, day, year, _EXTRA = ex
55   index = where(year eq -1)
56   if index[0] NE -1 then year[index] = 0
57   if keyword_set(mensuel) THEN BEGIN
58      index = where(day EQ 15)
59      if index[0] NE -1 then day[index] = 0
60   endif
61   if keyword_set(annuel) THEN BEGIN
62      index = where(day EQ 1 AND month EQ 6)
63      if index[0] NE -1 then BEGIN
64         day[index] = 0
65         month[index] = 0
66      endif
67   endif
68;------------------------------------------------------------
69   return, 10000L*year+100L*month+day
70;------------------------------------------------------------
71end
72;------------------------------------------------------------
Note: See TracBrowser for help on using the repository browser.