Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
59d0da1
Adding first GH page
jdha Feb 4, 2025
a9a41f0
adding docs workflow
jdha Feb 4, 2025
025a3fb
update pre-commit to accept 'unsafe' + docs updates
jdha Feb 4, 2025
fefc7a0
restructuring docs
jdha Feb 4, 2025
b012940
update ci
jdha Feb 4, 2025
e566759
mistake
jdha Feb 4, 2025
3c31cd3
adding ci
jdha Feb 4, 2025
db82d11
ci update
jdha Feb 4, 2025
9090dc4
temporary addtion of docs branch to populate gh pages
jdha Feb 4, 2025
3967725
removing old docs
jdha Feb 4, 2025
642de44
update syntax error
jdha Feb 4, 2025
3ca1c63
formatting
jdha Feb 5, 2025
4c4e49b
formatting
jdha Feb 5, 2025
dd095a2
formatting
jdha Feb 5, 2025
de8485a
formatting
jdha Feb 5, 2025
b1d3173
missing line
jdha Feb 5, 2025
73fda77
Added Contents header and How to use pyBDY documentation
b-barton May 28, 2025
f440b1f
Small changes
b-barton May 28, 2025
abfc40d
Added Tidal Boundary Conditions Generation from the old pyNEMO docs. …
b-barton May 29, 2025
87d1e6f
Added CMEMS Downloader from old pyNEMO page. I'm not sure this is sti…
b-barton May 29, 2025
5abdca1
Changed order. Testing links
b-barton May 29, 2025
a0bab9f
Testing links
b-barton May 29, 2025
4c635f6
Working links
b-barton May 29, 2025
a2a88de
Merge remote-tracking branch 'origin/master' into 185-docs so that th…
b-barton May 29, 2025
7855fc5
Fixed typo
b-barton May 29, 2025
3c36c02
Test adding function docstring from sphinx
b-barton May 29, 2025
0de0496
Comment docstring
b-barton May 29, 2025
bc20b8e
Added __init__.py to grid folder so sphinx can automatrically find it
b-barton May 29, 2025
9a41ca3
Testing adding function list contents
b-barton May 29, 2025
c15a5ed
Adding grid docstrings markdown file
b-barton May 29, 2025
758a567
test formatting
b-barton May 29, 2025
c9c6cef
Made index.md ready for auto appending module structure
b-barton May 29, 2025
cadd2e7
Adding automated docsting documentation of functions
b-barton May 30, 2025
dbef192
Sorted out line returns on arguments
b-barton May 30, 2025
5d514b2
Documentation typos
b-barton May 30, 2025
04526e3
Formatting to headings and indents
b-barton May 30, 2025
4e47fe9
Updated docstrings
b-barton May 30, 2025
45bd0b0
Removed Notes
b-barton May 30, 2025
6fb9f24
Formatting
b-barton May 30, 2025
5c71299
Docstring formatting
b-barton May 30, 2025
294efc0
Formatting
b-barton May 30, 2025
282035a
Docstring edits
b-barton May 30, 2025
3ce7695
Docstring formatting
b-barton May 30, 2025
454b39c
Edited docstrings and removed underscore from methods names so they a…
b-barton May 30, 2025
adc3605
Removing file because it doesn't get used anymore and has an obsolete…
b-barton May 30, 2025
43491b7
More docstring formatting issues
b-barton May 30, 2025
c0e1abc
Updated the docs
b-barton May 30, 2025
d107065
Made functions for automating the documentation of docstrings
b-barton May 30, 2025
3af6183
Updated Makefile for the new doc building script
b-barton May 30, 2025
f435fd0
Removed print
b-barton May 30, 2025
c6dc1aa
Updated docs
b-barton May 30, 2025
b7e7da8
Updated link to documentation page to the new github pages
b-barton Jun 3, 2025
082c46e
Typo, reference name and removed the CMEMS downloader bit
b-barton Jun 3, 2025
7846d56
Started adding an example namelist
b-barton Jun 5, 2025
f823895
Updating worked example
b-barton Jun 5, 2025
66d135e
Removing vertical coordinate set up parts
b-barton Jun 5, 2025
f471fc9
Removing vertical coordinate set up parts
b-barton Jun 5, 2025
d6d43c0
Removed sn_history as it wasn't used and has been replaced by sn_dst_…
b-barton Jun 6, 2025
13ee918
Added info on how to set up NcML file and continued the worked example.
b-barton Jun 6, 2025
c7e5084
Updating the example
b-barton Jun 6, 2025
e2655b0
Removed sn_history
b-barton Jun 6, 2025
f5a3ef8
Updated the docs with extra help on the nmcl and json files.
b-barton Jun 12, 2025
dbbe311
Formatting
b-barton Jun 12, 2025
4f64bf9
Formatting
b-barton Jun 12, 2025
92d11dd
Formatting
b-barton Jun 12, 2025
13f43bc
Formatting
b-barton Jun 12, 2025
b14d810
Added comments on setting up json file
b-barton Jun 16, 2025
0fdf02b
Added decription of ln_dyn2d and ln_dyn3d
b-barton Jun 16, 2025
20c4a6b
Typo
b-barton Jun 26, 2025
c056528
Adding new pybdy logo
b-barton Jun 27, 2025
8a6eb4e
Adding logo to readme
b-barton Jun 27, 2025
b399c75
Adding logos to docs page
b-barton Jun 27, 2025
75def04
Updating logo
b-barton Jun 27, 2025
8d70924
Updating logo
b-barton Jun 27, 2025
173e7e4
Update logo location
b-barton Jun 27, 2025
425d99f
Typo and trying different link for github pages
b-barton Jul 2, 2025
f2ab88d
Different link format and image format
b-barton Jul 2, 2025
0c370e3
Link heading format and trying different format for image
b-barton Jul 2, 2025
b5fc284
Image path
b-barton Jul 2, 2025
7cb1472
Image path
b-barton Jul 2, 2025
f35c2cb
Merge remote-tracking branch 'origin/master' into 185-docs
b-barton Jul 2, 2025
e51b050
Updated for module structure in tabs
b-barton Jul 2, 2025
85ccc14
Updating docs for new functions from master
b-barton Jul 2, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
110 changes: 110 additions & 0 deletions docs/index.md
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CMEMS downloader is on a stale branch - I wouldn't include it here - the tech has moved on in terms of accessing Copernicus Data.

Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@ convient GUI.
- [Quick Start Installation :rocket:](#quick-start-installation-)
- [How to use pyBDY :mechanical_arm:](#how-to-use-pybdy-)
- [Function List :scroll:](#function-list-)
-

## Dependencies :globe_with_meridians:

[Back to top](#pybdy-documentation)

pyBDY is installed under a conda/mamba environment to aid wider distribution and to facilitate development.
The key dependecies are listed below:

Expand All @@ -42,6 +45,8 @@ A recent JAVA installation is also required.

## Quick Start Installation :rocket:

[Back to top](#pybdy-documentation)

To get started, check out and set up an instance of the pyBDY GitHub [repository](https://github.com/NOC-MSM/pyBDY):

```sh
Expand Down Expand Up @@ -111,6 +116,8 @@ conda deactivate

## How to use pyBDY :mechanical_arm:

[Back to top](#pybdy-documentation)

In this documentation "bdy points" refer to the output boundary points generated by pyBDY.
Fist follow the installation instructions [Quick Start Installation](#quick-start-installation-).

Expand Down Expand Up @@ -277,8 +284,12 @@ This command line tool reads a BDY file, extracts boundary data and prepares the

## Function List :scroll:

[Back to top](#pybdy-documentation)

## Tidal Boundary Conditions Generation

[Back to top](#pybdy-documentation)

By providing a global tidal model dataset (TPXO and FES are currently supported) pyBDY can generate boundary conditions for the NEMO configuration supplied using the namelist file.

### Namelist options
Expand Down Expand Up @@ -354,6 +365,105 @@ Phase Exceedance = 5.052 * pyBDY Amplitude ^ -0.60

## CMEMS Downloader

[Back to top](#pybdy-documentation)

IMPORTANT The CMEMS downloader has not been tested recently (May 2025).
IMPORTANT The CMEMS downloader has only been tested with the GLOBAL_ANALYSIS_FORECAST_PHY_001_024 model and specifcally the hourly SSH and U V product. This also has temperature stored within it, but not salinity. Other models and products should work but are currently likely to need some changes to the code to cope with different variable names within the data. This will be fixed in a later release of pyBDY that is able to handle different variable and tracer names.

pyBDY has a CMEMS downloading function incorporated within it, this will download a section of the CMEMS global model (more models to be added) ‘GLOBAL_ANALYSIS_FORECAST_PHY_001_024-TDS’ for the defined time period in the namelist file

To use the downloading function, the following command is used:

```
$ pynemo -d namelist.bdy
```

Where the -d flag tells pyBDY to use the CMEMS downloader and download data as specified in the namelist file. The log file that pyBDY produces provides a log of what the downloader does. The CMEMS MOTU system is prone to disconnects and failure so there is download retry and error handling built in. Most of the options required should not need editing and are there for future use in case URL’s and filenames on CMEMS change.

The options that can be configured are described in further detail below:

```
!------------------------------------------------------------------------------
! I/O
!------------------------------------------------------------------------------
sn_src_dir = '/Users/thopri/Projects/pyBDY/inputs/CMEMS.ncml' ! src_files/'
sn_dst_dir = '/Users/thopri/Projects/pyBDY/outputs'

sn_fn = 'NNA_R12' ! prefix for output files
nn_fv = -1e20 ! set fill value for output files
nn_src_time_adj = 0 ! src time adjustment
sn_dst_metainfo = 'CMEMS example'

!------------------------------------------------------------------------------
! CMEMS Data Source Configuration
!------------------------------------------------------------------------------
ln_use_cmems = .true.
ln_download_cmems = .true.
sn_cmems_dir = '/Users/thopri/Projects/pyBDY/inputs/' ! where to download CMEMS input files (static and variable)
ln_download_static = .true.
ln_subset_static = .true.
nn_num_retry = 4 ! how many times to retry CMEMS download after non critical errors?
!------------------------------------------------------------------------------
! CMEMS MOTU Configuration (for Boundary Data)
!------------------------------------------------------------------------------
sn_motu_server = 'http://nrt.cmems-du.eu/motu-web/Motu'
sn_cmems_config_template = '/Users/thopri/Projects/pyBDY/pynemo/config/motu_config_template.ini'
sn_cmems_config = '/Users/thopri/Projects/pyBDY/pynemo/config/motu_config.ini'
sn_cmems_model = 'GLOBAL_ANALYSIS_FORECAST_PHY_001_024-TDS'
sn_cmems_product = 'global-analysis-forecast-phy-001-024'
sn_dl_prefix = 'subset'
!------------------------------------------------------------------------------
! CMEMS FTP Configuration (for Static Files)
!------------------------------------------------------------------------------
sn_ftp_server = 'nrt.cmems-du.eu'
sn_static_dir = '/Core/GLOBAL_ANALYSIS_FORECAST_PHY_001_024/global-analysis-forecast-phy-001-024-statics'
sn_static_filenames = 'GLO-MFC_001_024_coordinates.nc GLO-MFC_001_024_mask_bathy.nc GLO-MFC_001_024_mdt.nc'
sn_cdo_loc = '/opt/local/bin/cdo' ! location of cdo executable can be found by running "where cdo"
!------------------------------------------------------------------------------
! CMEMS Extent Configuration
!------------------------------------------------------------------------------
nn_latitude_min = 40
nn_latitude_max = 66
nn_longitude_min = -22
nn_longitude_max = 16
nn_depth_min = 0.493
nn_depth_max = 5727.918000000001
```

Some of the options define the behaviour of the downloader, others define locations to save files and others detail models and grid files to download. Finally the spatial extent to download is also required.

#### I/O and NCML file

The location of the NCML file is listed a string defining the source directory or “sn_src_dir”. The output folder is also defined here as “sn_dst_dir”, NOTE if this directory does not exist it will need to be created and permissoned correctly for pyBDY to run properly. The NCML file details the input files to agregate and what the variable names are. Variable names are in [https://resources.marine.copernicus.eu/?option=com_csw&task=results](https://resources.marine.copernicus.eu/?option=com_csw&task=results) For more information please read the ncml part.

NOTE A NCML file must be used and it also must use a regular expression. The CMEMS downloader uses this regular expression to determine what grid a given variable is part of e.g. temperature and salinity on the T grid. The example CMEMS.ncml file includes: an implementation of how to define temperature, SSH and U and V components of ocean currents.

Firstly, the string “sn_fn” defines the prefix for the output files. The number “nn_fv” defines the fill value, and the number “nn_src_time_adj” defines the source time adjustment. The rest of the boxes are CMEMS specific.

#### Data Source Configuration

The first section defines the CMESM data source configuration. The boolean “ln_use_cmems” when set to true will use the CMEMS downloader function to download the requested data, this is defined in the ncml file which can be generated using the NCML generator. Among other things this file defines what data variables to download. This term also changes the variable names to CMEMS specific ones e.g. thetao for temperature and so for salinity. This is in contrast to the NEMO specific ones such as Votemper and Vosaline. When set to false no download occurs and variable names are kept to NEMO specific.

#### MOTU Configuration

In the next section when set to true “ln_download_cmems” will download the boundary tracer data, e.g. time series of temperature and saliniy. When set to false pyBDY will skip this download. The string “sn_cmems_dir” defines where to save these downloaded files. pyBDY requires grid data, this isn’t possible to download using the same method as the tracer data which uses the MOTU python client. To get the grid data, an ftp request is made to download the global grids which are then subset to the relevent size. The booleans “ln_downlad_static” and “ln_subset_static” determine this behavior. Finally there is an int named “nn_num_retry” this defines the number of times to retry downloading the CMEMS data. The data connections are prone to failure so if a non critical error occurs the function will automatically try to redownload. This int defines how many times it will try to do this. Typically this static data and subsetting are only required once so these can be set to true for first download and then set to false when more time series data is required.

As mentioned previously, the time series boundary data is downloaded using MOTU, this is an efficent and robust web server that handles, extracts and transforms oceanographic data. By populating a configuration file, this can be sent to the MOTU server which will return the requested data in the requested format. The section CMEMS MOTU configuration sets this up. Most of these options should not need changing. The location of the MOTU server for CMEMS is defined here, and the location of the config template file and also the location of the config file to submit. The only options that should require changing are the model, product and prefix options. These define which CMEMS model and product to download and the prefix is a user defined string to prefix the downloads. A catalogue of the CMEMS model and products can be found at https://resources.marine.copernicus.eu/?option=com_csw&task=results Currently pyBDY has only been tested using the physical global forecast model although the downloader should be able to download other models and products, it has not been tested and their are known issues with other products that restrict seamless download. e.g. the NorthWest Atlantic model is not currently compatible due to differences in how the model variables are stored.

#### FTP Configuration for Static and Grid files

The next section CMEMS FTP configuration, defines which FTP server, remote directory and files to download. This should require modification unless CMEMS changes the file structure or names. Note it is important that the filenames are separated by a space as this is what pyBDY is expecting. Finally the location of CDO executable which should be installed to enable subsetting to occur. This can be found by running:

```
$ where cdo
```

#### Extent configuration

Finally the last box, this is where the extent to download is configured, it is up to the user to decide but it is suggested this is at least 1 degree wider than the destination or child configuration. The depth range to request is also defined here. This information can be extracted from the CMEMS catalogue. Once set for a given configuration this will not need to be edited.

## Troubleshooting

[Back to top](#pybdy-documentation)

Always check the pyBDY log file. This is usually saved in the working directory of pyBDY as nrct.log. It gives helpful information which may help to diagnose issues. E.g. ValueErrors that are result of a THREDDS server being down and unable to provide data files.
Loading