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