[85] | 1 | pro windmeso |
---|
| 2 | |
---|
| 3 | ;;Procedure de trace de valeurs issues du Mesoscale en temps-altitude |
---|
| 4 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
---|
| 5 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
---|
| 6 | |
---|
| 7 | ;;Choix des champs a tracer, 3 cas : |
---|
| 8 | ;;Un champ de deux variables, dont on trace le module, entrer [X,Y] |
---|
| 9 | ;;Une variable X seule, dont on trace la valeur entrer [X,X] |
---|
| 10 | ;;tk, entrer [T,PTOT] |
---|
| 11 | |
---|
| 12 | ;champ1='U' & champ2='V' & champlat = 'XLAT' & champlon = 'XLONG' & champhgt = 'HGT' & file='/home/aymeric/Science/INTERCOMP/LMD_MMM/LMD_MMM_d04_2024-05-57_06:00:00' & nomfich='nest4_MSL' & charphtot = 'PHTOT' |
---|
| 13 | |
---|
| 14 | champ1='u_avg' & champ2='v_avg' & champlat = 'glat' & champlon = 'glon' & champhgt = 'topo' & file='/home/aymeric/Science/INTERCOMP/MRAMS/MRAMS_d04_2024-05-57_06:00:00' & nomfich='nest4_MSL_mrams' & charphtot = 'z_lyrmid_agl' |
---|
| 15 | |
---|
| 16 | ;nomfich=nomfich+'proch' |
---|
| 17 | |
---|
| 18 | ;champ1='T' & champ2='PTOT' & champlat = 'XLAT' & champlon = 'XLONG' & champhgt = 'HGT' & file='/home/aymeric/Science/INTERCOMP/LMD_MMM/LMD_MMM_d04_2024-05-57_06:00:00' & nomfich='nest4_MSLtemp' & charphtot = 'PHTOT' |
---|
| 19 | |
---|
| 20 | ;champ1='tempk' & champ2='tempk' & champlat = 'glat' & champlon = 'glon' & champhgt = 'topo' & file='/home/aymeric/Science/INTERCOMP/MRAMS/MRAMS_d04_2024-05-57_06:00:00' & nomfich='nest4_MSL_mramstemp' & charphtot = 'z_lyrmid_agl' |
---|
| 21 | |
---|
| 22 | |
---|
| 23 | ;;Decommenter pour un fichier d'API |
---|
| 24 | ;api='on' ;;a tester, voir REF si ca ne marche pas |
---|
| 25 | |
---|
| 26 | ;;Choix du fichier de simulation |
---|
| 27 | ;file='/d6/vblmd/MERIDIANI_EXOMARS/saves_simu_LS_68.5/jour20/wrfout_d01_2024-03-20_06:00:00' |
---|
| 28 | ;file='/d6/vblmd/MERIDIANI_EXOMARS/saves_simu_LS_244_tau2/wrfout_d01_2024-09-08_00:00:00' |
---|
| 29 | ;file='/d6/vblmd/MERIDIANI_EXOMARS/saves_simu_LS_244_tau05/wrfout_d01_2024-09-08_00:00:00' |
---|
| 30 | ;file='/d6/vblmd/MERIDIANI_EXOMARS/saves_simu_LS_244_tau5/wrfout_d01_2024-09-08_00:00:00' |
---|
| 31 | ;file='/d6/vblmd/MERIDIANI_EXOMARS/saves_simu_LS_244_tau1/wrfout_d01_2024-09-08_00:00:00' |
---|
| 32 | ;file='/tmp7/aslmd/wrfout_d01_2024-09-10_06:00:00' |
---|
| 33 | ;file='/tmp7/aslmd/MERIDIANI_FLUSH/wrfout_d01_2024-09-07_06:00:00' |
---|
| 34 | ;file='/tmp7/aslmd/MERIDIANI_FLUSH/wrfout_d01_2024-09-13_06:00:00' |
---|
| 35 | ;file='/tmp7/aslmd/MERIDIANI_FLUSH2/wrfout_d01_2024-09-07_06:00:00' |
---|
| 36 | ;file='/tmp7/aslmd/MERIDIANI_FLUSH2/wrfout_d01_2024-09-13_06:00:00' |
---|
| 37 | ;file='/tmp7/aslmd/MERIDIANI_BOMB/wrfout_d01_2024-09-07_06:00:00' |
---|
| 38 | ;file='/home/aymeric/Science/INTERCOMP/LMD_MMM/LMD_MMM_d04_2024-05-57_06:00:00' |
---|
| 39 | |
---|
| 40 | ;;Nom du fichier de sortie |
---|
| 41 | ;nomfich='flush' |
---|
| 42 | ;nomfich='nest4_MSL' |
---|
| 43 | ;nomfich='flush_late' |
---|
| 44 | ;nomfich='flush2' |
---|
| 45 | ;nomfich='flush2_late' |
---|
| 46 | ;nomfich='bomb' |
---|
| 47 | nomfich= nomfich+'_vert' |
---|
| 48 | ;nomfich='LS244_tau1_vent_bas' |
---|
| 49 | ;nomfich='test' |
---|
| 50 | |
---|
| 51 | ;; Choix des options : |
---|
| 52 | ;;Heure de depart du trace sur les abscisses (ne fait que decaler le trace : le mettre a l'heure de debut de la simu) |
---|
| 53 | start_time=0. ;6. ;0. |
---|
| 54 | ;;Intervalle horaire (ne fait qu'elargir le trace, en placant une heure de simu tous les interv) |
---|
| 55 | interv=1. |
---|
| 56 | |
---|
| 57 | ;;Gestion des sites |
---|
| 58 | n = 1 ;;nombre de sites |
---|
| 59 | sites = make_array(n,/STRING) |
---|
| 60 | coord = make_array(2,n,/FLOAT) |
---|
| 61 | sites[0] ='landing_site' |
---|
| 62 | ;sites[0] = 'landing_site' |
---|
| 63 | ;sites[1] = 'crater' |
---|
| 64 | ;sites[2] = 'crater_rim' |
---|
| 65 | ;sites[3] = 'high_area' |
---|
| 66 | ;sites[4] = 'low_area' |
---|
| 67 | ;sites[5] = 'plain' |
---|
| 68 | ;sites[] = '' |
---|
| 69 | ;; si on ne veut pas de nom avec les coordonnes rajouter une case avec rien dedans |
---|
| 70 | coord[0,0] =325.149-360. & coord[1,0] =-26.372 |
---|
| 71 | ;coord[0,0] =353.87-360. & coord[1,0] =-1.88 |
---|
| 72 | ;coord[0,1] =-9.93 & coord[1,1] =5.45 |
---|
| 73 | ;coord[0,2] =-9.78 & coord[1,2] =6.63 |
---|
| 74 | ;coord[0,3] =5.77 & coord[1,3] =-6.84 |
---|
| 75 | ;coord[0,4] =-11.78 & coord[1,4] =7.80 |
---|
| 76 | ;coord[0,5] =-2.67 & coord[1,5] =-1.8 |
---|
| 77 | ;coord[0,] =-2.67 & coord[1,] =-1.8 |
---|
| 78 | |
---|
| 79 | ;;sites de reference: |
---|
| 80 | ;'landing_site' coord[0,] =353.87-360. & coord[1,] =-1.88 |
---|
| 81 | ;'crater' coord[0,] =-9.93 & coord[1,] =5.45 |
---|
| 82 | ;'crater_rim' coord[0,] =-9.78 & coord[1,] =6.63 |
---|
| 83 | ;'high_area' coord[0,] =5.77 & coord[1,] =-6.84 |
---|
| 84 | ;'low_area' coord[0,] =-11.78 & coord[1,] =7.80 |
---|
| 85 | ;'plain' coord[0,] =-2.67 & coord[1,] =-1.8 |
---|
| 86 | ;'crater_slope' coord[0,] =-9.59 & coord[1,] =5.96 |
---|
| 87 | ;'crater_LS' coord[0,] =-3.68 & coord[1,] =-3.65 |
---|
| 88 | ;'crater_LS_rim' coord[0,] =-4.70 & coord[1,] =-3.65 |
---|
| 89 | ;'holden' coord[0,] =-34.851 & coord[1,] =-26.372 |
---|
| 90 | |
---|
| 91 | |
---|
| 92 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
---|
| 93 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
---|
| 94 | |
---|
| 95 | ;;Pour regler les parametres de trace dans autre chose que param_plot qui risaue de mal finir un jour |
---|
| 96 | SPAWN, '\rm param_plot.idl ; cp -f windautom.idl param_plot.idl' |
---|
| 97 | |
---|
| 98 | |
---|
| 99 | ;;Recuperation de la latitude, longitude, topographie et pression (pour le calcul de la heuteur) |
---|
| 100 | |
---|
| 101 | getcdf, file=file, charvar=champlat, invar=lat |
---|
| 102 | getcdf, file=file, charvar=champlon, invar=lon |
---|
| 103 | getcdf, file=file, charvar=champhgt, invar=elevation |
---|
| 104 | |
---|
| 105 | |
---|
| 106 | ;;Recuperation des variables |
---|
| 107 | if champ1 eq champ2 then begin |
---|
| 108 | getcdf, file=file, charvar=champ1, invar=c |
---|
| 109 | endif else begin |
---|
| 110 | getcdf, file=file, charvar=champ1, invar=c1 |
---|
| 111 | getcdf, file=file, charvar=champ2, invar=c2 |
---|
| 112 | endelse |
---|
| 113 | |
---|
| 114 | |
---|
| 115 | for i = 0,n-1 do begin |
---|
| 116 | |
---|
| 117 | ;;Site du trace |
---|
| 118 | name_site = sites[i] |
---|
| 119 | landing_site=[ coord[0,i] , coord[1,i] ] |
---|
| 120 | |
---|
| 121 | ;;Recuperation de [i,j] a partir de [lon,lat] |
---|
| 122 | findxy, $ |
---|
| 123 | x=lon, $ |
---|
| 124 | y=lat, $ |
---|
| 125 | point=landing_site, $ |
---|
| 126 | ind=indp, $ |
---|
| 127 | flag=2 |
---|
| 128 | |
---|
| 129 | |
---|
| 130 | if (n_elements(api) eq 0) then begin |
---|
| 131 | print,'----------- Standard output' |
---|
| 132 | |
---|
| 133 | ;;Recuperation de la hauteur |
---|
| 134 | getcdf, file=file, charvar=charphtot, invar=ph |
---|
| 135 | height=reform(ph(indp[0],indp[1],*,*)) |
---|
| 136 | ;;on se debarasse de la position |
---|
| 137 | height=total(height,2)/n_elements(height(0,*)) |
---|
| 138 | ;;on somme sur le temps et on moyenne: on obtient un tableau de valeurs d'altitudes moyennes |
---|
| 139 | if (charphtot eq 'z_lyrmid_agl') then begin |
---|
| 140 | heightp=height/1000. |
---|
| 141 | print, heightp |
---|
| 142 | endif else begin |
---|
| 143 | height=height/1000./3.72 |
---|
| 144 | heightp=height(0:n_elements(height(*))-2)-elevation(indp[0],indp[1])/1000. |
---|
| 145 | ;;on soustrait la topographie et on obtient une colonne des hauteurs finales |
---|
| 146 | print, heightp |
---|
| 147 | endelse |
---|
| 148 | ;if (champ1 eq 'W') then heightp=height(0:n_elements(height(*))-1)-elevation(indp[0],indp[1])/1000. |
---|
| 149 | |
---|
| 150 | |
---|
| 151 | ;;Utiliser la boucle ci dessous pour imprimer les hauteurs à entrer dans la création d'un API |
---|
| 152 | ;print='on' |
---|
| 153 | if (n_elements(print) ne 0) then begin |
---|
| 154 | for i=0,n_elements(heightp)-1 do begin |
---|
| 155 | print, STRTRIM(heightp(i),2)+',' |
---|
| 156 | endfor |
---|
| 157 | endif |
---|
| 158 | |
---|
| 159 | endif else begin |
---|
| 160 | print,'----------- API output' |
---|
| 161 | |
---|
| 162 | ;;créer avec API un fichier contenant Um, Vm (ou autres) et vert, dans namelist.api mettre les interp_levels voulus (par ex avec la boucle print ci dessus) |
---|
| 163 | getcdf, file=file, charvar='vert', invar=height |
---|
| 164 | heightp=height/1000. |
---|
| 165 | endelse |
---|
| 166 | |
---|
| 167 | |
---|
| 168 | ;;Creation du champ a tracer |
---|
| 169 | |
---|
| 170 | if champ1 eq champ2 then begin |
---|
| 171 | print,'Vous tracez les valeurs de '+champ1 |
---|
| 172 | champi = reform(c(indp[0],indp[1],*,*)) |
---|
| 173 | what_I_plot = champi |
---|
| 174 | |
---|
| 175 | if (champ1 eq 'W') then what_I_plot = what_I_plot[0:n_elements(what_I_plot(*,0))-2,*] |
---|
| 176 | |
---|
| 177 | endif else begin |
---|
| 178 | |
---|
| 179 | if (champ1 eq 'T') and (champ2 eq 'PTOT') then begin |
---|
| 180 | print,'Vous tracez la temperature normale' |
---|
| 181 | T = reform( c1(indp[0],indp[1],*,*) ) |
---|
| 182 | PTOT = reform( c2(indp[0],indp[1],*,*) ) |
---|
| 183 | what_I_plot =(T+220.)*(PTOT/610.)^(192./844.) |
---|
| 184 | |
---|
| 185 | endif else begin |
---|
| 186 | print,'Vous tracez le module de '+champ1+' et '+champ2 |
---|
| 187 | champi1 = reform(c1(indp[0],indp[1],*,*)) |
---|
| 188 | champi2 = reform(c2(indp[0],indp[1],*,*)) |
---|
| 189 | what_I_plot = sqrt(champi1^2 + champi2^2) |
---|
| 190 | |
---|
| 191 | endelse |
---|
| 192 | endelse |
---|
| 193 | |
---|
| 194 | |
---|
| 195 | ;print, 'mean(what_I_plot) ', mean(what_I_plot) |
---|
| 196 | ;print, what_I_plot |
---|
| 197 | |
---|
| 198 | ;;Gestion du temps |
---|
| 199 | ;;definition des abscisses : il va tracer toutes les valeurs du fichier de simu, mais en les decalant a start time |
---|
| 200 | localtime = float(start_time) + float(interv)*findgen(n_elements(what_I_plot(0,*))) |
---|
| 201 | |
---|
| 202 | ;;Nom du fichier de sortie |
---|
| 203 | |
---|
| 204 | PS_Start,filename=nomfich+'_'+name_site+'_lon'+string(coord[0,i],'(I0)')+'_lat'+string(coord[1,i],'(I0)')+'.ps' |
---|
| 205 | !P.Charsize = 1.2 |
---|
| 206 | |
---|
| 207 | help, transpose(what_I_plot), localtime, heightp |
---|
| 208 | |
---|
| 209 | map_latlon, $ |
---|
| 210 | transpose(what_I_plot), $ ; 2D field |
---|
| 211 | localtime, $ ; 1D latitude |
---|
| 212 | heightp, $ ; 1D longitude |
---|
| 213 | overcontour=0 |
---|
| 214 | |
---|
| 215 | |
---|
| 216 | ;;Conversion en .png |
---|
| 217 | PS_End, /PNG |
---|
| 218 | |
---|
| 219 | endfor |
---|
| 220 | |
---|
| 221 | |
---|
| 222 | end |
---|
| 223 | |
---|
| 224 | |
---|
| 225 | |
---|
| 226 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
---|
| 227 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
---|
| 228 | ;yeah=where(localtime lt 0) & if (yeah(0) ne -1) then localtime[yeah]=24+localtime[yeah] |
---|
| 229 | ;;; 24h issue |
---|
| 230 | ;localtime=localtime MOD 24 & yeah=where(localtime eq 0) & if (yeah(0) ne -1) then localtime[yeah]=24 |
---|
| 231 | ;localtime=24.+localtime |
---|
| 232 | |
---|
| 233 | ;!p.charthick = 2.0 |
---|
| 234 | ;!p.thick = 3.0 |
---|
| 235 | ;!x.thick = 1.0 |
---|
| 236 | ;!y.thick = 2.0 |
---|
| 237 | |
---|
| 238 | ;overcontour=transpose(what_I_plot) ; another 2D field to overplot with contour lines (=0: no) |
---|
| 239 | |
---|
| 240 | ;;ATTENTION : a ne JAMAIS, JAMAIS, JAMAIS faire |
---|
| 241 | ;field=sqrt(c1^2+c2^2) & c1=0. & c2=0. |
---|
| 242 | ;what_I_plot=reform(field(indp[0],indp[1],*,*)) |
---|
| 243 | ;what_I_plot = field |
---|