1 | ;;--------------------------------------- |
---|
2 | ; MOVIE |
---|
3 | ; |
---|
4 | ; **** DO NOT MODIFY **** |
---|
5 | ; |
---|
6 | ; set parameters in plot.def then type: |
---|
7 | ; |
---|
8 | ; @movie.idl |
---|
9 | ; |
---|
10 | ;;--------------------------------------- |
---|
11 | |
---|
12 | field1='' & field2='' & winds='' |
---|
13 | backup_data='no' & already_data='no' |
---|
14 | datafolder='./' & plotfolder='./' |
---|
15 | nomovie='yes' |
---|
16 | topo=0 |
---|
17 | extract='no' |
---|
18 | |
---|
19 | SPAWN, '\rm user.idl' |
---|
20 | SPAWN, 'grep -v grep plot.def > user.idl' |
---|
21 | |
---|
22 | ;; to avoid dumb and useless warnings from IDL |
---|
23 | space=0. & altitude=0. & lon=0. & lat=0. |
---|
24 | what_I_plot=0. & title_user='' & missing_value=0. |
---|
25 | |
---|
26 | @user.idl |
---|
27 | if (nam5 eq " interp_method = 0 ") then coord='height' |
---|
28 | if ((nam5 eq " interp_method = 1 ") and (tabnam(0) lt tabnam(1))) then coord='height' |
---|
29 | |
---|
30 | .compile call_arwpost |
---|
31 | if (extract eq 'yes') then call_arwpost, nam1, nam2, nam3, nam4, nam5, tabnam |
---|
32 | |
---|
33 | denom=plot+'_'+coord+'_'+field1 |
---|
34 | if ((field2 ne '') and (topo eq 0)) then denom=denom+'_'+field2 |
---|
35 | if (topo eq 1) then denom=denom+'_HGT' |
---|
36 | if (winds(0) ne '') then denom=denom+'_'+winds(0)+winds(1) |
---|
37 | |
---|
38 | if (already_data eq 'yes') then SPAWN, 'ln -sf '+datafolder+'/'+coord+'.input.ctl input.ctl' |
---|
39 | if (already_data eq 'yes') then SPAWN, 'ln -sf '+datafolder+'/'+coord+'.input.dat input.dat' |
---|
40 | |
---|
41 | SPAWN, '\rm param_plot.idl' |
---|
42 | SPAWN, 'grep grepALL plot.def > param_plot.idl' |
---|
43 | if ((plot eq 'meridional') or (plot eq 'zonal')) then SPAWN, 'grep grepSEC plot.def >> param_plot.idl' |
---|
44 | if (plot eq 'map') then SPAWN, 'grep grepMAP plot.def >> param_plot.idl' |
---|
45 | .compile map_latlon |
---|
46 | .compile section |
---|
47 | |
---|
48 | !p.charthick = 2.0 |
---|
49 | !p.thick = 3.0 |
---|
50 | !x.thick = 2.0 |
---|
51 | !y.thick = 2.0 |
---|
52 | |
---|
53 | for i=1,num do $ |
---|
54 | out_wrf, $ |
---|
55 | plot=plot, $ |
---|
56 | field1=field1, $ |
---|
57 | field2=field2, $ |
---|
58 | when=i, $ |
---|
59 | winds=winds, $ |
---|
60 | level=level,$ |
---|
61 | save_data=yeah,$ ;; data is loaded only once |
---|
62 | topo=topo,$ |
---|
63 | ; range=range,$ |
---|
64 | colors=colors, $ |
---|
65 | nlon=nlon, $ |
---|
66 | nlat=nlat, $ |
---|
67 | save_ps=denom+string(1000+i,'(I0)') |
---|
68 | |
---|
69 | print, 'generating movie ...' |
---|
70 | SPAWN, 'rm -rf temp' |
---|
71 | SPAWN, 'mkdir temp' |
---|
72 | SPAWN, 'mv -f '+denom+'????.ps temp' |
---|
73 | SPAWN, 'cp bigconvert200 temp' |
---|
74 | SPAWN, 'cd temp ; bigconvert200 *.ps ; convert -delay 60 *.png movie.gif ; cd ..' |
---|
75 | if (nomovie ne 'yes') then SPAWN, 'animate temp/movie.gif &' |
---|
76 | print, 'movie done' |
---|
77 | |
---|
78 | SPAWN, 'mv -f temp/'+denom+'????.ps '+plotfolder+'/' |
---|
79 | SPAWN, 'mv -f temp/movie.gif '+plotfolder+'/'+denom+'.gif' |
---|
80 | SPAWN, 'mv -f temp/'+denom+'????.png '+plotfolder+'/' |
---|
81 | if (backup_data eq 'yes') then SPAWN, 'cp -f namelist.ARWpost '+datafolder+'/'+coord+'.namelist.ARWpost' |
---|
82 | if (backup_data eq 'yes') then SPAWN, 'cp -f input.ctl '+datafolder+'/'+coord+'.input.ctl' |
---|
83 | if (backup_data eq 'yes') then SPAWN, 'cp -f input.dat '+datafolder+'/'+coord+'.input.dat' |
---|
84 | |
---|
85 | SPAWN, 'cp -f plot.def '+plotfolder+'/'+denom+'.def' |
---|