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

TOPIC: surge in TOMAWAC using MARUTI subroutine

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

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

Ok. So just to let you know: I have not used maruti.f in the end, so cannot confirm it is working -sorry.
Anamar.f was working though (please find attached). I did not use an associated file, but an analytic formulation. As I wanted Tomawac to spin-up first, I added a condition on time before amending the water depth in the code.

Hope that helps :cheer:
Regards,
Claire
Attachments:
The administrator has disabled public write access.
The following user(s) said Thank You: Papadimitriou

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

  • Papadimitriou
  • Papadimitriou's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 80
  • Thank you received: 3
Thank you all for your recommendations and help,I think I am starting to get somewhere.As I am trying to modify the depth inside the maruti subroutine, I get an error about incombatible ranks.I think I understand that I am trying to add two objects with different ranks but I can't locate my mistake could I ask you to help me once more in this topic?

Kind Regards,
Andreas
The administrator has disabled public write access.

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

  • c.coulet
  • c.coulet's Avatar
  • OFFLINE
  • Moderator
  • Posts: 3722
  • Thank you received: 1031
Hi

ZM is not an argument of the subroutine, so it can't have an INTENT(INOUT) type

regards
Christophe
The administrator has disabled public write access.

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

  • Phelype
  • Phelype's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 140
  • Thank you received: 64
There are a few things to consider about your code:

You are declaring a variable, ZM, with intent INOUT, that is, it is supposed to enter (INTENT(IN)) MARUTI, be used in it, and return to tomawac (INTENT(OUT)).

First problem here is that you created this variable, so it does not exist in tomawac, therefore it should be INTENT(OUT) only.

Then there is another problem: the variables passed from tomawac to MARUTI and back to tomawac must be on the call of the subroutine:
                      SUBROUTINE MARUTI!                     VV
     &(X,Y,NPOIN,NMAR,BINMAR,NBOR,NPTFR,AT,DDC,TV1,TV2,Z1,Z2,ZM)

But this brings up one more problem: You would have to modify every line that calls MARUTI and add this variable; then you would need to declare ZM in each of the subroutines that call MARUTI. This would make a big mess in your code. Definitely not recommended.

Your options:
  1. Modify your code so that you assign the values of Z1 and Z2 an the times TV1 and TV2, respectively, so that TOMAWAC will interpolate in between.
  2. Move your code to ANAMAR, as Mrs. Claire did. There the array ZM already exists and it is a single value in time, so I think it will be easier to implement.

I, particularly, would go with the second option mainly because I did not find out where and how the times TV1 and TV2 are calculated, so ANAMAR would be a more certain approach.

TL;DR: Move your code to ANAMAR that it will probably work better than in MARUTI.

P.S.: Another problem in your code is that in the loop (DO IP= 1,NPOIN), you are assigning "ZM(NPOIN)=-ZF+Z1". But here NPOIN is constant, not the loop iterator. You would have to change to IP.

Regards,

Phelype
The administrator has disabled public write access.
The following user(s) said Thank You: Papadimitriou

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

  • Papadimitriou
  • Papadimitriou's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 80
  • Thank you received: 3
Dear all,
I have tried to follow all your instuctions, and have come up with this version of the anamar subroutine.It seems to run at first but at the second iteration I get an ERROR end of file statement regarding the file where I want to read my water levels from.It does seem ok to me (there are indeed 169 values).Could you help me once again locate where the problem lies?

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

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

  • c.coulet
  • c.coulet's Avatar
  • OFFLINE
  • Moderator
  • Posts: 3722
  • Thank you received: 1031
Hi
The use of Telemac-Mascaret system require a basic knowledge of Fortran and it seems you're totally a newbie.
Start to learn Fortran, there is a lot of possibilities on Internet...

You try to read your file at each time step and when you reach the end of file at the end of the first time step, you don't do anything more and then try to continue reading and the second iteration but there is nothing else to read...

As you don't close your water level file, it stay open. If you just close it this will work but this will be fully time consuming.
You could also make a rewind of your file to start the reading again at the beginning. This will also work but stay inefficient.
As you save the variables in your program, this means you don't have to read them any more, just use them so you should modify the program to only read your file at the fist iteration and by-pass the reading after

Once again, spending time to learn a programming language like fortran is important if you plan to use Telemac more frequently.

Regards
Christophe
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Moderators: tfouquet

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