Welcome, Guest
Username: Password: Remember me

TOPIC: Programming Triangular Hyetograph

Programming Triangular Hyetograph 10 years 6 months ago #13029

  • JP
  • JP's Avatar
Hi community,

I am trying to make a triangular hyetograph using the prosou.f subroutine. I see there is different post about this topic and i read many of them but i want to use a different algorythm.

I just have a problem with the test in my code :
IF (AT.LT.TEMPS_MAX)THEN.
In fact this condition is never true when it should be true from AT=0 to AT= evenement duration/2.

The TEMPS_MAX is the evenement duration/2.
And I calculate it : time step (DT) * Number of step (LT)/2

Note that if I replace TEMPS_EVENEMENT by 1800.D0, then my test works. So it seems that the problem is coming from the calcul of TEMPS_EVENEMENT.

The code is as following.
IF(RAIN) THEN
        PLUIE_MAX = RAIN_MMPD*2.D0
        TEMPS_EVENEMENT = LT*DT
        TEMPS_MAX = TEMPS_EVENEMENT/2.D0 
        IF (AT.LT.TEMPS_MAX)THEN
          RAIN_MPS=RAIN_MMPD/86400000.D0*10.D0
!          RAIN_MPS=AT/TEMPS_MAX*PLUIE_MAX
        ELSE	
          RAIN_MPS=RAIN_MMPD/86400000.D0
!        RAIN_MPS=AT/(TEMPS_EVENEMENT-TEMPS_MAX)*PLUIE_MAX
        ENDIF
!        RAIN_MPS=RAIN_MMPD/86400000.D0*10
        SURDT=1.D0/DT
        IF(BANDEC) THEN
!         EVAPORATION (TENTATIVELY...) LIMITED BY AVAILABLE WATER
          DO I=1,NPOIN
            PLUIE%R(I)=MAX(RAIN_MPS,-HN%R(I)*SURDT)
          ENDDO
        ELSE
          CALL OS('X=C     ',X=PLUIE,C=RAIN_MPS)
        ENDIF 
      ENDIF

Is there a way to check the value of the different variables : PLUIE_MAX, TEMPS_EVENEMENT, TEMPS_MAX, PLUIE.

Nota : The variables are declared above in the program ;
The comment in the test are the real expression i will use when the test will work.

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

Programming Triangular Hyetograph 10 years 6 months ago #13030

  • jmhervouet
  • jmhervouet's Avatar
Hello,

Difficult to explain if TEMPS_EVENEMENT is duly declared as a double precision...

Anyway you can check the values of variables by printing them :

PRINT*,'TEMPS_EVENEMENT=',TEMPS_EVENEMENT,' LT=',LT,' DT=,DT

this will probably unravel the maze.

With best regards,

JMH
The administrator has disabled public write access.

Programming Triangular Hyetograph 10 years 6 months ago #13033

  • JP
  • JP's Avatar
Hello,

Thanks for your answer.

Actually, LT is not the total number of time step of the simulation (event simulation duration) but it the time step number (position from 1 to last) of the current time step. That's why my test was never true.

I checked all the available variables in prosou.f (written in comment) and i didn't find any variable that allows to calculate the event duration.

Sure I can use directly the middle duration of the event in my test like 1800 for a 1 hour event. But I think I will use often this subroutine so I would like to set the parameters from the .cas file, and for this i need to calculate the event duration.

Thanks for your help.

Best regards,

JP
The administrator has disabled public write access.
Moderators: pham

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