about the coordinate conversion

General scientific issues regarding ROMS

Moderators: arango, robertson

Post Reply
Message
Author
zhaoqian
Posts: 45
Joined: Tue Nov 11, 2008 5:45 pm
Location: National Marine Environmental Mornitoring Center

about the coordinate conversion

#1 Unread post by zhaoqian »

Hi all users:
We notice that in orthogonal curvilinear grids the velocity in nc file are in eta and xi directions. So if we want to plot current fields using the matlab command quiver, should we change the velocity fields into the cartesian coordinate first? And if the external forcing like winds are precribed, should they be changed from cartesian coordinate into orthogonal curvilinear coordinate according to the angle in the grd file?
Thanks for your help!

User avatar
kate
Posts: 4088
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: about the coordinate conversion

#2 Unread post by kate »

Yes, you have to rotate the model velocities clockwise by the field "angle" for many plotting packages.

If you are providing winds to ROMS, you may or may not have to rotate, it depends. Are you giving ROMS a full gridded field on the ROMS grid? If so, it should be rotated to the xi,eta directions. If you are giving ROMS a global wind field and expecting ROMS to do the interpolation, ROMS will also do the rotation. Same for a single value of wind data that gets used over the whole domain.

zhaoqian
Posts: 45
Joined: Tue Nov 11, 2008 5:45 pm
Location: National Marine Environmental Mornitoring Center

Re: about the coordinate conversion

#3 Unread post by zhaoqian »

kate wrote:If you are giving ROMS a global wind field and expecting ROMS to do the interpolation, ROMS will also do the rotation. Same for a single value of wind data that gets used over the whole domain.
Dear Kate and other users:
Would you please tell where to find the interpolation and rotation part in ROMS? I want to read the code. Thank you!
Qian

User avatar
kate
Posts: 4088
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: about the coordinate conversion

#4 Unread post by kate »

Rotation is in set_data.F: search for CosAngler or SinAngler.

Interpolation is in interpolate.F, called by regrid, called by nf_fread2d.

zhaoqian
Posts: 45
Joined: Tue Nov 11, 2008 5:45 pm
Location: National Marine Environmental Mornitoring Center

Re: about the coordinate conversion

#5 Unread post by zhaoqian »

! If input point wind stress, rotate to curvilinear grid. Notice
! that rotation is done at RHO-points. It does not matter.
!
IF (.not.Linfo(1,idUsms,ng).or. &
& (Iinfo(5,idUsms,ng).ne.Lm(ng)+1).or. &
& (Iinfo(6,idUsms,ng).ne.Mm(ng)+2)) THEN
DO j=JstrR,JendR
DO i=IstrR,IendR
cff1=FORCES(ng)%sustr(i,j)*GRID(ng)%CosAngler(i,j)+ &
& FORCES(ng)%svstr(i,j)*GRID(ng)%SinAngler(i,j)
cff2=FORCES(ng)%svstr(i,j)*GRID(ng)%CosAngler(i,j)- &
& FORCES(ng)%sustr(i,j)*GRID(ng)%SinAngler(i,j)
FORCES(ng)%sustr(i,j)=cff1
FORCES(ng)%svstr(i,j)=cff2
END DO
END DO
----------------------------------------------------------------------------
Dear Kate:
In set_data.F, the transfromation about winds are listed above. According to the code, the values of sustr are positive if the wind is from north. Is that true?
Qian

User avatar
kate
Posts: 4088
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: about the coordinate conversion

#6 Unread post by kate »

It depends on the angle. What direction is the positive i direction in the model?

zhaoqian
Posts: 45
Joined: Tue Nov 11, 2008 5:45 pm
Location: National Marine Environmental Mornitoring Center

Re: about the coordinate conversion

#7 Unread post by zhaoqian »

zhaoqian wrote:
In set_data.F, the transfromation about winds are listed above. According to the code, the values of sustr are positive if the wind is from north. Is that true?
If the wind is from north, the svstr is negitive!

Post Reply