NOC-MSM / pyBDY

pyBDY: a Python based regional NEMO model configuration toolbox.
GNU General Public License v3.0
7 stars 7 forks source link

Get tpxo7 tides working #78

Closed jpolton closed 2 years ago

jpolton commented 2 years ago

Aim: To get the old TPXO7.2 tides working in py3

On route spotted a few things that are not related to the tides but make the python3 experience better.

Made some changes to the namelist_local.bdy to remove hard linking. Requires benchmarking data to be linked (into the PyNEMO/inputs dir):

cd PyNEMO
ln -s /work/jdha/PyNEMO/inputs/benchmark inputs/.

Requires tide data to be linked (into inputs):

ln -s /work/jelt/tpxo7.2  inputs/.

Also:

mkdir /work/$USER/PyNEMO/outputs

Acceptance Criteria:

  1. livljobs8$ pynemo -s namelist_local.py

This tests ln_tide = true, and 2D,3D time varying boundaries all turned off, and rim_width != 1 NB does not work with ln_tra=true, but that might be something you are fixing independently

  1. It works against known data. (Do you have any?) UPDATE: Found Tom's tide verification code (compares PyNEMO output with FES2014 points.) UPDATE2: It looks OK
jdha commented 2 years ago

@jpolton are you going to pull in the FES bits from the IMMERSE branch? Looks like Tom had added the tide code for FES.

jpolton commented 2 years ago

@jpolton are you going to pull in the FES bits from the IMMERSE branch? Looks like Tom had added the tide code for FES.

I will but maybe not yet. I've decided to get TPXO7.2 working first because it worked under py27 so should be easier. Getting FES2014 or TPXO09 working requires more intrusive changes because the structure of the files is different.

jpolton commented 2 years ago

Ooo. Got the tide code working with rimwidth=1. Will try and generalise for >1.

jdha commented 2 years ago

Ooo. Got the tide code working with rimwidth=1. Will try and generalise for >1.

Maybe I've missed something, but for tides we only want rimwidth=1, no?

jdha commented 2 years ago

Ooo. Got the tide code working with rimwidth=1. Will try and generalise for >1.

@jpolton - just checking that you're not working on generalising? Tides only need to defined on rimwidth=1 nowhere else.

jpolton commented 2 years ago

Ooo. Got the tide code working with rimwidth=1. Will try and generalise for >1.

@jpolton - just checking that you're not working on generalising? Tides only need to defined on rimwidth=1 nowhere else.

I made tides work regardless of what value rim_width takes

jpolton commented 2 years ago

@jdha I've stopped meddling with it now. It should all work beautifully...

jdha commented 2 years ago

Ooo. Got the tide code working with rimwidth=1. Will try and generalise for >1.

@jpolton - just checking that you're not working on generalising? Tides only need to defined on rimwidth=1 nowhere else.

I made tides work regardless of what value rim_width takes

@jpolton - I would prefer that if fails if rimwidth>1 ... in theory this shouldn't matter when NEMO reads in the data. But it seems unnecessary to do additional processing.

jpolton commented 2 years ago

Ooo. Got the tide code working with rimwidth=1. Will try and generalise for >1.

@jpolton - just checking that you're not working on generalising? Tides only need to defined on rimwidth=1 nowhere else.

I made tides work regardless of what value rim_width takes

@jpolton - I would prefer that if fails if rimwidth>1 ... in theory this shouldn't matter when NEMO reads in the data. But it seems unnecessary to do additional processing.

I thought you'd like to push tides and time-varying boundaries through at the same time? (I think that's what the bitbucket code did)

jpolton commented 2 years ago

The file rewriting appears to be me editing all the white space at the end of the line for a few files. E.g.

git diff --ignore-space-at-eol master feature/tide_fes2014 -- pynemo/tide/nemo_bdy_tide3.py

is OK. I need to try and undo these EOL edits as it breaks the history somewhat.

jpolton commented 2 years ago

The file rewriting appears to be me editing all the white space at the end of the line for a few files. E.g.

git diff --ignore-space-at-eol master feature/tide_fes2014 -- pynemo/tide/nemo_bdy_tide3.py

is OK. I need to try and undo these EOL edits as it breaks the history somewhat.

Figured it out how it fix it. Will implement later today.

jpolton commented 2 years ago

Line endings restored

jpolton commented 2 years ago

@jdha I've got a couple off pull requests seeking some expert review. (Michela is keen to try them, so I've pointed her to the source branch on my repo and this review "opportunity")

jpolton commented 2 years ago

Fixed the typo you spotted with lat and lon.