AML that allows to downscale monthly PRISM or DAYMET climate maps (1-4.5km grid size) to a finer resolution DEM of choice. The routine calls a Fortran program. This program performs a least-square regression between climate and elevation in a moving window. The output of the regression results (lapse rate and intercept) are stored in an ASCII-Grid format. The logic behind this procedure is that originally, regression techniques were used as well to generate the coarse-scale climate grids. Using regressions in a moving window aims at detecting the "hidden" regression paramters. Once these parameters are detected, they can be spatially interpolated to finer scales - to the scale of the high resolution DEM. Finally, the climate map is generated using the finer scale DEM and the interpolated regression parameters. The latter should now be in the same projection and should have the same dimensions and size as the high-resolution DEM. This usually requires an additional re-projection step prior to interpolating the lattice containing the regression results.
The mowinreg.aml performs all these tasks calling a Fortran program (mowinreg). You do not need to understand this program in detail, since the AML passes the necessary variables itself. However, you have to download the code and copy it into the directory where you run start the AML (NOTE: Do not copy this code into the ATOOL directory, rather in the directory where you call the AML).
Usage: &r mowinreg <climvar>
where: <climvar> is the name of the climate variable to downscale excluding a suffix for the labelling the months. Attention: The code assumes that the suffix for climate variables has the following form: tave_01, tave_02, ..., tave12. So here, as climvar we would pass "tave_" as <climvar>!
Below is a graph that illustrates the procedure coded in <mowinreg.aml> and its associated Fortran program. Click on the thumbnail to view a larger version of the graph.
![]() |
The code is more complicated than it could be. This has historical reason (development
of the procedure) and it reflects the limited time I have available to improve the code. Use
it as is, or improve it yourself... I welcome any updates to make this stuff easier to use....
There are some theoretical limitations in performing this regression based doenscaling in moving windows. This is especially true for PRISM maps, to a much lesser degree for DAYMET maps. PRISM maps are generated using the FACET approach, where a coarse-scale DEM is classified into topographic facets (E- and W-slopes, plaines). The rationale behind is to calculate regressions only of stations that are situated within the same facet, and then to apply the regression to the same facet, simulating the effect of elevation of climate therein. When attempting to detect the "hidden" regression paramters, it is obviously not a "correct" solution to search for this in a regular-shaped window. Rather we should know the structure of the FACETs, which we don't. DAYMET does not use this approach. Rather it uses distance-weighted regression within circular windows. It is thus much better suited as source for downscaling.
Another theoretical limitations arises when the coarse-scale climate maps are based on regressing climate variables on adjusted elevation data. Especially in PRISM, not the "true" elevation of the climate station goes into the regression, rather it is a value that originates from overlaying the climate station coordinates with the coarse-scale DEM. In PRISM, it used to be a 4.5km grid. The reason for this is that for precipitation this method produced better regression results than when using the "true" elevation data. See Daly et al. (1994) for further discussions. P.E. Thornton et al. (1997) showed that this is especially true for precipitation, but not for other climate variables. When it comes to downscaling, this causes a problem, because we now "detect" the hidden regression parameters between climate and a "false" elevation. Theoretically, we now can't use these parameters to blow up our high-resolution maps based on an accurate DEM. Statistically speaking, we add uncertainty to our model.
What are the conclusions we can draw from this execise? First of all, I personally prefer DAYMET maps as source of coarse-scale climate input, since only precipitation modeling uses this approach of "adjusting" elevations for the regression (while in PRISM all variables are derived this way). Secondly, I suggest not to downscale precipitation maps to very fine resolutions anyway. Precipitation seems to react more generally to masses, varying intercepts of the regression considerably over short distances, but having rather flat sopes, complicating the downscaling to fine-resolution grids. As a rule of thumb, I suggest not to downscale to grid sizes smaller than 250m. If for nicety, you want to have the precip grids at the same smaller resolution, then do it by spatial interpolation, rather than by terrain-dependent downscaling. For temperatures, this limitation is valid, at least not if you use climate grids of DAYMET origin.
See also http://www.wsl.ch/staff/niklaus.zimmermann/biophys.html
for more information on biophysical modeling.
Prior to running the code a series of coverages and some measures have to be prepared. They have to be set in the header section of the AML, where all variables are declared. They are discussed below in sequence. See an example header for referece.
1. Coarse-scale DEM: You need a DEM of the same dimension (X/Y and pixel size) as you have coarse-scale climate grids to downscale. This is necessary to enable the regression between climate and elevation within mowing windows. The best case is if you can organize the DEM which originally was used to produce the climate maps.
2. A coarse lattice of climate input dimensions: You need to prepare a point lattice that matches the coarse input DEM (and climate variables). The reason is that the DEM and the montly climate grids are first sampled using <latticespot>. Thus, you best prepare a point lattice that matches the center of the cells, so that you do not interpolate (much) at this step. ATTENTION 1: Make sure that you generate a lattice that is big enough for the subsequent steps. Once you reproject this lattice, it will get distorted. It is a good procedure to first reproject the fine-scale DEM, or another coverage of the same dimensions, to the coarse scale DEM, and then to design a rectangular lattice that is big enough to capture the distorted area of the final DEM. ATTENTION 2: Note specifically, that you have to add (to this lattice) an additional margin of at least half the maximum window size you intend to apply in the procedure. You will loose a boarder stripe of half of the regression window, in order calculate the regressions with equal number of pixels.
3. A coarse lattice of new projection dimension: Since in most cases, your output grids will be in a new projection, you need to generate also a second lattice that will sample the reprojected coarse grids (climate & DEM) prior to unloading the data to a file of the GRIDASCII format. The code would be nicer if the regression would be calculated directly on the reprojected point data. It does not for historical reason mentioned above. Instead, the re-projected lattice is gridded first. This gridding requires some gap filling (through spatial interpolations), since depending on the distortion introduced through the re-projection, the simple <pointgrid> procedure might generate some gaps. The lattice you generate here sould sample the NEW grid at the center of the pixels. This is why you should not use the reprojected original point lattice.
4. Coarse-scale climate grids: Prepare the coarse-resolution climate grids as mentioned above. The suffix to denominate the months should be numerical, in the form 01, 02, ..., 12. This is important to facilitate the iteration through all months within the downscaling code without additional manual adjustments within the AML. You will have to enter the name of the climate grids in the header of the AML. This will be the name excluding the numerical suffix.
5. Fine-scale DEM: You need to prepare a fine-scale, high-resolution DEM for generating the climate grids to higher resolution. The interpolated regression parameters allow to do so by using this high-resolution DEM to scale the climate information in space. Especially, you need to extract the dimansions and grid size to input into the header of the AML.
6. Paths for the procedure: The AML is set up so that you can have the low-resolution DEM
and climate grids in one (input) directory, and the new grids (including the new coarse-resolution
lattice and the new projection file) in another (output) directory. If you prefer to store all
grids in the same directory, this might cause conflicts of names, since currently the AML gives
the high-resolution climate grids the same names (but stores them in another directory). So either
adjust the AML here, or follow the convention of separating the low- and high-resolution climate
grids. You can store and call the AML in a separate directory. If you prefer to store the AML in
the ATOOL/ARC directory, make sure that you have access right to adjust the header of the AML.
The <mowinreg> program needs to be placed in the directory where you actually CALL the AML.
The following variables need to be set in the header section of the AML:
Some remarks on these parameters:
Most parameters you can derive from the description of the two grids, the coarse-scale (input)
DEM and the fine-scale (output) DEM. This is not true for the reprojeted coarse-scale grids, that
have to be set manually, mostly. The reason for this is that it is not easy to generalize this
step without considerable changes to the mowingreg program, for which I do not have the time at
the moment. Yo you have to go through the pain to determine what the dimension and size would be
of the reprojected coarse-scale DEM/climate. The best way to do this is: 1) to reproject the
fine-scale DEM back to the projection of the input grids, 2) to add at least 1/2 window size
of the regression window to this dimension (rather a full window size) to the LL/UR coordinates
and to generate a point lattice (coverage) based on these coords, 3) to reproject this lattice
to the new projection of the finescale DEM, and 4) to determine round numbers for gridding the
lattice values in the new coordinate system. This new coarse grid can be slightly smaller than
the reprojected lattice (at least if we added enough spare cells at the edges, see point 2).
The final step should be done at the same grid size as was the original grid size. An IDW routine
checks whether there were some missing pixels due to reprojection distortions.
| Command: | &r mowinreg <climvar> (at ARC prompt) |
| Required input: | coarse & fine DEM, in- and out-projection lattice |
| Required additional sources: | |
| Output units: | 1/100 of input units (stored as integer grid) |
| Speed of calculations: | Rather slow due to complex calculations (depending on window size) |
| Flexibility of the routine: | High; but user needs to adjust AML manually |
| User interface: | No (or limited) interface |
| Known errors: | - |
| Programmer | N.E. Zimmermann |
| Download: | mowinreg.aml (use: "save link as") |
| Contact: | niklaus.zimmermann @ wsl.ch |
References:
Daly, C., Neilson, R.P. and Phillips, D.L. 1994. A Statistical-Topographic Model for Mapping Climatological Precipitation over Mountainous Terrain. Journal of Applied Meteorology 33: 140-158.Thornton, P.E., Running, S.W. and White, M.A. 1997. Generating surfaces of daily meteorological variables over large regions of complex terrain.Journal of Hydrology 190(3-4): 214-251.
[top] [back] [home]
Last Updated: 11/30/01
By Niklaus E. Zimmermann