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

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

improvements/corrections of some *.pro headers

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