Skip to content

Commit

Permalink
Added level definitions from ml2pl operator...
Browse files Browse the repository at this point in the history
  • Loading branch information
janhclem authored Feb 1, 2024
1 parent b25a46a commit 2b40b75
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions src/libtrac.c
Original file line number Diff line number Diff line change
Expand Up @@ -1543,6 +1543,7 @@ double lapse_rate(

void level_definitions(
ctl_t * ctl) {


if (0 == ctl->press_level_def) {

Expand Down Expand Up @@ -1691,6 +1692,55 @@ void level_definitions(
for (int ip = 0; ip < ctl->met_np; ip++)
ctl->met_p[ctl->met_np - ip - 1] = press[ip];

} else if (6 == ctl->press_level_def) {

ctl->met_np = 137;

const double press[137] = {
0.01, 0.02,0.031,0.0467,0.0683,0.0975,0.1361,0.1861,
0.2499,0.3299,0.4288,0.5496,0.6952,0.869,1.0742,
1.3143,1.5928,1.9134,2.2797,2.6954,3.1642,3.6898,
4.2759,4.9262,5.6441,6.4334,7.2974,8.2397,9.2634,
10.372,11.5685,12.8561,14.2377,15.7162,17.2945,18.9752,
20.761,22.6543,24.6577,26.7735,29.0039,31.3512,33.8174,
36.4047,39.1149,41.9493,44.9082,47.9915,51.199,54.5299,
57.9834,61.5607,65.2695,69.1187,73.1187,77.281,81.6182,
86.145,90.8774,95.828,101.005,106.415,112.068,117.971,
124.134,130.564,137.27,144.262,151.549,159.14,167.045,
175.273,183.834,192.739,201.997,211.619,221.615,231.995,
242.772,253.955,265.556,277.585,290.055,302.976,316.361,
330.22,344.566,359.411,374.767,390.645,407.058,424.019,
441.539,459.632,478.31,497.584,517.42,537.72,558.343,
579.193,600.167,621.162,642.076,662.808,683.262,703.347,
722.979,742.086,760.6,778.466,795.64,812.085,827.776,
842.696,856.838,870.2,882.791,894.622,905.712,916.081,
925.757,934.767,943.14,950.908,958.104,965.299,972.495,
979.69,986.886,994.081,1001.28,1008.47,1015.67,1022.86,
1030.06,1037.25,1044.45
};

for (int ip = 0; ip < ctl->met_np; ip++)
ctl->met_p[ctl->met_np - ip - 1] = press[ip];

} else if (7 == ctl->press_level_def) {

ctl->met_np = 59;

const double press[59] = {
0.1, 0.2, 0.3843, 0.6365, 0.9564, 1.3448, 1.8058, 2.3478,
2.985, 3.7397, 4.6462, 5.7565, 7.1322, 8.8366, 10.9483,
13.5647, 16.8064, 20.8227, 25.7989, 31.9642, 39.6029, 49.0671,
60.1802, 73.0663, 87.7274, 104.229, 122.614, 142.902, 165.089,
189.147, 215.025, 242.652, 272.059, 303.217, 336.044, 370.407,
406.133, 443.009, 480.791, 519.209, 557.973, 596.777, 635.306,
673.24, 710.263, 746.063, 780.346, 812.83, 843.263, 871.42,
897.112, 920.189, 940.551, 958.148, 975.744, 993.341, 1010.94,
1028.53, 1046.13
};

for (int ip = 0; ip < ctl->met_np; ip++)
ctl->met_p[ctl->met_np - ip - 1] = press[IP];

} else {
ERRMSG
("Definition does not exist, use 0 for l137, 1 for l91 or 2 for l60.")
Expand Down

0 comments on commit 2b40b75

Please sign in to comment.