Difference between revisions of "FJORD TIDAL CASE"

From WikiROMS
Jump to navigationJump to search
Line 40: Line 40:


'''fjord.h file:''' Use basin.h as a template. '''<font color="red">Erase red</font> and <font color="green">Add green</font>''' (black remains the same).
'''fjord.h file:''' Use basin.h as a template. '''<font color="red">Erase red</font> and <font color="green">Add green</font>''' (black remains the same).
:{| style="width:50%; background:white; line-height:115%; padding:10px; border:2px dashed blue;" cellpadding="0" cellspacing="0"
/*
|-
** svn $Id: basin.h 139 2008-01-10 00:17:29Z arango $
|<nowiki>/*</nowiki>
*******************************************************************************
|-
** Copyright (c) 2002-2008 The ROMS/TOMS Group **
|<nowiki>** svn $Id: basin.h 139 2008-01-10 00:17:29Z arango $</nowiki>
** Licensed under a MIT/X style license **
|-
** See License_ROMS.txt **
|<nowiki>*******************************************************************************</nowiki>
*******************************************************************************
|-
**
|<nowiki>** Copyright (c) 2002-2008 The ROMS/TOMS Group                               **</nowiki>
<font color="Red">** Options for Big Bad Basin.</font>
|-
<font color="Green">** Options for Tidal Fjord.</font>
|<nowiki>**   Licensed under a MIT/X style license                                   **</nowiki>
**
|-
<font color="Red">** Application flag: BASIN</font>
|<nowiki>**   See License_ROMS.txt                                                   **</nowiki>
<font color="Green">** Application flag: FJORD</font>
|-
<font color="Red">** Input script: ocean_basin.in</font>
|<nowiki>*******************************************************************************</nowiki>
<font color="Green">** Input script: ocean_fjord.in</font>
|-
*/
|<nowiki>**</nowiki>
|-
#define UV_ADV
|<font color="red"><nowiki>** Options for Big Bad Basin.</nowiki></font>
#define UV_COR
|-
#define UV_QDRAG
|<font color="green">'''<nowiki>** Options for Tidal Fjord.</nowiki>'''</font>
#define UV_VIS4
|-
#define MIX_S_UV
|<nowiki>**</nowiki>
#define DJ_GRADPS
|-
#define TS_U3HADVECTION
|<font color="red"><nowiki>** Application flag:   BASIN</nowiki></font>
#define TS_C4VADVECTION
|-
#define SOLVE3D
|<font color="green">'''<nowiki>** Application flag:   FJORD</nowiki>'''</font>
#define SPLINES
|-
<font color="Red">#define EASTERN_WALL
|<font color="red"><nowiki>** Input script:       ocean_basin.in</nowiki></font>
#define WESTERN_WALL
|-
#define SOUTHERN_WALL
|<font color="green">'''<nowiki>** Input script:       ocean_fjord.in</nowiki>'''</font>
#define NORTHERN_WALL
|-
#define BODYFORCE
|<nowiki>*/</nowiki>
#define ANA_GRID
|-
#define ANA_INITIAL
|<br>
#define ANA_SMFLUX
|-
#define ANA_STFLUX</font>
|<nowiki>#define UV_ADV</nowiki>
<font color="Green">#define MASKING
|-
#define EAST_FSCHAPMAN
|<nowiki>#define UV_COR</nowiki>
#define EAST_M2FLATHER
|-
#define EAST_M3RADIATION
|<nowiki>#define UV_QDRAG</nowiki>
#define EAST_TRADIATION
|-
#define ANA_FSOBC
|<nowiki>#define UV_VIS4</nowiki>
#define ANA_M2OBC</font>
|-
|<nowiki>#define MIX_S_UV</nowiki>
|-
|<nowiki>#define DJ_GRADPS</nowiki>
|-
|<nowiki>#define TS_U3HADVECTION</nowiki>
|-
|<nowiki>#define TS_C4VADVECTION</nowiki>
|-
|<nowiki>#define SOLVE3D</nowiki>
|-
|<nowiki>#define SPLINES</nowiki>
|-
|<font color="red"><nowiki>#define EASTERN_WALL</nowiki></font>
|-
|<font color="red"><nowiki>#define WESTERN_WALL</nowiki></font>
|-
|<font color="red"><nowiki>#define SOUTHERN_WALL</nowiki></font>
|-
|<font color="red"><nowiki>#define NORTHERN_WALL</nowiki></font>
|-
|<font color="red"><nowiki>#define BODYFORCE</nowiki></font>
|-
|<font color="red"><nowiki>#define ANA_GRID</nowiki></font>
|-
|<font color="red"><nowiki>#define ANA_INITIAL</nowiki></font>
|-
|<font color="red"><nowiki>#define ANA_SMFLUX</nowiki></font>
|-
|<font color="red"><nowiki>#define ANA_STFLUX</nowiki></font>
|-
|<font color="green"><nowiki>#define MASKING</nowiki></font>
|-
|<font color="green"><nowiki>#define EAST_FSCHAPMAN</nowiki></font>
|-
|<font color="green"><nowiki>#define EAST_M2FLATHER</nowiki></font>
|-
|<font color="green"><nowiki>#define EAST_M3RADIATION</nowiki></font>
|-
|<font color="green"><nowiki>#define EAST_TRADIATION </nowiki></font>
|-
|<font color="green"><nowiki>#define ANA_FSOBC</nowiki></font>
|-
|<font color="green"><nowiki>#define ANA_M2OBC</nowiki></font>
|}


===Modify ana_fsobc.h===
===Modify ana_fsobc.h===
Line 144: Line 99:
         END DO
         END DO
       END IF
       END IF
  <font color="Orange">#elif defined WEDDELL
  #elif defined WEDDELL
       IF (WESTERN_EDGE) THEN
       IF (WESTERN_EDGE) THEN
         fac=TANH((tdays(ng)-dstart)/1.0_r8)
         fac=TANH((tdays(ng)-dstart)/1.0_r8)
Line 162: Line 117:
           BOUNDARY(ng)%zeta_east(j)=fac*val*COS(omega-phase)
           BOUNDARY(ng)%zeta_east(j)=fac*val*COS(omega-phase)
         END DO
         END DO
       END IF</font>
       END IF
  <font color="Green">#elif defined FJORD
  <font color="Green">#elif defined FJORD
       IF (WESTERN_EDGE) THEN
       IF (WESTERN_EDGE) THEN

Revision as of 17:48, 15 April 2008

Fjord Tidal Test Case
Warning This WikiROMS article is currently under HEAVY construction. This message will be erased when active construction is finished (in 1 or 2 days).
April 14, 2008

This tutorial will go over some of the basic steps to set up a ROMS realistic application (yet, this is a very simple one). This tutorial is also a demonstration of how to use EASYGRID, a "quick-and-dirty" matlab script to make ROMS grids and initialization files.


Warning PREREQUISITES: This tutorial assumes that you have (1) downloaded ROMS, (2) installed it in your computer (or cluster), (3) tested it by compiling and running one of the included test cases, and (4) installed MEXNC, SNCTOOLS and the ROMS Matlab tool-kit. If you haven't done all the above, check the "Getting Started" and "Tutorials" WikiROMS sections.




Geographical Setting: 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. 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. Ship Harbour has a shallow sill of approximately 7 m depth. Average depth of the inner basin is 15 m with a maximum of 25 m.



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. Here I will use EASYGRID.

Get bathymetry and coastline

Dummy text... No real information here yet

Download EASYGRID

Dummy text... No real information here yet

Initialization

Dummy text... No real information here yet

Compiling ROMS

Before we compile ROMS, we need to create a header (.h) file and to modify some analytical Fortran files.

Create header (.h) file

Create a copy of the basin.h test-case header file, and rename the copy fjord.h


fjord.h file: Use basin.h as a template. Erase red and Add green (black remains the same).

/*
** svn $Id: basin.h 139 2008-01-10 00:17:29Z arango $
*******************************************************************************
** Copyright (c) 2002-2008 The ROMS/TOMS Group **
** Licensed under a MIT/X style license **
** See License_ROMS.txt **
*******************************************************************************
**
** Options for Big Bad Basin.
** Options for Tidal Fjord.
**
** Application flag: BASIN
** Application flag: FJORD
** Input script: ocean_basin.in
** Input script: ocean_fjord.in
*/

#define UV_ADV
#define UV_COR
#define UV_QDRAG
#define UV_VIS4
#define MIX_S_UV
#define DJ_GRADPS
#define TS_U3HADVECTION
#define TS_C4VADVECTION
#define SOLVE3D
#define SPLINES
#define EASTERN_WALL
#define WESTERN_WALL
#define SOUTHERN_WALL
#define NORTHERN_WALL
#define BODYFORCE
#define ANA_GRID
#define ANA_INITIAL
#define ANA_SMFLUX
#define ANA_STFLUX
#define MASKING
#define EAST_FSCHAPMAN
#define EAST_M2FLATHER
#define EAST_M3RADIATION
#define EAST_TRADIATION
#define ANA_FSOBC
#define ANA_M2OBC

Modify ana_fsobc.h

fjord.h file: Use basin.h as a template. Erase red and Add green (black remains the same).

#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

Text

Tidal Forcing

Dummy text... No real information here yet