source: trunk/SRC/Obsolete/ficdate.pro @ 134

Last change on this file since 134 was 134, checked in by navarro, 18 years ago

change *.pro file properties (del eof-style, del executable, set keywords Id

  • Property svn:keywords set to Id
File size: 3.3 KB
Line 
1;------------------------------------------------------------
2;------------------------------------------------------------
3;------------------------------------------------------------
4;+
5; @file_comments
6; sets s_fichier to name of the vairmer file associated
7; to the given date in vairmer format ( yymmdd )
8;
9; @obsolete
10;
11; @param vdate {in} date vairmer ex:930124
12;
13; @param dim {in} 'so' ou 'vo' par defaut so est choisi
14;
15; @param nomexp {in} nom de l'experience en trois lettres par defaut prefix
16;
17; @returns le nom du fichier vairmer (depuis iodir)
18;
19; @uses common.pro
20;
21; @examples
22; IDL> fic = ficdate(930124)
23;
24; @history Jerome Vialard  (jv\@lodyc.jussieu.fr)
25;1/7/98
26;
27; @version $Id$
28;
29;-
30;------------------------------------------------------------
31;------------------------------------------------------------
32;------------------------------------------------------------
33function ficdate, vdate, dim, nomexp
34;
35  compile_opt idl2, strictarrsubs, obsolete
36;
37@common
38;------------------------------------------------------------
39case n_params() of
40  1: dim = 'SO'
41  2: dim=strupcase(dim)
42  3: begin
43       prefix=nomexp
44       dim=strupcase(dim)
45     end
46endcase
47;------------------------------------------------------------
48;   constitution de l'adresse ou aller chercher le fichier
49;--------------------------------------------------------------
50; date yymmdd = vdate
51; sets month, year and day to the good value :
52   rien = juldate(vdate)
53; constitution de la date yymmdd
54   case 1 of
55     year lt 10:                s_year ='0'+string(format='(i1)',year)
56     year ge 10 and year lt 100:s_year=     string(format='(i2)',year)
57     year ge 100:BEGIN
58        year = year-1900
59        if year LT 10 then s_year ='0'+string(format='(i1)',year) $
60         ELSE s_year =string(format='(i2)',year)
61     end
62   endcase
63   if month lt 10 then s_month='0'+string(format='(i1)',month) $
64                  else s_month=    string(format='(i2)',month)
65   if day lt 10 then s_day='0'+string(format='(i1)',day) $
66                else s_day=    string(format='(i2)',day)
67;
68   case dim of
69     'SO': begin
70       case 1 of
71          (year eq 0) and (month eq 0) : s_fichier=iodir+prefix+'O.EX.SO'
72          (year eq 0) and (month ne 0) and (day eq 0) : s_fichier=iodir+prefix+'O.SE.SO'+s_month
73          (year ne 0) and (month eq 0) : s_fichier=iodir+prefix+'O.AN.SO'+s_year
74          (year ne 0) and (day eq 0) :   s_fichier=iodir+prefix+'O.MO.SO'+s_year+s_month
75          else: s_fichier=iodir+prefix+'O..SO'+s_year+s_month+s_day
76       endcase
77     end
78     'VO': begin
79       case 1 of
80          (year eq 0) and (month eq 0) : s_fichier=iodir+prefix+'O.EX.VO'
81          (year eq 0) and (month ne 0) and (day eq 0) : s_fichier=iodir+prefix+'O.SE.VO'+s_month
82          (year ne 0) and (month eq 0) : s_fichier=iodir+prefix+'O.AN.VO'+s_year
83          (year ne 0) and (day eq 0) : s_fichier=iodir+prefix+'O.MO.VO'+s_year+s_month
84          else: s_fichier=iodir+prefix+'O..VO'+s_year+s_month+s_day
85       endcase
86     end
87     else: return, report('le fichier doit etre VO ou SO')
88   endcase
89;
90;   print,' '
91;   print,' adresse du fichier: ',fichier
92;------------------------------------------------------------
93   return, s_fichier
94;------------------------------------------------------------
95end
96;------------------------------------------------------------
Note: See TracBrowser for help on using the repository browser.