Adding the wind vector as an output

Everything related to the preinstalled test cases in COHERENS. Additionally, you can find here the necessary files to setup a test case.If you have developed a new test case and you want to share it with other users, feel free to post a new thread.

Moderator: Katrijn

Post Reply
Sou
Posts: 51
Joined: Wed Sep 03, 2014 7:46 pm
Full name: Soudeh Afsharian

Adding the wind vector as an output

Post by Sou »

Hello,
I have modified my uwind and vwind parameters in the usrdef surface dataf90 file in subroutine
SUBROUTINE usrdef_surface_data
in RHONE test case, I made a variable " windspd " in the cited subroutine which is defined as :

Do i =1,n1dat
Do j =1,n2dat
windspeed(i,j)= SQRT(surdata(i,j,1)**2 + surdata(i,j,2)**2)
windspd(i,j) = windspd(i,j)+windspeed(i,j)
uwindspd(i,j) = uwindspd(i,j)+ABS(surdata(i,j,1))
vwindspd(i,j) = vwindspd(i,j)+ABS(surdata(i,j,2))

surdata(i,j,1) =uwindspd(i,j)
surdata(i,j,2) =vwindspd(i,j)
END DO
END DO
END DO


Now I want to ask coherence to set windspd to be one of my output parameters.
How can I ask it?
I only defined the

!1. Output variables
!-------------------
!
!---fortran name
tsrvars(3)%f90_name = 'winspd'

!---long name
tsrvars(3)%long_name = 'wind vector'

!---units
tsrvars(3)%units = 'm/s'

!---varids and ranks
tsrvars%ivarid = (/0,iarr_uwindatc,iarr_vwindatc,iarr_windatc,iarr_uvel,iarr_vvel,iarr_temp/)
tsrvars%nrank = (/2,2,2,2,3,3,3/)
.
.
.
.
.
!


and I dont know thow to define it in SUBROUTINE usrdef_tsr2d_vals(out2ddat,i,j,n2vars)
in the usrdef time series f90 file....

I tried to get iarr_windatc output, too, but it just gives 0, any idea why?

Thank you,
Sue
Katrijn
Posts: 87
Joined: Fri Nov 29, 2013 3:04 pm
Full name: Katrijn Baetens

Re: Adding the wind vector as an output

Post by Katrijn »

Hi Sou,

Normally windspeed is listed as a standard output so just adding iarr_uwindatc in the standard 'SUBROUTINE usrdef_tsr_params' should be sufficient:

!---varids and ranks
tsrvars%ivarid = (/0,iarr_uwindatc,iarr_vwindatc,iarr_windatc,iarr_uvel,iarr_vvel,iarr_temp/)
tsrvars%nrank = (/2,2,2,2,3,3,3/)

This should be sufficient, don't forget to change the number of output variables in the Usrdef_Model.f90 file accordingly! Hope this helped.


Cheers,

Katrijn
Sou
Posts: 51
Joined: Wed Sep 03, 2014 7:46 pm
Full name: Soudeh Afsharian

Re: Adding the wind vector as an output

Post by Sou »

thank you katrijin but I have done all of these settings but it just produces 0 for iarr_windatc.
sysysy
Posts: 1
Joined: Wed Jul 26, 2017 6:35 am
Full name: sysysy swswsw

Re: Adding the wind vector as an output

Post by sysysy »

i agree with the third comment about that ...well done
Graduated from Soran University with First Class Degree with Honours in Computer Science.
Katrijn
Posts: 87
Joined: Fri Nov 29, 2013 3:04 pm
Full name: Katrijn Baetens

Re: Adding the wind vector as an output

Post by Katrijn »

Hi sysysy,
Can you elaborate? Soudeh wrote me a pm that his problem is solved now, what about your problem?

Cheers,

Katrijn
Sou
Posts: 51
Joined: Wed Sep 03, 2014 7:46 pm
Full name: Soudeh Afsharian

Re: Adding the wind vector as an output

Post by Sou »

Hi Katrijin,
This problem is not solved yet I mean for this specific parameter. iarr-windatc.
Regards,
Soudeh
Katrijn
Posts: 87
Joined: Fri Nov 29, 2013 3:04 pm
Full name: Katrijn Baetens

Re: Adding the wind vector as an output

Post by Katrijn »

elaborate please
Post Reply