Dwave

General scientific issues regarding ROMS

Moderators: arango, robertson

Post Reply
Message
Author
User avatar
jivica
Posts: 135
Joined: Mon May 05, 2003 2:41 pm
Location: The University of Western Australia, Perth, Australia

Dwave

#1 Post by jivica » Mon Jun 20, 2011 7:26 am

Dear users,
I have question regarding NEARSHORE_MELLOR05.
In the varinfo.dat I have found that Dwave (Direction for waves) should be in degrees, so I have used forcing file where I defined Dwave in degrees from North CW. Should I rotate the values into grid coordinate, I mean to rotate for -angler? I am interpolation values onto model grid, so no interpolation inside ROMS.
On the other hand I have checked in Nonlinear/nearshore_mellor05.h there is line with

Code: Select all

cff=1.5_r8*pi-Dwave(i,j)-angler(i,j)
I am not sure any more should I rotate or not, and is it still in degrees or in radians and what convention should I follow (from North CW? or radians because in model grid) ..

Thanks in advance,

Cheers
Ivica

jcwarner
Posts: 855
Joined: Wed Dec 31, 2003 6:16 pm
Location: USGS, USA

Re: Dwave

#2 Post by jcwarner » Mon Jun 20, 2011 3:35 pm

For SWAN use:
SET INRHOG 1 NAUTICAL
this ensures that the wave dir is in degrees, the direction the waves are coming from.
Do not rotate the dir to the model grid.
Internally, the model adjusts for local coordinate system. That is done with the:
cff=1.5_r8*pi-Dwave(i,j)-angler(i,j)
-j

User avatar
jivica
Posts: 135
Joined: Mon May 05, 2003 2:41 pm
Location: The University of Western Australia, Perth, Australia

Re: Dwave

#3 Post by jivica » Mon Jun 20, 2011 10:20 pm

Thanks John on swift replay!

Nevertheless, I am not using SWAN but other wave model (WWM),
the most important is to have the same convention DEGREES not RADIANS (Nautical SWAN convention) calculating direction from the North clockwise
and that direction, as you said, is pointing direction "from where" the waves are coming.

My grid is tilted and curved so I was worried about rotating Dwave, I have looked into set_data.F and saw that if POINT BASED variable (Dwave) is given than ROMS is rotating to the grid coord. system (the same as for Wind) but not if you feed in variables exactly at the grid dimensions (no interpolation inside ROMS needed).

Does it mean if you specify forcing file with only one point (spatial) in time that it is going to be rotated twice?
And again in the code seems to me that it is applying GRID angler (which is in radians!) on degrees (as you said should be)..

set_data.F:

Code: Select all

#    ifdef ICURVGRID
!
!  If input point-data, rotate direction to curvilinear coordinates.
!
      IF (.not.Linfo(1,idWdir,ng).or.                                   &
     &    (Iinfo(5,idWdir,ng).ne.Lm(ng)+2).or.                          &
     &    (Iinfo(6,idWdir,ng).ne.Mm(ng)+2)) THEN
        DO j=JstrR,JendR
          DO i=IstrR,IendR
            FORCES(ng)%Dwave(i,j)=FORCES(ng)%Dwave(i,j)-                &
     &                            GRID(ng)%angler(i,j)
          END DO
        END DO
      END IF

Again in Functionals/ana_wwave.h
there are examples with Dwave in RADIANS and rotated to grid coord system..

Code: Select all

!
!-----------------------------------------------------------------------
!  Set wind induced wave amplitude (m), direction (radians) and
!  period (s) at RHO-points.
!-----------------------------------------------------------------------
!
#if defined BL_TEST
      wdir=210.0_r8*deg2rad
      DO j=JstrR,JendR
        DO i=IstrR,IendR
          Hwave(i,j)=0.5_r8
          Dwave(i,j)=wdir
          Pwave_bot(i,j)=8.0_r8
        END DO
      END DO
#elif defined LAKE_SIGNELL
      mxst=0.25_r8         ! Wave amplitude (1/2 wave height) (meters)
      ramp_u=15.0_r8       ! start ramp UP at RAMP_UP (hours)
      ramp_time=10.0_r8    ! ramp from 0 to 1 over RAMP_TIME (hours)
      ramp_d=50.0_r8       ! start ramp DOWN at RAMP_DOWN (hours)
      DO j=JstrR,JendR
        DO i=Istr,IendR
          Dwave(i,j)=270.0_r8*deg2rad
          Pwave_bot(i,j)=5.0_r8    ! wave period (seconds)
           cff1=MIN((0.5_r8*(TANH((time(ng)/3600.0_r8-ramp_u)/          &
     &                            (ramp_time/5.0_r8))+1.0_r8)),         &
     &              (1.0_r8-(0.5_r8*(TANH((time(ng)/3600.0_r8-ramp_d)/  &
     &                                    (ramp_time/5.0_r8))+1.0_r8))))
          Hwave(i,j)=MAX((cff1*mxst),0.01_r8)
        END DO
      END DO
#elif defined NJ_BIGHT
!!    wdir=210.0_r8*deg2rad
      wdir=150.0_r8*deg2rad
      IF ((tdays(ng)-dstart).lt.1.5_r8) THEN
        cff=TANH(0.5_r8*(tdays(ng)-dstart))
        cff=1.0_r8
      ELSE
        cff=1.0_r8
      END IF
      DO j=JstrR,JendR
        DO i=IstrR,IendR
          Hwave(i,j)=0.12_r8
          Dwave(i,j)=wdir-angler(i,j)
          Pwave_bot(i,j)=10.0_r8
        END DO
      END DO
#elif defined SED_TOY
      DO j=JstrR,JendR
        DO i=IstrR,IendR
          Hwave(i,j)=2.0_r8
          Dwave(i,j)=90.0_r8*deg2rad
          Pwave_bot(i,j)=8.0_r8
          Lwave(i,j)=20.0_r8
        END DO
      END DO
#else
      ana_wwave: No values provided for Hwave, Dwave, Pwave, Lwave.
#endif



So seems to me that it is not clearly put in the model..

At the end take home message is:
1) I should use DEGREES in meteo convention from NORTH CW
2) should not rotate Dwave into grid coord. system (like angler)

Thanks and cheers,

Ivica

User avatar
jivica
Posts: 135
Joined: Mon May 05, 2003 2:41 pm
Location: The University of Western Australia, Perth, Australia

Re: Dwave

#4 Post by jivica » Tue Jun 21, 2011 8:12 pm

OK figured it out,
It is in the degrees and during the loading phase it is converted into radians (varinfo.dat, the last line)

Code: Select all

'Dwave'                                            ! Input
  'wind-induced wave direction'
  'degrees'                                        ! [radians]
  'Dwave, scalar, series'
  'wave_time'
  'idWdir'
  'r2dvar'
  0.017453292519943295                             ! pi/180
This resolves analytical case where it is in radians that you have to convert it by yourself (no loading phase) -> so ana_wwave.h is fine.
Even more important is that in ana_wwave.h you first rotate your Dwave into the NAUTICAL convention and then deg2rad (part with 1.5*pi in nearshore_mellor05.h is that NAUTICAL convention).

Rotate into grid coords is done in nearshore_mellor05.h from 3/2pi so 90 degrees convention which is at the end fine.

The only place it is possibly wrong is if you use forcing with only one point in space (like station) than it is rotated twice, because applying part in set_data.F


Cheers,
Ivica

Post Reply