-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #722 from PCMDI/709-updates-for-mip-cmor-tables
Updates for mip-cmor-tables
- Loading branch information
Showing
17 changed files
with
1,144 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
[submodule "cmip6-cmor-tables"] | ||
path = cmip6-cmor-tables | ||
url = https://github.com/PCMDI/cmip6-cmor-tables.git | ||
[submodule "mip-cmor-tables"] | ||
path = mip-cmor-tables | ||
url = https://github.com/PCMDI/mip-cmor-tables.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ | ||
"branch_method": "standard", | ||
"calendar": "360_day", | ||
"experiment_id": "hist-lu", | ||
"institution_id": "MOHC", | ||
"license": "CMIP6Plus model data produced by the Met Office Hadley Centre is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License (https://creativecommons.org/licenses). Consult https://pcmdi.llnl.gov/CMIP6Plus/TermsOfUse for terms of use governing CMIP6Plus output, including citation requirements and proper acknowledgment. The data producers and data providers make no warranty, either express or implied, including, but not limited to, warranties of merchantability and fitness for a particular purpose. All liabilities arising from the supply of the information (including any liability arising in negligence) are excluded to the fullest extent permitted by law.", | ||
"activity_id": "LESFMIP", | ||
"mip_era": "CMIP6Plus", | ||
"source_id": "HadGEM3-GC31-LL", | ||
"source_type": "AOGCM BGC AER CHEM", | ||
"outpath": ".", | ||
"sub_experiment_id": "f2023", | ||
"variant_label": "r1i1p1f2", | ||
"grid": "Native N96 grid; 192 x 144 longitude/latitude", | ||
"grid_label": "gn", | ||
"nominal_resolution": "250 km", | ||
"parent_experiment_id": "piControl", | ||
"parent_mip_era": "CMIP6Plus", | ||
"parent_source_id": "HadGEM3-GC31-LL", | ||
"parent_time_units": "days since 1850-01-01", | ||
"parent_variant_label": "r1i1p1f2", | ||
"history": "2023-11-03T11:41:57Z MIP Convert v2.6.0.dev0, Python v3.8.17, iris v3.4.1, numpy v1.24.4, cftime v1.6.2, pyproj v3.5.0", | ||
"#_cmip6_option": "CMIP6", | ||
"realization_index": "1", | ||
"initialization_index": "1", | ||
"physics_index": "1", | ||
"forcing_index": "2", | ||
"cv_version": "0.0.1", | ||
"experiment": "Single forcing historical simulations", | ||
"sub_experiment": "Forcings 2023", | ||
"tracking_prefix": "hdl:21.14100", | ||
"parent_activity_id": "CMIP", | ||
"_controlled_vocabulary_file": "TestTables/CMIP6Plus_CV.json", | ||
"_AXIS_ENTRY_FILE": "mip-cmor-tables/Auxillary_files/MIP_coordinate.json", | ||
"_FORMULA_VAR_FILE": "mip-cmor-tables/Auxillary_files/MIP_formula_terms.json", | ||
"further_info_url": "https://furtherinfo.es-doc.org/", | ||
"mo_runid": "u-be509", | ||
"branch_time_in_parent": 59400.0, | ||
"branch_time_in_child": 59400.0 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import cmor | ||
import numpy | ||
import unittest | ||
|
||
|
||
class TestCMIP6Plus(unittest.TestCase): | ||
|
||
def test_multiple_modeling_realms(self): | ||
ntimes_passed = 12 | ||
|
||
self.assertEqual( | ||
cmor.setup(inpath='mip-cmor-tables/Tables', | ||
netcdf_file_action=cmor.CMOR_REPLACE), | ||
0) | ||
self.assertEqual(cmor.dataset_json("Test/CMIP6Plus_user_input.json"), | ||
0) | ||
|
||
self.assertEqual(cmor.load_table("MIP_OPmon.json"), 0) | ||
|
||
axes = [ | ||
{ | ||
'table_entry': 'time', | ||
'units': 'months since 2010-1-1', | ||
'coord_vals': numpy.arange(0, ntimes_passed, 1), | ||
'cell_bounds': numpy.arange(0, ntimes_passed+1, 1) | ||
}, | ||
{ | ||
'table_entry': 'latitude', | ||
'units': 'degrees_north', | ||
'coord_vals': [0], | ||
'cell_bounds': [-1, 1] | ||
}, | ||
{ | ||
'table_entry': 'longitude', | ||
'units': 'degrees_east', | ||
'coord_vals': [90], | ||
'cell_bounds': [89, 91] | ||
} | ||
] | ||
|
||
axis_ids = [cmor.axis(**axis) for axis in axes] | ||
|
||
ivar = cmor.variable('hfsifrazil2d', units='W m-2', axis_ids=axis_ids) | ||
|
||
data = [280., ] * ntimes_passed | ||
|
||
self.assertEqual( | ||
cmor.write(ivar, data, ntimes_passed=ntimes_passed), | ||
0) | ||
|
||
realms = cmor.get_cur_dataset_attribute('realm') | ||
self.assertEqual(realms, "ocean seaIce") | ||
|
||
self.assertEqual(cmor.close(), 0) | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() |
Oops, something went wrong.