Commit e8c66beb authored by thopri's avatar thopri
Browse files

ammended CMEMS downloader to work with remapped variables

parent a01a3491
......@@ -76,7 +76,11 @@ The location of the NCML file is listed a string defining the source directory o
defined here as "sn_dst_dir", **NOTE** if this directory does not exist it will need to be created and permissoned correctly
for PyNEMO to run properly. The NCML file details the input files to agregate and what the variable names are. This file
can be generated using the ncml_generator, with variable names found using the CMEMS catalogue. https://resources.marine.copernicus.eu/?option=com_csw&task=results
For more information please read the ncml generator page. The example CMEMS.ncml file includes: temperature, SSH and U and V components of ocean currents.
For more information please read the ncml generator page.
**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.
......@@ -112,7 +116,7 @@ product and prefix options. These define which CMEMS model and product to downlo
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 PyNEMO 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 compatable due to differences in how the model variables are stored.
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
--------------------------------------------
......
......@@ -12,8 +12,12 @@ Boundary file generation
------------------------
This command line tool reads a BDY file, extracts boundary data and prepares the data for a NEMO simulation. The bdy file
is a plain text file containing key value pairs. Please look at the sample namelists in the github repository. They are
stored in the inputs directory. There are three different examples, they all use the same child grid but ultilise different
data sources. One uses local data, the other uses data hosted on a THREDDS server. The last one is configured to download
stored in the inputs directory. PyNEMO now also requires an NCML file (Netcdf markup) that defines the variables and
remaps their names so that they are compatable with PyNEMO. This is common with CMEMS runs as the variable names for tracers etc
are different.
There are three examples of ncml files in the inputs folder and they can also be created with the NCML GUI. They all use the same child grid
but ultilise different data sources. One uses local data, the other uses data hosted on a THREDDS server. The last one is configured to download
CMEMS data first and then run using the downloaded data. The namelist file shares common syntax with the NEMO simulation namelist input file.
.. note:: Directory paths in bdy file can be relative or absolute.
......
......@@ -213,7 +213,7 @@ def request_cmems(args, date_min, date_max):
for n in range(num_var):
F = root.getchildren()[0].getchildren()[n].getchildren()[0].getchildren()[0].attrib
var_name = root.getchildren()[n+1].attrib['name']
var_name = root.getchildren()[n+1].attrib['orgName']
Type = root.getchildren()[0].getchildren()[n].getchildren()[0].attrib
logger.info('Variable '+ str(n+1)+' is '+Type['name']+' (Variable name: '+var_name+')')
r = re.findall('([A-Z])', F['regExp'])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment