Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: surge in TOMAWAC using MARUTI subroutine

surge in TOMAWAC using MARUTI subroutine 7 years 3 months ago #27548

  • ClaireBeraud
  • ClaireBeraud's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 42
  • Thank you received: 2
Dear Telemac users,

I would like to model a surge event and look at the effect of the surge on the waves using Tomawac.

As I failed using ANAMAR subroutine, I have tried to amend and use the subroutine MARUTI to read evolving water elevation (see attached). I have amended MARUTI following a similar job I did in VENUTI subroutine to read wind data.
But I get several FORTRAN error (attached), I cannot see what is wrong. Would be grateful if someone could give me any advice.

Thanks,
Claire
Attachments:
The administrator has disabled public write access.

surge in TOMAWAC using MARUTI subroutine 7 years 3 months ago #27550

  • Phelype
  • Phelype's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 140
  • Thank you received: 64
Hello Claire

This is most probably because you are compiling your code using the Fortran 95 standard. In Fortran 95 the continuation character is an & at the end of the line to be continued and an & at the beginning of the continuation line. i.e.:
                      SUBROUTINE MARUTI &
 !                    *****************
 !
      &(X,Y,NPOIN,NMAR,BINMAR,NBOR,NPTFR,AT,DDC,TV1,TV2,Z1,Z2)

On the other hand, the Fortran 77 standard (the one your .f file is written on), only requires a character (any character) on the 6th column of the line (exactly as the file you attached).

To fix this you should either modify your .cfg file to use the Fortran 77 standard (the --ffixed-form flag should suffice if you are using Gfortran), or add an & at the end of the line to be continued (as the example above).

Hope this helps.

Best regards,

Phelype
The administrator has disabled public write access.

surge in TOMAWAC using MARUTI subroutine 7 years 3 months ago #27576

  • ClaireBeraud
  • ClaireBeraud's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 42
  • Thank you received: 2
Hello,

Thanks a lot for your reply.
I managed to make it work by amending the first line to:
SUBROUTINE MARUTI(X,Y,NPOIN,NMAR,BINMAR,NBOR,NPTFR,AT,DDC,TV1,TV2,Z1,Z2)
and adding TV1 and TV2 in the variable declaration:
DOUBLE PRECISION ZH1,ZH2,TV1,TV2

The constant water depth is then set to Z1 while the subroutine states that Z1 (and Z2) should be a TIDAL LEVEL (this is similar to the result I get using ANAMAR subroutine).
What I hoped to simulate is a unique water level throughout the mesh leading to spatially different water depths.

I guess for that I need to add the water depth (or positive bathymetry) to Z1?
Could you tell how to access water depth information (or bathymetry) for each point please? and how can I include that in ANAMAR?

Thanks for your help.
Regards,
Claire
The administrator has disabled public write access.

surge in TOMAWAC using MARUTI subroutine 7 years 3 months ago #27580

  • Phelype
  • Phelype's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 140
  • Thank you received: 64
Hello Claire,

I found some variables that may be of interest:
========================================================
!     INITIAL STILL WATER LEVEL
      DOUBLE PRECISION ZREPOS
This may be only an initial condition, as the name says, and probably has no effect later on the computation (just guessing).
This is also a single value for the whole domain and is set using the keyword "INITIAL STILL WATER LEVEL" in the steering.
========================================================
! cote du fond
      DOUBLE PRECISION, DIMENSION(:) , POINTER ::  ZF
This is the bathymetry, read from the variable BOTTOM in the geometry file. If you wish you can access it in MARUTI adding a "USE DECLARATIONS_TOMAWAC, ONLY : ZF" statement to it.
========================================================
! profondeur
      DOUBLE PRECISION, DIMENSION(:) , POINTER ::  DEPTH
This is the water depth saved in the results file. It is the (positive) height of the water column below a mesh node.
This variable can be accessed in the subroutine MARUTI adding a "USE DECLARATIONS_TOMAWAC, ONLY : DEPTH" statement in the subroutine.
Observation: The DEPTH is calculated inside TOMAWAC using ZF and ZREPOS as follows: DEPTH=ZREPOS-ZF
========================================================

Hope this helps.

Best regards,

Phelype
The administrator has disabled public write access.

surge in TOMAWAC using MARUTI subroutine 7 years 3 months ago #27588

  • ClaireBeraud
  • ClaireBeraud's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 42
  • Thank you received: 2
Hi Phelype

Thanks a lot, it definitely helps.
I have chosen to use the depth variable (ZF) within ANAMAR, as I would like to define a time-varying formulation to define the evolution of the water level (please find attached my fortran file).
I managed to get the correct water depth at the beginning of the simulation. Unfortunately, the water depth evolution is not updated for the successive time-steps. How can I make it evolve please?

Thanks in advance.
Regards,
Claire
Attachments:
The administrator has disabled public write access.

surge in TOMAWAC using MARUTI subroutine 7 years 3 months ago #27590

  • Phelype
  • Phelype's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 140
  • Thank you received: 64
Hi Claire,

From what it looks like in your fortran file, you are assigning the water level as the sum of the bathymetry with the current computation time, in seconds (?).

It should work fine. What you have to check if tomawac is actually calling ANAMAR. Do this: add a line printing some message inside ANAMAR and run tomawac to see if the program is entering the subroutine. Like this:
      DO IP=1,NPOIN2
        UC(IP)   = UCONST
        VC(IP)   = VCONST
        ZM(IP)   = ZF(IP)+HVAR
      ENDDO
!!!!!!!!!!!!!!!!!!!!!!
      PRINT*, '>>>>>>>>> DONE ASSIGNING WATER LEVEL TO ZM.'
!!!!!!!!!!!!!!!!!!!!!!

What I suspect is that tomawac is not even entering ANAMAR. If that's the case, make sure that the keyword "CONSIDERATION OF TIDE" is set to YES.

Best regards,

Phelype
The administrator has disabled public write access.

surge in TOMAWAC using MARUTI subroutine 7 years 3 months ago #27592

  • ClaireBeraud
  • ClaireBeraud's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 42
  • Thank you received: 2
Hi Phelype

It is actually running fine! I just missed that ZF is negative! As you said earlier it is the "cote du fond".

Well, thanks a lot for your advice.

Kind regards,
Claire
The administrator has disabled public write access.

surge in TOMAWAC using MARUTI subroutine 7 years 2 months ago #27800

  • Papadimitriou
  • Papadimitriou's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 80
  • Thank you received: 3
Dear all,

I am trying to implement the Maruti subroutine to read a user defined water level file.I tried to follow the attachment that was posted in this forum and use a modified limwac subroutine that Phelype helped me modify.I hope that the subroutine does what the maruti is supposed to achieve

Could you please once again help me solve the problems that occur in the attached output.txt file?

Kind regards,
Andreas
Attachments:
The administrator has disabled public write access.

surge in TOMAWAC using MARUTI subroutine 7 years 2 months ago #27801

  • c.coulet
  • c.coulet's Avatar
  • OFFLINE
  • Moderator
  • Posts: 3722
  • Thank you received: 1031
Hi
You should takes time to study fortran ...
There are many different problems in your program.
Some error message gives you a part of the solution...
For example, all the arguments of the subroutine which are of type INTENT(IN) couldn't be modified in the subroutine.
So the line TV1 = or TV2 = are wrong.
This subroutine allows you to give only a value to Z1 and Z2.

Regards
Christophe
The administrator has disabled public write access.

surge in TOMAWAC using MARUTI subroutine 7 years 2 months ago #27803

  • Phelype
  • Phelype's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 140
  • Thank you received: 64
Hello Andreas,

One problem you have there is that your fortran file has some very weird characters...

For example, this line: "TV2=AT_PP(Κ+2)".
If I convert then no integers I get:
[84 86 50 61 65 84 95 80 80 40 922 43 50 41]

See that 922? It's not supposed to be there. This is why on the output.txt gfortran shows "TV2=AT_PP(\xCE\x9A+2)". Fortran uses only the ASCII default set, so the characters must correspond to 127 maximum.

I'm guessing that you used a keyboard configuration that produces non-ASCII characters. For example, I use a Greek keyboard configuration to type math symbols. If I type "ATK" in English and convert to integers I get [65 84 75]. But if I type "ΑΤΚ" using the Greek configuration and convert to integers I get [913 932 922] even though they look exactly the same.

I'm attaching a fixed version of your fortran file.

Now you have to take a look at the intent errors. As Cristophe said, TV1 and TV2 are inputs of this subroutine, you cannot modify them.

File Attachment:

File Name: maruti_try_venuti.f
File Size: 3 KB
The administrator has disabled public write access.
The following user(s) said Thank You: Papadimitriou
  • Page:
  • 1
  • 2
Moderators: tfouquet

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