source: trunk/procs/trans_month.pro

Last change on this file was 203, checked in by pinsard, 14 years ago

remove trailing blanks

  • Property svn:keywords set to Id
File size: 1.1 KB
Line 
1;+
2;
3; @categories
4; Calendar
5;
6; @param MONTH {in}{required}{type=integer}
7;
8; @returns
9; month 2 characters strings
10; -1 in case of error
11;
12; @todo
13; why not use <pro>monthname</pro> instead ?
14;
15; @history
16; - fplod 20100119T094252Z aedon.locean-ipsl.upmc.fr (Darwin)
17;
18;   * check parameters
19;
20; @version
21; $Id$
22;
23;-
24FUNCTION trans_month, month
25;
26  compile_opt idl2, strictarrsubs
27;
28 usage='result=trans_month(month)'
29;
30 nparam = N_PARAMS()
31 IF (nparam LT 1) THEN BEGIN
32   ras = report(['Incorrect number of arguments.' $
33          + '!C' $
34          + 'Usage : ' + usage])
35   return, -1
36 ENDIF
37
38 arg_type = size(month,/type)
39 IF ((arg_type NE 2) AND (arg_type NE 3)) THEN BEGIN
40   ras = report(['Incorrect arg type month' $
41          + '!C' $
42          + 'Usage : ' + usage])
43   return, -1
44 ENDIF
45
46
47   CASE month OF
48      01: mn = 'JAN'
49      02: mn = 'FEB'
50      03: mn = 'MAR'
51      04: mn = 'APR'
52      05: mn = 'MAY'
53      06: mn = 'JUN'
54      07: mn = 'JUL'
55      08: mn = 'AUG'
56      09: mn = 'SEP'
57      10: mn = 'OCT'
58      11: mn = 'NOV'
59      12: mn = 'DEC'
60      ELSE:
61   ENDCASE
62
63   return, mn
64END
Note: See TracBrowser for help on using the repository browser.