diff --git a/roocs_utils/etc/roocs.ini b/roocs_utils/etc/roocs.ini index e1189f3..d8437a9 100644 --- a/roocs_utils/etc/roocs.ini +++ b/roocs_utils/etc/roocs.ini @@ -146,6 +146,34 @@ mappings = use_catalog = True data_node_root = https://data.mips.copernicus-climate.eu/thredds/fileServer/esg_c3s-cordex/ +[project:c3s-ipcc-atlas] +base_dir = /pool/data/c3s-ipcc-ar6-atlas +use_inventory = True +use_catalog = True +is_default_for_path = True +file_name_template = {__derive__var_id}_{source}_{experiment_id}_{frequency}{__derive__time_range}{extra}.{__derive__extension} +attr_defaults = + frequency:no-freq + experiment_id:no-expt +facet_rule = variable project experiment time_frequency +mappings = + project:project_id +data_node_root = https://data.mips.copernicus-climate.eu/thredds/fileServer/esg_c3s-ipcc-atlas/ + +[project:c3s-cica-atlas] +base_dir = /pool/data/c3s-cica-atlas +use_inventory = True +use_catalog = True +is_default_for_path = True +file_name_template = {__derive__var_id}_{source}_{experiment_id}_{frequency}{__derive__time_range}{extra}.{__derive__extension} +attr_defaults = + frequency:no-freq + experiment_id:no-expt +facet_rule = variable project experiment time_frequency +mappings = + project:project_id +data_node_root = https://data.mips.copernicus-climate.eu/thredds/fileServer/esg_c3s-cica-atlas/ + [environment] OMP_NUM_THREADS=1 diff --git a/tests/test_project_utils.py b/tests/test_project_utils.py index 0b56520..13163ef 100644 --- a/tests/test_project_utils.py +++ b/tests/test_project_utils.py @@ -18,6 +18,7 @@ def test_get_project_name(load_test_data): + # cmip5 dset = "cmip5.output1.INM.inmcm4.rcp45.mon.ocean.Omon.r1i1p1.latest.zostoga" project = get_project_name(dset) assert project == "cmip5" @@ -26,10 +27,6 @@ def test_get_project_name(load_test_data): project = get_project_name(dset) assert project == "cmip5" - dset = "CMIP6.CMIP.NCAR.CESM2.historical.r1i1p1f1.SImon.siconc.gn.latest" - project = get_project_name(dset) - assert project == "cmip6" - ds = xr.open_mfdataset( CMIP5_TAS, use_cftime=True, @@ -38,6 +35,11 @@ def test_get_project_name(load_test_data): project = get_project_name(ds) assert project == "cmip5" + # cmip6 + dset = "CMIP6.CMIP.NCAR.CESM2.historical.r1i1p1f1.SImon.siconc.gn.latest" + project = get_project_name(dset) + assert project == "cmip6" + ds = xr.open_mfdataset( CMIP6_SICONC, use_cftime=True, @@ -51,6 +53,16 @@ def test_get_project_name(load_test_data): project = get_project_name(dset) assert project == "c3s-cmip6" + # c3s-cmip6-decadal + dset = "c3s-cmip6-decadal.DCPP.MOHC.HadGEM3-GC31-MM.dcppA-hindcast.s1995-r1i1p1f2.Amon.tas.gn.v20200417" + project = get_project_name(dset) + assert project == "c3s-cmip6-decadal" + + # c3s-cica-atlas + dset = "c3s-cica-atlas.cd.CMIP6.historical.yr" + project = get_project_name(dset) + assert project == "c3s-cica-atlas" + def test_get_project_name_badc(): dset = "/badc/cmip5/data/cmip5/output1/MOHC/HadGEM2-ES/rcp85/mon/atmos/Amon/r1i1p1/latest/tas/*.nc" @@ -162,6 +174,7 @@ def test_get_filepaths(): def test_derive_dset(): + # c3s-cmip6 dset = "c3s-cmip6.CMIP.MIROC.MIROC6.historical.r1i1p1f1.SImon.siconc.gn.latest" ds_id = derive_dset(dset) @@ -170,6 +183,7 @@ def test_derive_dset(): == "/badc/cmip6/data/CMIP6/CMIP/MIROC/MIROC6/historical/r1i1p1f1/SImon/siconc/gn/latest" ) + # cmip5 dset = "cmip5.output1.ICHEC.EC-EARTH.historical.day.atmos.day.r1i1p1.tas.v20131231" ds_id = derive_dset(dset) @@ -178,6 +192,21 @@ def test_derive_dset(): == "/badc/cmip5/data/cmip5/output1/ICHEC/EC-EARTH/historical/day/atmos/day/r1i1p1/tas/v20131231" ) + # c3s-cmip6-decadal + dset = "c3s-cmip6-decadal.DCPP.MOHC.HadGEM3-GC31-MM.dcppA-hindcast.s1995-r1i1p1f2.Amon.tas.gn.v20200417" + ds_id = derive_dset(dset) + + assert ( + ds_id + == "/badc/cmip6/data/CMIP6/DCPP/MOHC/HadGEM3-GC31-MM/dcppA-hindcast/s1995-r1i1p1f2/Amon/tas/gn/v20200417" + ) + + # c3s-cica-atlas + dset = "c3s-cica-atlas.cd.CMIP6.historical.yr" + ds_id = derive_dset(dset) + + assert ds_id == "/pool/data/c3s-cica-atlas/cd/CMIP6/historical/yr" + def test_switch_dset(): dset = "/badc/cmip6/data/CMIP6/CMIP/MIROC/MIROC6/historical/r1i1p1f1/SImon/siconc/gn/latest/*.nc"