|
27 | 27 | "- [dewtemp_trh](https://www.ncl.ucar.edu/Document/Functions/Built-in/dewtemp_trh.shtml)\n",
|
28 | 28 | "- [daylight_fao56](https://www.ncl.ucar.edu/Document/Functions/Crop/daylight_fao56.shtml)\n",
|
29 | 29 | "- [satvpr_temp_fao56](https://www.ncl.ucar.edu/Document/Functions/Crop/satvpr_temp_fao56.shtml)\n",
|
30 |
| - "- [satvpr_tdew_fao56](https://www.ncl.ucar.edu/Document/Functions/Crop/satvpr_tdew_fao56.shtml)" |
| 30 | + "- [satvpr_tdew_fao56](https://www.ncl.ucar.edu/Document/Functions/Crop/satvpr_tdew_fao56.shtml)\n", |
| 31 | + "- [satvpr_slope_fao56](https://www.ncl.ucar.edu/Document/Functions/Crop/satvpr_slope_fao56.shtml)" |
31 | 32 | ]
|
32 | 33 | },
|
33 | 34 | {
|
|
284 | 285 | " geocat_satvpr_tdew_fao56[temp] = actual_saturation_vapor_pressure(temp)"
|
285 | 286 | ]
|
286 | 287 | },
|
| 288 | + { |
| 289 | + "cell_type": "markdown", |
| 290 | + "id": "a933c4b2-3b1c-46ac-b1a0-47643e302c02", |
| 291 | + "metadata": {}, |
| 292 | + "source": [ |
| 293 | + "### satvpr_slope_fao56" |
| 294 | + ] |
| 295 | + }, |
| 296 | + { |
| 297 | + "cell_type": "code", |
| 298 | + "execution_count": null, |
| 299 | + "id": "fc1aa525-542a-4be3-8ed3-7eb998280890", |
| 300 | + "metadata": {}, |
| 301 | + "outputs": [], |
| 302 | + "source": [ |
| 303 | + "#### Collect NCL values for satvpr_slope_fao56 from geocat-datafiles\n", |
| 304 | + "import geocat.datafiles as gdf\n", |
| 305 | + "import numpy as np\n", |
| 306 | + "\n", |
| 307 | + "satvpr_slope_fao56_data = gdf.get(\n", |
| 308 | + " 'applications_files/ncl_outputs/satvpr_slope_fao56_output.txt'\n", |
| 309 | + ")\n", |
| 310 | + "satvpr_slope_fao56_data = np.loadtxt(satvpr_slope_fao56_data, delimiter=',', skiprows=6)" |
| 311 | + ] |
| 312 | + }, |
| 313 | + { |
| 314 | + "cell_type": "code", |
| 315 | + "execution_count": null, |
| 316 | + "id": "33edf359-c26d-4eff-b845-d4df8d91f0ae", |
| 317 | + "metadata": {}, |
| 318 | + "outputs": [], |
| 319 | + "source": [ |
| 320 | + "### Collect NCL `satvpr_slope_fao56` value and associated (temp, slope_satvpr) values\n", |
| 321 | + "ncl_satvpr_slope_fao56 = dict(\n", |
| 322 | + " zip(satvpr_slope_fao56_data[::, 0], satvpr_slope_fao56_data[::, 1])\n", |
| 323 | + ")" |
| 324 | + ] |
| 325 | + }, |
| 326 | + { |
| 327 | + "cell_type": "code", |
| 328 | + "execution_count": null, |
| 329 | + "id": "da65e261-19f5-4a1c-973d-1e7e13053621", |
| 330 | + "metadata": {}, |
| 331 | + "outputs": [], |
| 332 | + "source": [ |
| 333 | + "### Calculate GeoCAT-Comp `saturation_vapor_pressure_slope`\n", |
| 334 | + "from geocat.comp import saturation_vapor_pressure_slope\n", |
| 335 | + "\n", |
| 336 | + "geocat_satvpr_slope_fao56 = {}\n", |
| 337 | + "\n", |
| 338 | + "for temp in range(33, 212 + 1):\n", |
| 339 | + " geocat_satvpr_slope_fao56[temp] = saturation_vapor_pressure_slope(temp)" |
| 340 | + ] |
| 341 | + }, |
287 | 342 | {
|
288 | 343 | "cell_type": "markdown",
|
289 | 344 | "id": "3237a0bffc6827fc",
|
|
391 | 446 | " ncl_satvpr_tdew_fao56[key], geocat_satvpr_tdew_fao56[key], rel_tol=1e-05\n",
|
392 | 447 | " ) # within 5 decimal points"
|
393 | 448 | ]
|
| 449 | + }, |
| 450 | + { |
| 451 | + "cell_type": "markdown", |
| 452 | + "id": "a8b4bee3-7f78-42ba-a9ae-2d13e4b3db59", |
| 453 | + "metadata": {}, |
| 454 | + "source": [ |
| 455 | + "### satvpr_slope_fao56" |
| 456 | + ] |
| 457 | + }, |
| 458 | + { |
| 459 | + "cell_type": "code", |
| 460 | + "execution_count": null, |
| 461 | + "id": "35bbca06-937e-4459-89ab-6c82280790c7", |
| 462 | + "metadata": {}, |
| 463 | + "outputs": [], |
| 464 | + "source": [ |
| 465 | + "import math\n", |
| 466 | + "\n", |
| 467 | + "for key in ncl_satvpr_slope_fao56.keys():\n", |
| 468 | + " assert math.isclose(\n", |
| 469 | + " ncl_satvpr_slope_fao56[key], geocat_satvpr_slope_fao56[key], rel_tol=1e-05\n", |
| 470 | + " ) # within 5 decimal points" |
| 471 | + ] |
394 | 472 | }
|
395 | 473 | ],
|
396 | 474 | "metadata": {
|
|
0 commit comments