Skip to content
Closed
Show file tree
Hide file tree
Changes from 52 commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
c6bbdc1
#547: Attempt at using masking for subsetting/masking ocean data.
mo-gill Jul 17, 2025
8cc9807
#547: Remove a comment.
mo-gill Jul 17, 2025
b1a5f14
#547: Add comments.
mo-gill Jul 22, 2025
dcbb90f
#547: Fix some formatting.
mo-gill Jul 22, 2025
4988f98
#547: Add halo removal for 2D ocean data. Tidy up code.
mo-gill Jul 23, 2025
3b83370
#547: Starting to try to separate subsetting of dimensions into separ…
mo-gill Jul 25, 2025
b60c6e8
#547: Further attempt at subsetting different dimensions.
mo-gill Jul 29, 2025
14e1e50
#547: Add halo_remove detection - non-functional with zostoga data.
mo-gill Aug 12, 2025
bd116a9
#547: Add another log message, think removal working with zostoga now.
mo-gill Aug 14, 2025
a07fa41
#547: Remove comment and some whitespace.
mo-gill Aug 14, 2025
7c9bbd7
#547: Minor adjustments to _apply removal.
mo-gill Aug 15, 2025
8e305c3
#547: First attempt at adding defaults. Non-functional.
mo-gill Aug 15, 2025
ab5db16
#547: Further attempt to implement default values.
mo-gill Aug 29, 2025
0a84ac4
#547: Trying to adjust logic for halo removal attributes.
mo-gill Aug 29, 2025
f2e4a00
#547: Remove unnecessary data from jsons.
mo-gill Aug 29, 2025
e034822
#547: Add halo removal overloading.
mo-gill Sep 1, 2025
9a72f09
#547: Further attempt to implement default values for plugins.
mo-gill Sep 1, 2025
d85c26a
#547: Default retrieval semi-working.
mo-gill Sep 1, 2025
0b2ff04
#547: Default working, logic needs work.
mo-gill Sep 1, 2025
cb98f82
#547: Add default values to other mip config jsons.
mo-gill Sep 2, 2025
29f6a09
#547: Amend altered indentation, remove a breakpoint.
mo-gill Sep 2, 2025
4e3b858
#547: Remove unnecessary code, run pep8.
mo-gill Sep 2, 2025
f318a7a
#547: Minor reformatting, replace hardcoded string logic.
mo-gill Sep 3, 2025
07e0e65
#547: Add abstract property to class fix mypy err.
mo-gill Sep 4, 2025
1bced7a
#547: Fix a pep8 fail.
mo-gill Sep 4, 2025
1aacdb0
#547: Add longitude check for diaptr.
mo-gill Sep 4, 2025
7086a9a
#547: Add check for singleton latitude.
mo-gill Sep 4, 2025
28e2ce9
#547: Add a functional test.
mo-gill Sep 8, 2025
a2263d2
#547: Add test file i forgot in last commit.
mo-gill Sep 8, 2025
2e50e16
#547: Tidy code, remove comment, fix quote marks.
mo-gill Sep 10, 2025
9d4cfcc
#547: Remove a blank line.
mo-gill Sep 10, 2025
cc2e3c8
#547: Correct copyright header date
mo-gill Sep 10, 2025
7aaaf53
#547: Remove halo_options sections from .jsons
mo-gill Sep 16, 2025
e8a312b
#547: Remove default_halo_removal from jsons.
mo-gill Sep 16, 2025
2358d99
#547: Remove code related to halo_options.
mo-gill Sep 16, 2025
762d16e
#547: Remove some halo sections from the docs.
mo-gill Sep 16, 2025
1b72ccd
#547: Remove code linked to halo_removal_latitude/longitude
mo-gill Sep 16, 2025
b20d60f
#547: Revert deletion of misc section validation code.
mo-gill Sep 16, 2025
70b3769
#547: Remove halo removal validation from MiscSectionValidator and te…
mo-gill Sep 16, 2025
2804a50
#547: Amend docs in json_model_parameter page.
mo-gill Sep 17, 2025
029297a
#547: Amend halo_removal section in mip_convert docs.
mo-gill Sep 17, 2025
ec45485
#547: Add halo_removal section in cmip6 plus model parameters JSON
mo-gill Sep 17, 2025
1d81a83
#547: Add empty halo removal section.
mo-gill Sep 18, 2025
24292c8
#547:correction to location of halo removal in cmip6 json.
mo-gill Sep 18, 2025
de38be1
#547: Add halo_removal section to gcmodeldev jsons.
mo-gill Sep 18, 2025
9f68a3d
#547: Amend json model docs.
mo-gill Sep 18, 2025
744affc
#547: Amend halo_removal docs formatting.
mo-gill Sep 18, 2025
92c4485
#547: Add halo removal section to test jsons.
mo-gill Sep 18, 2025
3f94f8f
#547: Add cordex halo_removal values for apm,ap6,ap5,ap7 in json
mo-gill Sep 18, 2025
b111f5f
#547: Remove argument and a logger.
mo-gill Sep 19, 2025
e9c46ef
#547: Add more halo_removal sections to jsons.
mo-gill Sep 19, 2025
e6818ed
Merge branch '547_remove_mask_from_read' of github.com:MetOffice/CDDS…
mo-gill Sep 19, 2025
9b92377
#547 pep8 fix
matthew-mizielinski Sep 19, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions cdds/cdds/common/plugins/base/base_grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ def _load_ocean_grid_polar_masks(self, json) -> None:
slice_longitude = self._to_mask_slice_str(values['slice_longitude'])
mask_slice = '{},{}'.format(slice_latitude, slice_longitude)
self._ocean_grid_polar_masks[grid_name] = mask_slice
self._halo_options = json['halo_options']

def _load_bounds_coordinates(self, json) -> None:
if "bounds_coordinates" in json:
Expand Down Expand Up @@ -184,22 +183,6 @@ def masks(self) -> Dict[str, str]:
"""
return self._ocean_grid_polar_masks

@property
def halo_options(self) -> Dict[str, List[str]]:
"""
Returns the ncks options needed to move ocean holo rows and columns.
For example::

{
'grid-T': ['-dx,1,360', '-dy,1,330'],
'grid-U': ['-dx,1,360', '-dy,1,330']
}

:return: The ncks options according their gird names
:rtype: dict
"""
return self._halo_options

def hybrid_heights_files(self) -> List[str]:
"""
Returns the hybrid heights file names.
Expand Down
12 changes: 12 additions & 0 deletions cdds/cdds/common/plugins/base/base_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ def __init__(self, model_id: ModelId) -> None:
self._stream_file_info: StreamFileInfo = None
self._streams: List[str] = []
self._grid_mappings: BaseGridMapping = BaseGridMapping()
self._halo_removal_info: Dict[str, str] = {}

def temp_space(self, stream_id: str) -> int:
"""
Expand All @@ -147,6 +148,15 @@ def memory(self, stream_id: str) -> str:
"""
return self._memory[stream_id]

@property
def halo_removal_info(self) -> Dict[str, str]:
"""
Returns the halo removal information for this model.
:return: Halo removal information
:rtype: Dict[str, str]
"""
return self._halo_removal_info

def cycle_length(self, stream_id: str) -> str:
"""
Returns the cycle length of the given stream.
Expand Down Expand Up @@ -235,13 +245,15 @@ def load_parameters(self, dir_path: str) -> LoadResult:
new_temp_space = parameters.get('temp_space', {})
new_sizing_info = parameters.get('sizing_info', {})
new_grid_info = parameters.get('grid_info')
new_halo_removal = parameters.get('halo_removal', {})

self._load_stream_file_info(parameters.get('stream_file_frequency', {}))
self._subdaily_streams = parameters.get('subdaily_streams', [])
self._cycle_lengths.update(new_cylc_lengths)
self._memory.update(new_memory)
self._temp_space.update(new_temp_space)
self._sizing.update(new_sizing_info)
self._halo_removal_info.update(new_halo_removal)

if new_grid_info:
self._load_grid_info(new_grid_info)
Expand Down
33 changes: 11 additions & 22 deletions cdds/cdds/common/plugins/cmip6/data/model/HadGEM3-GC31-HH.json
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,16 @@
"ap9",
"apt"
],
"halo_removal": {
"onm": {
"longitude": "1:-1",
"latitude": "1:-1"
},
"ond": {
"longitude": "1:-1",
"latitude": "1:-1"
}
},
"grid_info": {
"atmos": {
"atmos_timestep": 600,
Expand Down Expand Up @@ -247,28 +257,7 @@
null
]
}
},
"halo_options": {
"grid-T": [
"-dx,1,4320",
"-dy,1,3604"
],
"grid-U": [
"-dx,1,4320",
"-dy,1,3604"
],
"grid-V": [
"-dx,1,4320",
"-dy,1,3604"
],
"grid-W": [
"-dx,1,4320",
"-dy,1,3604"
],
"diaptr": [
"-dy,1,3604"
]
}
}
}
}
}
33 changes: 11 additions & 22 deletions cdds/cdds/common/plugins/cmip6/data/model/HadGEM3-GC31-HM.json
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,16 @@
"ap9",
"apt"
],
"halo_removal": {
"onm": {
"longitude": "1:-1",
"latitude": "1:-1"
},
"ond": {
"longitude": "1:-1",
"latitude": "1:-1"
}
},
"grid_info": {
"atmos": {
"atmos_timestep": 600,
Expand Down Expand Up @@ -253,28 +263,7 @@
null
]
}
},
"halo_options": {
"grid-T": [
"-dx,1,1440",
"-dy,1,1205"
],
"grid-U": [
"-dx,1,1440",
"-dy,1,1205"
],
"grid-V": [
"-dx,1,1440",
"-dy,1,1205"
],
"grid-W": [
"-dx,1,1440",
"-dy,1,1205"
],
"diaptr": [
"-dy,1,1205"
]
}
}
}
}
}
53 changes: 32 additions & 21 deletions cdds/cdds/common/plugins/cmip6/data/model/HadGEM3-GC31-LL.json
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,16 @@
"ap9",
"apt"
],
"halo_removal": {
"onm": {
"longitude": "1:-1",
"latitude": "1:-1"
},
"ond": {
"longitude": "1:-1",
"latitude": "1:-1"
}
},
"grid_info": {
"atmos": {
"atmos_timestep": 1200,
Expand Down Expand Up @@ -202,6 +212,28 @@
"diaptr_basin_masks.nc",
"ocean_zostoga.nc"
],
"halo_removal": {
"onm": [
[
1,
-1
],
[
1,
-1
]
],
"ond": [
[
1,
-1
],
[
1,
-1
]
]
},
"masked": {
"grid-V": {
"slice_latitude": [
Expand All @@ -227,27 +259,6 @@
null
]
}
},
"halo_options": {
"grid-T": [
"-dx,1,360",
"-dy,1,330"
],
"grid-U": [
"-dx,1,360",
"-dy,1,330"
],
"grid-V": [
"-dx,1,360",
"-dy,1,330"
],
"grid-W": [
"-dx,1,360",
"-dy,1,330"
],
"diaptr": [
"-dy,1,330"
]
}
}
}
Expand Down
33 changes: 11 additions & 22 deletions cdds/cdds/common/plugins/cmip6/data/model/HadGEM3-GC31-MH.json
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,16 @@
"ap9",
"apt"
],
"halo_removal": {
"onm": {
"longitude": "1:-1",
"latitude": "1:-1"
},
"ond": {
"longitude": "1:-1",
"latitude": "1:-1"
}
},
"grid_info": {
"atmos": {
"atmos_timestep": 900,
Expand Down Expand Up @@ -247,28 +257,7 @@
null
]
}
},
"halo_options": {
"grid-T": [
"-dx,1,4320",
"-dy,1,3604"
],
"grid-U": [
"-dx,1,4320",
"-dy,1,3604"
],
"grid-V": [
"-dx,1,4320",
"-dy,1,3604"
],
"grid-W": [
"-dx,1,4320",
"-dy,1,3604"
],
"diaptr": [
"-dy,1,3604"
]
}
}
}
}
}
33 changes: 11 additions & 22 deletions cdds/cdds/common/plugins/cmip6/data/model/HadGEM3-GC31-MM.json
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,16 @@
"apt",
"apa"
],
"halo_removal": {
"onm": {
"longitude": "1:-1",
"latitude": "1:-1"
},
"ond": {
"longitude": "1:-1",
"latitude": "1:-1"
}
},
"grid_info": {
"atmos": {
"atmos_timestep": 900,
Expand Down Expand Up @@ -254,28 +264,7 @@
null
]
}
},
"halo_options": {
"grid-T": [
"-dx,1,1440",
"-dy,1,1205"
],
"grid-U": [
"-dx,1,1440",
"-dy,1,1205"
],
"grid-V": [
"-dx,1,1440",
"-dy,1,1205"
],
"grid-W": [
"-dx,1,1440",
"-dy,1,1205"
],
"diaptr": [
"-dy,1,1205"
]
}
}
}
}
}
33 changes: 21 additions & 12 deletions cdds/cdds/common/plugins/cmip6/data/model/HadREM3-GA7-05.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,21 @@
"ond"
]
},
"cycle_length": {
},
"memory": {
},
"temp_space": {
},
"sizing_info": {
},
"cycle_length": {},
"memory": {},
"temp_space": {},
"sizing_info": {},
"subdaily_streams": [],
"halo_removal": {
"onm": {
"longitude": "1:-1",
"latitude": "1:-1"
},
"ond": {
"longitude": "1:-1",
"latitude": "1:-1"
}
},
"grid_info": {
"atmos": {
"atmos_timestep": null,
Expand Down Expand Up @@ -52,10 +58,13 @@
"diaptr_basin_masks.nc",
"ocean_zostoga.nc"
],
"masked": {
},
"halo_options": {
"masked": {},
"halo_removal": {
"onm": {
"longitude": "1:-1",
"latitude": "1:-1"
}
}
}
}
}
}
Loading