You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now we load cubed sphere grids from a file which is a Julia/JLD2.jl version of the binary files used by MITgcm. These grid files are currently stored at https://github.com/CliMA/OceananigansArtifacts.jl.
This works well for the CS32 and CS96 grids, but for much larger grids like the CS510 the grid file is ~200 MiB uncompressed (~118 MiB compressed with JLD2's compress=true) which is bigger than GitHub's 100 MiB file size limit. 200 MiB for a grid file is also a bit cumbersome. Right now I'm thinking of hosting CS510 on the engaging cluster, although git lfs for OceananigansArtifacts.jl may be an option.
It would be nice to be able to generate conformal cubed sphere grid files to make it easier for users to use cubed sphere grids, and also for the added flexibility of not being limited to three common resolutions (CS32, CS96, and CS510).
It would also be good to keep the ability to load a cubed sphere grid from file since we may want to do this for other grids besides the cubed sphere in the future (lat-lon-cap or LLC grids?), and it would be useful to test that the grids we generate are indeed correct by comparing with the grid files.
I'm opening this issue just to document what we know about conformal cubed sphere grid generation.
It's not a particularly urgent issue.
Computing grid metrics
We already have some code that generates conformal cubed sphere grids with the coordinates, but they are missing the grid metrics (grid spacings and areas).
@christophernhill has pointed out these MITgcm MATLAB scripts that may just be what we need to compute the grid metrics.
In appendices A and B, Rančić et al. (1996) describes how to map from the cube faces to the surface of the sphere and how to compute the Taylor coefficients, but after spending several hours trying to reproduce them I was not able to (my complex analysis is quite rusty) and so I copy-pasted the 30 coefficients given in Table B.1.
However, we may need more than 30 coefficients for a truly accurate numerical mapping. I'm guessing the accuracy of the mapping matters more at higher resolutions, but not sure if it's ever an issue for the kind of work we're doing. Rančić et al. (1996) find that you need 128 terms for 15-figure accuracy in Appendix B.
I'm attaching Rančić et al. (1996) here for reference:
Right now we load cubed sphere grids from a file which is a Julia/JLD2.jl version of the binary files used by MITgcm. These grid files are currently stored at https://github.com/CliMA/OceananigansArtifacts.jl.
The easiest way to use them is to load them as a data dependency with DataDeps.jl: https://github.com/CliMA/Oceananigans.jl/blob/master/test/data_dependencies.jl
This works well for the CS32 and CS96 grids, but for much larger grids like the CS510 the grid file is ~200 MiB uncompressed (~118 MiB compressed with JLD2's
compress=true
) which is bigger than GitHub's 100 MiB file size limit. 200 MiB for a grid file is also a bit cumbersome. Right now I'm thinking of hosting CS510 on the engaging cluster, although git lfs for OceananigansArtifacts.jl may be an option.It would be nice to be able to generate conformal cubed sphere grid files to make it easier for users to use cubed sphere grids, and also for the added flexibility of not being limited to three common resolutions (CS32, CS96, and CS510).
It would also be good to keep the ability to load a cubed sphere grid from file since we may want to do this for other grids besides the cubed sphere in the future (lat-lon-cap or LLC grids?), and it would be useful to test that the grids we generate are indeed correct by comparing with the grid files.
I'm opening this issue just to document what we know about conformal cubed sphere grid generation.
It's not a particularly urgent issue.
Computing grid metrics
We already have some code that generates conformal cubed sphere grids with the coordinates, but they are missing the grid metrics (grid spacings and areas).
@christophernhill has pointed out these MITgcm MATLAB scripts that may just be what we need to compute the grid metrics.
http://wwwcvs.mitgcm.org/viewvc/MITgcm/MITgcm_contrib/high_res_cube/matlab-grid-generator/README?revision=1.1.1.1&view=markup
http://wwwcvs.mitgcm.org/viewvc/MITgcm/MITgcm_contrib/high_res_cube/matlab-grid-generator/calc_fvgrid.m?revision=1.1.1.1&view=markup
http://wwwcvs.mitgcm.org/viewvc/MITgcm/MITgcm_contrib/high_res_cube/matlab-grid-generator/gengrid_fn.m?revision=1.1.1.1&view=markup
He also mentioned Ives & Zacharias (1989) as being a good reference for this. Attached here: ives_zacharias.pdf
More accurate cubed sphere conformal mapping
Not sure if this will be an issue, but the cubed sphere conformal mapping we use from https://github.com/CliMA/CubedSphere.jl/blob/main/src/conformal_cubed_sphere.jl involves evaluating a Taylor series as described by Rančić et al. (1996).
In appendices A and B, Rančić et al. (1996) describes how to map from the cube faces to the surface of the sphere and how to compute the Taylor coefficients, but after spending several hours trying to reproduce them I was not able to (my complex analysis is quite rusty) and so I copy-pasted the 30 coefficients given in Table B.1.
However, we may need more than 30 coefficients for a truly accurate numerical mapping. I'm guessing the accuracy of the mapping matters more at higher resolutions, but not sure if it's ever an issue for the kind of work we're doing. Rančić et al. (1996) find that you need 128 terms for 15-figure accuracy in Appendix B.
I'm attaching Rančić et al. (1996) here for reference:
Rančić et al, 1996, Quarterly Journal of the Royal Meteorological Society, A global shallow-water model using an expanded spherical cube - Gnomonic versus conformal coordinates.pdf
The text was updated successfully, but these errors were encountered: