4. Make open boundary conditions - NOC-MSM/SEAsia GitHub Wiki

We made the open ocean boundary conditions using the PyNEMO tool. This includes time varying fields (SSH and barotropic currents) and tidal harmonics (which NEMO reconstructs on-the-fly). An overview of PyNEMO usage.

Even for a simulation is frozen boundaries, you need a coordinates.bdy.nc file (generated here) to tell NEMO where the frozen boundaries are..

Workflow:

  1. Install PyNEMO
  2. Prepare data inputs
  3. Prepare PyNEMO files
  4. Run PyNEMO
  5. Make sure any output is where it is supposed to end up

For NOC users FES2014 data are stored in /work/n01/n01/shared/jelt/FES2014/ or are obtainable from AVISO.


1) Install PyNEMO

We install PyNEMO here on ARCHER2. But note that large jobs should be scheduled and not run on the login node. For more generic install instructions, see the PyNEMO guide: (https://pynemo.readthedocs.io/en/latest/installation.html).


2) Prepare data inputs

Ensure the necessary files are in place. Get all the necessary files onto this machine. For example::

cd $DOMAIN
ln -s domain_cfg_SEAsia.nc domain_cfg.nc
ln -s bathy_meter_SEAsia.nc bathy_meter.nc

#rsync -uvrt archer2:/work/n01/n01/$USER/NEMO-RELOC/BUILD_CFG/DOMAIN/domain_cfg.nc
##rsync -uvrt archer2:/work/n01/n01/$USER/NEMO-RELOC/BUILD_CFG/DOMAIN/coordinates.nc .
#rsync -uvrt archer2:/work/n01/n01/$USER/NEMO-RELOC/BUILD_CFG/DOMAIN/bathy_meter.nc .

Parent tide files

Finally put the parent tides files in place:

cd $WDIR/BUILD_CFG/OPEN_BOUNDARIES/
mkdir FES2014/
cd FES2014

ln -s /work/n01/n01/shared/jelt/FES2014/M2_Z.nc .
ln -s /work/n01/n01/shared/jelt/FES2014/M2_V.nc .
ln -s /work/n01/n01/shared/jelt/FES2014/M2_U.nc .

ln -s /work/n01/n01/shared/jelt/FES2014/S2_Z.nc .
ln -s /work/n01/n01/shared/jelt/FES2014/S2_V.nc .
ln -s /work/n01/n01/shared/jelt/FES2014/S2_U.nc .

ln -s /work/n01/n01/shared/jelt/FES2014/grid_fes.nc .

Parent coordinates file

This is a coordinates file for the parent domain from which time varying (i.e. not harmonic) boundary conditions are extracted. (Note this file is looked for even if no boundary conditions of this type are generated).

scp /projectsa/accord/SEAsia_CMEMS/CMEMS/CMEMS_subdomain_coordinates.nc archer2:/work/n01/n01/$USER/NEMO-RELOC/BUILD_CFG/OPEN_BOUNDARIES/.
scp /projectsa/accord/SEAsia_CMEMS/CMEMS/CMEMS_subdomain_mask.nc        archer2:/work/n01/n01/$USER/NEMO-RELOC/BUILD_CFG/OPEN_BOUNDARIES/.

3. Prepare PyNEMO files

The namelist*.bdy drives PyNEMO and has input files which point to the data sources sn_src_hgr, sn_src_zgr, sn_src_msk. These source files are the parent files for the (non-harmonic) time varying boundaries. Even if only tides are being generated these need to be specified and real because their presence is checked before running the tide bit of code.

The ncml files remap some variable names in the source and destination files.

cd $WDIR/BUILD_CFG/OPEN_BOUNDARIES/

Copy the NCML files that control the output:

cp -r /work/n01/n01/jelt/PyNEMO/pynemo/output_NCML .

4) Run PyNEMO

Run (in conda:env pynemo3):

conda activate pynemo3
export PYTHONPATH=/work/n01/n01/$USER/miniconda3/envs/pynemo3/lib/python3.7/site-packages:$PYTHONPATH

mkdir OUTPUT
pynemo -s namelist_FES14.bdy

GOT HERE. CREATES COORDINATES.BDY.NC BUT NOT TIDES YET. ISSUE WITH THE FINDING THE CMEMS_2018.NCML FILE.

This creates files in OUTPUT:

coordinates.bdy.nc
SEVERN_FES14_bdytide_M2_grd_U.nc
SEVERN_FES14_bdytide_M2_grd_V.nc
SEVERN_FES14_bdytide_M2_grd_Z.nc
SEVERN_FES14_bdytide_S2_grd_U.nc
SEVERN_FES14_bdytide_S2_grd_V.nc
SEVERN_FES14_bdytide_S2_grd_Z.nc

5) Make sure any output is where it is supposed to end up

Copy files to ARCHER2. Files names are not quite what will be expected (*grid_[UVT].nc)so fix that during transfer:

mv SEVERN_FES14_bdytide_M2_grd_U.nc SEVERN_FES14_bdytide_M2_grid_U.nc
mv SEVERN_FES14_bdytide_S2_grd_U.nc SEVERN_FES14_bdytide_S2_grid_U.nc
mv SEVERN_FES14_bdytide_M2_grd_V.nc SEVERN_FES14_bdytide_M2_grid_V.nc
mv SEVERN_FES14_bdytide_S2_grd_V.nc SEVERN_FES14_bdytide_S2_grid_V.nc
mv SEVERN_FES14_bdytide_M2_grd_Z.nc SEVERN_FES14_bdytide_M2_grid_T.nc
mv SEVERN_FES14_bdytide_S2_grd_Z.nc SEVERN_FES14_bdytide_S2_grid_T.nc

scp OUTPUT/SEVERN_FES14_bdy* archer2:/work/n01/n01/$USER/SEVERN-SWOT/INPUTS/TIDES/.
scp OUTPUT/coordinates.bdy.nc archer2:/work/n01/n01/$USER/SEVERN-SWOT/INPUTS/OBC/.
⚠️ **GitHub.com Fallback** ⚠️