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

Last change on this file since 370 was 370, checked in by pinsard, 16 years ago

improvemnts of headers (typo, links)

  • 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; <pro>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;-
35function ficdate, vdate, dim, nomexp
36;
37  compile_opt idl2, strictarrsubs, obsolete
38;
39@common
40;------------------------------------------------------------
41case n_params() of
42  1: dim = 'SO'
43  2: dim=strupcase(dim)
44  3: begin
45       prefix=nomexp
46       dim=strupcase(dim)
47     end
48endcase
49;------------------------------------------------------------
50;   constitution de l'adresse ou aller chercher le fichier
51;--------------------------------------------------------------
52; date yymmdd = vdate
53; sets month, year and day to the good value :
54   rien = juldate(vdate)
55; constitution de la date yymmdd
56   case 1 of
57     year lt 10:                s_year ='0'+string(format='(i1)',year)
58     year ge 10 and year lt 100:s_year=     string(format='(i2)',year)
59     year ge 100:BEGIN
60        year = year-1900
61        if year LT 10 then s_year ='0'+string(format='(i1)',year) $
62         ELSE s_year =string(format='(i2)',year)
63     end
64   endcase
65   if month lt 10 then s_month='0'+string(format='(i1)',month) $
66                  else s_month=    string(format='(i2)',month)
67   if day lt 10 then s_day='0'+string(format='(i1)',day) $
68                else s_day=    string(format='(i2)',day)
69;
70   case dim of
71     'SO': begin
72       case 1 of
73          (year eq 0) and (month eq 0) : s_fichier=iodir+prefix+'O.EX.SO'
74          (year eq 0) and (month ne 0) and (day eq 0) : s_fichier=iodir+prefix+'O.SE.SO'+s_month
75          (year ne 0) and (month eq 0) : s_fichier=iodir+prefix+'O.AN.SO'+s_year
76          (year ne 0) and (day eq 0) :   s_fichier=iodir+prefix+'O.MO.SO'+s_year+s_month
77          else: s_fichier=iodir+prefix+'O..SO'+s_year+s_month+s_day
78       endcase
79     end
80     'VO': begin
81       case 1 of
82          (year eq 0) and (month eq 0) : s_fichier=iodir+prefix+'O.EX.VO'
83          (year eq 0) and (month ne 0) and (day eq 0) : s_fichier=iodir+prefix+'O.SE.VO'+s_month
84          (year ne 0) and (month eq 0) : s_fichier=iodir+prefix+'O.AN.VO'+s_year
85          (year ne 0) and (day eq 0) : s_fichier=iodir+prefix+'O.MO.VO'+s_year+s_month
86          else: s_fichier=iodir+prefix+'O..VO'+s_year+s_month+s_day
87       endcase
88     end
89     else: return, report('le fichier doit etre VO ou SO')
90   endcase
91;
92;   print,' '
93;   print,' adresse du fichier: ',fichier
94;------------------------------------------------------------
95   return, s_fichier
96;------------------------------------------------------------
97end
98;------------------------------------------------------------
Note: See TracBrowser for help on using the repository browser.