Welcome, Guest
Username: Password: Remember me

TOPIC: How to use partial Harmonic constant (from TPXO) as Tidal Boundary?

How to use partial Harmonic constant (from TPXO) as Tidal Boundary? 3 years 10 months ago #37579

  • Gareth
  • Gareth's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 46
Hello

TPXO8-altas has 13 tidal constituents,but I want to use part of them as the tidal boundary.

Does Telemac have any relevant settings that can directly select the required tidal constituents? Or It needs to be extracted from the TPXO8-altas data file first (maybe use TMD-tools)?

Best wishes

Gareth
The administrator has disabled public write access.

How to use partial Harmonic constant (from TPXO) as Tidal Boundary? 3 years 10 months ago #37580

  • pham
  • pham's Avatar
  • OFFLINE
  • Administrator
  • Posts: 1559
  • Thank you received: 602
Hello Gareth,

Currently, TELEMAC-2D and 3D are implemented to use every known tidal constituent available in the tidal solutions coming from OSU (like TPXO, European Shelf, etc.).

Anyway, you can do whatever you want by changing the TPXO module.
I think the easier way is to change the implementation of the DEF_CID subroutine of the TPXO module.

Rather than
      K = 1
      DO IC = 1,NC0
        IND(K) = 0
        DO JC = 1,TPXO_NCMX
          IF( CID(IC).EQ.TPXO_CONSTID(JC) ) THEN
            IND(K) = JC
            EXIT
          ENDIF
        ENDDO
        IF( IND(K).EQ.0 ) THEN
          WRITE(LU,*) 'TPXO : WARNING:' //
     &       'CONSTITUENT ID ',CID(IC),' IS NOT ALLOWED'
        ENDIF
        K = K + 1
      ENDDO

you can try:
      K = 1
      DO IC = 1,NC0
        IND(K) = 0
        DO JC = 1,TPXO_NCMX
          IF( CID(IC).EQ.TPXO_CONSTID(JC) 
     &       .AND.((CID(IC).EQ.'m2  ')
     &         .OR.(CID(IC).EQ.'m4  '))) THEN
            IND(K) = JC
            EXIT
          ENDIF
        ENDDO
        IF( IND(K).EQ.0 ) THEN
          WRITE(LU,*) 'TPXO : WARNING:' //
     &       'CONSTITUENT ID ',CID(IC),' IS NOT ALLOWED'
        ENDIF
        K = K + 1
      ENDDO

or directly:
      DO K = 1,NC0
        IND(K) = 0
      ENDDO
      IND(1) = 1
      IND(21) = 1
as M2 is the 1st tidal constituent and M4 is the 21st tidal constituent of the TPXO_CONSTID array.

I let you adjust the right implementation corresponding to the tidal constituents you want to keep.

Please tell me if it suits what you want (I have not compiled nor tried what I wrote).

Hope this helps,

Chi-Tuan
The administrator has disabled public write access.
The following user(s) said Thank You: Gareth

How to use partial Harmonic constant (from TPXO) as Tidal Boundary? 3 years 10 months ago #37583

  • Gareth
  • Gareth's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 46
Hello pham

Thank you for kindly help.

I have tried your advice as a user_fortran. Here is the code and feedback picture:
      K = 1
      DO IC = 1,NC0
        IND(K) = 0
        DO JC = 1,TPXO_NCMX
          IF( CID(IC).EQ.TPXO_CONSTID(JC) 
     &       .AND.((CID(IC).EQ.'q1')
     &         .OR.(CID(IC).EQ.'o1')
     &         .OR.(CID(IC).EQ.'p1')
     &         .OR.(CID(IC).EQ.'k1')
     &         .OR.(CID(IC).EQ.'n2')
     &         .OR.(CID(IC).EQ.'m2')
     &         .OR.(CID(IC).EQ.'s2')
     &         .OR.(CID(IC).EQ.'k2'))) THEN
            IND(K) = JC
            EXIT
          ENDIF
        ENDDO
        IF( IND(K).EQ.0 ) THEN
          WRITE(LU,*) 'TPXO : WARNING:' //
     &       'CONSTITUENT ID ',CID(IC),' IS NOT ALLOWED'
        ENDIF
        K = K + 1
      ENDDO


20210110_002.jpg


It seems that partial tidal constituents is used,which iss what I need.
But there is a problem with the simulation: no water in the calculation area.This case worked well before modify the DEF_CID subroutine of the TPXO module.

All regards

Gareth
The administrator has disabled public write access.

How to use partial Harmonic constant (from TPXO) as Tidal Boundary? 3 years 10 months ago #37615

  • pham
  • pham's Avatar
  • OFFLINE
  • Administrator
  • Posts: 1559
  • Thank you received: 602
Hello Gareth,

Even if you start with INITIAL CONDITIONS = CONSTANT ELEVATION with an INITIAL ELEVATION not so bad, do you still get the same error?

Anyway, looking a little bit deeper in the source code, the modifications are not so straightforward.

What I can suggest you is to change the input tidal solutions with the tidal constituents you want to keep.
You can try the enclosed Fortran program which may help you (I have just implemented it).
Please tell me if it is OK for you or not.

You will have to change a few things before compiling (look for the triple symbols !!!): mainly the definition of variables: NC_NEW (number of tidal constituents to keep), FILE_NEW1 (name of the new tidal database for water depth), FILE_NEW2 (name of the new tidal database for transports/velocities) and NEW_CONSTID (name of the tidal constituents written with 4 characters, blanks included), but also FILE_NAME1 and FILE_NAME2 (the name of the original BINARY DATABASE 1 or 2 FOR TIDE).

Hope this helps,

Chi-Tuan
Attachments:
The administrator has disabled public write access.
The following user(s) said Thank You: Gareth

How to use partial Harmonic constant (from TPXO) as Tidal Boundary? 3 years 10 months ago #37622

  • Gareth
  • Gareth's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 46
Hello pham

Thanks for your help.

I'll take a look at the source code later. Then,test your suggestions and give a feedback.

Best wishes

Gareth
The administrator has disabled public write access.

How to use partial Harmonic constant (from TPXO) as Tidal Boundary? 2 years 1 month ago #41243

  • smk.svks
  • smk.svks's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 93
  • Thank you received: 1
hello,

Is the code working to simulate the particular tidal constituent as an input?

Thanks in advance

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

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