roms-tools 1.4.2__py3-none-any.whl → 1.5.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- roms_tools/_version.py +1 -1
- roms_tools/setup/boundary_forcing.py +276 -99
- roms_tools/setup/datasets.py +19 -15
- roms_tools/setup/fill.py +38 -2
- roms_tools/setup/initial_conditions.py +170 -44
- roms_tools/setup/regrid.py +198 -0
- roms_tools/setup/surface_forcing.py +136 -51
- roms_tools/setup/tides.py +103 -31
- roms_tools/setup/utils.py +235 -40
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/.zmetadata +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/ALK_ALT_CO2_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/ALK_ALT_CO2_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/ALK_ALT_CO2_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/ALK_ALT_CO2_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/ALK_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/ALK_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/ALK_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/ALK_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DIC_ALT_CO2_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DIC_ALT_CO2_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DIC_ALT_CO2_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DIC_ALT_CO2_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DIC_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DIC_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DIC_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DIC_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOC_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOC_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOC_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOC_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOCr_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOCr_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOCr_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOCr_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DON_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DON_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DON_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DON_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DONr_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DONr_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DONr_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DONr_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOP_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOP_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOP_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOP_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOPr_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOPr_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOPr_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOPr_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/Fe_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/Fe_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/Fe_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/Fe_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/Lig_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/Lig_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/Lig_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/Lig_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/NH4_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/NH4_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/NH4_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/NH4_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/NO3_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/NO3_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/NO3_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/NO3_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/O2_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/O2_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/O2_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/O2_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/PO4_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/PO4_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/PO4_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/PO4_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/SiO3_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/SiO3_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/SiO3_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/SiO3_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatC_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatC_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatC_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatC_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatChl_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatChl_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatChl_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatChl_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatFe_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatFe_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatFe_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatFe_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatP_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatP_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatP_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatP_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatSi_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatSi_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatSi_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatSi_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazC_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazC_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazC_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazC_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazChl_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazChl_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazChl_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazChl_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazFe_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazFe_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazFe_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazFe_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazP_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazP_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazP_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazP_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spC_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spC_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spC_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spC_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spCaCO3_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spCaCO3_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spCaCO3_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spCaCO3_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spChl_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spChl_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spChl_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spChl_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spFe_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spFe_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spFe_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spFe_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spP_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spP_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spP_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spP_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/zooC_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/zooC_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/zooC_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/zooC_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_surface_forcing.zarr/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_surface_forcing.zarr/.zmetadata +1 -1
- roms_tools/tests/test_setup/test_data/bgc_surface_forcing.zarr/pco2_air_alt/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_surface_forcing_from_climatology.zarr/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_surface_forcing_from_climatology.zarr/.zmetadata +1 -1
- roms_tools/tests/test_setup/test_data/bgc_surface_forcing_from_climatology.zarr/pco2_air_alt/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/.zmetadata +1 -1
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/salt_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/salt_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/salt_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/salt_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/temp_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/temp_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/temp_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/temp_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/u_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/u_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/u_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/u_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/ubar_east/0.0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/ubar_north/0.0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/ubar_south/0.0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/ubar_west/0.0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/v_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/v_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/v_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/v_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/vbar_east/0.0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/vbar_north/0.0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/vbar_south/0.0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/vbar_west/0.0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/zeta_east/0.0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/zeta_south/0.0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/.zmetadata +1 -1
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/ALK/0.0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/ALK_ALT_CO2/0.0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/DIC/0.0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/DIC_ALT_CO2/0.0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/DOC/0.0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/DOCr/0.0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/DON/0.0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/DONr/0.0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/DOP/0.0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/DOPr/0.0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/Fe/0.0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/Lig/0.0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/NH4/0.0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/NO3/0.0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/O2/0.0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/PO4/0.0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/SiO3/0.0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/diatC/0.0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/diatChl/0.0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/diatFe/0.0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/diatP/0.0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/diatSi/0.0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/diazC/0.0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/diazChl/0.0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/diazFe/0.0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/diazP/0.0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/salt/0.0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/spC/0.0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/spCaCO3/0.0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/spChl/0.0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/spFe/0.0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/spP/0.0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/temp/0.0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/u/0.0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/ubar/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/v/0.0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/vbar/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/zeta/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/zooC/0.0.0.0 +0 -0
- roms_tools/tests/test_setup/test_fill.py +43 -14
- roms_tools/tests/test_setup/test_regrid.py +59 -0
- roms_tools/tests/test_setup/test_surface_forcing.py +18 -0
- {roms_tools-1.4.2.dist-info → roms_tools-1.5.0.dist-info}/METADATA +2 -2
- {roms_tools-1.4.2.dist-info → roms_tools-1.5.0.dist-info}/RECORD +222 -221
- roms_tools/setup/mixins.py +0 -227
- {roms_tools-1.4.2.dist-info → roms_tools-1.5.0.dist-info}/LICENSE +0 -0
- {roms_tools-1.4.2.dist-info → roms_tools-1.5.0.dist-info}/WHEEL +0 -0
- {roms_tools-1.4.2.dist-info → roms_tools-1.5.0.dist-info}/top_level.txt +0 -0
|
@@ -7,7 +7,8 @@ from roms_tools.setup.grid import Grid
|
|
|
7
7
|
from datetime import datetime
|
|
8
8
|
import numpy as np
|
|
9
9
|
from typing import Dict, Union, List
|
|
10
|
-
from roms_tools.setup.
|
|
10
|
+
from roms_tools.setup.fill import _lateral_fill, LateralFill
|
|
11
|
+
from roms_tools.setup.regrid import _lateral_regrid, LateralRegrid
|
|
11
12
|
from roms_tools.setup.datasets import (
|
|
12
13
|
ERA5Dataset,
|
|
13
14
|
ERA5Correction,
|
|
@@ -20,6 +21,8 @@ from roms_tools.setup.utils import (
|
|
|
20
21
|
get_variable_metadata,
|
|
21
22
|
group_dataset,
|
|
22
23
|
save_datasets,
|
|
24
|
+
get_target_coords,
|
|
25
|
+
rotate_velocities,
|
|
23
26
|
)
|
|
24
27
|
from roms_tools.setup.plot import _plot
|
|
25
28
|
import matplotlib.pyplot as plt
|
|
@@ -27,7 +30,7 @@ from pathlib import Path
|
|
|
27
30
|
|
|
28
31
|
|
|
29
32
|
@dataclass(frozen=True, kw_only=True)
|
|
30
|
-
class SurfaceForcing
|
|
33
|
+
class SurfaceForcing:
|
|
31
34
|
"""Represents surface forcing input data for ROMS.
|
|
32
35
|
|
|
33
36
|
Parameters
|
|
@@ -91,63 +94,50 @@ class SurfaceForcing(ROMSToolsMixins):
|
|
|
91
94
|
def __post_init__(self):
|
|
92
95
|
|
|
93
96
|
self._input_checks()
|
|
94
|
-
|
|
95
|
-
object.__setattr__(self, "
|
|
96
|
-
object.__setattr__(self, "target_lat", lat)
|
|
97
|
+
target_coords = get_target_coords(self.grid, self.use_coarse_grid)
|
|
98
|
+
object.__setattr__(self, "target_coords", target_coords)
|
|
97
99
|
|
|
98
100
|
data = self._get_data()
|
|
99
101
|
data.choose_subdomain(
|
|
100
|
-
latitude_range=[
|
|
101
|
-
|
|
102
|
+
latitude_range=[
|
|
103
|
+
target_coords["lat"].min().values,
|
|
104
|
+
target_coords["lat"].max().values,
|
|
105
|
+
],
|
|
106
|
+
longitude_range=[
|
|
107
|
+
target_coords["lon"].min().values,
|
|
108
|
+
target_coords["lon"].max().values,
|
|
109
|
+
],
|
|
102
110
|
margin=2,
|
|
103
|
-
straddle=straddle,
|
|
111
|
+
straddle=target_coords["straddle"],
|
|
104
112
|
)
|
|
105
|
-
if self.type == "physics":
|
|
106
|
-
vars_2d = ["uwnd", "vwnd", "swrad", "lwrad", "Tair", "qair", "rain"]
|
|
107
|
-
elif self.type == "bgc":
|
|
108
|
-
vars_2d = data.var_names.keys()
|
|
109
|
-
vars_3d = []
|
|
110
113
|
|
|
111
|
-
|
|
114
|
+
variable_info = self._set_variable_info(data)
|
|
112
115
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
+
data_vars = {}
|
|
117
|
+
for var_name in data.var_names:
|
|
118
|
+
if var_name != "mask":
|
|
119
|
+
data_vars[var_name] = data.ds[data.var_names[var_name]]
|
|
120
|
+
|
|
121
|
+
data_vars = _lateral_fill(data_vars, data)
|
|
122
|
+
|
|
123
|
+
# lateral regridding
|
|
124
|
+
var_names = variable_info.keys()
|
|
125
|
+
data_vars = _lateral_regrid(
|
|
126
|
+
data, target_coords["lon"], target_coords["lat"], data_vars, var_names
|
|
127
|
+
)
|
|
128
|
+
|
|
129
|
+
# rotation of velocities and interpolation to u/v points
|
|
130
|
+
if "uwnd" in variable_info and "vwnd" in variable_info:
|
|
131
|
+
data_vars["uwnd"], data_vars["vwnd"] = rotate_velocities(
|
|
132
|
+
data_vars["uwnd"],
|
|
133
|
+
data_vars["vwnd"],
|
|
134
|
+
target_coords["angle"],
|
|
135
|
+
interpolate=False,
|
|
116
136
|
)
|
|
117
|
-
if self.correct_radiation:
|
|
118
|
-
correction_data = self._get_correction_data()
|
|
119
|
-
# choose same subdomain as forcing data so that we can use same mask
|
|
120
|
-
coords_correction = {
|
|
121
|
-
correction_data.dim_names["latitude"]: data.ds[
|
|
122
|
-
data.dim_names["latitude"]
|
|
123
|
-
],
|
|
124
|
-
correction_data.dim_names["longitude"]: data.ds[
|
|
125
|
-
data.dim_names["longitude"]
|
|
126
|
-
],
|
|
127
|
-
}
|
|
128
|
-
correction_data.choose_subdomain(coords_correction, straddle=straddle)
|
|
129
|
-
# apply mask from ERA5 data
|
|
130
|
-
if "mask" in data.var_names.keys():
|
|
131
|
-
mask = data.ds["mask"]
|
|
132
|
-
for var in correction_data.ds.data_vars:
|
|
133
|
-
correction_data.ds[var] = xr.where(
|
|
134
|
-
mask == 1, correction_data.ds[var], np.nan
|
|
135
|
-
)
|
|
136
|
-
correction_data.ds["mask"] = mask
|
|
137
|
-
vars_2d = ["swr_corr"]
|
|
138
|
-
vars_3d = []
|
|
139
|
-
# spatial interpolation
|
|
140
|
-
data_vars_corr = super()._regrid_data(
|
|
141
|
-
correction_data, vars_2d, vars_3d, lon, lat
|
|
142
|
-
)
|
|
143
|
-
# temporal interpolation
|
|
144
|
-
corr_factor = interpolate_from_climatology(
|
|
145
|
-
data_vars_corr["swr_corr"],
|
|
146
|
-
correction_data.dim_names["time"],
|
|
147
|
-
time=data_vars["swrad"].time,
|
|
148
|
-
)
|
|
149
137
|
|
|
150
|
-
|
|
138
|
+
# correct radiation
|
|
139
|
+
if self.type == "physics" and self.correct_radiation:
|
|
140
|
+
data_vars = self._apply_correction(data_vars, data)
|
|
151
141
|
|
|
152
142
|
object.__setattr__(data, "data_vars", data_vars)
|
|
153
143
|
|
|
@@ -231,6 +221,99 @@ class SurfaceForcing(ROMSToolsMixins):
|
|
|
231
221
|
|
|
232
222
|
return correction_data
|
|
233
223
|
|
|
224
|
+
def _set_variable_info(self, data):
|
|
225
|
+
"""Sets up a dictionary with metadata for variables based on the type of data
|
|
226
|
+
(physics or BGC).
|
|
227
|
+
|
|
228
|
+
The dictionary contains the following information:
|
|
229
|
+
- `location`: Where the variable resides in the grid (e.g., rho, u, or v points).
|
|
230
|
+
- `is_vector`: Whether the variable is part of a vector (True for velocity components like 'u' and 'v').
|
|
231
|
+
- `vector_pair`: For vector variables, this indicates the associated variable that forms the vector (e.g., 'u' and 'v').
|
|
232
|
+
- `is_3d`: Indicates whether the variable is 3D (True for variables like 'temp' and 'salt') or 2D (False for 'zeta').
|
|
233
|
+
|
|
234
|
+
Returns
|
|
235
|
+
-------
|
|
236
|
+
dict
|
|
237
|
+
A dictionary where the keys are variable names and the values are dictionaries of metadata
|
|
238
|
+
about each variable, including 'location', 'is_vector', 'vector_pair', and 'is_3d'.
|
|
239
|
+
"""
|
|
240
|
+
default_info = {
|
|
241
|
+
"location": "rho",
|
|
242
|
+
"is_vector": False,
|
|
243
|
+
"vector_pair": None,
|
|
244
|
+
"is_3d": False,
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
# Define a dictionary for variable names and their associated information
|
|
248
|
+
if self.type == "physics":
|
|
249
|
+
variable_info = {
|
|
250
|
+
"swrad": default_info,
|
|
251
|
+
"lwrad": default_info,
|
|
252
|
+
"Tair": default_info,
|
|
253
|
+
"qair": default_info,
|
|
254
|
+
"rain": default_info,
|
|
255
|
+
"uwnd": {
|
|
256
|
+
"location": "u",
|
|
257
|
+
"is_vector": True,
|
|
258
|
+
"vector_pair": "vwnd",
|
|
259
|
+
"is_3d": False,
|
|
260
|
+
},
|
|
261
|
+
"vwnd": {
|
|
262
|
+
"location": "v",
|
|
263
|
+
"is_vector": True,
|
|
264
|
+
"vector_pair": "uwnd",
|
|
265
|
+
"is_3d": False,
|
|
266
|
+
},
|
|
267
|
+
}
|
|
268
|
+
elif self.type == "bgc":
|
|
269
|
+
variable_info = {}
|
|
270
|
+
for var in data.var_names.keys():
|
|
271
|
+
variable_info[var] = default_info
|
|
272
|
+
|
|
273
|
+
return variable_info
|
|
274
|
+
|
|
275
|
+
def _apply_correction(self, data_vars, data):
|
|
276
|
+
|
|
277
|
+
correction_data = self._get_correction_data()
|
|
278
|
+
# choose same subdomain as forcing data so that we can use same mask
|
|
279
|
+
coords_correction = {
|
|
280
|
+
correction_data.dim_names["latitude"]: data.ds[data.dim_names["latitude"]],
|
|
281
|
+
correction_data.dim_names["longitude"]: data.ds[
|
|
282
|
+
data.dim_names["longitude"]
|
|
283
|
+
],
|
|
284
|
+
}
|
|
285
|
+
correction_data.choose_subdomain(
|
|
286
|
+
coords_correction, straddle=self.target_coords["straddle"]
|
|
287
|
+
)
|
|
288
|
+
|
|
289
|
+
# regrid
|
|
290
|
+
lateral_fill = LateralFill(
|
|
291
|
+
data.ds["mask"], # use mask from ERA5 data
|
|
292
|
+
[
|
|
293
|
+
correction_data.dim_names["latitude"],
|
|
294
|
+
correction_data.dim_names["longitude"],
|
|
295
|
+
],
|
|
296
|
+
)
|
|
297
|
+
lateral_regrid = LateralRegrid(
|
|
298
|
+
correction_data, self.target_coords["lon"], self.target_coords["lat"]
|
|
299
|
+
)
|
|
300
|
+
|
|
301
|
+
filled = lateral_fill.apply(
|
|
302
|
+
correction_data.ds[correction_data.var_names["swr_corr"]]
|
|
303
|
+
)
|
|
304
|
+
corr_factor = lateral_regrid.apply(filled)
|
|
305
|
+
|
|
306
|
+
# temporal interpolation
|
|
307
|
+
corr_factor = interpolate_from_climatology(
|
|
308
|
+
corr_factor,
|
|
309
|
+
correction_data.dim_names["time"],
|
|
310
|
+
time=data_vars["swrad"].time,
|
|
311
|
+
)
|
|
312
|
+
|
|
313
|
+
data_vars["swrad"] = data_vars["swrad"] * corr_factor
|
|
314
|
+
|
|
315
|
+
return data_vars
|
|
316
|
+
|
|
234
317
|
def _write_into_dataset(self, data, d_meta):
|
|
235
318
|
|
|
236
319
|
# save in new dataset
|
|
@@ -388,7 +471,9 @@ class SurfaceForcing(ROMSToolsMixins):
|
|
|
388
471
|
else:
|
|
389
472
|
field = field.where(self.grid.ds.mask_rho)
|
|
390
473
|
|
|
391
|
-
field = field.assign_coords(
|
|
474
|
+
field = field.assign_coords(
|
|
475
|
+
{"lon": self.target_coords["lon"], "lat": self.target_coords["lat"]}
|
|
476
|
+
)
|
|
392
477
|
|
|
393
478
|
# choose colorbar
|
|
394
479
|
if varname in ["uwnd", "vwnd"]:
|
roms_tools/setup/tides.py
CHANGED
|
@@ -16,15 +16,19 @@ from roms_tools.setup.utils import (
|
|
|
16
16
|
interpolate_from_rho_to_v,
|
|
17
17
|
get_variable_metadata,
|
|
18
18
|
save_datasets,
|
|
19
|
+
get_target_coords,
|
|
20
|
+
rotate_velocities,
|
|
21
|
+
get_vector_pairs,
|
|
19
22
|
)
|
|
20
|
-
from roms_tools.setup.
|
|
23
|
+
from roms_tools.setup.fill import _lateral_fill
|
|
24
|
+
from roms_tools.setup.regrid import _lateral_regrid
|
|
21
25
|
import matplotlib.pyplot as plt
|
|
22
26
|
from pathlib import Path
|
|
23
27
|
|
|
24
28
|
|
|
25
29
|
@dataclass(frozen=True, kw_only=True)
|
|
26
|
-
class TidalForcing
|
|
27
|
-
"""Represents tidal forcing
|
|
30
|
+
class TidalForcing:
|
|
31
|
+
"""Represents tidal forcing for ROMS.
|
|
28
32
|
|
|
29
33
|
Parameters
|
|
30
34
|
----------
|
|
@@ -68,49 +72,58 @@ class TidalForcing(ROMSToolsMixins):
|
|
|
68
72
|
def __post_init__(self):
|
|
69
73
|
|
|
70
74
|
self._input_checks()
|
|
71
|
-
|
|
75
|
+
target_coords = get_target_coords(self.grid)
|
|
72
76
|
|
|
73
77
|
data = self._get_data()
|
|
74
|
-
|
|
75
78
|
data.check_number_constituents(self.ntides)
|
|
76
79
|
data.choose_subdomain(
|
|
77
|
-
latitude_range=[
|
|
78
|
-
|
|
80
|
+
latitude_range=[
|
|
81
|
+
target_coords["lat"].min().values,
|
|
82
|
+
target_coords["lat"].max().values,
|
|
83
|
+
],
|
|
84
|
+
longitude_range=[
|
|
85
|
+
target_coords["lon"].min().values,
|
|
86
|
+
target_coords["lon"].max().values,
|
|
87
|
+
],
|
|
79
88
|
margin=2,
|
|
80
|
-
straddle=straddle,
|
|
89
|
+
straddle=target_coords["straddle"],
|
|
81
90
|
)
|
|
82
|
-
|
|
83
91
|
# select desired number of constituents
|
|
84
92
|
object.__setattr__(data, "ds", data.ds.isel(ntides=slice(None, self.ntides)))
|
|
85
|
-
|
|
86
93
|
self._correct_tides(data)
|
|
87
94
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
data_vars = super()._regrid_data(data, vars_2d, vars_3d, lon, lat)
|
|
101
|
-
|
|
102
|
-
data_vars = super()._process_velocities(
|
|
103
|
-
data_vars, angle, "u_Re", "v_Re", interpolate=False
|
|
104
|
-
)
|
|
105
|
-
data_vars = super()._process_velocities(
|
|
106
|
-
data_vars, angle, "u_Im", "v_Im", interpolate=False
|
|
95
|
+
variable_info = self._set_variable_info()
|
|
96
|
+
|
|
97
|
+
data_vars = {}
|
|
98
|
+
for var_name in data.var_names:
|
|
99
|
+
data_vars[var_name] = data.ds[data.var_names[var_name]]
|
|
100
|
+
|
|
101
|
+
data_vars = _lateral_fill(data_vars, data)
|
|
102
|
+
|
|
103
|
+
# lateral regridding
|
|
104
|
+
var_names = variable_info.keys()
|
|
105
|
+
data_vars = _lateral_regrid(
|
|
106
|
+
data, target_coords["lon"], target_coords["lat"], data_vars, var_names
|
|
107
107
|
)
|
|
108
108
|
|
|
109
|
-
#
|
|
109
|
+
# rotation of velocities and interpolation to u/v points
|
|
110
|
+
vector_pairs = get_vector_pairs(variable_info)
|
|
111
|
+
for pair in vector_pairs:
|
|
112
|
+
u_component = pair[0]
|
|
113
|
+
v_component = pair[1]
|
|
114
|
+
if u_component in data_vars and v_component in data_vars:
|
|
115
|
+
(data_vars[u_component], data_vars[v_component],) = rotate_velocities(
|
|
116
|
+
data_vars[u_component],
|
|
117
|
+
data_vars[v_component],
|
|
118
|
+
target_coords["angle"],
|
|
119
|
+
interpolate=False,
|
|
120
|
+
)
|
|
121
|
+
|
|
122
|
+
# convert to barotropic velocity
|
|
110
123
|
for varname in ["u_Re", "v_Re", "u_Im", "v_Im"]:
|
|
111
124
|
data_vars[varname] = data_vars[varname] / self.grid.ds.h
|
|
112
125
|
|
|
113
|
-
#
|
|
126
|
+
# interpolate from rho- to velocity points
|
|
114
127
|
for uname in ["u_Re", "u_Im"]:
|
|
115
128
|
data_vars[uname] = interpolate_from_rho_to_u(data_vars[uname])
|
|
116
129
|
for vname in ["v_Re", "v_Im"]:
|
|
@@ -147,6 +160,62 @@ class TidalForcing(ROMSToolsMixins):
|
|
|
147
160
|
raise ValueError('Only "TPXO" is a valid option for source["name"].')
|
|
148
161
|
return data
|
|
149
162
|
|
|
163
|
+
def _set_variable_info(self):
|
|
164
|
+
"""Sets up a dictionary with metadata for variables based on the type.
|
|
165
|
+
|
|
166
|
+
The dictionary contains the following information:
|
|
167
|
+
- `location`: Where the variable resides in the grid (e.g., rho, u, or v points).
|
|
168
|
+
- `is_vector`: Whether the variable is part of a vector (True for velocity components like 'u' and 'v').
|
|
169
|
+
- `vector_pair`: For vector variables, this indicates the associated variable that forms the vector (e.g., 'u' and 'v').
|
|
170
|
+
- `is_3d`: Indicates whether the variable is 3D (True for variables like 'temp' and 'salt') or 2D (False for 'zeta').
|
|
171
|
+
|
|
172
|
+
Returns
|
|
173
|
+
-------
|
|
174
|
+
dict
|
|
175
|
+
A dictionary where the keys are variable names and the values are dictionaries of metadata
|
|
176
|
+
about each variable, including 'location', 'is_vector', 'vector_pair', and 'is_3d'.
|
|
177
|
+
"""
|
|
178
|
+
default_info = {
|
|
179
|
+
"location": "rho",
|
|
180
|
+
"is_vector": False,
|
|
181
|
+
"vector_pair": None,
|
|
182
|
+
"is_3d": False,
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
# Define a dictionary for variable names and their associated information
|
|
186
|
+
variable_info = {
|
|
187
|
+
"ssh_Re": default_info,
|
|
188
|
+
"ssh_Im": default_info,
|
|
189
|
+
"pot_Re": default_info,
|
|
190
|
+
"pot_Im": default_info,
|
|
191
|
+
"u_Re": {
|
|
192
|
+
"location": "u",
|
|
193
|
+
"is_vector": True,
|
|
194
|
+
"vector_pair": "v_Re",
|
|
195
|
+
"is_3d": False,
|
|
196
|
+
},
|
|
197
|
+
"v_Re": {
|
|
198
|
+
"location": "v",
|
|
199
|
+
"is_vector": True,
|
|
200
|
+
"vector_pair": "u_Re",
|
|
201
|
+
"is_3d": False,
|
|
202
|
+
},
|
|
203
|
+
"u_Im": {
|
|
204
|
+
"location": "u",
|
|
205
|
+
"is_vector": True,
|
|
206
|
+
"vector_pair": "v_Im",
|
|
207
|
+
"is_3d": False,
|
|
208
|
+
},
|
|
209
|
+
"v_Im": {
|
|
210
|
+
"location": "v",
|
|
211
|
+
"is_vector": True,
|
|
212
|
+
"vector_pair": "u_Im",
|
|
213
|
+
"is_3d": False,
|
|
214
|
+
},
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
return variable_info
|
|
218
|
+
|
|
150
219
|
def _write_into_dataset(self, data_vars, d_meta):
|
|
151
220
|
|
|
152
221
|
# save in new dataset
|
|
@@ -457,6 +526,9 @@ class TidalForcing(ROMSToolsMixins):
|
|
|
457
526
|
|
|
458
527
|
# Update var_names dictionary
|
|
459
528
|
var_names = {**data.var_names, "pot_Re": "pot_Re", "pot_Im": "pot_Im"}
|
|
529
|
+
var_names.pop("sal_Re", None) # Remove "sal_Re" if it exists
|
|
530
|
+
var_names.pop("sal_Im", None) # Remove "sal_Im" if it exists
|
|
531
|
+
|
|
460
532
|
object.__setattr__(data, "var_names", var_names)
|
|
461
533
|
|
|
462
534
|
|