Scottish Shelf Model. Part 6: Wider Domain and Sub-Domains Integration

Part 6 of the hydrodynamic model developed for Scottish waters.


Appendix: Particle Tracking code

Program PARTICLE_TRAJ Module
Location 'root'/output/FVCOM_particle_tracking/source/ OFFLAG.f90
Description This is the main program for offline particle tracking:
  • Read in control data
  • Read in model data
  • Read pre-calculated metrics if not first run
  • Calculate and save metrics if first run
  • Read initial particle locations
  • Update particle locations
  • Write output files
Called from  
Subroutines and
Functions called
DATA_RUN
NCD_READ_GRID
ALLOC_VARS
NCD_READ_SHAPE
NCD_READ_METRICS
TRIANGLE_GRID_EDGE
NCD_WRITE_METRICS
SET_LAG
LAG_UPDATE
DATA_RUN.f90
NCDIO.f90
ALLOC_VARS.f90
NCDIO.f90
NCDIO.f90
TRIANGLE_GRID_EDGE.f90
NCDIO.f90
OFFLAG.f90
OFFLAG.f90
User input files 'root'/output/FVCOM_particle_tracking/run/'basename'/'runname'_run.dat
'root'/output/FVCOM_particle_tracking/input/'basename'/'runname'_metrics.nc
Model Input 'root'/output/ FVCOM_particle_tracking/input/'basename'/'runname'_dddd.nc
Output 'root'/output/ FVCOM_particle_tracking/input/'basename'/'runname'_metrics.nc
Subroutine SET_LAG Module
Location 'root'/output/ FVCOM_particle_tracking/source/ OFFLAG.f90
Description This subroutine reads initial particle positions and locates in model grid:
  • Reads in initial particle positions
  • Calculates particle locations in model grid
  • Writes first particle positions to output file
Called from PARTICLE_TRAJ
Subroutines and
Functions called
FHE_ROBUST
NCD_READ
INTERP_ELH
NCD_WRITE
OFFLAG.f90
NCDIO.f90
OFFLAG.f90
NCDIO.f90
User input files 'root'/output/FVCOM_particle_tracking/input/'basename'/'runname'.dat
Output 'root'/output/ FVCOM_particle_tracking/output/'basename'/'dirname'/'runname'_LAG.nc
Subroutine LAG_UPDATE Module
Location 'root'/output/FVCOM_particle_tracking/source/ OFFLAG.f90
Description This subroutine calculates new particle positions and locates in model grid:
  • Reads next model output
  • Calculates particle locations in model grid using advection and optional diffusion
  • Writes new particle positions to output file
Called from PARTICLE_TRAJ
Subroutines and
Functions called
NCD_READ
TRAJECT
RAND_WALK
NCD_WRITE
NCDIO.f90
OFFLAG.f90
OFFLAG.f90
NCDIO.f90
User input files 'root'/output/FVCOM_particle_tracking/input/'basename'/'runname'.dat
Model Input 'root'/output/FVCOM_particle_tracking/input/'basename'/'runname'_dddd.nc
Output 'root'/output/ FVCOM_particle_tracking/output/'basename'/'dirname'/'runname'_LAG.nc
Subroutine TRAJECT Module
Location 'root'/output/FVCOM_particle_tracking/source/ OFFLAG.f90
Description This subroutine calculates new particle positions and locates in model grid:
  • Calculates new particle positions using Runge-Kutta
  • Locates particles in model grid
Called from LAG_UPDATE
Subroutines and
Functions called
INTERP_V
INTERP_ELH
FHE_QUICK
FHE_ROBUST
OFFLAG.f90
OFFLAG.f90
OFFLAG.f90
OFFLAG.f90
User input files 'root'/output/FVCOM_particle_tracking/input/'basename'/'runname'.dat
Output 'root'/output/FVCOM_particle_tracking/output/'basename'/'dirname'/'runname'_LAG.nc
Subroutine RAND_WALK  
Location 'root'/output/FVCOM_particle_tracking/source/ OFFLAG.f90
Description This subroutine calculates horizontal and vertical random walk i.e. turbulent diffusion
  • Smooths vertical diffusivity KH (passed from model output)
  • Interpolates KH and its 2 nd vertical derivative using CALL spline (see Ross and Sharples, 2004)
  • Calculates horizontal random walk
  • Calculates vertical random walk
Called from LAG_UPDATE
Subroutines/ Functions called Spline
INTERP_ELH
FHE_QUICK
FHE_ROBUST
UTILS.f90
OFFLAG.f90
OFFLAG.f90
OFFLAG.f90
User input files 'root'/output/FVCOM_particle_tracking/input/'basename'/'runname'.dat
Output 'root'/output/FVCOM_particle_tracking/output/'basename'/'dirname'/'runname'_LAG.nc
flow chart 1 flow chart 2

Contact

Back to top