source: trunk/Obsolete/juldate.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.1 KB
Line 
1;------------------------------------------------------------
2;------------------------------------------------------------
3;------------------------------------------------------------
4;+
5; NAME: juldate
6;
7;       OBSOLETE: you better use date2jul
8;
9; PURPOSE:  gives julian date equivalent of a date in vairmer
10;           ( yymmdd or yyyymmdd ) format
11;           sets month, day and year to the corresp values
12;
13; CATEGORY: bidouilles dates
14;
15; CALLING SEQUENCE:  date = juldate(930124)
16;
17; INPUTS:date de la forme yymmdd ou yyyymmdd
18;
19; KEYWORD PARAMETERS:
20;
21;       /VRAIDATE: pour ne pas transformer l''annnee 01 en 1901
22;       /GRADS: if  1 le year le 49 then year = 2000+year
23;               if 50 le year le 99 then year = 1900+year
24;
25; OUTPUTS:date en jour julien
26;
27; COMONTHON BLOCKS:
28;       common.pro      vraidate
29;
30; SIDE EFFECTS:
31;   l'annee 0 n'existant pas, qd year est nulle on calcule le
32;     jour julien de l'annee -1.
33;   COMPATIBLE AVEC L'AN 2000 !!!: une date de la forme yymmdd est
34;    donvertit sous la forme yyyymmdd a l''aide de vraidate.
35;   Attention, les variables globales year, month day sont attribuees
36;
37; MODIFICATION HISTORY: Jerome Vialard  (jv@lodyc.jussieu.fr)
38;                       2/7/98
39;-
40;------------------------------------------------------------
41;------------------------------------------------------------
42;------------------------------------------------------------
43function juldate, vvdate, _EXTRA = ex
44vdate = vvdate
45vdate = vraidate(vdate, _EXTRA = ex)
46@common
47;------------------------------------------------------------
48   year=vdate/10000
49   month=vdate/100 - year*100
50   day=abs(vdate - year*10000 - month*100)
51   month = abs(month)
52;
53   mm = month & dd = day & yy = year
54;------------------------------------------------------------
55   ndate = n_elements(vdate)
56   if total(mm EQ 0) EQ ndate then mm[*] = 6
57   if total(dd EQ 0) EQ ndate then dd[*] = 15
58   if total(yy EQ 0) EQ ndate THEN yy[*] = -1
59;------------------------------------------------------------
60   return, julday(mm,dd,yy, _EXTRA = ex)
61;------------------------------------------------------------
62   return, -1
63end
64;------------------------------------------------------------
65
Note: See TracBrowser for help on using the repository browser.