1 | ;------------------------------------------------------------ |
---|
2 | ;------------------------------------------------------------ |
---|
3 | ;------------------------------------------------------------ |
---|
4 | ;+ |
---|
5 | ; NAME: ficdate |
---|
6 | ; |
---|
7 | ; PURPOSE: sets s_fichier to name of the vairmer file associated |
---|
8 | ; to the given date in vairmer format ( yymmdd ) |
---|
9 | ; |
---|
10 | ; CATEGORY: |
---|
11 | ; |
---|
12 | ; CALLING SEQUENCE: fic = ficdate(930124) |
---|
13 | ; |
---|
14 | ; INPUTS:vdate:date vairmer ex:930124 |
---|
15 | ; dim:'so' ou 'vo' par defaut so est choisi |
---|
16 | ; nomexp:nomde l'experience en trois lettres par defaut prefix |
---|
17 | ; |
---|
18 | ; KEYWORD PARAMETERS: |
---|
19 | ; |
---|
20 | ; OUTPUTS:le nom du fichier vairmer (depuis iodir) |
---|
21 | ; |
---|
22 | ; COMMON BLOCKS: |
---|
23 | ; common.pro |
---|
24 | ; |
---|
25 | ; SIDE EFFECTS: |
---|
26 | ; |
---|
27 | ; RESTRICTIONS: |
---|
28 | ; |
---|
29 | ; EXAMPLE: |
---|
30 | ; |
---|
31 | ; MODIFICATION HISTORY: Jerome Vialard (jv@lodyc.jussieu.fr) |
---|
32 | ; 1/7/98 |
---|
33 | ;- |
---|
34 | ;------------------------------------------------------------ |
---|
35 | ;------------------------------------------------------------ |
---|
36 | ;------------------------------------------------------------ |
---|
37 | function ficdate, vdate, dim, nomexp |
---|
38 | @common |
---|
39 | ;------------------------------------------------------------ |
---|
40 | case n_params() of |
---|
41 | 1: dim = 'SO' |
---|
42 | 2: dim=strupcase(dim) |
---|
43 | 3: begin |
---|
44 | prefix=nomexp |
---|
45 | dim=strupcase(dim) |
---|
46 | end |
---|
47 | endcase |
---|
48 | ;------------------------------------------------------------ |
---|
49 | ; constitution de l'adresse ou aller chercher le fichier |
---|
50 | ;-------------------------------------------------------------- |
---|
51 | ; date yymmdd = vdate |
---|
52 | ; sets month, year and day to the good value : |
---|
53 | rien = juldate(vdate) |
---|
54 | ; constitution de la date yymmdd |
---|
55 | case 1 of |
---|
56 | year lt 10: s_year ='0'+string(format='(i1)',year) |
---|
57 | year ge 10 and year lt 100:s_year= string(format='(i2)',year) |
---|
58 | year ge 100:BEGIN |
---|
59 | year = year-1900 |
---|
60 | if year LT 10 then s_year ='0'+string(format='(i1)',year) $ |
---|
61 | ELSE s_year =string(format='(i2)',year) |
---|
62 | end |
---|
63 | endcase |
---|
64 | if month lt 10 then s_month='0'+string(format='(i1)',month) $ |
---|
65 | else s_month= string(format='(i2)',month) |
---|
66 | if day lt 10 then s_day='0'+string(format='(i1)',day) $ |
---|
67 | else s_day= string(format='(i2)',day) |
---|
68 | ; |
---|
69 | case dim of |
---|
70 | 'SO': begin |
---|
71 | case 1 of |
---|
72 | (year eq 0) and (month eq 0) : s_fichier=iodir+prefix+'O.EX.SO' |
---|
73 | (year eq 0) and (month ne 0) and (day eq 0) : s_fichier=iodir+prefix+'O.SE.SO'+s_month |
---|
74 | (year ne 0) and (month eq 0) : s_fichier=iodir+prefix+'O.AN.SO'+s_year |
---|
75 | (year ne 0) and (day eq 0) : s_fichier=iodir+prefix+'O.MO.SO'+s_year+s_month |
---|
76 | else: s_fichier=iodir+prefix+'O..SO'+s_year+s_month+s_day |
---|
77 | endcase |
---|
78 | end |
---|
79 | 'VO': begin |
---|
80 | case 1 of |
---|
81 | (year eq 0) and (month eq 0) : s_fichier=iodir+prefix+'O.EX.VO' |
---|
82 | (year eq 0) and (month ne 0) and (day eq 0) : s_fichier=iodir+prefix+'O.SE.VO'+s_month |
---|
83 | (year ne 0) and (month eq 0) : s_fichier=iodir+prefix+'O.AN.VO'+s_year |
---|
84 | (year ne 0) and (day eq 0) : s_fichier=iodir+prefix+'O.MO.VO'+s_year+s_month |
---|
85 | else: s_fichier=iodir+prefix+'O..VO'+s_year+s_month+s_day |
---|
86 | endcase |
---|
87 | end |
---|
88 | else: return, report('le fichier doit etre VO ou SO') |
---|
89 | endcase |
---|
90 | ; |
---|
91 | ; print,' ' |
---|
92 | ; print,' adresse du fichier: ',fichier |
---|
93 | ;------------------------------------------------------------ |
---|
94 | return, s_fichier |
---|
95 | ;------------------------------------------------------------ |
---|
96 | end |
---|
97 | ;------------------------------------------------------------ |
---|