Hello,
I noticed that he BELD5 input data is generated only for the default LAM_40N97W projection, using the following parameters:
'LAM_40N97W’2, 33.0D0, 45.D0, -97.D0, -97.D0, 40.D0
I would like to create BELD5 input data using a different map projection with our own parameters. For example:
! coords – 2 lines: name; type, P‑alpha, P‑beta, P‑gamma, xcent, ycent
'LAM_33N112W’2, 33.0D0, 45.D0, -112.D0, -112.D0, 33.5
The document does not provide enough information about how to generate 1 km × 1 km BELD5 input data. I’m wondering whether any tools or utilities exist that can help automate or support the creation of BELD5 input data for custom map projections.
Thanks,
Feng
Tools to do grid-to-grid transforms for both emissions and meteorology data been part of the I/O API M3Tools package since well before the writing of AGGWNDW. In using these tools, you need to be aware that SMOKE emissions are in non-MKS, non-interpolatable units of mass per grid cell per unit time, so you need to use the scale factor
(output grid cell area) / (input grid cell area)
with these programs. Note also that these programs support transforms among all the I/O API supported map coordinate types.
For an output grid finer than the input grid (not your case here, but listed for reference):
- m3cple, which does the transform in one step;
For an output grid coarser than the input grid (your case), you need two steps:
- mtxcalc computes a sparse matrix to do the transformation, optionally using the scale factor described above; and
- mtxcple uses a sparse matrix from mtxcalc to perform the grid-to-grid transformation.
mtxcalc will ask you for a grid-refinement parameter as well. For your case, I’d recommend 5 for urban-scale output grids, and 3 for regional (> 12KM) ones.
– Carlie J. Coats, Jr.
I/O API author/maintainer
Original SMOKE author
Hi Carlie,
Thank you very much for the solutions.
I followed your instructions and successfully obtained mtxcalc+36km.nc after running mtxcalc with grid refinement set to 5.
I am now running mtxcple, but I am unsure about its required input file and where to obtain it. In the Program MTXCPLE example, I see the input file emep_ann.1997.eu50.ncf.
Specifically, the example includes:
setenv IN_DATA ${INDIR}/emep_ann.1997.eu50.ncf
Could you please clarify what this NetCDF file represents and how it should be generated or obtained?
Thanks,
Feng
Hi Feng,
I believe that you would take the specified transform matrix output that you generated from mtxcalc and use it in mtxcple as input by defining it in the MATRIX_FILE environment variable.
Note, please run mtxclple from the command line, and verify what variables it is looking for as inputs.
This is from the documentation:
The MTXCPLE program extracts all [variables](https://cjcoats.github.io/ioapi/VBLE.html) for a specified time step sequence from one I/O API file, infile, transforms them to a new grid using the specified transform matrix,, and writes them to a different I/O API file, outfile, under the optional control of a synchfile. Any combination of [physical or virtual files](https://cjcoats.github.io/ioapi/BUFFERED.html) is supported.
You would need to set the infile ($INFILE or $IN_DATA) to be the BELD5 input data that you wish to transform to a new grid, and also specify the matrix file as what you generated after running mtxcalc to create the sparse matrix used to do the transformation.
According to the document you provided in the link, the 1km BELD5 data is in ONE file that is about 34GB in size.
According to the example in the documentation, to run mtxcple, you would need to set the following environment variables.
setenv MATRIX_FILE mtxcalc+36km.nc
setenv IN_DATA [BELD5_input_data_filename_1km]
setenv OUT_DATA BELD5_36km
Hello Lizi,
Thank you very much for your support.
I generated BELD5 for our 36 km grids in two steps by running mtxcalc and mtxcple. However, the resulting domain was shifted and did not align with our intended domain. I did not spend time investigating the cause. My coworker then suggested using m3cple to perform a simple Lambert‑to‑Lambert conversion (with different projection angles) so that we could obtain the same 1 km × 1 km BELD5 data in our own Lambert projection. After that, I updated the sample csh script “aggwndw.test.csh” and was able to produce correct results for all three of our domains.
By the way, the file BELD5_1US3_FIA6.1_2017CLD_Canada.ncf is about 734 MB rather than 34 GB, so I am wondering if we are referring to the same dataset.
Thank you again for your time and help.
Feng