Deltares / dfm_tools

A Python package for pre- and postprocessing D-FlowFM model input and output files
https://deltares.github.io/dfm_tools/
GNU General Public License v3.0
65 stars 11 forks source link

CMEMS phyc not available in reanalysis #622

Open veenstrajelmer opened 10 months ago

veenstrajelmer commented 10 months ago

The below MWE raises: KeyError: '"phyc" not found in dataset, available are: [\'chl\', \'no3\', \'nppv\', \'o2\', \'po4\', \'si\']'

import dfm_tools as dfmt

lon_min, lon_max, lat_min, lat_max = -68.55, -67.9, 11.8, 12.6
date_min = '2020-12-02'
date_max = '2020-12-03'

varkey = 'phyc'
dfmt.download_CMEMS(varkey=varkey,
                    longitude_min=lon_min, longitude_max=lon_max, latitude_min=lat_min, latitude_max=lat_max,
                    date_min=date_min, date_max=date_max,
                    dir_output='.', file_prefix='cmems_', overwrite=True)

Forecast does have phyc: https://data.marine.copernicus.eu/product/GLOBAL_ANALYSISFORECAST_BGC_001_028/services Reanalysis has not: https://data.marine.copernicus.eu/product/GLOBAL_MULTIYEAR_BGC_001_029/services

Maybe consider whether nppv can also be used which might be comparable, although this is something different according to the user manuals. Units are different and the quantity differs approximately a factor 10.

However, both user manuals state the datasets should have a phyc variable:

multiyear:
nppv [mg.m-3.day-1] Net primary production net_primary_production_of_biomass_expressed_as_carbon_per_unit_volume_in_sea_water
phyc [mmol.m-3] Phytoplankton concentration in carbon mole_concentration_of_phytoplankton_expressed_as_carbon_in_sea_water

forecast:
nppv [mg m-3 day-1] Total Primary Production of Phyto net_primary_production_of_biomass_expressed_as_carbon_per_unit_volume_in_sea_water
phyc [mmol m-3] Total Phytoplankton mole_concentration_of_phytoplankton_expressed_as_carbon_in_sea_water

CMEMS clarified on 9-8-2024 that phyc is available in reanalyis monthly datasets, but not in daily. Requested to add it to daily, but not yet sure whether this request will be accepted. If not, download phyc from monthly mean datasets instead (for reanalysis only)