1 | ;+ |
---|
2 | ; @file_comments |
---|
3 | ; |
---|
4 | ; |
---|
5 | ; @categories |
---|
6 | ; |
---|
7 | ; |
---|
8 | ; @param MESHFILEIN |
---|
9 | ; |
---|
10 | ; |
---|
11 | ; @keyword _EXTRA |
---|
12 | ; Used to pass your keywords |
---|
13 | ; |
---|
14 | ; @returns |
---|
15 | ; |
---|
16 | ; |
---|
17 | ; @uses |
---|
18 | ; |
---|
19 | ; |
---|
20 | ; @restrictions |
---|
21 | ; |
---|
22 | ; |
---|
23 | ; @examples |
---|
24 | ; |
---|
25 | ; |
---|
26 | ; @history |
---|
27 | ; |
---|
28 | ; |
---|
29 | ; @version |
---|
30 | ; $Id$ |
---|
31 | ; |
---|
32 | ; @todo |
---|
33 | ; seb |
---|
34 | ; |
---|
35 | ;- |
---|
36 | PRO loadgrid, meshfiletxtin, _extra = ex |
---|
37 | ; |
---|
38 | meshfilein = strsed(meshfiletxtin,'@@@', '''') |
---|
39 | ; |
---|
40 | compile_opt idl2, strictarrsubs |
---|
41 | ; |
---|
42 | @cm_4mesh |
---|
43 | ccmeshparameters.filename = meshfilein |
---|
44 | ; split the name according to "," delimiter |
---|
45 | meshfile = strsplit(meshfilein, ',', /extract) |
---|
46 | meshfile = strtrim(meshfile, 2) |
---|
47 | ; try to find a .pro file with this name... |
---|
48 | filepro = (find(meshfile[0], /firstfound, /onlypro))[0] |
---|
49 | ; if this is an idl batch file or a procedure |
---|
50 | if filepro NE 'NOT FOUND' THEN BEGIN |
---|
51 | CASE protype(filepro) OF |
---|
52 | ; this is a procedure |
---|
53 | 'proc':listing = file_basename(filepro, '.pro') |
---|
54 | ; this is a function, this case is not coded... |
---|
55 | 'func':stop |
---|
56 | ; this is an IDL batch file |
---|
57 | 'batch':listing = '@'+file_basename(filepro, '.pro') |
---|
58 | ENDCASE |
---|
59 | ENDIF ELSE BEGIN |
---|
60 | filenc = (find(meshfile[0], /firstfound, /onlync))[0] |
---|
61 | if filenc EQ 'NOT FOUND' THEN stop |
---|
62 | listing = 'initncdf, ''' + filenc +'''' |
---|
63 | ENDELSE |
---|
64 | ; add the arguments and keywords if necessary |
---|
65 | IF n_elements(meshfile) GT 1 AND strmid(listing, 0, 1) NE '@' THEN $ |
---|
66 | listing = listing + strmid(meshfilein, strpos(meshfilein, ',')) |
---|
67 | |
---|
68 | meshfilein = strsed(meshfilein, '''', '@@@') |
---|
69 | IF strmid(listing, 0, 1) NE '@' THEN listing = listing + ', strcalling = ''' + meshfilein + ''', _extra = ex' |
---|
70 | |
---|
71 | createpro, listing, filename = myuniquetmpdir +'for_createpro.pro', _extra = ex |
---|
72 | |
---|
73 | return |
---|
74 | END |
---|