- subroutine tideset
- Description
- Subroutine Arguments
- Local variables
- Logical units
- Order of Things
- Calls
- Called By
- Options - Logical
- Options - Compiler
- Known Issues

- subroutine czbar
- Description
- Subroutine Arguments
- Local variables
- Logical units
- Order of Things
- Calls
- Called By
- Options - Logical
- Options - Compiler
- Known Issues

- subroutine tidndrp3
- Description
- Subroutine Arguments
- Local variables
- Logical units
- Order of Things
- Calls
- Called By
- Options - Logical
- Options - Compiler
- Known Issues

- subroutine uvset
- Description
- Subroutine Arguments
- Local variables
- Logical units
- Order of Things
- Calls
- Called By
- Options - Logical
- Options - Compiler
- Known Issues

- subroutine vday
- Description
- Subroutine Arguments
- Local variables
- Logical units
- Order of Things
- Calls
- Called By
- Options - Logical
- Options - Compiler
- Known Issues

- subroutine shpen
- Description
- Subroutine Arguments
- Local variables
- Logical units
- Order of Things
- Calls
- Called By
- Options - Logical
- Options - Compiler
- Known Issues

- subroutine ufset
- Description
- Subroutine Arguments
- Local variables
- Logical units
- Order of Things
- Calls
- Called By
- Options - Logical
- Options - Compiler
- Known Issues

- subroutine vset
- Description
- Subroutine Arguments
- Local variables
- Logical units
- Order of Things
- Calls
- Called By
- Options - Logical
- Options - Compiler
- Known Issues

- subroutine tideset_longform
- Description
- Subroutine Arguments
- Local variables
- Logical units
- Order of Things
- Calls
- Called By
- Options - Logical
- Options - Compiler

- subroutine tidndrp3_longform

tidbndrp2.F

subroutine tideset

**ncond**no. of tidal constituents, read in from unit**itidef****sigmam**holding array for speeds of constituents**ampe,ahlove,aklove**equilibrium tidal amplitudes and love numbers read in**alove,alat,along,amp,speed,phase,a**used in calculating lat. and long. factors for equilibrium tide including Love numbers**i,ic,j,jc**counters for loops**nobdUV,nobdZ**no. of boundary UV and Z points derived from grid dimensions l,m.**itide,itidef**logical units 14, 43.**mcond**=15, used as argument in calling UVSET**mcon**array holding the constituent number or array of switches to select individual tidal constituents,NOTE reused in this routine.**indx**which nodal correction (1..15) to use for each of**ncond**tidal constituents. =0 no nodal correction are used for this one (e.g. for residual)**arg**phase, including nodal term, of constituent**atde,btde**f*cos(arg), f*sin(arg) terms**timh**time expressed in hours**z1t,z2t**holding variables for initial elevations and U and V currents at each boundary point.**idate(4)**hour, day, month, year at start of run read in.**nfac**switch for imposition of nodal terms, read in.**ihs,iday,imnth,iyr**=idate(1),idate(2),idate(3),idate(4)**ftc,vplu**f and v+p nodal corrections -calculated for a fixed number of consituents (15)

- 14 tidal constituent data at Z, UV boundary points, including equilibrium tide information subject to switch
- 43 control file including switch for nodal factors and starting date

- Allocate arrays
- Read in harmonic data (equilibrium tide data optional)
- Calculate nodal factors and phases (optional)
- Adjust constituents for nodal factors (optional)
- Compute latitude and longitude factors for equilibrium tide (optional)
- Switch off unwanted constituents by multiplying by zero using
**mcon**

- copy1d copy1di
- copy2ds copy2dr
- Exch3DIS Exch3DIR
- gsynchwrk
- uvset

- b3dinit

**nfac**>0 to invoke nodal corrections- lzbar true to read in and calculate equilibrium tidal factors

- (none)

subroutine czbar

**ncond**no. of tidal constituents**timh**timestep expressed in hours**arg**argument of time**sarg**argument of time *speed of constituent**cost,sist**cos and sin of**sarg**

- none

- Calculate the instantaneous contribution for each constituent at timestep timh
- Calculate the equilibrium tide due to each constituent and sum.

- barot

- none

- none

- none

subroutine tidndrp3

- none

**ncond**no. of tidal constituents**timh**timestep expressed in hours**arg**argument of time**sarg**argument of time *speed of constituent**cost,sist**cos and sin of**sarg****z12,u12,v12**accumulator arrays for summing constituents

- none

- Calculate instantaneous argument of time
- Allocate summing arrays
- Calculate and sum z,u,v constituents
- Zero boundary holding arrays
- Allocate total z,u,v components to boundary holding arrays

- barot

- none

- none

- none

subroutine uvset

**ihs,iday,imnth,iyr**S tart time, day, month and year of run**sigo**Speed of constituents in degrees per hour**f**Nodal factor for amplitude of each constituent**vplu**Phase of each contituent including nodal factor**incon**Number of tidal constituents**mcon**array of the constituent numbers

**year**=iyr, year of required data**vd**day number in year**ndc**Number of constituents**u**Nodal factor U for each constituent**v**Phase of each constituent at 0h gmt on start day of run**zig**speed of constituents in radians per hour**rtd**Factor radians to degrees**ss,h,p,en,p1**Astronomical arguments returned from routine**shpen**

- none

- Calculate day number
- Allocate array of tidal contituent speeds
- Obtain astronomical arguments for date
- Calculate nodal amplitude and phase factors
- calculate phase of each constituent at start time
- Add nodal phase to start phase

- vday
- shpen
- ufset
- vset

- tideset

- none

- none

- none

subroutine vday

**iday,imnth,iy,ivdy**Day, month, year, day number within year

**ivdy**Day number within year

- none

- Calculate day number allowing for leap years and century years

- uvset

- none

- (none)

- none

subroutine shpen

**year**Year of run**vd**Day number in year**s**Mean longitude of Moon**h**Mean longitude of Sun**p**Mean longitude of lunar perigee**en**Mean longitude of ascending node**p1**Mean longitude of solar perigee (perihelion)

**yr**Year of run**ilc**Indicator of leap years**icent**Century count**it**Switch if year greater or less than 2000**iday**Correction for century days**ild**Leap year day counter**ipos**Indicates whether current date is positive or negative from time origin 0h 1st Jan 2000**nn**Integer number of complete cycles of 360 degrees in s,h,p,en,p1 from time origin**iyd**=365*yr**cycle**=360**t**=icent-20, reused as distance in time from time origin in centuries**td**distance in time from time origin in days**delt**Values of delta T in seconds for the first 84 years of the 20th century**delta**Calculated delta T in seconds for given year and day**deltat**Delta T correction included in appropriate formulae

- none

- Declare array of delta T for 20th century
- Calculate distance in time from time origin
- Calculate appropriate values of delta T from 3 different formulae depending on date
- calculate astronomical arguments from formulae
- Set arguments in range 0-360 degrees

- uvset

**ipos**Determines whether date before or after time origin 0h 1st Jan 2000

- none

- none

subroutine ufset

**p**Mean longitude of lunar perigee**cn**Mean longitude of ascending node**b**Nodal factor for phase**a**Nodal factor for amplitude

**pw,nw**p and cn expressed in radians**w1,w2,w3,w4.....w8**Combinations of trigonemtric functions of pw and nw**b**Nodal factor for phase**a**Nodal factor for amplitude

- none

- Calculate combinations of p and cn
- For each constituent calculate a and b
- where necessary set b to the range 0-360 degrees

- uvset

- none

- none

- none

subroutine vset

**s**Mean longitude of Moon**h**Mean longitude of Sun**p**Mean longitude of lunar perigee**en**Mean longitude of ascending node**p1**Mean longitude of solar perigee (perihelion)**v**phase of harmonic constant for 0h on start day of run

**nc**Number of constituents, set at 15

- none

- Calculate v for each constituent from s,h,p,en,p1 directly
- Set v in the range 0-360 degrees

- uvset

- none

- none

subroutine tideset_longform

**Same a tideset, except old boundary condition format is used
**

**ncond**no. of tidal constituents, read in from unit**itidef****sigmam**holding array for speeds of constituents**ampe,ahlove,aklove**equilibrium tidal amplitudes and love numbers read in**alove,alat,along,amp,speed,phase,a**used in calculating lat. and long. factors for equilibrium tide including Love numbers**i,ic,j,jc**counters for loops**nobdUV,nobdZ**no. of boundary UV and Z points derived from grid dimensions l,m.**itide,itidef**logical units 14, 43.**mcond**=15, used as argument in calling UVSET**mcon**array holding the constituent number or array of switches to select individual tidal constituents,NOTE reused in this routine.**indx**which nodal correction (1..15) to use for each of**ncond**tidal constituents. =0 no nodal correction are used for this one (e.g. for residual)**arg**phase, including nodal term, of constituent**atde,btde**f*cos(arg), f*sin(arg) terms**timh**time expressed in hours**z1t,z2t**holding variables for initial elevations and U and V currents at each boundary point.**idate(4)**hour, day, month, year at start of run read in.**nfac**switch for imposition of nodal terms, read in.**ihs,iday,imnth,iyr**=idate(1),idate(2),idate(3),idate(4)**ftc,vplu**f and v+p nodal corrections -calculated for a fixed number of consituents (15)

- 14 tidal constituent data at Z, UV boundary points, including equilibrium tide information subject to switch
- 43 control file including switch for nodal factors and starting date

- Allocate arrays
- Read in harmonic data (equilibrium tide data optional)
- Calculate nodal factors and phases (optional)
- Adjust constituents for nodal factors (optional)
- Compute latitude and longitude factors for equilibrium tide (optional)
- Switch off unwanted constituents by multiplying by zero using
**mcon**

- copy1d copy1di
- copy2ds copy2dr
- Exch3DIS Exch3DIR
- gsynchwrk
- uvset

- b3dinit

**nfac**>0 to invoke nodal corrections- lzbar true to read in and calculate equilibrium tidal factors

- (none)

subroutine tidndrp3_longform

**Same a tidndrp3, except old boundary condition
format is used
**

- none

**ncond**no. of tidal constituents**nobdUV,nobdZ**no. of boundary Uv and Z points derived from grid dimensions l,m.**timh**timestep expressed in hours**arg**argument of time**sarg**argument of time *speed of constituent**cost,sist**cos and sin of**sarg****z12,u12,v12**accumulator arrays for summing constituents

- none

- Calculate instantaneous argument of time
- Allocate summing arrays
- Calculate and sum z,u,v constituents
- Zero boundary holding arrays
- Allocate total z,u,v components to boundary holding arrays

- barot

- none

- none

- none