| 1 | pro gravitwaveprof |
|---|
| 2 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
|---|
| 3 | |
|---|
| 4 | ; |
|---|
| 5 | ; faire avant api avec kappa 3.9 |
|---|
| 6 | ; |
|---|
| 7 | |
|---|
| 8 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
|---|
| 9 | path='../TESTGW/' |
|---|
| 10 | path='/tmp7/aslmd/' |
|---|
| 11 | path='/home/aslmd/GRAVITWAVE/' |
|---|
| 12 | experiment='mcd_lt16_rcpcst' |
|---|
| 13 | ;experiment='mcd_lt16' |
|---|
| 14 | ;experiment='short_mcd_lt16_rcpcst' |
|---|
| 15 | ;experiment='short_mcd_lt16' |
|---|
| 16 | ;experiment='short_mcd_lt16_calcprho' |
|---|
| 17 | ;experiment='mcd_lt16_calcprho' |
|---|
| 18 | ;experiment='short_mcd_lt16_calcprho_tot' |
|---|
| 19 | ;experiment='colder_gcm_add_short' |
|---|
| 20 | ;experiment='colder_gcm_add' |
|---|
| 21 | experiment='' |
|---|
| 22 | ;experiment='wind15' |
|---|
| 23 | ;experiment='wind20c' |
|---|
| 24 | ;experiment='colder_gcm_add_3.9_fine_rad_mountain' |
|---|
| 25 | experiment='test' |
|---|
| 26 | experiment='GW_MARS_highwind_3D.157077' |
|---|
| 27 | experiment='GW_MARS_highwind_3D_lower_opacity.161436' |
|---|
| 28 | experiment='GW_MARS_highwind_3D_loweropacity_lotspoints.161468' |
|---|
| 29 | experiment='GW_MARS_highwind_3D_loweropacity_morepoints.161542' |
|---|
| 30 | ;experiment='GW_MARS_highwind_3D_loweropacity_morepoints_LT15.161544' |
|---|
| 31 | ;experiment='GW_MARS_highwind_3D_loweropacity_morepoints_LTcst.168440' |
|---|
| 32 | ;experiment='GW_MARS_highwind_3D_loweropacity_morepoints_widehill.168468' |
|---|
| 33 | file=path+experiment+'_wrfout_d01_9999-09-09_09:00:00_z' |
|---|
| 34 | file=path+experiment+'/wrfout_d01_9999-09-09_09:00:00_z' |
|---|
| 35 | ;file=path+experiment+'/wrfout_d01_9999-09-09_10:00:00_z' |
|---|
| 36 | ;file=path+experiment+'/wrfout_d01_9999-09-09_11:00:00_z' |
|---|
| 37 | charvar='W' & charvarc='W' |
|---|
| 38 | charvar='tk' & charvarc='W' |
|---|
| 39 | charvar='tk' & charvarc='W' & cond=1 |
|---|
| 40 | charvar='tpot' & charvarc='tpot' |
|---|
| 41 | ;charvar='PTOT' & charvarc='PTOT' |
|---|
| 42 | charvar='tk' & charvarc='tk' |
|---|
| 43 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
|---|
| 44 | nts=1 & nte=15 & nxs=0 & nxe=59 |
|---|
| 45 | nts=3 & nte=nts & nxs=999 & nxe=999 ;; moyenne ;; attention a la montagne !!! |
|---|
| 46 | nts=4 & nte=nts & nxs=31 & nxe=nxs ;; AU CENTRE ! sinon choisir le point en traçant de 0a 59 |
|---|
| 47 | nts=1 & nte=nts & nxs=0 & nxe=59 |
|---|
| 48 | nts=4 & nte=nts & nxs=0 & nxe=59 |
|---|
| 49 | nts=1 & nte=15 & nxs=31 & nxe=31 |
|---|
| 50 | nts=1 & nte=15 & nxs=45 & nxe=45 |
|---|
| 51 | nts=9 & nte=9 & nxs=0 & nxe=59 |
|---|
| 52 | nts=1 & nte=13 & nxs=59 & nxe=59 |
|---|
| 53 | nts=8 & nte=8 & nxs=0 & nxe=121 |
|---|
| 54 | nts=1 & nte=9 & nxs=59 & nxe=59 |
|---|
| 55 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
|---|
| 56 | nts=1 & nte=10 & nxs=50 & nxe=50 |
|---|
| 57 | ;nts=1 & nte=1 & nxs=6 & nxe=6 |
|---|
| 58 | nts=1 & nte=100 & nxs=50 & nxe=50 |
|---|
| 59 | nts=1 & nte=100 & nxs=60 & nxe=60 |
|---|
| 60 | nts=1 & nte=100 & nxs=20 & nxe=20 |
|---|
| 61 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
|---|
| 62 | ; |
|---|
| 63 | ; |
|---|
| 64 | ; |
|---|
| 65 | what_I_plot=0. & overcontour=0. |
|---|
| 66 | ;SPAWN, '\rm param_plot.idl ; cp gravitwave_inc2.pro param_plot.idl' |
|---|
| 67 | ; |
|---|
| 68 | ; |
|---|
| 69 | ; |
|---|
| 70 | getcdf, $ |
|---|
| 71 | file=file, $ |
|---|
| 72 | charvar=charvar, $ |
|---|
| 73 | invar=invar |
|---|
| 74 | ;getcdf, $ |
|---|
| 75 | ; file=file, $ |
|---|
| 76 | ; charvar=charvarc, $ |
|---|
| 77 | ; invar=invarc |
|---|
| 78 | getcdf, $ |
|---|
| 79 | file=file, $ |
|---|
| 80 | charvar='vert', $ |
|---|
| 81 | invar=vert |
|---|
| 82 | getcdf, $ |
|---|
| 83 | file=file, $ |
|---|
| 84 | charvar='PTOT', $ |
|---|
| 85 | invar=columnp |
|---|
| 86 | ;; |
|---|
| 87 | ;; |
|---|
| 88 | ;; |
|---|
| 89 | s = size(invar) & middle = floor(s[2]/2) & print, 'PLOT at y subs ', middle |
|---|
| 90 | nte = min(s[4]-1,nte) & print, 'nte ', nte |
|---|
| 91 | mean_invar = TOTAL(invar(*,*,*,nts:nte),4) / float(nte-nts+1) |
|---|
| 92 | ;mean_columnp = TOTAL(columnp(*,*,*,nts:nte),4) / float(nte-nts+1) |
|---|
| 93 | anomal_invar = invar & for i=0,s[4]-1 do anomal_invar(*,*,*,i) = anomal_invar(*,*,*,i) - mean_invar |
|---|
| 94 | ;; |
|---|
| 95 | ;; |
|---|
| 96 | ;; |
|---|
| 97 | ; goto, perturb |
|---|
| 98 | for nt=nts,nte do begin |
|---|
| 99 | for nx=nxs,nxe do begin |
|---|
| 100 | ; |
|---|
| 101 | zefile=experiment+'_'+charvar+'_'+string(nt+100,'(I0)')+'_'+string(nx+100,'(I0)') |
|---|
| 102 | ; |
|---|
| 103 | ; |
|---|
| 104 | ; |
|---|
| 105 | PS_Start, filename=zefile+'.ps' |
|---|
| 106 | print, zefile+'.ps' |
|---|
| 107 | !P.Charsize = 1.2 |
|---|
| 108 | !p.charthick = 2.0 |
|---|
| 109 | !p.thick = 2.0 |
|---|
| 110 | !x.thick = 2.0 |
|---|
| 111 | !y.thick = 2.0 |
|---|
| 112 | ; |
|---|
| 113 | ; |
|---|
| 114 | ; |
|---|
| 115 | ;;what_I_plot = reform(invar(*,1,*,nt)) |
|---|
| 116 | ;what_I_plot = reform(invar(*,59,*,nt)) |
|---|
| 117 | what_I_plot = reform(invar(*,middle,*,nt)) |
|---|
| 118 | |
|---|
| 119 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
|---|
| 120 | file=path+experiment+'/input_sounding' & header='' & nlines_header=1 & ncol = 5 |
|---|
| 121 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
|---|
| 122 | nlines = FILE_LINES(file)-nlines_header & data=FLTARR(ncol,nlines) |
|---|
| 123 | OPENR, lun, file, /GET_LUN & READF, lun, header & READF, lun, data & CLOSE, lun & FREE_LUN, lun |
|---|
| 124 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
|---|
| 125 | mcd_column = reform(data(0,*)) |
|---|
| 126 | calc_tpot = reform(data(1,*)) |
|---|
| 127 | |
|---|
| 128 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
|---|
| 129 | file=path+experiment+'/input_therm' & ncol = 5 |
|---|
| 130 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
|---|
| 131 | nlines = FILE_LINES(file) & data=FLTARR(ncol,nlines) |
|---|
| 132 | OPENR, lun, file, /GET_LUN & READF, lun, data & CLOSE, lun & FREE_LUN, lun |
|---|
| 133 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
|---|
| 134 | pressure = reform(data(2,*)) |
|---|
| 135 | mcd_tpot = reform(data(4,*)) |
|---|
| 136 | |
|---|
| 137 | if (nx lt 999) then begin |
|---|
| 138 | what_I_plot = reform(what_I_plot(nx,*)) |
|---|
| 139 | endif else begin |
|---|
| 140 | what_I_plot = TOTAL(what_I_plot,1) / n_elements(reform(what_I_plot(*,0))) |
|---|
| 141 | endelse |
|---|
| 142 | |
|---|
| 143 | ;;;;;;;;;;; |
|---|
| 144 | ;;;;;;;;;;; |
|---|
| 145 | ;;;;;;;;;;; |
|---|
| 146 | column = vert/1000. |
|---|
| 147 | overplot_column = mcd_column/1000. |
|---|
| 148 | alt = [20.,150.] |
|---|
| 149 | alt = [40.,100.] |
|---|
| 150 | alt = [40.,80.] |
|---|
| 151 | alt = [0.,120.] |
|---|
| 152 | ;;;;;;;;;;; |
|---|
| 153 | ;;;;;;;;;;; |
|---|
| 154 | ;mention = '' |
|---|
| 155 | SPAWN, '\rm param_plot.idl' |
|---|
| 156 | minfield_init = 85. ;100. |
|---|
| 157 | maxfield_init = 185. ;250. |
|---|
| 158 | title_axis = ['Temperature (K)','Altitude (km)'] |
|---|
| 159 | overplot = mcd_tpot |
|---|
| 160 | ;;;;;;;;;;; |
|---|
| 161 | SPAWN, "echo 'intervaly=10.' >> param_plot.idl" |
|---|
| 162 | SPAWN, "echo 'intervalx=5.' >> param_plot.idl" |
|---|
| 163 | ;;;;;;;;;;; |
|---|
| 164 | |
|---|
| 165 | ;overplot = reform(mean_invar(nx,middle,*)) |
|---|
| 166 | ;overplot_column = column |
|---|
| 167 | |
|---|
| 168 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;; PLOT PRESSION mettre profile en log |
|---|
| 169 | ;column = reform(columnp(nx,middle,*,nt)) |
|---|
| 170 | ;overplot_column = pressure |
|---|
| 171 | ; ;;overplot = mean_invar |
|---|
| 172 | ; ;;overplot_column = mean_columnp |
|---|
| 173 | ;alt = [1.e2,1.e-3] |
|---|
| 174 | ;title_axis = ['Temperature (K)','Pressure (Pa)'] |
|---|
| 175 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; PLOT PRESSION |
|---|
| 176 | |
|---|
| 177 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
|---|
| 178 | ;; calculer la CAPE ? Tsat - Tenv / Tenv |
|---|
| 179 | |
|---|
| 180 | |
|---|
| 181 | ;what_I_plot = pressure |
|---|
| 182 | ; what_I_plot = calc_tpot |
|---|
| 183 | ;overplot = alog(overplot) / alog(10.) |
|---|
| 184 | ;overplot = overplot[where(overplot lt 35.)] ;; evite les valeurs impossibles |
|---|
| 185 | ;what_I_plot = alog(what_I_plot) / alog(10.) |
|---|
| 186 | ;minfield_init = -5. |
|---|
| 187 | ;maxfield_init = 3. |
|---|
| 188 | ; ;;tpot |
|---|
| 189 | ; minfield_init = 2. |
|---|
| 190 | ; maxfield_init = 4. |
|---|
| 191 | ;what_I_plot = 100. * abs(calc_tpot - overplot) / overplot |
|---|
| 192 | ;minfield_init = 0.000001 |
|---|
| 193 | ;maxfield_init = 100. |
|---|
| 194 | |
|---|
| 195 | profile, $ |
|---|
| 196 | what_I_plot, $ ; 1D vertical profile |
|---|
| 197 | column, $ ; altitudes |
|---|
| 198 | alt=alt, $ ; altitude range [altmin, altmax] |
|---|
| 199 | minfield=minfield_init, $ ; minimum value of plotted field (=0: calculate) |
|---|
| 200 | maxfield=maxfield_init, $ ; maximum value of plotted field (=0: calculate) |
|---|
| 201 | inprofile=overplot, $ ; another vertical profile to overplot |
|---|
| 202 | incolumn=overplot_column, $ ; altitudes of the other vertical profile (in case /= column) |
|---|
| 203 | ; discrete=discrete, $ ; show the profile points (= type of points in !psym) |
|---|
| 204 | ; title_plot=title_user, $ ; title of the plot ('Profile' is default) |
|---|
| 205 | title_axis=title_axis, $ ; title of the [x,y] axis (['Field','Altitude'] is default) |
|---|
| 206 | mention=mention ; add text precision within the plot window (default is nothing or '') |
|---|
| 207 | |
|---|
| 208 | ;;; sponge layer |
|---|
| 209 | ;w=where(FINITE(overplot) ne 0) |
|---|
| 210 | ;oplot, [minfield_init,maxfield_init], [max(overplot_column[w])-50.,max(overplot_column[w])-50.], linestyle=1 |
|---|
| 211 | |
|---|
| 212 | ;column = columnp |
|---|
| 213 | ;@tempcond.inc |
|---|
| 214 | ;yeye = reform(overplot(nx,1,*,nt)) |
|---|
| 215 | ;;w = where(yeye le 0.) & yeye[w] = !VALUES.F_NAN |
|---|
| 216 | ;;oplot, yeye, vert/1000., linestyle=1 |
|---|
| 217 | |
|---|
| 218 | @tempcond.inc |
|---|
| 219 | overplot = reform(overplot(nx,middle,*,nt)) |
|---|
| 220 | oplot, overplot, overplot_column, linestyle=1 |
|---|
| 221 | |
|---|
| 222 | ;calc_tk = calc_tpot * (pressure/610.)^(1/4.4) |
|---|
| 223 | ;oplot, calc_tk, column, linestyle=3 |
|---|
| 224 | |
|---|
| 225 | PS_End, /PNG |
|---|
| 226 | endfor |
|---|
| 227 | endfor |
|---|
| 228 | |
|---|
| 229 | perturb: |
|---|
| 230 | PS_Start, filename=experiment+'_'+charvar+'_perturb_'+string(nxs+100,'(I0)')+'.ps' |
|---|
| 231 | |
|---|
| 232 | what_I_plot_loop = reform(anomal_invar(nxs,middle,*,*)) |
|---|
| 233 | |
|---|
| 234 | what_I_plot = reform(what_I_plot_loop(*,nts)) |
|---|
| 235 | column = vert/1000. |
|---|
| 236 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
|---|
| 237 | alt = [0.,120.] |
|---|
| 238 | minfield_init = -30. |
|---|
| 239 | maxfield_init = 30. |
|---|
| 240 | title_axis = ['Temperature anomaly (K)','Altitude (km)'] |
|---|
| 241 | ;; peut pas changer |
|---|
| 242 | ;SPAWN, "echo 'intervaly=10.' >> param_plot.idl" |
|---|
| 243 | ;SPAWN, "echo 'intervalx=5.' >> param_plot.idl" |
|---|
| 244 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
|---|
| 245 | profile, $ |
|---|
| 246 | what_I_plot, $ ; 1D vertical profile |
|---|
| 247 | column, $ ; altitudes |
|---|
| 248 | alt=alt, $ ; altitude range [altmin, altmax] |
|---|
| 249 | minfield=minfield_init, $ ; minimum value of plotted field (=0: calculate) |
|---|
| 250 | maxfield=maxfield_init, $ ; maximum value of plotted field (=0: calculate) |
|---|
| 251 | inprofile=overplot, $ ; another vertical profile to overplot |
|---|
| 252 | incolumn=overplot_column, $ ; altitudes of the other vertical profile (in case /= column) |
|---|
| 253 | ; discrete=discrete, $ ; show the profile points (= type of points in !psym) |
|---|
| 254 | ; title_plot=title_user, $ ; title of the plot ('Profile' is default) |
|---|
| 255 | title_axis=title_axis, $ ; title of the [x,y] axis (['Field','Altitude'] is default) |
|---|
| 256 | mention=mention ; add text precision within the plot window (default is nothing or '') |
|---|
| 257 | |
|---|
| 258 | for iii=nts+1, nte do begin |
|---|
| 259 | overplot = reform(what_I_plot_loop(*,iii)) |
|---|
| 260 | overplot_column = column |
|---|
| 261 | oplot, overplot, overplot_column |
|---|
| 262 | endfor |
|---|
| 263 | |
|---|
| 264 | ;temppp = reform(mean_invar(nxs,middle,*)) |
|---|
| 265 | ;hache = 191.*temppp/3.72/1000. |
|---|
| 266 | ;ok = column / ( 2. * hache ) |
|---|
| 267 | ;print, exp(ok) |
|---|
| 268 | ;yeah = exp(ok) |
|---|
| 269 | ;oplot, yeah, column |
|---|
| 270 | |
|---|
| 271 | PS_End, /PNG |
|---|
| 272 | |
|---|
| 273 | end |
|---|