ROMS 2.2 analytical tide forcing

Report or discuss software problems and other woes

Moderators: arango, robertson

Post Reply
Message
Author
rmueller
Posts: 26
Joined: Thu May 04, 2006 4:15 am
Location: Earth & Space Research

ROMS 2.2 analytical tide forcing

#1 Unread post by rmueller »

Hello everyone,

Yes--I know--2.2. :?
I have plans to upgrade to 3.1 later this summer, I promise.

In the meantime, I would like to create an idealistic run that has a simple kelvin wave forcing along the north/south boundary and walls along the east and west. I am trying to do so analytically, following the KELVIN case. The error that I get is that ROMS can't find my frc_forcing.nc file, which is odd given that it didn't complain when I did this experiment by forcing analytically from the east with walls along the north/south/west. In cppdefs.h, for the case of forcing from N/S, I have:


#define RADIATION_2D
#define WESTERN_WALL
#define EASTERN_WALL

#define SOUTH_FSCHAPMAN
#define SOUTH_M3RADIATION
#define SOUTH_M2FLATHER
#define SOUTH_TRADIATION

#define NORTH_FSCHAPMAN
#define NORTH_M3RADIATION
#define NORTH_M2FLATHER
#define NORTH_TRADIATION

#define ANA_FSOBC
#define ANA_M2OBC

#undef SSH_TIDES
#undef UV_TIDES
#undef M2CLIMATOLOGY
#undef ZCLIMATOLOGY

Why is ROMS still looking for my forcing file when I'm using ANA_FSOBC and ANA_M2OBC??? The answer is probably a bug in the way that I coded the N/S forcing. Before I show that code, let me sheepishly warn that I'm not quite clear on what the "R" in IstrR, IendR, JstrR and JendR refers to. I guessed. If someone could clarify this point too, I'd be most appreciative! Oh...and while I expose my ignorance...what are the units of "yp" and "xp". I interpreted them as y and x distances in units of meters.

In any case, in analytical.F under the ana_fsobc_tile subroutine, I have coded the following:
#elif defined ICETEST

IF (NORTHERN_EDGE) THEN
fac=TANH((tdays(ng)-dstart)/1.0_r8)
omega=2.0_r8*pi/(12.42_r8*3600.0_r8) ! M2 Tide period
DO i=IstrR,IendR
cff=1.0_r8/SQRT(g*GRID(ng)%h(i,Jend))
val=fac*EXP(-GRID(ng)%f(i,Jend+1)* &
& GRID(ng)%yp(i,Jend+1)/ &
& SQRT(g*GRID(ng)%h(i,Jend+1)))
BOUNDARY(ng)%zeta_north(j)=val*COS(omega*GRID(ng)%yp(i,Jend)* &
& cff-omega*time(ng))
END DO
END IF

IF (SOUTHERN_EDGE) THEN
fac=TANH((tdays(ng)-dstart)/1.0_r8)
omega=2.0_r8*pi/(12.42_r8*3600.0_r8) ! M2 Tide period
DO i=IstrR,IendR
val=fac*EXP(-GRID(ng)%f(i,Jstr)* &
& GRID(ng)%yp(i,Jstr)/ &
& SQRT(g*GRID(ng)%h(i,Jstr)))
BOUNDARY(ng)%zeta_south(j)=val*COS(omega*time(ng))
END DO
END IF

Under the ana_m2obc_tile subroutine, I coded:

# elif defined ICETEST

IF (NORTHERN_EDGE) THEN
DO i=IstrR,IendR
omega=2.0_r8*pi/(12.42_r8*3600.0_r8) ! M2 Tide period
fac=TANH((tdays(ng)-dstart)/1.0_r8)
cff=SQRT(g/GRID(ng)%h(i,JendR))
val=fac*COS(omega*GRID(ng)%xp(i,JendR)/cff - omega*time(ng))
BOUNDARY(ng)%vbar_north(i)=val*cff*EXP(-GRID(ng)%f(i,JendR)* &
& GRID(ng)%xp(i,JendR)/ &
& SQRT(g*GRID(ng)%h(i,JendR)))
END DO
DO i=Istr,IendR
BOUNDARY(ng)%ubar_north(i)=0.0_r8
END DO
END IF

IF (SOUTHERN_EDGE) THEN
DO i=IstrR,IendR
omega=2.0_r8*pi/(12.42_r8*3600.0_r8) ! M2 Tide period
fac=TANH((tdays(ng)-dstart)/1.0_r8)
val=fac*COS(omega*time(ng))
cff=SQRT(g/GRID(ng)%h(i,JstrR))
BOUNDARY(ng)%vbar_south(i)=val*cff*EXP(-GRID(ng)%f(i,JstrR)* &
& GRID(ng)%xp(i,JstrR)/ &
& SQRT(g*GRID(ng)%h(i,JstrR)))
END DO
DO i=Istr,IendR
BOUNDARY(ng)%ubar_south(i)=0.0_r8
END DO
END IF

Also, in case it's not obvious yet, I am a student and am still learning FORTRAN; so feel free to rip on my coding practices/errors as I need to learn (note, however, that the ampersands are messed up after pasting in here).

Thanks everyone! (Particularly developers for being patient with my inertia to upgrade.)

-Rachael

rmueller
Posts: 26
Joined: Thu May 04, 2006 4:15 am
Location: Earth & Space Research

Fix to this problem

#2 Unread post by rmueller »

Hi me,

The way I fixed this (thanks to Susan H.!) was to

1) added #define ANA_SRFLUX in CPPDEFS.h file
2) changed the "j" to "i" index in the analytical. F file.

I made other changes to the indices too, but those were different kinds of bugs than I was reporting here.

Unfortunately, it's not smooth sailing yet: I am still having problems with my GRID(ng)%xp(i,JstrR) values being NULL! Perhaps there is a problem running a non-analytical grid with analytical boundary forcing? I may just switch to using a boundary forcing file.

In any case, I just thought I'd follow up on this post.....

-Rachael

Post Reply