CREATE_GBXBOUNDARIES

Copyright (c) 2024 MPI-M, Clara Bayley

—– CLEO —– File: create_gbxboundaries.py Project: gbxboundariesbinary_src Created Date: Monday 16th October 2023 Author: Clara Bayley (CB) Additional Contributors: —– Last Modified: Tuesday 7th May 2024 Modified By: CB —– License: BSD 3-Clause “New” or “Revised” License https://opensource.org/licenses/BSD-3-Clause —– File Description:

pySD.gbxboundariesbinary_src.create_gbxboundaries.check_halfcoords(grid, coord)[source]

check that x , y or z grid limits are for at least 1 cell with strictly monotonically increasing bounds

pySD.gbxboundariesbinary_src.create_gbxboundaries.ctype_compatible_gridboxboundaries(ndims, idxs, bounds)[source]

check type of gridbox boundaries data is compatible with c type double. If not, change type and raise error

pySD.gbxboundariesbinary_src.create_gbxboundaries.dimless_gridboxboundaries(zgrid, xgrid, ygrid, COORD0)[source]

use zgrid, xgrid and ygrid lists or arrays to create half coords of gridboxes (ie. their boundaries). Return single list of zhalf, then xhalf, then yhalf coords and a list of len(3) which states how many of each z, x and y coords there are

pySD.gbxboundariesbinary_src.create_gbxboundaries.get_COORD0_from_constsfile(constsfile, returnconsts=False)[source]

create values from constants file required as inputs to create initial superdroplet conditions

pySD.gbxboundariesbinary_src.create_gbxboundaries.get_dimless_halfcoords(grid, coord, COORD0)[source]

given a list or array, return dimensionless halfcoords. For list call “halfcoords_from_coordlims” before de-dimensionalising. For array simply return array / COORD0

pySD.gbxboundariesbinary_src.create_gbxboundaries.gridboxboundaries_from_halfcoords(allhalfcoords, ngridboxes)[source]

returns gbxbounds dictionary. Each key of gbxbounds is a gridbox’s index and the corresponding value is the gridbox’s [zmin, zmax, xmin, xmax, ymin, ymax] boundaries

pySD.gbxboundariesbinary_src.create_gbxboundaries.linearlyspaced_halfcoords(grid)[source]

returns linearly spaced half coords ie. 1D gridbox boundaries given ‘grid’ list of [min coord, max coord, delta coord] for x, y or z

pySD.gbxboundariesbinary_src.create_gbxboundaries.write_gridboxboundaries_binary(gridfile, zgrid, xgrid, ygrid, constsfile)[source]

zgrid, xgrid and ygrid can either be list of [min coord, max coord, delta] or they can be arrays of their half coordinates (ie. gridbox boundaries). If the former, first create half coordinates. In both cases, de-dimensionalise and write the boundaries to a binary file, “filename”