WCRP-CORDEX / data-request-table

Machine readable data request tables
MIT License
0 stars 0 forks source link

Definition of soil coordinate. #5

Closed doblerone closed 5 months ago

doblerone commented 7 months ago

The Tier1 request includes three variables that need to be stored at each soil layer (3D variable): tsl, mrsfl and mrsol.

Should the vertical soil coordinate be defined in the archive specifications? And added here: https://github.com/WCRP-CORDEX/cordex-cmip6-cmor-tables/blob/main/Tables/CORDEX_coordinate.json Could be (just a guess)

double soil_depth(soil_depth) ;
    soil_depth:standard_name = "depth" ;
    soil_depth:long_name = "Soil layer depth" ;
    soil_depth:units = "m" ;
    soil_depth:positive = "down" ;
    soil_depth:axis = "Z" ;
    soil_depth:bounds = "soil_depth_bnds" ;
double soil_depth_bnds(soil_depth, bnds) ;

And then add that dimension here https://github.com/WCRP-CORDEX/cordex-cmip6-cmor-tables/blob/main/Tables/CORDEX_6hr.json for the three variables i.e. "dimensions": "longitude latitude depth time1",

larsbuntemeyer commented 7 months ago

Thanks @doblerone for pointing this out. I think you are right, there should a depth dimension and coordinate variable (like in the CMIP6 cmor tables that were adapted here). This information is still a little incomplete in the data request table for CORDEX and might got lost. Let me move this issue there since this is not CV related.

larsbuntemeyer commented 5 months ago

fixed using:

import pandas as pd

df = pd.read_csv("CORDEX-CMIP6/data-request.csv")

def insert_sdepth(dims):
    split = dims.split()
    if len(split) == 3:  # contains time
        split.insert(-1, "sdepth")
    else:
        split.append("sdepth")
    return " ".join(split)

out_names = ["tsl", "mrsfl", "mrsol"]
sdepths = df[df.out_name.isin(out_names)].dimensions.map(insert_sdepth)
df.loc[sdepths.index, "dimensions"] = sdepths
df.to_csv("CORDEX-CMIP6/data-request.csv", index=False)
larsbuntemeyer commented 5 months ago

@doblerone just to let you know, i kept the meta data of the sdepth coordinate entry like it is in CMIP6:

https://github.com/WCRP-CORDEX/cordex-cmip6-cmor-tables/blob/3519cb03ffd93fe92c15dc0adfe162b7173581a7/Tables/CORDEX-CMIP6_coordinate.json#L647-L669

meaning that this coordinate also will require boundaries ("must_have_bounds": "yes). I think it makes sense since it clearly defines also the thickness of the soil layers.