FJORD TIDAL CASE: Difference between revisions
No edit summary (change visibility) |
No edit summary (change visibility) |
||
| Line 1: | Line 1: | ||
<div class="title">Fjord Tidal Test Case</div> | <div class="title">Fjord Tidal Test Case</div> | ||
<br> | |||
<br> | |||
{| style="width:98%; background:yellow; margin-top:10px; border:1px solid red;" cellpadding="5" cellspacing="0" | {| style="width:98%; background:yellow; margin-top:10px; border:1px solid red;" cellpadding="5" cellspacing="0" | ||
|- | |- | ||
| Line 6: | Line 7: | ||
|} | |} | ||
This tutorial will | There are a few ways to setup tidal forcing in ROMS ([[Tidal_Forcing|...learn more about tides in ROMS]]). This tutorial will explain the simplest way, which is to prescribe (<span class="red">analytically</span>) tidal variations in sea-surface height at a open boundary (this uses a FLATHER/CHAPMAN combination). | ||
I learned this trick from '''hetland''' in this [https://www.myroms.org/forum/viewtopic.php?p=249&sid=a059e4ffb90b2ad96b0a5463875277fe forum post] (at the bottom). | |||
<br> | <br> | ||
<br> | <br> | ||
{{warning}} | {{warning}} <span class="red">RESTRICTIONS:</span> This technique is ONLY applicable in cases with one relatively narrow open boundary (say < 10 km). In this cases, the tidal height along the open boundary is essentially uniform and can be prescribed analytically. | ||
<br> | <br> | ||
<br> | <br> | ||
{{warning}} <span class="red">PREREQUISITES:</span> This tutorial assumes that you have (1) downloaded ROMS, (2) installed it in your computer (or cluster), and (3) tested it by compiling and running one of the included test cases. If you haven't done all the above, check the [[Getting_Started|"Getting Started"]] and [[Tutorials|"Tutorials"]] WikiROMS sections. | |||
<br> | <br> | ||
<br> | <br> | ||
==Geographical Preamble== | |||
This application is for Ship Harbour, an estuarine fjord in Nova Scotia, Canada. [http://maps.google.ca/maps/ms?hl=en&ie=UTF8&msa=0&ll=44.774524,-62.817421&spn=0.177915,0.310707&t=h&z=12&msid=109937017048460614209.00044a9aa08be20958242 Click here] to see the location in Google. Tides are semidiurnal and tidal range is 1.4 m on average and 2 m on spring tides. Ship Harbour is a long embayment (~7 km) with an open (EAST) boundary of ~1 km, therefore it is an ideal candidate for the type of analytical tidal forcing taught in this tutorial. For now I will only include tidal forcing, however, there is a river at the uppermost end of the estuary, which discharges freshwater at an annual average rate of 18 m<sup>3</sup> s<sup>-1</sup>. I plan to write another tutorial on how to add a river, but for now is only tides. | |||
<br> | <br> | ||
<br> | <br> | ||
==Grid Generation== | ==Grid Generation== | ||
The first step to set up a realistic application is to set up a realistic grid. There are several [[Grid_Generation|software packages]] to generate ROMS grids; [[seagrid|SEAGRID]] and [http://www.marine.csiro.au/~sak007/ GRIDGEN] being the most popular ones. | The first step to set up a realistic application is to set up a realistic grid. There are several [[Grid_Generation|software packages]] to generate ROMS grids; [[seagrid|SEAGRID]] and [http://www.marine.csiro.au/~sak007/ GRIDGEN] being the most popular ones. I used the much-less-fancy EASYGRID, which is a bit easier to get up and running. | ||
<br> | <br> | ||
<br> | <br> | ||
DOWNLOAD HERE to get the '''GRID and INITIALIZATION files required for this tutorial'''. Alternatively, you can create your own grid and initialization files for this tutorial using the grid-generation software of your choice. You can download the bathymetry and coastline data for Ship Harbour Fjord [http://easygrid4roms.googlecode.com/files/EASYGRID_v1.rar HERE]. | |||
<br> | <br> | ||
<br> | <br> | ||
{{note}} <span class="red">NOTE:</span> I also wrote a [[easygrid|tutorial for grid generation using EASYGRID]]. The output of that tutorial are the grid and initialization files '''used in this tutorial''' (see above). So if you want to start from scratch, you should begin with the EASYGRID tutorial. | |||
<br> | <br> | ||
<br> | <br> | ||
==Compiling ROMS with tides== | |||
== | Before we compile ROMS, we need to create a header (.h) file with the appropriate cpp definitions that turn ON the analytical tides. Also, we need to modify some analytical Fortran files, where we are going to specify how create the analytical tide. | ||
Before we compile ROMS, we need to create a header (.h) file | |||
=== | ===Creating header (.h) file=== | ||
Create a file named <span class="red">fjord.h</span> and copy-paste the cpp definitions below: | Create a file named <span class="red">fjord.h</span> and copy-paste the cpp definitions below: | ||
Revision as of 17:50, 22 April 2008
April 21, 2008 |
There are a few ways to setup tidal forcing in ROMS (...learn more about tides in ROMS). This tutorial will explain the simplest way, which is to prescribe (analytically) tidal variations in sea-surface height at a open boundary (this uses a FLATHER/CHAPMAN combination).
I learned this trick from hetland in this forum post (at the bottom).
RESTRICTIONS: This technique is ONLY applicable in cases with one relatively narrow open boundary (say < 10 km). In this cases, the tidal height along the open boundary is essentially uniform and can be prescribed analytically.
PREREQUISITES: This tutorial assumes that you have (1) downloaded ROMS, (2) installed it in your computer (or cluster), and (3) tested it by compiling and running one of the included test cases. If you haven't done all the above, check the "Getting Started" and "Tutorials" WikiROMS sections.
Geographical Preamble
This application is for Ship Harbour, an estuarine fjord in Nova Scotia, Canada. Click here to see the location in Google. Tides are semidiurnal and tidal range is 1.4 m on average and 2 m on spring tides. Ship Harbour is a long embayment (~7 km) with an open (EAST) boundary of ~1 km, therefore it is an ideal candidate for the type of analytical tidal forcing taught in this tutorial. For now I will only include tidal forcing, however, there is a river at the uppermost end of the estuary, which discharges freshwater at an annual average rate of 18 m3 s-1. I plan to write another tutorial on how to add a river, but for now is only tides.
Grid Generation
The first step to set up a realistic application is to set up a realistic grid. There are several software packages to generate ROMS grids; SEAGRID and GRIDGEN being the most popular ones. I used the much-less-fancy EASYGRID, which is a bit easier to get up and running.
DOWNLOAD HERE to get the GRID and INITIALIZATION files required for this tutorial. Alternatively, you can create your own grid and initialization files for this tutorial using the grid-generation software of your choice. You can download the bathymetry and coastline data for Ship Harbour Fjord HERE.
NOTE: I also wrote a tutorial for grid generation using EASYGRID. The output of that tutorial are the grid and initialization files used in this tutorial (see above). So if you want to start from scratch, you should begin with the EASYGRID tutorial.
Compiling ROMS with tides
Before we compile ROMS, we need to create a header (.h) file with the appropriate cpp definitions that turn ON the analytical tides. Also, we need to modify some analytical Fortran files, where we are going to specify how create the analytical tide.
Creating header (.h) file
Create a file named fjord.h and copy-paste the cpp definitions below:
/* ** ** Options for Tidal Fjord. ** ** Application flag: FJORD ** Input script: ocean_fjord.in */ #define UV_ADV /* use to turn ON or OFF advection terms */ #define UV_COR /* use to turn ON or OFF Coriolis term */ #define UV_QDRAG /* use to turn ON or OFF quadratic bottom friction */ #define DJ_GRADPS /* use if splines density Jacobian (Shchepetkin, 2000) */ #define UV_VIS2 /* use to turn ON or OFF harmonic horizontal mixing */ #define MIX_S_UV /* momentum mixing on s-surfaces */ #define TS_DIF2 /* use to turn ON or OFF harmonic horizontal mixing */ #define MIX_GEO_TS /* tracer mixing on constant z surfaces */ #define TS_U3HADVECTION /* use if 3rd-order upstream horiz. advection */ #define TS_C4VADVECTION /* use if 4th-order centered vertical advection */ #define TS_MPDATA /* use if recursive MPDATA 3D advection */ #define NONLIN_EOS /* use if using nonlinear equation of state */ #define SALINITY /* use if having salinity */ #define SPLINES /* use to activate parabolic splines reconstruction */ #define AVERAGES /* use if writing out time-averaged data */ #define AVERAGES_FLUXES /* use if writing out time-averaged fluxes */ #define AVERAGES_AKV /* use if writing out time-averaged AKv */ #define AVERAGES_AKT /* use if writing out time-averaged AKt */ #define SOLVE3D /* use if solving 3D primitive equations */ #define MY25_MIXING /* use if Mellor/Yamada Level-2.5 closure */ # define N2S2_HORAVG /* use if Large et al. (1994) interior closure */ # define KANTHA_CLAYSON /* use if Kantha and Clayson stability function */ #define MASKING /* use if analytical masking is enabled */ #define EAST_FSCHAPMAN /*use if free-surface Chapman condition*/ #define EAST_M2FLATHER /*use if 2D momentum Flather condition*/ #define EAST_M3RADIATION /*use if 3D momentum radiation condition*/ #define EAST_TRADIATION /*use if tracers radiation condition*/ #define ANA_FSOBC /*use if analytical free-surface boundary conditions*/ #define ANA_M2OBC /*use if analytical 2D momentum boundary conditions*/
The last 6 cpp definitions are the responsible for the analytical tidal forcing.
If your open boundary is not EAST... change EAST_FSCHAPMAN, EAST_M2FLATHER, EAST_M3RADIATION and EAST_TRADIATION to represent your open boundary (e.g. WEST__FSCHAPMAN for a west open boundary... etc.).
Modify ana_fsobc.h
You will have to edit the file ana_fsobc.h (located in trunk/ROMS/Functionals) to tell ROMS to estimate surface height analytically when running the FJORD case. Below is a snippet of the end of the file... you have to ADD the green code.
#elif defined TEST_CHAN
IF (WESTERN_EDGE) THEN
cff=0.0_r8
DO j=JstrR,JendR
BOUNDARY(ng)%zeta_west(j)=cff
END DO
END IF
IF (EASTERN_EDGE) THEN
cff=-0.4040_r8*MIN(time(ng)/150000.0_r8,1.0_r8)
DO j=JstrR,JendR
BOUNDARY(ng)%zeta_east(j)=cff
END DO
END IF
#elif defined WEDDELL
IF (WESTERN_EDGE) THEN
fac=TANH((tdays(ng)-dstart)/1.0_r8)
omega=2.0_r8*pi*time(ng)/(12.42_r8*3600.0_r8) ! M2 Tide period
val=0.53_r8+(0.53_r8-0.48_r8)/REAL(Iend+1,r8)
phase=(277.0_r8+(277.0_r8-240.0_r8)/REAL(Iend+1,r8))*deg2rad
DO j=JstrR,JendR
BOUNDARY(ng)%zeta_west(j)=fac*val*COS(omega-phase)
END DO
END IF
IF (EASTERN_EDGE) THEN
fac=TANH((tdays(ng)-dstart)/1.0_r8)
omega=2.0_r8*pi*time(ng)/(12.42_r8*3600.0_r8) ! M2 Tide period
val=0.53_r8+(0.53_r8-0.48_r8)
phase=(277.0_r8+(277.0_r8-240.0_r8))*deg2rad
DO j=JstrR,JendR
BOUNDARY(ng)%zeta_east(j)=fac*val*COS(omega-phase)
END DO
END IF
#elif defined FJORD
IF (WESTERN_EDGE) THEN
fac=TANH((tdays(ng)-dstart)/1.0_r8)
omega=2.0_r8*pi*time(ng)/(12.42_r8*3600.0_r8) ! M2 Tide period
val=0.53_r8+(0.53_r8-0.48_r8)/REAL(Iend+1,r8)
phase=(277.0_r8+(277.0_r8-240.0_r8)/REAL(Iend+1,r8))*deg2rad
DO j=JstrR,JendR
BOUNDARY(ng)%zeta_west(j)=fac*val*COS(omega-phase)
END DO
END IF
IF (EASTERN_EDGE) THEN
fac=TANH((tdays(ng)-dstart)/1.0_r8)
omega=2.0_r8*pi*time(ng)/(12.42_r8*3600.0_r8) ! M2 Tide period
val=0.53_r8+(0.53_r8-0.48_r8)
phase=(277.0_r8+(277.0_r8-240.0_r8))*deg2rad
DO j=JstrR,JendR
BOUNDARY(ng)%zeta_east(j)=fac*val*COS(omega-phase)
END DO
END IF
#else
IF (EASTERN_EDGE) THEN
DO j=JstrR,JendR
BOUNDARY(ng)%zeta_east(j)=0.0_r8
END DO
END IF
IF (WESTERN_EDGE) THEN
DO j=JstrR,JendR
BOUNDARY(ng)%zeta_west(j)=0.0_r8
END DO
END IF
IF (SOUTHERN_EDGE) THEN
DO i=IstrR,IendR
BOUNDARY(ng)%zeta_south(i)=0.0_r8
END DO
END IF
IF (NORTHERN_EDGE) THEN
DO i=IstrR,IendR
BOUNDARY(ng)%zeta_north(i)=0.0_r8
END DO
END IF
#endif
RETURN
END SUBROUTINE ana_fsobc_tile
Modify ana_m2obc.h
You will have to edit the file ana_m2obc.h (located in trunk/ROMS/Functionals) to tell ROMS to estimate currents analytically when running the FJORD case. Below is a snippet of the end of the file... you have to ADD the green code.
#elif defined WEDDELL
IF (WESTERN_EDGE) THEN
fac=TANH((tdays(ng)-dstart)/1.0_r8)
omega=2.0_r8*pi*time(ng)/(12.42_r8*3600.0_r8) ! M2 Tide period
minor=0.0143_r8+(0.0143_r8+0.010_r8)/REAL(Iend+1,r8)
major=0.1144_r8+(0.1144_r8-0.013_r8)/REAL(Iend+1,r8)
phase=(318.0_r8+(318.0_r8-355.0_r8)/REAL(Iend+1,r8))*deg2rad
angle=(125.0_r8+(125.0_r8- 25.0_r8)/REAL(Iend+1,r8))*deg2rad
DO j=JstrR,JendR
val=0.5_r8*(angler(Istr-1,j)+angler(Istr,j))
BOUNDARY(ng)%ubar_west(j)=fac*(major*COS(angle-val)* &
& COS(omega-phase)- &
& minor*SIN(angle-val)* &
& SIN(omega-phase))
END DO
DO j=Jstr,JendR
val=0.5_r8*(angler(Istr-1,j-1)+angler(Istr-1,j))
BOUNDARY(ng)%vbar_west(j)=fac*(major*SIN(angle-val)* &
& COS(omega-phase)- &
& minor*SIN(angle-val)* &
& COS(omega-phase))
END DO
END IF
IF (EASTERN_EDGE) THEN
fac=TANH((tdays(ng)-dstart)/1.0_r8)
omega=2.0_r8*pi*time(ng)/(12.42_r8*3600.0_r8) ! M2 Tide period
minor=0.0143_r8+(0.0143_r8+0.010_r8)
major=0.1144_r8+(0.1144_r8-0.013_r8)
phase=(318.0_r8+(318.0_r8-355.0_r8))*deg2rad
angle=(125.0_r8+(125.0_r8- 25.0_r8))*deg2rad
DO j=JstrR,JendR
val=0.5_r8*(angler(Iend,j)+angler(Iend+1,j))
BOUNDARY(ng)%ubar_east(j)=fac*(major*COS(angle-val)* &
& COS(omega-phase)- &
& minor*SIN(angle-val)* &
& SIN(omega-phase))
END DO
DO j=Jstr,JendR
val=0.5_r8*(angler(Iend+1,j-1)+angler(Iend+1,j))
BOUNDARY(ng)%vbar_east(j)=fac*(major*SIN(angle-val)* &
& COS(omega-phase)- &
& minor*SIN(angle-val)* &
& COS(omega-phase))
END DO
END IF
#elif defined FJORD
IF (WESTERN_EDGE) THEN
fac=TANH((tdays(ng)-dstart)/1.0_r8)
omega=2.0_r8*pi*time(ng)/(12.42_r8*3600.0_r8) ! M2 Tide period
minor=0.0143_r8+(0.0143_r8+0.010_r8)/REAL(Iend+1,r8)
major=0.1144_r8+(0.1144_r8-0.013_r8)/REAL(Iend+1,r8)
phase=(318.0_r8+(318.0_r8-355.0_r8)/REAL(Iend+1,r8))*deg2rad
angle=(125.0_r8+(125.0_r8- 25.0_r8)/REAL(Iend+1,r8))*deg2rad
DO j=JstrR,JendR
val=0.5_r8*(angler(Istr-1,j)+angler(Istr,j))
BOUNDARY(ng)%ubar_west(j)=fac*(major*COS(angle-val)* &
& COS(omega-phase)- &
& minor*SIN(angle-val)* &
& SIN(omega-phase))
END DO
DO j=Jstr,JendR
val=0.5_r8*(angler(Istr-1,j-1)+angler(Istr-1,j))
BOUNDARY(ng)%vbar_west(j)=fac*(major*SIN(angle-val)* &
& COS(omega-phase)- &
& minor*SIN(angle-val)* &
& COS(omega-phase))
END DO
END IF
IF (EASTERN_EDGE) THEN
fac=TANH((tdays(ng)-dstart)/1.0_r8)
omega=2.0_r8*pi*time(ng)/(12.42_r8*3600.0_r8) ! M2 Tide period
minor=0.0143_r8+(0.0143_r8+0.010_r8)
major=0.1144_r8+(0.1144_r8-0.013_r8)
phase=(318.0_r8+(318.0_r8-355.0_r8))*deg2rad
angle=(125.0_r8+(125.0_r8- 25.0_r8))*deg2rad
DO j=JstrR,JendR
val=0.5_r8*(angler(Iend,j)+angler(Iend+1,j))
BOUNDARY(ng)%ubar_east(j)=fac*(major*COS(angle-val)* &
& COS(omega-phase)- &
& minor*SIN(angle-val)* &
& SIN(omega-phase))
END DO
DO j=Jstr,JendR
val=0.5_r8*(angler(Iend+1,j-1)+angler(Iend+1,j))
BOUNDARY(ng)%vbar_east(j)=fac*(major*SIN(angle-val)* &
& COS(omega-phase)- &
& minor*SIN(angle-val)* &
& COS(omega-phase))
END DO
END IF
#else
IF (EASTERN_EDGE) THEN
DO j=JstrR,JendR
BOUNDARY(ng)%ubar_east(j)=0.0_r8
END DO
DO j=Jstr,JendR
BOUNDARY(ng)%vbar_east(j)=0.0_r8
END DO
END IF
IF (WESTERN_EDGE) THEN
DO j=JstrR,JendR
BOUNDARY(ng)%ubar_west(j)=0.0_r8
END DO
DO j=Jstr,JendR
BOUNDARY(ng)%vbar_west(j)=0.0_r8
END DO
END IF
IF (SOUTHERN_EDGE) THEN
DO i=Istr,IendR
BOUNDARY(ng)%ubar_south(i)=0.0_r8
END DO
DO i=IstrR,IendR
BOUNDARY(ng)%vbar_south(i)=0.0_r8
END DO
END IF
IF (NORTHERN_EDGE) THEN
DO i=Istr,IendR
BOUNDARY(ng)%ubar_north(i)=0.0_r8
END DO
DO i=IstrR,IendR
BOUNDARY(ng)%vbar_north(i)=0.0_r8
END DO
END IF
#endif
RETURN
END SUBROUTINE ana_m2obc_tile
Tidal Forcing
Dummy text... No real information here yet