roms-tools 1.3.0__py3-none-any.whl → 1.4.1__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.
Files changed (348) hide show
  1. ci/environment.yml +1 -8
  2. roms_tools/_version.py +1 -1
  3. roms_tools/setup/boundary_forcing.py +1 -1
  4. roms_tools/setup/datasets.py +278 -105
  5. roms_tools/setup/download.py +5 -0
  6. roms_tools/setup/fill.py +266 -331
  7. roms_tools/setup/grid.py +92 -8
  8. roms_tools/setup/initial_conditions.py +10 -11
  9. roms_tools/setup/mixins.py +29 -21
  10. roms_tools/setup/surface_forcing.py +3 -5
  11. roms_tools/setup/tides.py +44 -46
  12. roms_tools/setup/topography.py +30 -4
  13. roms_tools/setup/utils.py +41 -23
  14. roms_tools/tests/test_setup/test_boundary_forcing.py +1 -1
  15. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/.zattrs +1 -1
  16. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/.zmetadata +1 -1
  17. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/ALK_ALT_CO2_east/0.0.0 +0 -0
  18. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/ALK_ALT_CO2_north/0.0.0 +0 -0
  19. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/ALK_ALT_CO2_south/0.0.0 +0 -0
  20. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/ALK_ALT_CO2_west/0.0.0 +0 -0
  21. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/ALK_east/0.0.0 +0 -0
  22. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/ALK_north/0.0.0 +0 -0
  23. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/ALK_south/0.0.0 +0 -0
  24. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/ALK_west/0.0.0 +0 -0
  25. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DIC_ALT_CO2_east/0.0.0 +0 -0
  26. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DIC_ALT_CO2_north/0.0.0 +0 -0
  27. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DIC_ALT_CO2_south/0.0.0 +0 -0
  28. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DIC_ALT_CO2_west/0.0.0 +0 -0
  29. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DIC_east/0.0.0 +0 -0
  30. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DIC_north/0.0.0 +0 -0
  31. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DIC_south/0.0.0 +0 -0
  32. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DIC_west/0.0.0 +0 -0
  33. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOC_east/0.0.0 +0 -0
  34. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOC_north/0.0.0 +0 -0
  35. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOC_south/0.0.0 +0 -0
  36. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOC_west/0.0.0 +0 -0
  37. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOCr_east/0.0.0 +0 -0
  38. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOCr_north/0.0.0 +0 -0
  39. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOCr_south/0.0.0 +0 -0
  40. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOCr_west/0.0.0 +0 -0
  41. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DON_east/0.0.0 +0 -0
  42. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DON_north/0.0.0 +0 -0
  43. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DON_south/0.0.0 +0 -0
  44. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DON_west/0.0.0 +0 -0
  45. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DONr_east/0.0.0 +0 -0
  46. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DONr_north/0.0.0 +0 -0
  47. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DONr_south/0.0.0 +0 -0
  48. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DONr_west/0.0.0 +0 -0
  49. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOP_east/0.0.0 +0 -0
  50. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOP_north/0.0.0 +0 -0
  51. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOP_south/0.0.0 +0 -0
  52. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOP_west/0.0.0 +0 -0
  53. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOPr_east/0.0.0 +0 -0
  54. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOPr_north/0.0.0 +0 -0
  55. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOPr_south/0.0.0 +0 -0
  56. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOPr_west/0.0.0 +0 -0
  57. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/Fe_east/0.0.0 +0 -0
  58. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/Fe_north/0.0.0 +0 -0
  59. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/Fe_south/0.0.0 +0 -0
  60. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/Fe_west/0.0.0 +0 -0
  61. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/Lig_east/0.0.0 +0 -0
  62. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/Lig_north/0.0.0 +0 -0
  63. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/Lig_south/0.0.0 +0 -0
  64. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/Lig_west/0.0.0 +0 -0
  65. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/NH4_east/0.0.0 +0 -0
  66. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/NH4_north/0.0.0 +0 -0
  67. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/NH4_south/0.0.0 +0 -0
  68. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/NH4_west/0.0.0 +0 -0
  69. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/NO3_east/0.0.0 +0 -0
  70. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/NO3_north/0.0.0 +0 -0
  71. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/NO3_south/0.0.0 +0 -0
  72. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/NO3_west/0.0.0 +0 -0
  73. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/O2_east/0.0.0 +0 -0
  74. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/O2_north/0.0.0 +0 -0
  75. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/O2_south/0.0.0 +0 -0
  76. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/O2_west/0.0.0 +0 -0
  77. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/PO4_east/0.0.0 +0 -0
  78. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/PO4_north/0.0.0 +0 -0
  79. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/PO4_south/0.0.0 +0 -0
  80. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/PO4_west/0.0.0 +0 -0
  81. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/SiO3_east/0.0.0 +0 -0
  82. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/SiO3_north/0.0.0 +0 -0
  83. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/SiO3_south/0.0.0 +0 -0
  84. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/SiO3_west/0.0.0 +0 -0
  85. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatC_east/0.0.0 +0 -0
  86. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatC_north/0.0.0 +0 -0
  87. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatC_south/0.0.0 +0 -0
  88. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatC_west/0.0.0 +0 -0
  89. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatChl_east/0.0.0 +0 -0
  90. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatChl_north/0.0.0 +0 -0
  91. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatChl_south/0.0.0 +0 -0
  92. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatChl_west/0.0.0 +0 -0
  93. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatFe_east/0.0.0 +0 -0
  94. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatFe_north/0.0.0 +0 -0
  95. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatFe_south/0.0.0 +0 -0
  96. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatFe_west/0.0.0 +0 -0
  97. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatP_east/0.0.0 +0 -0
  98. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatP_north/0.0.0 +0 -0
  99. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatP_south/0.0.0 +0 -0
  100. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatP_west/0.0.0 +0 -0
  101. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatSi_east/0.0.0 +0 -0
  102. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatSi_north/0.0.0 +0 -0
  103. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatSi_south/0.0.0 +0 -0
  104. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatSi_west/0.0.0 +0 -0
  105. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazC_east/0.0.0 +0 -0
  106. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazC_north/0.0.0 +0 -0
  107. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazC_south/0.0.0 +0 -0
  108. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazC_west/0.0.0 +0 -0
  109. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazChl_east/0.0.0 +0 -0
  110. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazChl_north/0.0.0 +0 -0
  111. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazChl_south/0.0.0 +0 -0
  112. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazChl_west/0.0.0 +0 -0
  113. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazFe_east/0.0.0 +0 -0
  114. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazFe_north/0.0.0 +0 -0
  115. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazFe_south/0.0.0 +0 -0
  116. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazFe_west/0.0.0 +0 -0
  117. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazP_east/0.0.0 +0 -0
  118. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazP_north/0.0.0 +0 -0
  119. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazP_south/0.0.0 +0 -0
  120. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazP_west/0.0.0 +0 -0
  121. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spC_east/0.0.0 +0 -0
  122. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spC_north/0.0.0 +0 -0
  123. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spC_south/0.0.0 +0 -0
  124. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spC_west/0.0.0 +0 -0
  125. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spCaCO3_east/0.0.0 +0 -0
  126. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spCaCO3_north/0.0.0 +0 -0
  127. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spCaCO3_south/0.0.0 +0 -0
  128. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spCaCO3_west/0.0.0 +0 -0
  129. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spChl_east/0.0.0 +0 -0
  130. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spChl_north/0.0.0 +0 -0
  131. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spChl_south/0.0.0 +0 -0
  132. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spChl_west/0.0.0 +0 -0
  133. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spFe_east/0.0.0 +0 -0
  134. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spFe_north/0.0.0 +0 -0
  135. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spFe_south/0.0.0 +0 -0
  136. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spFe_west/0.0.0 +0 -0
  137. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spP_east/0.0.0 +0 -0
  138. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spP_north/0.0.0 +0 -0
  139. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spP_south/0.0.0 +0 -0
  140. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spP_west/0.0.0 +0 -0
  141. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/zooC_east/0.0.0 +0 -0
  142. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/zooC_north/0.0.0 +0 -0
  143. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/zooC_south/0.0.0 +0 -0
  144. roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/zooC_west/0.0.0 +0 -0
  145. roms_tools/tests/test_setup/test_data/bgc_surface_forcing.zarr/.zattrs +1 -1
  146. roms_tools/tests/test_setup/test_data/bgc_surface_forcing.zarr/.zmetadata +1 -1
  147. roms_tools/tests/test_setup/test_data/bgc_surface_forcing.zarr/dust/0.0.0 +0 -0
  148. roms_tools/tests/test_setup/test_data/bgc_surface_forcing.zarr/iron/0.0.0 +0 -0
  149. roms_tools/tests/test_setup/test_data/bgc_surface_forcing.zarr/nhy/0.0.0 +0 -0
  150. roms_tools/tests/test_setup/test_data/bgc_surface_forcing.zarr/nox/0.0.0 +0 -0
  151. roms_tools/tests/test_setup/test_data/bgc_surface_forcing.zarr/pco2_air/0.0.0 +0 -0
  152. roms_tools/tests/test_setup/test_data/bgc_surface_forcing.zarr/pco2_air_alt/0.0.0 +0 -0
  153. roms_tools/tests/test_setup/test_data/bgc_surface_forcing_from_climatology.zarr/.zattrs +1 -1
  154. roms_tools/tests/test_setup/test_data/bgc_surface_forcing_from_climatology.zarr/.zmetadata +1 -1
  155. roms_tools/tests/test_setup/test_data/bgc_surface_forcing_from_climatology.zarr/dust/0.0.0 +0 -0
  156. roms_tools/tests/test_setup/test_data/bgc_surface_forcing_from_climatology.zarr/iron/0.0.0 +0 -0
  157. roms_tools/tests/test_setup/test_data/bgc_surface_forcing_from_climatology.zarr/nhy/0.0.0 +0 -0
  158. roms_tools/tests/test_setup/test_data/bgc_surface_forcing_from_climatology.zarr/nox/0.0.0 +0 -0
  159. roms_tools/tests/test_setup/test_data/bgc_surface_forcing_from_climatology.zarr/pco2_air/0.0.0 +0 -0
  160. roms_tools/tests/test_setup/test_data/bgc_surface_forcing_from_climatology.zarr/pco2_air_alt/0.0.0 +0 -0
  161. roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/.zattrs +1 -1
  162. roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/.zmetadata +1 -1
  163. roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/salt_east/0.0.0 +0 -0
  164. roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/salt_north/0.0.0 +0 -0
  165. roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/salt_south/0.0.0 +0 -0
  166. roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/salt_west/0.0.0 +0 -0
  167. roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/temp_east/0.0.0 +0 -0
  168. roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/temp_north/0.0.0 +0 -0
  169. roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/temp_south/0.0.0 +0 -0
  170. roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/temp_west/0.0.0 +0 -0
  171. roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/u_east/0.0.0 +0 -0
  172. roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/u_north/0.0.0 +0 -0
  173. roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/u_south/0.0.0 +0 -0
  174. roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/u_west/0.0.0 +0 -0
  175. roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/ubar_east/0.0 +0 -0
  176. roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/ubar_north/0.0 +0 -0
  177. roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/ubar_south/0.0 +0 -0
  178. roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/ubar_west/0.0 +0 -0
  179. roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/v_east/0.0.0 +0 -0
  180. roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/v_north/0.0.0 +0 -0
  181. roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/v_south/0.0.0 +0 -0
  182. roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/v_west/0.0.0 +0 -0
  183. roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/vbar_east/0.0 +0 -0
  184. roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/vbar_north/0.0 +0 -0
  185. roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/vbar_south/0.0 +0 -0
  186. roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/vbar_west/0.0 +0 -0
  187. roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/zeta_east/0.0 +0 -0
  188. roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/zeta_south/0.0 +0 -0
  189. roms_tools/tests/test_setup/test_data/coarse_surface_forcing.zarr/.zattrs +1 -1
  190. roms_tools/tests/test_setup/test_data/coarse_surface_forcing.zarr/.zmetadata +8 -8
  191. roms_tools/tests/test_setup/test_data/coarse_surface_forcing.zarr/Tair/.zarray +1 -1
  192. roms_tools/tests/test_setup/test_data/coarse_surface_forcing.zarr/Tair/0.0.0 +0 -0
  193. roms_tools/tests/test_setup/test_data/coarse_surface_forcing.zarr/lwrad/.zarray +1 -1
  194. roms_tools/tests/test_setup/test_data/coarse_surface_forcing.zarr/lwrad/0.0.0 +0 -0
  195. roms_tools/tests/test_setup/test_data/coarse_surface_forcing.zarr/qair/.zarray +1 -1
  196. roms_tools/tests/test_setup/test_data/coarse_surface_forcing.zarr/qair/0.0.0 +0 -0
  197. roms_tools/tests/test_setup/test_data/coarse_surface_forcing.zarr/rain/.zarray +1 -1
  198. roms_tools/tests/test_setup/test_data/coarse_surface_forcing.zarr/rain/0.0.0 +0 -0
  199. roms_tools/tests/test_setup/test_data/coarse_surface_forcing.zarr/swrad/.zarray +1 -1
  200. roms_tools/tests/test_setup/test_data/coarse_surface_forcing.zarr/swrad/0.0.0 +0 -0
  201. roms_tools/tests/test_setup/test_data/coarse_surface_forcing.zarr/uwnd/.zarray +1 -1
  202. roms_tools/tests/test_setup/test_data/coarse_surface_forcing.zarr/uwnd/0.0.0 +0 -0
  203. roms_tools/tests/test_setup/test_data/coarse_surface_forcing.zarr/vwnd/.zarray +1 -1
  204. roms_tools/tests/test_setup/test_data/coarse_surface_forcing.zarr/vwnd/0.0.0 +0 -0
  205. roms_tools/tests/test_setup/test_data/corrected_surface_forcing.zarr/.zattrs +1 -1
  206. roms_tools/tests/test_setup/test_data/corrected_surface_forcing.zarr/.zmetadata +8 -8
  207. roms_tools/tests/test_setup/test_data/corrected_surface_forcing.zarr/Tair/.zarray +1 -1
  208. roms_tools/tests/test_setup/test_data/corrected_surface_forcing.zarr/Tair/0.0.0 +0 -0
  209. roms_tools/tests/test_setup/test_data/corrected_surface_forcing.zarr/lwrad/.zarray +1 -1
  210. roms_tools/tests/test_setup/test_data/corrected_surface_forcing.zarr/lwrad/0.0.0 +0 -0
  211. roms_tools/tests/test_setup/test_data/corrected_surface_forcing.zarr/qair/.zarray +1 -1
  212. roms_tools/tests/test_setup/test_data/corrected_surface_forcing.zarr/qair/0.0.0 +0 -0
  213. roms_tools/tests/test_setup/test_data/corrected_surface_forcing.zarr/rain/.zarray +1 -1
  214. roms_tools/tests/test_setup/test_data/corrected_surface_forcing.zarr/rain/0.0.0 +0 -0
  215. roms_tools/tests/test_setup/test_data/corrected_surface_forcing.zarr/swrad/.zarray +1 -1
  216. roms_tools/tests/test_setup/test_data/corrected_surface_forcing.zarr/swrad/0.0.0 +0 -0
  217. roms_tools/tests/test_setup/test_data/corrected_surface_forcing.zarr/uwnd/.zarray +1 -1
  218. roms_tools/tests/test_setup/test_data/corrected_surface_forcing.zarr/uwnd/0.0.0 +0 -0
  219. roms_tools/tests/test_setup/test_data/corrected_surface_forcing.zarr/vwnd/.zarray +1 -1
  220. roms_tools/tests/test_setup/test_data/corrected_surface_forcing.zarr/vwnd/0.0.0 +0 -0
  221. roms_tools/tests/test_setup/test_data/grid.zarr/.zattrs +2 -2
  222. roms_tools/tests/test_setup/test_data/grid.zarr/.zmetadata +62 -2
  223. roms_tools/tests/test_setup/test_data/grid.zarr/lat_psi/.zarray +22 -0
  224. roms_tools/tests/test_setup/test_data/grid.zarr/lat_psi/.zattrs +8 -0
  225. roms_tools/tests/test_setup/test_data/grid.zarr/lat_psi/0.0 +0 -0
  226. roms_tools/tests/test_setup/test_data/grid.zarr/lat_u/0.0 +0 -0
  227. roms_tools/tests/test_setup/test_data/grid.zarr/lat_v/0.0 +0 -0
  228. roms_tools/tests/test_setup/test_data/grid.zarr/lon_psi/.zarray +22 -0
  229. roms_tools/tests/test_setup/test_data/grid.zarr/lon_psi/.zattrs +8 -0
  230. roms_tools/tests/test_setup/test_data/grid.zarr/lon_psi/0.0 +0 -0
  231. roms_tools/tests/test_setup/test_data/grid.zarr/lon_u/0.0 +0 -0
  232. roms_tools/tests/test_setup/test_data/grid_that_straddles_dateline.zarr/.zattrs +2 -2
  233. roms_tools/tests/test_setup/test_data/grid_that_straddles_dateline.zarr/.zmetadata +62 -2
  234. roms_tools/tests/test_setup/test_data/grid_that_straddles_dateline.zarr/lat_psi/.zarray +22 -0
  235. roms_tools/tests/test_setup/test_data/grid_that_straddles_dateline.zarr/lat_psi/.zattrs +8 -0
  236. roms_tools/tests/test_setup/test_data/grid_that_straddles_dateline.zarr/lat_psi/0.0 +0 -0
  237. roms_tools/tests/test_setup/test_data/grid_that_straddles_dateline.zarr/lat_u/0.0 +0 -0
  238. roms_tools/tests/test_setup/test_data/grid_that_straddles_dateline.zarr/lat_v/0.0 +0 -0
  239. roms_tools/tests/test_setup/test_data/grid_that_straddles_dateline.zarr/lon_psi/.zarray +22 -0
  240. roms_tools/tests/test_setup/test_data/grid_that_straddles_dateline.zarr/lon_psi/.zattrs +8 -0
  241. roms_tools/tests/test_setup/test_data/grid_that_straddles_dateline.zarr/lon_psi/0.0 +0 -0
  242. roms_tools/tests/test_setup/test_data/grid_that_straddles_dateline.zarr/lon_u/0.0 +0 -0
  243. roms_tools/tests/test_setup/test_data/grid_that_straddles_dateline.zarr/lon_v/0.0 +0 -0
  244. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/.zattrs +1 -1
  245. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/.zmetadata +1 -1
  246. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/ALK/0.0.0.0 +0 -0
  247. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/ALK_ALT_CO2/0.0.0.0 +0 -0
  248. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/DIC/0.0.0.0 +0 -0
  249. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/DIC_ALT_CO2/0.0.0.0 +0 -0
  250. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/DOC/0.0.0.0 +0 -0
  251. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/DOCr/0.0.0.0 +0 -0
  252. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/DON/0.0.0.0 +0 -0
  253. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/DONr/0.0.0.0 +0 -0
  254. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/DOP/0.0.0.0 +0 -0
  255. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/DOPr/0.0.0.0 +0 -0
  256. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/Fe/0.0.0.0 +0 -0
  257. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/Lig/0.0.0.0 +0 -0
  258. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/NH4/0.0.0.0 +0 -0
  259. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/NO3/0.0.0.0 +0 -0
  260. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/O2/0.0.0.0 +0 -0
  261. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/PO4/0.0.0.0 +0 -0
  262. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/SiO3/0.0.0.0 +0 -0
  263. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/diatC/0.0.0.0 +0 -0
  264. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/diatChl/0.0.0.0 +0 -0
  265. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/diatFe/0.0.0.0 +0 -0
  266. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/diatP/0.0.0.0 +0 -0
  267. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/diatSi/0.0.0.0 +0 -0
  268. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/diazC/0.0.0.0 +0 -0
  269. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/diazChl/0.0.0.0 +0 -0
  270. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/diazFe/0.0.0.0 +0 -0
  271. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/diazP/0.0.0.0 +0 -0
  272. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/salt/0.0.0.0 +0 -0
  273. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/spC/0.0.0.0 +0 -0
  274. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/spCaCO3/0.0.0.0 +0 -0
  275. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/spChl/0.0.0.0 +0 -0
  276. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/spFe/0.0.0.0 +0 -0
  277. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/spP/0.0.0.0 +0 -0
  278. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/temp/0.0.0.0 +0 -0
  279. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/u/0.0.0.0 +0 -0
  280. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/ubar/0.0.0 +0 -0
  281. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/v/0.0.0.0 +0 -0
  282. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/vbar/0.0.0 +0 -0
  283. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/zeta/0.0.0 +0 -0
  284. roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/zooC/0.0.0.0 +0 -0
  285. roms_tools/tests/test_setup/test_data/surface_forcing.zarr/.zattrs +1 -1
  286. roms_tools/tests/test_setup/test_data/surface_forcing.zarr/.zmetadata +8 -8
  287. roms_tools/tests/test_setup/test_data/surface_forcing.zarr/Tair/.zarray +1 -1
  288. roms_tools/tests/test_setup/test_data/surface_forcing.zarr/Tair/0.0.0 +0 -0
  289. roms_tools/tests/test_setup/test_data/surface_forcing.zarr/lwrad/.zarray +1 -1
  290. roms_tools/tests/test_setup/test_data/surface_forcing.zarr/lwrad/0.0.0 +0 -0
  291. roms_tools/tests/test_setup/test_data/surface_forcing.zarr/qair/.zarray +1 -1
  292. roms_tools/tests/test_setup/test_data/surface_forcing.zarr/qair/0.0.0 +0 -0
  293. roms_tools/tests/test_setup/test_data/surface_forcing.zarr/rain/.zarray +1 -1
  294. roms_tools/tests/test_setup/test_data/surface_forcing.zarr/rain/0.0.0 +0 -0
  295. roms_tools/tests/test_setup/test_data/surface_forcing.zarr/swrad/.zarray +1 -1
  296. roms_tools/tests/test_setup/test_data/surface_forcing.zarr/swrad/0.0.0 +0 -0
  297. roms_tools/tests/test_setup/test_data/surface_forcing.zarr/uwnd/.zarray +1 -1
  298. roms_tools/tests/test_setup/test_data/surface_forcing.zarr/uwnd/0.0.0 +0 -0
  299. roms_tools/tests/test_setup/test_data/surface_forcing.zarr/vwnd/.zarray +1 -1
  300. roms_tools/tests/test_setup/test_data/surface_forcing.zarr/vwnd/0.0.0 +0 -0
  301. roms_tools/tests/test_setup/test_data/tidal_forcing.zarr/.zattrs +1 -1
  302. roms_tools/tests/test_setup/test_data/tidal_forcing.zarr/.zmetadata +2 -4
  303. roms_tools/tests/test_setup/test_data/tidal_forcing.zarr/omega/.zattrs +1 -3
  304. roms_tools/tests/test_setup/test_data/tidal_forcing.zarr/pot_Im/0.0.0 +0 -0
  305. roms_tools/tests/test_setup/test_data/tidal_forcing.zarr/pot_Re/0.0.0 +0 -0
  306. roms_tools/tests/test_setup/test_data/tidal_forcing.zarr/ssh_Im/0.0.0 +0 -0
  307. roms_tools/tests/test_setup/test_data/tidal_forcing.zarr/ssh_Re/0.0.0 +0 -0
  308. roms_tools/tests/test_setup/test_data/tidal_forcing.zarr/u_Im/0.0.0 +0 -0
  309. roms_tools/tests/test_setup/test_data/tidal_forcing.zarr/u_Re/0.0.0 +0 -0
  310. roms_tools/tests/test_setup/test_data/tidal_forcing.zarr/v_Im/0.0.0 +0 -0
  311. roms_tools/tests/test_setup/test_data/tidal_forcing.zarr/v_Re/0.0.0 +0 -0
  312. roms_tools/tests/test_setup/test_datasets.py +280 -211
  313. roms_tools/tests/test_setup/test_fill.py +177 -0
  314. roms_tools/tests/test_setup/test_grid.py +56 -0
  315. roms_tools/tests/test_setup/test_initial_conditions.py +5 -3
  316. roms_tools/tests/test_setup/test_surface_forcing.py +4 -4
  317. roms_tools/tests/test_setup/test_tides.py +5 -2
  318. roms_tools/tests/test_setup/test_topography.py +40 -0
  319. roms_tools/tests/test_setup/test_validation.py +1 -1
  320. roms_tools/tests/test_utils.py +30 -0
  321. roms_tools/utils.py +39 -3
  322. roms_tools-1.4.1.dist-info/LICENSE +201 -0
  323. {roms_tools-1.3.0.dist-info → roms_tools-1.4.1.dist-info}/METADATA +13 -3
  324. {roms_tools-1.3.0.dist-info → roms_tools-1.4.1.dist-info}/RECORD +326 -334
  325. {roms_tools-1.3.0.dist-info → roms_tools-1.4.1.dist-info}/WHEEL +1 -1
  326. roms_tools/tests/test_setup/test_data/coarse_surface_forcing.zarr/Tair/1.0.0 +0 -0
  327. roms_tools/tests/test_setup/test_data/coarse_surface_forcing.zarr/lwrad/1.0.0 +0 -0
  328. roms_tools/tests/test_setup/test_data/coarse_surface_forcing.zarr/qair/1.0.0 +0 -0
  329. roms_tools/tests/test_setup/test_data/coarse_surface_forcing.zarr/rain/1.0.0 +0 -0
  330. roms_tools/tests/test_setup/test_data/coarse_surface_forcing.zarr/swrad/1.0.0 +0 -0
  331. roms_tools/tests/test_setup/test_data/coarse_surface_forcing.zarr/uwnd/1.0.0 +0 -0
  332. roms_tools/tests/test_setup/test_data/coarse_surface_forcing.zarr/vwnd/1.0.0 +0 -0
  333. roms_tools/tests/test_setup/test_data/corrected_surface_forcing.zarr/Tair/1.0.0 +0 -0
  334. roms_tools/tests/test_setup/test_data/corrected_surface_forcing.zarr/lwrad/1.0.0 +0 -0
  335. roms_tools/tests/test_setup/test_data/corrected_surface_forcing.zarr/qair/1.0.0 +0 -0
  336. roms_tools/tests/test_setup/test_data/corrected_surface_forcing.zarr/rain/1.0.0 +0 -0
  337. roms_tools/tests/test_setup/test_data/corrected_surface_forcing.zarr/swrad/1.0.0 +0 -0
  338. roms_tools/tests/test_setup/test_data/corrected_surface_forcing.zarr/uwnd/1.0.0 +0 -0
  339. roms_tools/tests/test_setup/test_data/corrected_surface_forcing.zarr/vwnd/1.0.0 +0 -0
  340. roms_tools/tests/test_setup/test_data/surface_forcing.zarr/Tair/1.0.0 +0 -0
  341. roms_tools/tests/test_setup/test_data/surface_forcing.zarr/lwrad/1.0.0 +0 -0
  342. roms_tools/tests/test_setup/test_data/surface_forcing.zarr/qair/1.0.0 +0 -0
  343. roms_tools/tests/test_setup/test_data/surface_forcing.zarr/rain/1.0.0 +0 -0
  344. roms_tools/tests/test_setup/test_data/surface_forcing.zarr/swrad/1.0.0 +0 -0
  345. roms_tools/tests/test_setup/test_data/surface_forcing.zarr/uwnd/1.0.0 +0 -0
  346. roms_tools/tests/test_setup/test_data/surface_forcing.zarr/vwnd/1.0.0 +0 -0
  347. roms_tools-1.3.0.dist-info/LICENSE +0 -674
  348. {roms_tools-1.3.0.dist-info → roms_tools-1.4.1.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,177 @@
1
+ import pytest
2
+ from roms_tools.setup.datasets import (
3
+ GLORYSDataset,
4
+ ERA5Dataset,
5
+ CESMBGCDataset,
6
+ CESMBGCSurfaceForcingDataset,
7
+ TPXODataset,
8
+ )
9
+ from roms_tools.setup.download import download_test_data
10
+ from roms_tools.setup.fill import LateralFill
11
+ from roms_tools.setup.utils import extrapolate_deepest_to_bottom
12
+ from datetime import datetime
13
+ import numpy as np
14
+ import xarray as xr
15
+
16
+
17
+ @pytest.fixture()
18
+ def era5_data(request, use_dask):
19
+ fname = download_test_data("ERA5_regional_test_data.nc")
20
+ data = ERA5Dataset(
21
+ filename=fname,
22
+ start_time=datetime(2020, 1, 31),
23
+ end_time=datetime(2020, 2, 2),
24
+ use_dask=use_dask,
25
+ )
26
+ data.post_process()
27
+
28
+ return data
29
+
30
+
31
+ @pytest.fixture()
32
+ def glorys_data(request, use_dask):
33
+ fname = download_test_data("GLORYS_NA_2012.nc")
34
+
35
+ data = GLORYSDataset(
36
+ filename=fname,
37
+ start_time=datetime(2012, 1, 1),
38
+ end_time=datetime(2013, 1, 1),
39
+ use_dask=use_dask,
40
+ )
41
+ data.post_process()
42
+
43
+ # extrapolate deepest value to bottom so all levels can use the same surface mask
44
+ for var in data.var_names:
45
+ if var != "zeta":
46
+ data.ds[data.var_names[var]] = extrapolate_deepest_to_bottom(
47
+ data.ds[data.var_names[var]], data.dim_names["depth"]
48
+ )
49
+
50
+ return data
51
+
52
+
53
+ @pytest.fixture()
54
+ def tpxo_data(request, use_dask):
55
+ fname = download_test_data("TPXO_regional_test_data.nc")
56
+
57
+ data = TPXODataset(
58
+ filename=fname,
59
+ use_dask=use_dask,
60
+ )
61
+ data.post_process()
62
+
63
+ return data
64
+
65
+
66
+ @pytest.fixture()
67
+ def cesm_bgc_data(request, use_dask):
68
+ fname = download_test_data("CESM_BGC_2012.nc")
69
+
70
+ data = CESMBGCDataset(
71
+ filename=fname,
72
+ start_time=datetime(2012, 1, 1),
73
+ end_time=datetime(2013, 1, 1),
74
+ climatology=False,
75
+ use_dask=use_dask,
76
+ )
77
+ data.post_process()
78
+
79
+ # extrapolate deepest value to bottom so all levels can use the same surface mask
80
+ for var in data.var_names:
81
+ data.ds[data.var_names[var]] = extrapolate_deepest_to_bottom(
82
+ data.ds[data.var_names[var]], data.dim_names["depth"]
83
+ )
84
+
85
+ return data
86
+
87
+
88
+ @pytest.fixture()
89
+ def cesm_surface_bgc_data(request, use_dask):
90
+ fname = download_test_data("CESM_BGC_SURFACE_2012.nc")
91
+
92
+ data = CESMBGCSurfaceForcingDataset(
93
+ filename=fname,
94
+ start_time=datetime(2012, 1, 1),
95
+ end_time=datetime(2013, 1, 1),
96
+ climatology=False,
97
+ use_dask=use_dask,
98
+ )
99
+ data.post_process()
100
+
101
+ return data
102
+
103
+
104
+ @pytest.mark.parametrize(
105
+ "data_fixture",
106
+ ["era5_data", "glorys_data", "tpxo_data", "cesm_bgc_data", "cesm_surface_bgc_data"],
107
+ )
108
+ def test_lateral_fill_no_nans(data_fixture, request, use_dask):
109
+ data = request.getfixturevalue(data_fixture)
110
+ lateral_fill = LateralFill(
111
+ data.ds["mask"],
112
+ [data.dim_names["latitude"], data.dim_names["longitude"]],
113
+ )
114
+
115
+ for var in data.var_names:
116
+ filled = lateral_fill.apply(data.ds[data.var_names[var]].astype(np.float64))
117
+ assert not filled.isnull().any()
118
+
119
+
120
+ def test_lateral_fill_correct_order_of_magnitude(cesm_bgc_data):
121
+
122
+ lateral_fill = LateralFill(
123
+ cesm_bgc_data.ds["mask"],
124
+ [cesm_bgc_data.dim_names["latitude"], cesm_bgc_data.dim_names["longitude"]],
125
+ )
126
+
127
+ ALK = cesm_bgc_data.ds["ALK"]
128
+
129
+ # zero out alkalinity field in all depth levels but the uppermost
130
+ ALK = xr.where(cesm_bgc_data.ds.ALK.depth > 25, 0, cesm_bgc_data.ds.ALK)
131
+ ALK = ALK.where(cesm_bgc_data.ds.mask)
132
+
133
+ filled = lateral_fill.apply(ALK.astype(np.float64))
134
+
135
+ # check that alkalinity values in the uppermost values are of the correct order of magnitude
136
+ # and that no new minima and maxima are introduced
137
+ assert filled.isel(depth=0).min() == ALK.isel(depth=0).min()
138
+ assert filled.isel(depth=0).max() == ALK.isel(depth=0).max()
139
+
140
+ # check that the filled alkalinity values are zero in all deeper layers
141
+ assert filled.isel(depth=slice(1, None)).equals(
142
+ xr.zeros_like(filled.isel(depth=slice(1, None)))
143
+ )
144
+
145
+
146
+ @pytest.mark.parametrize(
147
+ "data_fixture",
148
+ [
149
+ "era5_data",
150
+ "glorys_data",
151
+ ],
152
+ )
153
+ def test_lateral_fill_reproducibility(data_fixture, request, use_dask):
154
+
155
+ data = request.getfixturevalue(data_fixture)
156
+ lateral_fill0 = LateralFill(
157
+ data.ds["mask"],
158
+ [data.dim_names["latitude"], data.dim_names["longitude"]],
159
+ )
160
+ lateral_fill1 = LateralFill(
161
+ data.ds["mask"],
162
+ [data.dim_names["latitude"], data.dim_names["longitude"]],
163
+ )
164
+
165
+ ds0 = data.ds.copy()
166
+ ds1 = data.ds.copy()
167
+
168
+ for var in data.var_names:
169
+
170
+ ds0[data.var_names[var]] = lateral_fill0.apply(
171
+ ds0[data.var_names[var]].astype(np.float64)
172
+ )
173
+ ds1[data.var_names[var]] = lateral_fill1.apply(
174
+ ds1[data.var_names[var]].astype(np.float64)
175
+ )
176
+
177
+ assert ds0.equals(ds1)
@@ -8,6 +8,26 @@ from conftest import calculate_file_hash
8
8
  from pathlib import Path
9
9
 
10
10
 
11
+ @pytest.fixture()
12
+ def counter_clockwise_rotated_grid():
13
+
14
+ grid = Grid(
15
+ nx=1, ny=1, size_x=100, size_y=100, center_lon=-20, center_lat=0, rot=20
16
+ )
17
+
18
+ return grid
19
+
20
+
21
+ @pytest.fixture()
22
+ def clockwise_rotated_grid():
23
+
24
+ grid = Grid(
25
+ nx=1, ny=1, size_x=100, size_y=100, center_lon=-20, center_lat=0, rot=-20
26
+ )
27
+
28
+ return grid
29
+
30
+
11
31
  def test_grid_creation(grid):
12
32
 
13
33
  assert grid.nx == 1
@@ -20,6 +40,42 @@ def test_grid_creation(grid):
20
40
  assert isinstance(grid.ds, xr.Dataset)
21
41
 
22
42
 
43
+ @pytest.mark.parametrize(
44
+ "grid_fixture",
45
+ ["grid", "counter_clockwise_rotated_grid", "clockwise_rotated_grid"],
46
+ )
47
+ def test_coords_relation(grid_fixture, request):
48
+ """
49
+ Test that the coordinates satisfy the expected relations on a C-grid.
50
+ """
51
+ grid = request.getfixturevalue(grid_fixture)
52
+
53
+ # psi versus rho
54
+ assert grid.ds.lon_psi.min() < grid.ds.lon_rho.min()
55
+ assert grid.ds.lon_psi.max() > grid.ds.lon_rho.max()
56
+ assert grid.ds.lat_psi.min() < grid.ds.lat_rho.min()
57
+ assert grid.ds.lat_psi.max() > grid.ds.lat_rho.max()
58
+
59
+ # Assertion with tolerance is necessary for non-rotated grids
60
+ def assert_larger_equal_than_with_tolerance(value1, value2, tolerance=1e-5):
61
+ assert value1 >= value2 - tolerance
62
+
63
+ def assert_smaller_equal_than_with_tolerance(value1, value2, tolerance=1e-5):
64
+ assert value1 <= value2 + tolerance
65
+
66
+ # u versus rho
67
+ assert_larger_equal_than_with_tolerance(grid.ds.lon_u.min(), grid.ds.lon_rho.min())
68
+ assert_larger_equal_than_with_tolerance(grid.ds.lat_u.min(), grid.ds.lat_rho.min())
69
+ assert_smaller_equal_than_with_tolerance(grid.ds.lon_u.max(), grid.ds.lon_rho.max())
70
+ assert_smaller_equal_than_with_tolerance(grid.ds.lon_u.max(), grid.ds.lon_rho.max())
71
+
72
+ # v versus rho
73
+ assert_larger_equal_than_with_tolerance(grid.ds.lon_v.min(), grid.ds.lon_rho.min())
74
+ assert_larger_equal_than_with_tolerance(grid.ds.lat_v.min(), grid.ds.lat_rho.min())
75
+ assert_smaller_equal_than_with_tolerance(grid.ds.lon_v.max(), grid.ds.lon_rho.max())
76
+ assert_smaller_equal_than_with_tolerance(grid.ds.lon_v.max(), grid.ds.lon_rho.max())
77
+
78
+
23
79
  def test_plot_save_methods(tmp_path):
24
80
 
25
81
  grid = Grid(
@@ -6,8 +6,8 @@ import numpy as np
6
6
  import textwrap
7
7
  from roms_tools.setup.download import download_test_data
8
8
  from roms_tools.setup.datasets import CESMBGCDataset
9
- from conftest import calculate_file_hash
10
9
  from pathlib import Path
10
+ from conftest import calculate_file_hash
11
11
 
12
12
 
13
13
  @pytest.mark.parametrize(
@@ -143,7 +143,7 @@ def test_initial_conditions_default_bgc_climatology(example_grid, use_dask):
143
143
  use_dask=use_dask,
144
144
  )
145
145
 
146
- assert initial_conditions.bgc_source["climatology"] is True
146
+ assert initial_conditions.bgc_source["climatology"] is False
147
147
 
148
148
 
149
149
  def test_interpolation_from_climatology(
@@ -159,6 +159,7 @@ def test_interpolation_from_climatology(
159
159
  start_time=datetime(2012, 1, 15),
160
160
  climatology=True,
161
161
  use_dask=use_dask,
162
+ apply_post_processing=False,
162
163
  )
163
164
  assert np.allclose(ds["ALK"].sel(month=1), bgc_data.ds["ALK"], equal_nan=True)
164
165
 
@@ -168,6 +169,7 @@ def test_interpolation_from_climatology(
168
169
  start_time=datetime(2012, 1, 30),
169
170
  climatology=True,
170
171
  use_dask=use_dask,
172
+ apply_post_processing=False,
171
173
  )
172
174
  assert np.allclose(
173
175
  0.5 * (ds["ALK"].sel(month=1) + ds["ALK"].sel(month=2)),
@@ -272,7 +274,7 @@ def test_roundtrip_yaml(initial_conditions, tmp_path, use_dask):
272
274
 
273
275
  def test_files_have_same_hash(initial_conditions, tmp_path, use_dask):
274
276
 
275
- yaml_filepath = tmp_path / "test_yaml"
277
+ yaml_filepath = tmp_path / "test_yaml.yaml"
276
278
  filepath1 = tmp_path / "test1.nc"
277
279
  filepath2 = tmp_path / "test2.nc"
278
280
 
@@ -3,8 +3,8 @@ from datetime import datetime
3
3
  from roms_tools import Grid, SurfaceForcing
4
4
  from roms_tools.setup.download import download_test_data
5
5
  import textwrap
6
- from conftest import calculate_file_hash
7
6
  from pathlib import Path
7
+ from conftest import calculate_file_hash
8
8
 
9
9
 
10
10
  @pytest.fixture
@@ -13,8 +13,8 @@ def grid_that_straddles_dateline():
13
13
  Fixture for creating a domain that straddles the dateline and lies within the bounds of the regional ERA5 data.
14
14
  """
15
15
  grid = Grid(
16
- nx=5,
17
- ny=5,
16
+ nx=20,
17
+ ny=20,
18
18
  size_x=1800,
19
19
  size_y=2400,
20
20
  center_lon=-10,
@@ -643,7 +643,7 @@ def test_files_have_same_hash(sfc_forcing_fixture, request, tmp_path, use_dask):
643
643
 
644
644
  sfc_forcing = request.getfixturevalue(sfc_forcing_fixture)
645
645
 
646
- yaml_filepath = tmp_path / "test_yaml"
646
+ yaml_filepath = tmp_path / "test_yaml.yaml"
647
647
  filepath1 = tmp_path / "test1.nc"
648
648
  filepath2 = tmp_path / "test2.nc"
649
649
 
@@ -3,8 +3,8 @@ from roms_tools import Grid, TidalForcing
3
3
  import xarray as xr
4
4
  from roms_tools.setup.download import download_test_data
5
5
  import textwrap
6
- from conftest import calculate_file_hash
7
6
  from pathlib import Path
7
+ from conftest import calculate_file_hash
8
8
 
9
9
 
10
10
  @pytest.fixture
@@ -232,10 +232,13 @@ def test_roundtrip_yaml(tidal_forcing, tmp_path, use_dask):
232
232
 
233
233
  def test_files_have_same_hash(tidal_forcing, tmp_path, use_dask):
234
234
 
235
- yaml_filepath = tmp_path / "test_yaml"
235
+ yaml_filepath = tmp_path / "test_yaml.yaml"
236
236
  filepath1 = tmp_path / "test1.nc"
237
237
  filepath2 = tmp_path / "test2.nc"
238
238
 
239
+ print(yaml_filepath)
240
+ print(filepath1)
241
+ print(filepath2)
239
242
  tidal_forcing.to_yaml(yaml_filepath)
240
243
  tidal_forcing.save(filepath1)
241
244
  tidal_forcing_from_file = TidalForcing.from_yaml(yaml_filepath, use_dask=use_dask)
@@ -56,3 +56,43 @@ def test_hmin_criterion():
56
56
 
57
57
  assert grid.hmin == 10.0
58
58
  assert np.less_equal(grid.hmin, grid.ds.h.min())
59
+
60
+
61
+ def test_mask_topography_boundary():
62
+ """
63
+ Test that the mask and topography along the grid boundaries (north, south, east, west)
64
+ are identical to the adjacent inland cells.
65
+ """
66
+
67
+ # Create a grid with some land along the northern boundary
68
+ grid = Grid(
69
+ nx=10, ny=10, size_x=1000, size_y=1000, center_lon=-20, center_lat=60, rot=0
70
+ )
71
+
72
+ # Toopography
73
+ np.testing.assert_array_equal(
74
+ grid.ds.h.isel(eta_rho=0).data, grid.ds.h.isel(eta_rho=1).data
75
+ )
76
+ np.testing.assert_array_equal(
77
+ grid.ds.h.isel(eta_rho=-1).data, grid.ds.h.isel(eta_rho=-2).data
78
+ )
79
+ np.testing.assert_array_equal(
80
+ grid.ds.h.isel(xi_rho=0).data, grid.ds.h.isel(xi_rho=1).data
81
+ )
82
+ np.testing.assert_array_equal(
83
+ grid.ds.h.isel(xi_rho=-1).data, grid.ds.h.isel(xi_rho=-2).data
84
+ )
85
+
86
+ # Mask
87
+ np.testing.assert_array_equal(
88
+ grid.ds.mask_rho.isel(eta_rho=0).data, grid.ds.mask_rho.isel(eta_rho=1).data
89
+ )
90
+ np.testing.assert_array_equal(
91
+ grid.ds.mask_rho.isel(eta_rho=-1).data, grid.ds.mask_rho.isel(eta_rho=-2).data
92
+ )
93
+ np.testing.assert_array_equal(
94
+ grid.ds.mask_rho.isel(xi_rho=0).data, grid.ds.mask_rho.isel(xi_rho=1).data
95
+ )
96
+ np.testing.assert_array_equal(
97
+ grid.ds.mask_rho.isel(xi_rho=-1).data, grid.ds.mask_rho.isel(xi_rho=-2).data
98
+ )
@@ -69,4 +69,4 @@ def test_check_results(forcing_fixture, request):
69
69
 
70
70
  forcing = request.getfixturevalue(forcing_fixture)
71
71
 
72
- xr.testing.assert_allclose(forcing.ds, expected_forcing_ds)
72
+ xr.testing.assert_allclose(forcing.ds, expected_forcing_ds, rtol=1.0e-5)
@@ -23,6 +23,8 @@ class TestPartitionGrid:
23
23
  "xi_rho": 32,
24
24
  "xi_u": 31,
25
25
  "eta_v": 10,
26
+ "eta_psi": 11,
27
+ "xi_psi": 33,
26
28
  "eta_coarse": 6,
27
29
  "xi_coarse": 17,
28
30
  "s_rho": 100,
@@ -33,6 +35,8 @@ class TestPartitionGrid:
33
35
  "xi_rho": 32,
34
36
  "xi_u": 31,
35
37
  "eta_v": 10,
38
+ "eta_psi": 10,
39
+ "xi_psi": 33,
36
40
  "eta_coarse": 5,
37
41
  "xi_coarse": 17,
38
42
  "s_rho": 100,
@@ -43,6 +47,8 @@ class TestPartitionGrid:
43
47
  "xi_rho": 32,
44
48
  "xi_u": 31,
45
49
  "eta_v": 11,
50
+ "eta_psi": 12,
51
+ "xi_psi": 33,
46
52
  "eta_coarse": 6,
47
53
  "xi_coarse": 17,
48
54
  "s_rho": 100,
@@ -57,6 +63,8 @@ class TestPartitionGrid:
57
63
  "xi_rho": 11,
58
64
  "xi_u": 10,
59
65
  "eta_v": 31,
66
+ "eta_psi": 33,
67
+ "xi_psi": 11,
60
68
  "eta_coarse": 17,
61
69
  "xi_coarse": 6,
62
70
  "s_rho": 100,
@@ -67,6 +75,8 @@ class TestPartitionGrid:
67
75
  "xi_rho": 10,
68
76
  "xi_u": 10,
69
77
  "eta_v": 31,
78
+ "eta_psi": 33,
79
+ "xi_psi": 10,
70
80
  "eta_coarse": 17,
71
81
  "xi_coarse": 5,
72
82
  "s_rho": 100,
@@ -77,6 +87,8 @@ class TestPartitionGrid:
77
87
  "xi_rho": 11,
78
88
  "xi_u": 11,
79
89
  "eta_v": 31,
90
+ "eta_psi": 33,
91
+ "xi_psi": 12,
80
92
  "eta_coarse": 17,
81
93
  "xi_coarse": 6,
82
94
  "s_rho": 100,
@@ -96,6 +108,8 @@ class TestPartitionGrid:
96
108
  "xi_rho": 11,
97
109
  "xi_u": 10,
98
110
  "eta_v": 10,
111
+ "eta_psi": 11,
112
+ "xi_psi": 11,
99
113
  "eta_coarse": 6,
100
114
  "xi_coarse": 6,
101
115
  "s_rho": 100,
@@ -107,6 +121,8 @@ class TestPartitionGrid:
107
121
  "xi_u": 10,
108
122
  "eta_v": 10,
109
123
  "eta_coarse": 5,
124
+ "eta_psi": 10,
125
+ "xi_psi": 11,
110
126
  "xi_coarse": 6,
111
127
  "s_rho": 100,
112
128
  "s_w": 101,
@@ -116,6 +132,8 @@ class TestPartitionGrid:
116
132
  "xi_rho": 11,
117
133
  "xi_u": 10,
118
134
  "eta_v": 11,
135
+ "eta_psi": 12,
136
+ "xi_psi": 11,
119
137
  "eta_coarse": 6,
120
138
  "xi_coarse": 6,
121
139
  "s_rho": 100,
@@ -126,6 +144,8 @@ class TestPartitionGrid:
126
144
  "xi_rho": 10,
127
145
  "xi_u": 10,
128
146
  "eta_v": 10,
147
+ "eta_psi": 11,
148
+ "xi_psi": 10,
129
149
  "eta_coarse": 6,
130
150
  "xi_coarse": 5,
131
151
  "s_rho": 100,
@@ -136,6 +156,8 @@ class TestPartitionGrid:
136
156
  "xi_rho": 10,
137
157
  "xi_u": 10,
138
158
  "eta_v": 10,
159
+ "eta_psi": 10,
160
+ "xi_psi": 10,
139
161
  "eta_coarse": 5,
140
162
  "xi_coarse": 5,
141
163
  "s_rho": 100,
@@ -146,6 +168,8 @@ class TestPartitionGrid:
146
168
  "xi_rho": 10,
147
169
  "xi_u": 10,
148
170
  "eta_v": 11,
171
+ "eta_psi": 12,
172
+ "xi_psi": 10,
149
173
  "eta_coarse": 6,
150
174
  "xi_coarse": 5,
151
175
  "s_rho": 100,
@@ -156,6 +180,8 @@ class TestPartitionGrid:
156
180
  "xi_rho": 11,
157
181
  "xi_u": 11,
158
182
  "eta_v": 10,
183
+ "eta_psi": 11,
184
+ "xi_psi": 12,
159
185
  "eta_coarse": 6,
160
186
  "xi_coarse": 6,
161
187
  "s_rho": 100,
@@ -166,6 +192,8 @@ class TestPartitionGrid:
166
192
  "xi_rho": 11,
167
193
  "xi_u": 11,
168
194
  "eta_v": 10,
195
+ "eta_psi": 10,
196
+ "xi_psi": 12,
169
197
  "eta_coarse": 5,
170
198
  "xi_coarse": 6,
171
199
  "s_rho": 100,
@@ -176,6 +204,8 @@ class TestPartitionGrid:
176
204
  "xi_rho": 11,
177
205
  "xi_u": 11,
178
206
  "eta_v": 11,
207
+ "eta_psi": 12,
208
+ "xi_psi": 12,
179
209
  "eta_coarse": 6,
180
210
  "xi_coarse": 6,
181
211
  "s_rho": 100,
roms_tools/utils.py CHANGED
@@ -14,7 +14,7 @@ def partition(
14
14
 
15
15
  This function divides the input dataset into `np_eta` by `np_xi` tiles, where each tile
16
16
  represents a subdomain of the original dataset. The partitioning is performed along
17
- the spatial dimensions `eta_rho`, `xi_rho`, `eta_v`, `xi_u`, `eta_coarse`, and `xi_coarse`,
17
+ the spatial dimensions `eta_rho`, `xi_rho`, `eta_v`, `xi_u`, `eta_psi`, `xi_psi`, `eta_coarse`, and `xi_coarse`,
18
18
  depending on which dimensions are present in the dataset.
19
19
 
20
20
  Parameters
@@ -69,6 +69,8 @@ def partition(
69
69
  "xi_rho",
70
70
  "eta_v",
71
71
  "xi_u",
72
+ "eta_psi",
73
+ "xi_psi",
72
74
  "eta_coarse",
73
75
  "xi_coarse",
74
76
  ]
@@ -123,6 +125,7 @@ def partition(
123
125
  eta_rho_domain_size = integer_division_or_raise(
124
126
  ds.sizes["eta_rho"] - 2 * n_eta_ghost_cells, np_eta, "eta_rho"
125
127
  )
128
+
126
129
  if "xi_rho" in dims_to_partition:
127
130
  xi_rho_domain_size = integer_division_or_raise(
128
131
  ds.sizes["xi_rho"] - 2 * n_xi_ghost_cells, np_xi, "xi_rho"
@@ -132,11 +135,22 @@ def partition(
132
135
  eta_v_domain_size = integer_division_or_raise(
133
136
  ds.sizes["eta_v"] - 1 * n_eta_ghost_cells, np_eta, "eta_v"
134
137
  )
138
+
135
139
  if "xi_u" in dims_to_partition:
136
140
  xi_u_domain_size = integer_division_or_raise(
137
141
  ds.sizes["xi_u"] - 1 * n_xi_ghost_cells, np_xi, "xi_u"
138
142
  )
139
143
 
144
+ if "eta_psi" in dims_to_partition:
145
+ eta_psi_domain_size = integer_division_or_raise(
146
+ ds.sizes["eta_psi"] - 3 * n_eta_ghost_cells, np_eta, "eta_psi"
147
+ )
148
+
149
+ if "xi_psi" in dims_to_partition:
150
+ xi_psi_domain_size = integer_division_or_raise(
151
+ ds.sizes["xi_psi"] - 3 * n_xi_ghost_cells, np_xi, "xi_psi"
152
+ )
153
+
140
154
  if "eta_coarse" in dims_to_partition:
141
155
  eta_coarse_domain_size = integer_division_or_raise(
142
156
  ds.sizes["eta_coarse"] - 2 * n_eta_ghost_cells, np_eta, "eta_coarse"
@@ -167,7 +181,12 @@ def partition(
167
181
  + [eta_rho_domain_size] * (np_eta - 2)
168
182
  + [eta_rho_domain_size + n_eta_ghost_cells]
169
183
  )
170
-
184
+ if "eta_psi" in dims_to_partition:
185
+ partitioned_sizes["eta_psi"] = (
186
+ [n_eta_ghost_cells + eta_psi_domain_size]
187
+ + [eta_psi_domain_size] * (np_eta - 2)
188
+ + [eta_psi_domain_size + 2 * n_eta_ghost_cells]
189
+ )
171
190
  if "eta_coarse" in dims_to_partition:
172
191
  partitioned_sizes["eta_coarse"] = (
173
192
  [eta_coarse_domain_size + n_eta_ghost_cells]
@@ -181,7 +200,12 @@ def partition(
181
200
  + [xi_rho_domain_size] * (np_xi - 2)
182
201
  + [xi_rho_domain_size + n_xi_ghost_cells]
183
202
  )
184
-
203
+ if "xi_psi" in dims_to_partition:
204
+ partitioned_sizes["xi_psi"] = (
205
+ [n_xi_ghost_cells + xi_psi_domain_size]
206
+ + [xi_psi_domain_size] * (np_xi - 2)
207
+ + [xi_psi_domain_size + 2 * n_xi_ghost_cells]
208
+ )
185
209
  if "xi_coarse" in dims_to_partition:
186
210
  partitioned_sizes["xi_coarse"] = (
187
211
  [xi_coarse_domain_size + n_xi_ghost_cells]
@@ -229,6 +253,18 @@ def partition(
229
253
  indexers["xi_u"] = slice(
230
254
  int(xi_u_partition_indices[j]), int(xi_u_partition_indices[j + 1])
231
255
  )
256
+ if "eta_psi" in dims_to_partition:
257
+ eta_psi_partition_indices = cumsum(partitioned_sizes["eta_psi"])
258
+ indexers["eta_psi"] = slice(
259
+ int(eta_psi_partition_indices[i]),
260
+ int(eta_psi_partition_indices[i + 1]),
261
+ )
262
+ if "xi_psi" in dims_to_partition:
263
+ xi_psi_partition_indices = cumsum(partitioned_sizes["xi_psi"])
264
+ indexers["xi_psi"] = slice(
265
+ int(xi_psi_partition_indices[j]),
266
+ int(xi_psi_partition_indices[j + 1]),
267
+ )
232
268
 
233
269
  if "eta_coarse" in dims_to_partition:
234
270
  eta_coarse_partition_indices = cumsum(partitioned_sizes["eta_coarse"])