Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ConformalCubedSphere grid via MultiRegion module (#2867)
* show methods * get_grid_name * fix typo in CubedSpherePartition * get_grid_name * remove CubedSpheres module * fix tests * use MultiRegion to load cs32 grid; move test to test_multi_region_cubed_sphere.jl * add functionality to load MultiRegion ConformalCubedSphere from file * let go of CubedSpheres module * let go of CubedSpheres module * better show for OrthogonalSphericalShellGrid * some code cleanup * drop OldConformalCubedSphereGrid * drop warning from OrthogonalSphericalShellGrid * add connectivity information in docstring * add warning * better docstring * add example for how to find connectivities * only support equal x-y CubedSpherePartitions * add data dependencies + cleanup * cleanup * docstring for CubedSpherePartition * some cleanup * add util functions * nuke duplicate method * add getindex(::MultiRegionGrid, i) * add CubedSphereField + export * end with newline * adds return nothing to avoid ambiguity * add missing comma * minor cleanup * adds utilities for coordinate transformations on sphere * extend vertices methods to work with all locations * add validation + plotting example * some code cleanup * fix docstrings * fix docstring * convert arrays to proper array type * arch -> architecture * allow OrthogonalSphericalShellGrid to have stretched z * simplify * add ConformalCubedSphereGrid alias * add cubed_sphere_field.jl * better allignment * add Δzᵃᵃᶜ, Δzᵃᵃᶠ to OSSG from file * alignment * define alias ZRegOrthogonalSphericalShellGrid * fix Δz spacings for OSSG * adapt Δz * reduce parameter pressure in fill_halo * fill flipped halos * pcg for csg * add with_halos * total_size * pass panel topology * make domain aware of the topology * apply regionally * with_halo returns grid * updates * add == * cleanup CubedSphereConnectivity + inner constructor + docstring * minor cleanup and code alignment * drop Suppresson * create grid metrics BUT without halos * Completely overhaul grid utils * no fallback for total_length * no empty line * fix OSSG tests * OSSG respect their topology + cleaner construction * fixes and cleanup * use add_halo utility * more robust add_halos + more examples * better show for OSSG * cleaner inner constructors * updates * central_angle -> Distances.spherical_angle * delete stray s * cleaner Δx, Δy using haversine * add Distances * generalize coordinate transform utils * remove CubedSphere module * it solVes :) * don't instantiate * change tabs to spaces * minor cleanup * remove spaces * add return nothing * introduce Connectivity * update ubedSphereConnectivity syntax in doctest * add getproperty methods * refactor CubedSphereConnectivity * Oceananigans.Architecture -> Oceananigans.Architectures * validate panel index function * allowscalar for grid equality * add back center_str * fix show(io, ::OSSG) * Update src/Solvers/preconditioned_conjugate_gradient_solver.jl Co-authored-by: Simone Silvestri <[email protected]> * better docs * more args passing around for PCG * fix doctests * keep the decimal * fill coordinates halos for cubedspheregrid * fix bugs * some cleanup * don't allow different halo size in horizontal or different topology * don't allow different halo size in horizontal or different topology * don't allow different halo size in horizontal or different topology * add clarification * resolve conflicts * add Distances * fix show * quick fix * alignment * fix bug * alignment * minor cleanup * alignment * alignment * refactor connectivity * resolve another conflict * remove spaces * code formatting * add neighbors * use λ/φnodes * allowscalars * cleanup compact_data! * better doc * code alignment * cleanup, return nothings, fix docs * NonTrivialConnectivity -> NonTrivialCubedSphereConnectivity * fix mistake when filling both east-west or north-south halos for MCBC * enhance ConformalCubedSphere docstring * upgrade test to check for proper orientation of halos * fix doctest * cleanup * fix single halo filling methods * Added unit tests to check u and v halos (a) Added unit tests to verify if the halos for the zonal (u) and meridional (v) velocity fields defined at the fcc and cfc locations on each of the 6 single-layer orthogonal spherical shell grids (panels) constituting a conformal cubed sphere grid (with 1 region in each panel) have been filled out correctly. (b) As expected, all 48 unit tests for u and v on the 4 sides of each of the 6 panels failed, since the halos for these fields have not yet been specified. * first implementation of u, v fill halos * simply tests * add methods for correcting halo filling for u, v * needs grid * begins->begin * use halo filling trick for grid * Added a multi-region tracer advection test case It is not working, most probably due to an error associated with PrescribedVelocityFields on the conformal cubed sphere grid. * fixed gpu problem * small bugfix * gpu friendlieness * Created tracer advection animation on cubed sphere (a) Renamed the script multi_region_cubedsphere.jl to multi_region_cubed_sphere.jl; (b) Wrapped the testing of the heatsphere! and heatlatlon! plotting functions of multi_region_cubed_sphere.jl into a function; (c) Imported the function heatsphere! from multi_region_cubed_sphere.jl to multi_region_tracer_advection.jl to create an animation of the tracer advection on the cubed sphere; (d) Wrapped the testing of the multi region tracer advection of multi_region_tracer_advection.jl into a function; (e) Since the velocities are still zero, the tracer does not advect yet. * fix some tests + replace_velocity_halo! * bugfix * fix fallback method name * bugfix * resolve w julia v1.8.5 * merge main * unmodulify * some updates * don't inline figs * add inbounds * Modified halo checks to consider index shift (a) In the process of completing the u and v halos, it is crucial to consider not only the potential exchange of the u and v values and the reversal of their signs, but also the possibility of an offset in their indices by one. This commit addresses the latter scenario, an aspect that was not factored into the halo checks previously. (b) iOutside the tests, an error is encountered while accessing an array element with index out of bounds, which will be fixed in a later commit. * remove stray spaces * cleaner * metaprogrammed metric halo filling, but still not right for fc, cf * add signed kwarg * Fixed keyword argument error * Condensed functions (a) Consolidated the functions get_halo_data, get_halo_data_subset, and get_halo_data_endpoint into two streamlined functions: get_range_of_indices and get_halo_data. This modification enhances the organization of the test/test_multi_region_cubed_sphere.jl script. (b) Created a new function get_boundary_indices to retrieve boundary indices, their endpoints, or subsets excluding one endpoint. * code alignment * some fixes * use default CubedSpherePartition * add connectivity in partition * Redefined plotting functions (a) Enclosed the testing of the multi-region plotting functions within a function; (b) Redefined these plotting functions to be applied regionally to prevent prefixing calls to these functions with @apply_regionally; (c) Replaced looping over the regions at some places with @apply_regionally. * Removed print statement * Switched panel to initialize tracer advection (a) Initialized the conformal cubed sphere tracer advection test case with a Gaussian bump centered at (the center of) panel 5 facing the viewer in a GeoMakie animation; (b) Customized the above-mentioned Gaussian function. * Increased the range of Gaussian initial condition * add connectivity property in MultiRegionGrid * Tracer advects along the equator of cubed sphere! * fix doctest * clean up show methods * minor reorganization * add rotation in connectivity * Prescribed zonal velocity = cosine of latitude * Enhanced configuration of the initial condition * compute derivative of CubedSphereField * fixed computation on multiregion fields * another try in filling velocities * Fixed rotation direction Corrected rotation direction from counterclockwise (↺) to clockwise (↻) for find_west_connectivity if from_side is North(). * velocity halo filliing tests pass on a grid with 1 halo point * velocity halo filliing tests pass on a grid with ANY halo points * bit of cleanup * Modified prescribed velocity for tracer advection * trying to advect a tracer * fill halos for coordinates * bit of cleanup + only 2 halo fillings are required * more cleanup * add connectivity for X/YPartition * simplify * remove test-related packages * cleanup * Update validation/multi_region/multi_region_tracer_advection.jl Co-authored-by: Gregory L. Wagner <[email protected]> * Minor modifications * Update src/AbstractOperations/kernel_function_operation.jl Co-authored-by: Simone Silvestri <[email protected]> * fill halos for metrics + fix Azffa bug in OSSG * 2 fill halos are enough * split tests * add test for total Az area * not working for R>1 * fix typo * resolve * fixed location(a, dim) * Halos still not filled everywhere for face fields * Modified multi_region_cubed_sphere.jl script * fill velocity halos * Update src/Models/HydrostaticFreeSurfaceModels/update_hydrostatic_free_surface_model_state.jl Co-authored-by: Simone Silvestri <[email protected]> * replace_horizontal_velocity_halos! only for FullyConnected OSSG * some allowscalars + 3 halo fillings * convert doctests to examples * fix doctests * gpu friendly * Delete proposal.jl * Delete multi_region_cubed_sphere_derivatives.jl * Delete multi_region_tracer_advection.jl --------- Co-authored-by: simone-silvestri <[email protected]> Co-authored-by: Gregory Wagner <[email protected]> Co-authored-by: Simone Silvestri <[email protected]> Co-authored-by: Sid <[email protected]>
- Loading branch information