1 | PRO loadgrid, meshfilein, _extra = ex |
---|
2 | ; |
---|
3 | ; |
---|
4 | ; |
---|
5 | compile_opt idl2, strictarrsubs |
---|
6 | ; |
---|
7 | @cm_4mesh |
---|
8 | ccmeshparameters.filename = meshfilein |
---|
9 | ; split the name according to "," delimiter |
---|
10 | meshfile = strsplit(meshfilein, ',', /extract) |
---|
11 | meshfile = strtrim(meshfile, 2) |
---|
12 | ; try to find a .pro file with this name... |
---|
13 | filepro = (find(meshfile[0], /firstfound, /onlypro))[0] |
---|
14 | ; if this is an idl batch file or a procedure |
---|
15 | if filepro NE 'NOT FOUND' THEN BEGIN |
---|
16 | CASE protype(filepro) OF |
---|
17 | ; this is a procedure |
---|
18 | 'proc':listing = file_basename(filepro, '.pro') |
---|
19 | ; this is a function, this case is not coded... |
---|
20 | 'func':stop |
---|
21 | ; this is an IDL batch file |
---|
22 | 'batch':listing = '@'+file_basename(filepro, '.pro') |
---|
23 | ENDCASE |
---|
24 | ENDIF ELSE BEGIN |
---|
25 | filenc = (find(meshfile[0], /firstfound, /onlync))[0] |
---|
26 | if filenc EQ 'NOT FOUND' THEN stop |
---|
27 | listing = 'initncdf, ''' + filenc +'''' |
---|
28 | ENDELSE |
---|
29 | ; add the arguments and keywords if necessary |
---|
30 | IF n_elements(meshfile) GT 1 AND strmid(listing, 0, 1) NE '@' THEN BEGIN |
---|
31 | FOR i = 1+(filepro NE 'NOT FOUND'), n_elements(meshfile)-1 DO listing = listing + ', ' + meshfile[i] |
---|
32 | ENDIF |
---|
33 | |
---|
34 | IF strmid(listing, 0, 1) NE '@' THEN listing = listing + ', strcalling = ''' + meshfilein + ''', _extra = ex' |
---|
35 | |
---|
36 | createpro, listing, filename = myuniquetmpdir +'for_createpro.pro', _extra = ex |
---|
37 | |
---|
38 | return |
---|
39 | END |
---|