Generate LON/LAT files based on GRIDDESC and Global Attributes

Hi all,
I want to know how to generate LON/LAT files (Like GRIDCRO2D files generated by MCIP which has LON/LAT values) based on GRIDDESC and Global Attributes of Emission files. In my understanding, the GRIDDESC provides the projection parameters and grid resolution and example emission file also provides all info needed in the Global Attributes. But I have no idea about how to generate the LON/LAT file correctly.
Any clues are highly appreciated!

With regards,
Ryan
@lizadams @hogrefe.christian @cgnolte

Have you looked at the code in MCIP that does this calculation?

Yes, I did read the source code of MCIP (setgriddefs.f90) while still not much clear about this. Could you please point me in the right direction?

I haven’t used it, but based on its description the I/O API m3tools program LATLON may be able to do this.

1 Like

Thanks for shooting this solution. This executable works for my case.
I appreciate the helpful discussion with you all!

Yes, I/O API M3Tools program latlon does this. Note that it generates both single-precision REAL LAT, LON and double-precision REAL*8 DLAT, DLON for those cases (e.g., large, high-resolution grids) where REAL does not have sufficient precision., and also supports more map-projections than MCIP (e.g., Albers Equal-Area, much-used in the hydrology/land-surface community).
It is documented at
https://cjcoats.github.io/ioapi/LATLON.html
and
https://www.cmascenter.org/ioapi/documentation/all_versions/html/LATLON.html

1 Like