source: trunk/CALENDRIER/vairdate.pro @ 2

Last change on this file since 2 was 2, checked in by opalod, 22 years ago

Initial revision

  • 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; PURPOSE:  gives vairmer date equivalent of a date in julian format
8;           sets month, day and year to the corresp values
9;
10; CATEGORY:
11;
12; CALLING SEQUENCE:  vdate = vairdate(1755087)
13;
14; INPUTS:jdate=date en jours juliens
15;
16; KEYWORD PARAMETERS:
17;
18;    MENSUEL: 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;    ANNUEL: a activer si on veut pour  que les dates dont le mois est
23;    6 et dont le jour est 1 deviennent avec un mois et jour egale a
24;    0. par ex:
25;    19990601   ->   19990000
26;
27; OUTPUTS:vdate=date vairmer
28;         plus year, month et day
29;
30; COMMON BLOCKS:
31;       common.pro
32;
33; SIDE EFFECTS:
34;
35; RESTRICTIONS:
36;
37; EXAMPLE:
38;
39; MODIFICATION HISTORY: Jerome Vialard  (jv@lodyc.jussieu.fr)
40;                       2/7/98
41;                13/9/1999, Sebastien Masson (smasson@lodyc.jussieu.fr)
42;                       ANNUEL,MENSUEL,_EXTRA et possibilite
43;                       d''utiliser vairdate avec des scalaire ou des
44;                       tableaux
45;-
46;------------------------------------------------------------
47;------------------------------------------------------------
48;------------------------------------------------------------
49function vairdate, jdate,  ANNUEL = annuel, MENSUEL = mensuel, _EXTRA = ex
50@common
51;------------------------------------------------------------
52   caldat, jdate, month, day, year, _EXTRA = ex
53   index = where(year eq -1)
54   if index[0] NE -1 then year[index] = 0
55   if keyword_set(mensuel) THEN BEGIN
56      index = where(day EQ 15)
57      if index[0] NE -1 then day[index] = 0
58   endif
59   if keyword_set(annuel) THEN BEGIN
60      index = where(day EQ 1 AND month EQ 6)
61      if index[0] NE -1 then BEGIN
62         day[index] = 0
63         month[index] = 0
64      endif
65   endif
66;------------------------------------------------------------
67   return, 10000L*year+100L*month+day
68;------------------------------------------------------------
69end
70;------------------------------------------------------------
Note: See TracBrowser for help on using the repository browser.