Welcome, Guest
Username: Password: Remember me

TOPIC: using wind&pressure that change in space and time

using wind&pressure that change in space and time 13 years 2 months ago #2435

  • mtayel
  • mtayel's Avatar
Hello for all,

i want to use wind and pressure data that change in space and time for every node in my telemac2d simulation model
i know i must use the function Meteo.f in the source code. but the example in the manual not show to me cleary how to modify it.
what i need is agood example which include also pressure data that describe how i can modify the original meteo.f file.
also is i need to recompile the whole telemac system after modification of meteo.f file?

thanks in advance for your cooperation
The administrator has disabled public write access.

Re: using wind&pressure that change in space and time 13 years 2 months ago #2437

  • jmhervouet
  • jmhervouet's Avatar
Hello,

Please have a look to the "guide to programming in the Telemac system" to have an idea of how it works, especially the BIEF_OBJ structure and the various subroutines like OV or OS.

Then you need to put your modified subroutine meteo in your "FORTRAN FILE" linked to the case, and put the name of this Fortran file in the parameter file (do not change the sources libraries nor recompile them, the perl or python scripts will compile your Fortran file at every run).

In meteo.f you have a few arguments, like AT for time and X and Y for the coordinates of points.

An example of loop for space varying pressure could be :

DO I=1,NPOIN (I to be declared as integer)
IF(X(I).GT.500.D0) THEN
PATMOS(I)=1000.
ELSE
PATMOS(I)=2000.
ENDIF
ENDDO

For using a data file of your own, report to user manual and keyword :

FORMATTED DATA FILE 1

for example. You do not need to open or close it.


This is to start with, with best regards,

Jean-Michel Hervouet
The administrator has disabled public write access.

Re: using wind&pressure that change in space and time 13 years 2 months ago #2438

  • mtayel
  • mtayel's Avatar
thanks for interactive respond

the example in the user manual use LT as the time is that true. and i will check the "guide for telemac programing"
i only has another questions:
first in the "fortrant file" parameter can i put more than one file for example princible.f;meteo.f ?
second can i read a data file in telemac source without using "formatted data file" keyword?i.e using the normal file read fortran instruction with wahtever unit number.

thanks with best regards
The administrator has disabled public write access.

Re: using wind&pressure that change in space and time 13 years 2 months ago #2439

  • c.coulet
  • c.coulet's Avatar
  • OFFLINE
  • Moderator
  • Posts: 3722
  • Thank you received: 1031
Hi
LT is the time step number (it's an integer).
The Time is AT variable.
For the fortran file, the best solution is to copy all the different subroutines in one file (myfortran.f for example) and declare this file in the keyword FORTRAN FILE
You could use your own programmation and read a data file in the telemac fortran but take care that the telemac execution take place in a subdirectory so the path to your file should be adapted. Some unit number are already used by telemac. You could find those number in the dictionary of telemac (.dico file in lib subdirectory)

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

Re: using wind&pressure that change in space and time 13 years 2 months ago #2503

  • mtayel
  • mtayel's Avatar
hello,
thanks for the all of you who help

i successfully run telemac with wind and pressure or wind data but at the end of the simulation i have some errors when i use"air pressure" or "wind"
attached the errors

another problem arise when i try to write the LT or WINDX variables to a text file using normal fortran comands in the parallel mode, which not appear in the scalar mode.
attached the modefied meteo function to write the variables
thanks
Attachments:
The administrator has disabled public write access.

Re: using wind&pressure that change in space and time 13 years 2 months ago #2504

  • mtayel
  • mtayel's Avatar
sorry attached the meteo function
Attachments:
The administrator has disabled public write access.

Re: using wind&pressure that change in space and time 13 years 2 months ago #2505

  • jmhervouet
  • jmhervouet's Avatar
Hello,

I give you a few hints:

In your subroutine meteo, add a line SAVE after the last declarations, otherwise it could be that windu and windv are not kept between 2 calls of meteo.

If you want to write a file in parallel, you must have the job done by only one of the processors, otherwise they will all try to do it. Use the test:

IF(IPID.EQ.0) THEN
write the file...
ENDIF

Do not use logical units 1 and 2 (it could be that 2 works, but 1 is the geometry file...). Use 97 and 98 instead, for example. Note also that if your files are in the directory of the case you run, the path may be just ../yourfile (2 dots because you have to get out of the temporary folder where the case is run)

Last thing, I do not know what is the use of the line round=INT(LT/180) but LT/180 is an integer division that will give 0 if LT<180, is it what you want ?

I hope this will help, have a good week-end,

Jean-Michel Hervouet
The administrator has disabled public write access.

Re: using wind&pressure that change in space and time 13 years 2 months ago #2508

  • mtayel
  • mtayel's Avatar
Thanks for the hints that really helped me.

i have ran the simulation in scalar mode with no errors during the write to a txt file, but the problem is coming back when write the file in parallel mode.
attached the errors and the modefied meteo subroutine

thanks
Attachments:
The administrator has disabled public write access.
Moderators: pham

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