| 1 | ; |
|---|
| 2 | ; horizontal coordinates (meters) |
|---|
| 3 | ; |
|---|
| 4 | rad=3397000. |
|---|
| 5 | deg_m=2*rad*!pi/360. |
|---|
| 6 | dlon=deg_m*cos(lat*!pi/180) |
|---|
| 7 | dlat=deg_m |
|---|
| 8 | x=(lon-min(lon))*dlon |
|---|
| 9 | y=(lat-min(lat))*dlat |
|---|
| 10 | ;print, x/1000. |
|---|
| 11 | ;print, y/1000. |
|---|
| 12 | |
|---|
| 13 | ;;---------------------------- |
|---|
| 14 | ;; methode directe |
|---|
| 15 | ;;---------------------------- |
|---|
| 16 | ;; var is a 2D field |
|---|
| 17 | ;; must be HGT_M |
|---|
| 18 | grad, hx, var*1000., x, y, 1 |
|---|
| 19 | grad, hy, var*1000., x, y, 2 |
|---|
| 20 | ;hx=hx*100. ;pente en % |
|---|
| 21 | |
|---|
| 22 | ;;------------------------------- |
|---|
| 23 | ;; methode "confiance en geogrid" |
|---|
| 24 | ;;------------------------------- |
|---|
| 25 | ;varid=ncdf_varid(cdfid,'MAPFAC_M') |
|---|
| 26 | ; ncdf_varget, cdfid, varid, msf |
|---|
| 27 | |
|---|
| 28 | |
|---|
| 29 | varid=ncdf_varid(cdfid,'SLPX') |
|---|
| 30 | ncdf_varget, cdfid, varid, hxwrf |
|---|
| 31 | varid=ncdf_varid(cdfid,'SLPY') |
|---|
| 32 | ncdf_varget, cdfid, varid, hywrf |
|---|
| 33 | |
|---|
| 34 | ;print, 100.*mean(abs(hx-hxwrf*1000.)/hx) |
|---|
| 35 | ;print, 100.*mean(abs(hy-hywrf*1000.)/hy) |
|---|
| 36 | |
|---|
| 37 | hx=hxwrf*1000. |
|---|
| 38 | hy=hywrf*1000. |
|---|
| 39 | |
|---|
| 40 | |
|---|
| 41 | |
|---|
| 42 | ;; SLOPE ANGLE vs HORIZONTAL |
|---|
| 43 | ;;--------------------------- |
|---|
| 44 | theta=atan(sqrt(hx^2+hy^2)) |
|---|
| 45 | theta=180.*theta/!pi |
|---|
| 46 | var=round(theta) |
|---|
| 47 | title='Slope angle (deg)' |
|---|
| 48 | format='(I0)' |
|---|
| 49 | pal=16 |
|---|
| 50 | |
|---|
| 51 | ;goto, squeeze |
|---|
| 52 | ;; SLOPE ORIENTATION |
|---|
| 53 | ;;-------------------- |
|---|
| 54 | ;; cas où hx < 0 |
|---|
| 55 | psi=-!pi/2 - atan(hy/hx) |
|---|
| 56 | ;; cas où hx > 0 |
|---|
| 57 | w=where(hx ge 0) |
|---|
| 58 | psi[w]=psi[w]-!pi |
|---|
| 59 | ;; SOUTH 0 & WEST 90 |
|---|
| 60 | psi=2*!pi+psi |
|---|
| 61 | psi=180.*psi/!pi |
|---|
| 62 | ;; NORTH 0 & EAST 90 (as MONTECARLO & PARAM) |
|---|
| 63 | psi=(180.+psi) MOD 360 |
|---|
| 64 | |
|---|
| 65 | var=round(psi) |
|---|
| 66 | title='Slope orientation (deg)' |
|---|
| 67 | format='(I0)' |
|---|
| 68 | pal=6 |
|---|
| 69 | ;; |
|---|
| 70 | squeeze: |
|---|
| 71 | |
|---|
| 72 | |
|---|
| 73 | ; |
|---|
| 74 | ; latitude |
|---|
| 75 | ; |
|---|
| 76 | varid=ncdf_varid(cdfid,'XLAT_M') |
|---|
| 77 | ncdf_varget, cdfid, varid, latyeah |
|---|
| 78 | |
|---|
| 79 | |
|---|
| 80 | ; |
|---|
| 81 | ; SCATTERED FLUX RATIO |
|---|
| 82 | ; |
|---|
| 83 | |
|---|
| 84 | nx=n_elements(latyeah(*,0)) |
|---|
| 85 | ny=n_elements(latyeah(0,*)) |
|---|
| 86 | |
|---|
| 87 | ratio_s=dblarr(nx,ny) |
|---|
| 88 | ratio_d=dblarr(nx,ny) |
|---|
| 89 | |
|---|
| 90 | count=0 |
|---|
| 91 | |
|---|
| 92 | for i=0,nx-1 do begin |
|---|
| 93 | for j=0,ny-1 do begin |
|---|
| 94 | |
|---|
| 95 | param_slope, $ |
|---|
| 96 | ls=set_ls, $ ; < input * |
|---|
| 97 | lct=set_lct, $ ; < input * |
|---|
| 98 | lat=latyeah(i,j), $ ; < input * |
|---|
| 99 | tau=set_tau, $ ; < input * |
|---|
| 100 | spz=theta(i,j), $ ; < input * |
|---|
| 101 | spa=psi(i,j), $ ; < input * |
|---|
| 102 | r_s=tmps, $ ; > output |
|---|
| 103 | r_d=tmpd ; > output |
|---|
| 104 | |
|---|
| 105 | ;count=count+1 |
|---|
| 106 | ;print, count, tmps, tmpd |
|---|
| 107 | |
|---|
| 108 | ratio_s(i,j)=tmps |
|---|
| 109 | ratio_d(i,j)=tmpd |
|---|
| 110 | |
|---|
| 111 | endfor |
|---|
| 112 | endfor |
|---|
| 113 | |
|---|
| 114 | pal=0 |
|---|
| 115 | format='(I0)' |
|---|
| 116 | var=ratio_s*100. & title='Ratio S/S0 (%)' |
|---|
| 117 | |
|---|
| 118 | ;var=ratio_d*100. & title='Ratio Fdir/Fdir0 (%)' |
|---|
| 119 | |
|---|
| 120 | title='Ls='+string(set_ls,'(I0)')+' LT='+string(set_lct,'(I0)')+' tau='+string(set_tau,'(F3.1)') |
|---|
| 121 | minfield_init=30. |
|---|
| 122 | maxfield_init=170. |
|---|
| 123 | |
|---|
| 124 | var=round(var) |
|---|