source: trunk/Obsolete/vairdate.pro @ 9

Last change on this file since 9 was 9, checked in by pinsard, 18 years ago

upgrade of CALENDRIER/Calendar according to cerbere.lodyc.jussieu.fr:/usr/home/smasson/SAXO_RD/ : files

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 2.2 KB
Line 
1;------------------------------------------------------------
2;------------------------------------------------------------
3;------------------------------------------------------------
4;+
5; NAME: vairdate
6;
7;       OBSOLETE: you better use jul2date
8;
9; PURPOSE:  gives vairmer date equivalent of a date in julian format
10;           sets month, day and year to the corresp values
11;
12; CATEGORY:
13;
14; CALLING SEQUENCE:  vdate = vairdate(1755087)
15;
16; INPUTS:jdate=date en jours juliens
17;
18; KEYWORD PARAMETERS:
19;
20;    MENSUEL: a activer si on veut pour  que les dates dont le jour est
21;    15 deviennent avec un jour egale a 0. par ex:
22;    19990115   ->   19990100
23;
24;    ANNUEL: a activer si on veut pour  que les dates dont le mois est
25;    6 et dont le jour est 1 deviennent avec un mois et jour egale a
26;    0. par ex:
27;    19990601   ->   19990000
28;
29; OUTPUTS:vdate=date vairmer
30;         plus year, month et day
31;
32; COMMON BLOCKS:
33;       common.pro
34;
35; SIDE EFFECTS:
36;
37; RESTRICTIONS:
38;
39; EXAMPLE:
40;
41; MODIFICATION HISTORY: Jerome Vialard  (jv@lodyc.jussieu.fr)
42;                       2/7/98
43;                13/9/1999, Sebastien Masson (smasson@lodyc.jussieu.fr)
44;                       ANNUEL,MENSUEL,_EXTRA et possibilite
45;                       d''utiliser vairdate avec des scalaire ou des
46;                       tableaux
47;-
48;------------------------------------------------------------
49;------------------------------------------------------------
50;------------------------------------------------------------
51function vairdate, jdate,  ANNUEL = annuel, MENSUEL = mensuel, _EXTRA = ex
52@common
53;------------------------------------------------------------
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.