Welcome, Guest
Username: Password: Remember me

TOPIC: How to set the spatial distribution of rainfall

How to set the spatial distribution of rainfall 3 years 8 months ago #37962

  • c.coulet
  • c.coulet's Avatar
  • OFFLINE
  • Moderator
  • Posts: 3722
  • Thank you received: 1031
Yes that's the idea
Just take care that prosou_fv.f is for the finite volume kernel of Telemac.
For finite element , it's prosou.f
To generate the selafin file with different time steps, it's better to use python scripts. Depending of the information you have to build the rainfall file you could find some tips in the generate_atm.py scripts as this script was designed to manage selafin file supporting Pressure, Wind, Temperature...

Hope this helps
Christophe
The administrator has disabled public write access.

How to set the spatial distribution of rainfall 3 years 8 months ago #38000

  • annatrinh
  • annatrinh's Avatar
Hi Christophe,

thanks to your advice I successfully created the test-slf-file for time- and space-varying rainfall (Variable "RAINI" in the attached "RAINFALL_BINARY.slf").

But when I modify the subroutine "runoff_scs_cn.f" to read the "RAINI" Variable, it always shows me the error: "Program received signal SIGSEGV: Segmentation fault - invalid memory reference."

This is what I firstly added in the file "runoff_scs_cn.f" in order to get the rainfall information (line 235):
CALL SYNC_METEO(AT)
CALL OS('X=Y     ',X=PLUIE, Y=RAINFALL)

Could you or someone else in the forum please help or give me some tipps with that? I have to admit that my skill in Fortran is very limited, thats why I am sitting with this problem for over 2 days without finding a solution for that.
The administrator has disabled public write access.

How to set the spatial distribution of rainfall 3 years 8 months ago #38016

  • pilou1253
  • pilou1253's Avatar
  • OFFLINE
  • openTELEMAC Guru
  • Posts: 584
  • Thank you received: 106
Hi!

I don't have experience with spatially variable rainfall in telemac, but with the info you got from Christophe you should be on a good track.

However, it will require some changes in runoff_scs_cn as this routine is built around the assumption of constant rain in space. What you want to change in the subroutine is to be able to give a different rainfall value at each node. The constant rainfall depth per time step is calculated in variable RFM, what you need is defining an array of size NPOIN in order to obtain the equivalent of RFM(I), ie. rainfall at each node. This should be possible to do the the method Christophe indicated (just a guess, I haven't looked at it into detail). I think it should be possible to use one of the private variables array to do that (RFM(I)), but some fortran coding is needed.

Keep in mind that the array PLUIE does NOT contain rainfall but runoff.

Hope it helps,

Kind regards
PL
The administrator has disabled public write access.
The following user(s) said Thank You: annatrinh

How to set the spatial distribution of rainfall 3 years 8 months ago #38020

  • annatrinh
  • annatrinh's Avatar
Thank you very much for your reply,

I am aware that PLUIE does not contain rainfall but runoff and RFM in the subroutine runoff_scs_cn is not an array but only a variable of double type. But at first I want to be able to read the spatial and time varying rainfall from my binary file to the subroutine runoff_scs_cn.

Due to the information in the user handbook (ver 8.2 page 47): Rain and evaporation can also vary in time and space. They can be introduced through the ASCII ATMOSPHERIC DATA FILE or BINARY ATMOSPHERIC DATA FILE. Shortnames RAINI and RAINC (with a final I for rain classically interpolated as other meteo variables or
with a final C as a cumulated variable during a certain period of time) are to be written in the headline of this file (see the section 3.1 of the WAQTEL user manual).
, I created the binary file containing the variable RAINI. And after investigating the subroutine meteo.f (line 189 to 191) I realize that the rain information could be read with the following commands (Sync_meteo is a subroutine of meteo_telemac):

CALL SYNC_METEO(AT)
IF(PRESENT(PLUIE)) THEN
CALL OS('X=Y ',X=PLUIE, Y=RAINFALL) ! MM/S

That's why I tried to insert those lines in my modified runoff_scs_cn but unfortunately it throws out the described error though successfully compiled.
I don't know if I miss something?
The administrator has disabled public write access.

How to set the spatial distribution of rainfall 3 years 8 months ago #38043

  • annatrinh
  • annatrinh's Avatar
I successfully implemented the desired rainfall using the routine "read_bin_2d". Modifications of runoff_scs_cn, find_variable (to not interpolate between times) were needed. Also meteo_telemac should be added to user_fortran_folder.

Thank you all again for great support!
The administrator has disabled public write access.

How to set the spatial distribution of rainfall 3 years 8 months ago #38061

  • Yunhao Song
  • Yunhao Song's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 118
  • Thank you received: 9
Hello,

Could you explain a little bit about how you created the time- and space-varying binary file? I tested in BlueKenue while only succeeded in making the space-varying .slf file...

Thanks in advance!
The administrator has disabled public write access.

How to set the spatial distribution of rainfall 3 years 8 months ago #38062

  • annatrinh
  • annatrinh's Avatar
Hi,

yes, I used BlueKenue to create separate space-varying frames.

And then I concatenate them with the function written by special_20: opentelemac.co.uk/index.php/assistance/f...tenate-two-slf-files

Note that the function was written for the file runSELAFIN.py (Python Version 2). The newest version of Telemac doesn't contain this file anymore but you could download the whole folder of python2 scripts from earlier versions.

I also modify the runSELAFIN.py in order to define my desired step between each frames.

Hope it helps.
The administrator has disabled public write access.

How to set the spatial distribution of rainfall 3 years 8 months ago #38063

  • c.coulet
  • c.coulet's Avatar
  • OFFLINE
  • Moderator
  • Posts: 3722
  • Thank you received: 1031
Hi
runselafin.py is available in Python 3 scripts under the new name run_selafin.py.

Regards
Christophe
The administrator has disabled public write access.

How to set the spatial distribution of rainfall 3 years 8 months ago #38064

  • Yunhao Song
  • Yunhao Song's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 118
  • Thank you received: 9
Hi annatrinh & Christophe,

Thank you so much for the detailed information.

Cheers,
The administrator has disabled public write access.

How to set the spatial distribution of rainfall 3 years 6 months ago #38362

  • nitesh
  • nitesh's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 73
  • Thank you received: 1
Hi annatrinh and Yunhao Song,

I have around 1000 time-steps. It will take forever to create separate space-varying frames for each time-step using Bluekenue.

Did you use any python script to create them, as suggested by Christophe in one of the above posts? If yes, please share.

Regards!
The administrator has disabled public write access.
Moderators: pham

The open TELEMAC-MASCARET template for Joomla!2.5, the HTML 4 version.