1 | % ----------------------------------------------- |
---|
2 | % custom_build.m |
---|
3 | % Script to be used with Matlab or GNU-Octave |
---|
4 | % ----------------------------------------------- |
---|
5 | % Purpose: |
---|
6 | % Custom topography in a peculiar region >> WRF geogrid tiles |
---|
7 | % Author: |
---|
8 | % A. Spiga - 03/2007 |
---|
9 | % ----------------------------------------------- |
---|
10 | |
---|
11 | load 'TylerData_8ppd.mat'; |
---|
12 | tilex=1440 |
---|
13 | tiley=2880 |
---|
14 | el = alb(1:1:tilex,1:1:tiley)'; |
---|
15 | |
---|
16 | % Scale factor (ie accuracy): 10000 |
---|
17 | el = 10000.*el; |
---|
18 | % Conversion float >> integer |
---|
19 | el = round(el); |
---|
20 | |
---|
21 | disp("coordinates") |
---|
22 | disp(lon(1,1:200:tiley)) |
---|
23 | disp(lat(1:200:tilex,1)') |
---|
24 | disp(lon(1,2)-lon(1,1)) |
---|
25 | disp(lat(2,1)-lat(1,1)) |
---|
26 | |
---|
27 | |
---|
28 | yeah = el(2000,1:10:tilex); |
---|
29 | plot(yeah) |
---|
30 | |
---|
31 | %% Create WRF data tiles (with 0. filling, to achieve a square tile) |
---|
32 | %tilex=641; |
---|
33 | %tiley=385; |
---|
34 | |
---|
35 | tilexx=2880 |
---|
36 | tileyy=1440 |
---|
37 | |
---|
38 | part = zeros(tilexx,tileyy); |
---|
39 | part(1:tilexx,1:tileyy) = el; |
---|
40 | fid = fopen('albedo/00001-02880.00001-01440','wb','b'); |
---|
41 | fwrite(fid,part,'integer*2'); |
---|
42 | |
---|
43 | plot(part(2000,1:tileyy)) |
---|
44 | |
---|
45 | plot(part(1000,1:tileyy)) |
---|
46 | |
---|
47 | |
---|
48 | %% now thermal inertia |
---|
49 | el = ti(1:1:tilex,1:1:tiley)'; |
---|
50 | part = zeros(tilexx,tileyy); |
---|
51 | part(1:tilexx,1:tileyy) = el; |
---|
52 | fid = fopen('ti/00001-02880.00001-01440','wb','b'); |
---|
53 | fwrite(fid,part,'integer*2'); |
---|
54 | |
---|