Welcome, Guest
Username: Password: Remember me

TOPIC: Returning Minimum Free Surface Elevation along a control section

Returning Minimum Free Surface Elevation along a control section 11 years 9 months ago #7674

Hello TELEMAC community,

I am interested in returning the minimum free surface elevation along a control section via updating subroutines flusec_telemac2d.f and fulxpr_telemac2d.f. Although what I've written compiles successfully (using g95), T2D exits after the first time step of the simulation, and fails to print. Any help on fixing this issue, or suggestions for a more appropriate solution would be much appreciated.

Thank you,
Chris

Added in the declarations section:
!=======================================================================
! Variables added by CGM 02/23/13 in order to return water surface 
! elevation along a control section. Necessary for Tidal Discharge 
! Oscillation Technical Paper
      INTEGER, INTENT(IN) :: NPOIN
      DOUBLE PRECISION, INTENT(IN) :: ZF(NPOIN)
      DOUBLE PRECISION, ALLOCATABLE :: WSE(:)
      DOUBLE PRECISION WSE1,WSE2
!      INTRINSIC MIN
!=======================================================================

And then to retain the minimum free surface elevation along a control section:
!       COMPUTING THE FLUX DIRECTLY, REGARDLESS OF THE WEAK FORM
!       OF THE IMPERMEABILITY CONDITION
!

        DO ISEG = 1 , NSEG(ISEC)
          I1 = LISTE(ISEC,ISEG,1)
          I2 = LISTE(ISEC,ISEG,2)
          X1 = X(I1)
          X2 = X(I2)
          Y1 = Y(I1)
          Y2 = Y(I2)
          H1 = H%R(I1)
          H2 = H%R(I2)
          NX = Y1-Y2
          NY = X2-X1
          UN1= U%R(I1)*NX + V%R(I1)*NY
          UN2= U%R(I2)*NX + V%R(I2)*NY
          FLX(ISEC) = FLX(ISEC) + ((H1+H2)*(UN1+UN2)+H2*UN2+H1*UN1)*SUR6
!=======================================================================
! Purpose of the following is to compare free surface elevations along
! control section segments, and keep the minimum value for the section.
!=======================================================================
!         WSE1 = MIN(0.0D0,(ZF%R(I1)+H1))
!         WSE2 = MIN(0.0D0,(ZF%R(I2)+H2))
!         WSE(ISEC) = MIN(WSE(ISEC),WSE1,WSE2)
          WSE1 = ZF(I1)+H1
          WSE2 = ZF(I2)+H2
           IF(WSE1.LT.WSE(ISEC)) THEN
            WSE(ISEC)=WSE1
           ELSEIF(WSE2.LT.WSE(ISEC)) THEN
            WSE(ISEC)=WSE2
           ENDIF
! \\end of user defined section
!=======================================================================
        ENDDO

The altered subroutines have been attached to this message if anyone has a chance to look through them.

File Attachment:

File Name: flusec_telemac2d.f
File Size: 15 KB


File Attachment:

File Name: fluxpr_telemac2d.f
File Size: 12 KB
The administrator has disabled public write access.

Returning Minimum Free Surface Elevation along a control section 11 years 8 months ago #7685

  • riadh
  • riadh's Avatar
Hello,

Which kind of error Telemac gives you when stopping? Do you run in parallel or not?

Riadh
The administrator has disabled public write access.

Returning Minimum Free Surface Elevation along a control section 11 years 8 months ago #7692

Hello Riadh,

I am running a serial installation of V6P1, compiled in windows using g95. There aren't any error messages, but when I initiate the simulation, TELEMAC-2D steps out of the routine after the first calculation, and before it would normally print out the control section values. The first screen shot below shows the DOS prompt output (with the modified routines in first post), while the second shows the results of the original routines.

Note: I don't care much about printing the WSE values from a control section to the DOS prompt, but I'd rather like to print them in the control section output file.

Screenshot #1: Simulation stepping out w/modified routines
================================================================================

 ITERATION        0    TIME:   0.0000 S

================================================================================

 ITERATION        1    TIME:   0.5000 S
 THE LIQUID BOUNDARIES FILE CONTAINS
 100001  LINES WITH:
 SL(2)
 LIQUID BOUNDARY: SL(2)   = -10.390005
--------------------------------------------------------------------------------

                          ADVECTION STEP
--------------------------------------------------------------------------------

                    DIFFUSION-PROPAGATION STEP
 RESCJG (BIEF) :       34 ITERATIONS, RELATIVE PRECISION:   0.8762344E-06
--------------------------------------------------------------------------------

                          K-EPSILON MODEL
 GRACJG (BIEF) :        4 ITERATIONS, RELATIVE PRECISION:   0.2556027E-09
 GRACJG (BIEF) :        4 ITERATIONS, RELATIVE PRECISION:   0.1565605E-09

C:\0_GiffordMiears\SVNs\Tidal_Oscillation_Paper_SVN\TELEMAC_Project_Files\TELEMA
C_simulation_files>

Screenshot#2: Expected simulation print out
================================================================================

 ITERATION        0    TIME:   0.0000 S

================================================================================

 ITERATION        1    TIME:   0.5000 S
 THE LIQUID BOUNDARIES FILE CONTAINS
 100001  LINES WITH:
 SL(2)
 LIQUID BOUNDARY: SL(2)   = -10.390005
--------------------------------------------------------------------------------

                          ADVECTION STEP
--------------------------------------------------------------------------------

                    DIFFUSION-PROPAGATION STEP
 RESCJG (BIEF) :       34 ITERATIONS, RELATIVE PRECISION:   0.8762344E-06
--------------------------------------------------------------------------------

                          K-EPSILON MODEL
 GRACJG (BIEF) :        4 ITERATIONS, RELATIVE PRECISION:   0.2556027E-09
 GRACJG (BIEF) :        4 ITERATIONS, RELATIVE PRECISION:   0.1565605E-09

 CONTROL SECTION NUMBER  1 (NAME DS_xsec_1)

     DISCHARGE:     8058.990

 CONTROL SECTION NUMBER  2 (NAME DS_xsec_2)

     DISCHARGE:     8062.731

 CONTROL SECTION NUMBER  3 (NAME DS_xsec_3)

     DISCHARGE:     8066.064

 CONTROL SECTION NUMBER  4 (NAME DS_xsec_4)

     DISCHARGE:     8059.426

 CONTROL SECTION NUMBER  5 (NAME Left_xsec_1)

     DISCHARGE:     6704.870

 CONTROL SECTION NUMBER  6 (NAME Left_xsec_2)

     DISCHARGE:     6714.580

 CONTROL SECTION NUMBER  7 (NAME Left_xsec_3)

     DISCHARGE:     6712.749

 CONTROL SECTION NUMBER  8 (NAME Right_xsec_1)

     DISCHARGE:     1325.026

 CONTROL SECTION NUMBER  9 (NAME Right_xsec_2)

     DISCHARGE:     1331.512

 CONTROL SECTION NUMBER 10 (NAME Right_xsec_3)

     DISCHARGE:     1331.390
--------------------------------------------------------------------------------

                       BALANCE OF WATER VOLUME
     VOLUME IN THE DOMAIN :   0.2156630E+08 M3
     FLUX BOUNDARY    1:     8000.003     M3/S  ( >0 : ENTERING  <0 : EXITING )
     FLUX BOUNDARY    2:    -8038.788     M3/S  ( >0 : ENTERING  <0 : EXITING )
     RELATIVE ERROR IN VOLUME AT T =       0.5000     S :   -0.8819236E-09

================================================================================

Thank you for your response,
I look forward to hearing back from you.
-Chris
The administrator has disabled public write access.

Returning Minimum Free Surface Elevation along a control section 11 years 8 months ago #7693

  • jmhervouet
  • jmhervouet's Avatar
Hello,

I do not understand well what you are doing, from a Fortran point of view. Did you change also the call to the subroutine flusec_telemac2d.f ? If not it is the problem, if yes and if you added ZF it is also a problem because ZF is a bief_obj structure (see guide for programming in the Telemac system).

To avoid any problem, do not change the number of arguments of a subroutine. Normally the interface should complain about that, but here it seems that this subroutine is not in the interface_telemac2d.

A better way is to add at the beginning of the subroutine :

USE DECLARATIONS_TELEMAC2D, ONLY : NPOIN,ZF

but ZF will be here a BIEF_OBJ structure, so that the double precision value for point I will be ZF%R(I).

Same thing for FLUXPR_TELEMAC2D, if you want to change its number of arguments, it is better to rename it FLUXPR2 and to do a call fluxpr2(...) with the extra arguments (but then no interface will check what you are doing).

I hope this helps,

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

Returning Minimum Free Surface Elevation along a control section 11 years 8 months ago #7697

  • riadh
  • riadh's Avatar
Hello Chris,

Verify what Jean Michel suggested, I think that he pointed out the problem.
If you need the output to be written in the control section file, do not forget to add the keyword SECTIONS OUTPUT FILE.

With my best regards,

Riadh ATA
The administrator has disabled public write access.

Returning Minimum Free Surface Elevation along a control section 11 years 8 months ago #7702

Jean-Michel and Riadh,

Sorry for the delayed response.

I updated flusec_telemac2d.f with the appropriate declarations statement and my function now runs, passes the new array to fluxpr2.f, and prints to the control section outputs text file successfully.

My problem was indeed the declarations statement along with an inappropriate subroutine argument change.

Thank you very much for your help! I will certainly be more mindful of the programmer's guide in the future.

Best regards,
Chris

Updated Fortran files attached:

File Attachment:

File Name: flusec_telemac2d_2013-02-26-2.f
File Size: 15 KB

File Attachment:

File Name: fluxpr2.f
File Size: 12 KB
The administrator has disabled public write access.
Moderators: pham

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