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

TOPIC: Previmer database

Previmer database 5 months 4 weeks ago #43626

  • phmusiedlak
  • phmusiedlak's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 7
  • Thank you received: 1
Hello,

Thanks Chi-Tuan and Jerome for the advices.

There is a few additional tricks/troubles to faced to generate harmonics_constants.txt file from PREVIMER netCFD file:
- a netCFD sometimes has a scale factor (and a mask):
=> in Python (using scypi.io):
netcdf.NetCDFFile( folder + file ,'r', maskandscale=True )

- If you are a BlueKenue user: sometimes a given boundary is split in two in the .cli file, which gives something alike following:
5 6 6  0.000 0.000 0.000 0.000  4  0.000 0.000 0.000     939       1   # west
5 6 6  0.000 0.000 0.000 0.000  4  0.000 0.000 0.000    1006       2   # west
2 2 2  0.000 0.000 0.000 0.000  2  0.000 0.000 0.000    1071       3   # 
2 2 2  0.000 0.000 0.000 0.000  2  0.000 0.000 0.000    1154       4   # 
...
2 2 2  0.000 0.000 0.000 0.000  2  0.000 0.000 0.000       7     716   # 
2 2 2  0.000 0.000 0.000 0.000  2  0.000 0.000 0.000       3     717   # 
5 6 6  0.000 0.000 0.000 0.000  4  0.000 0.000 0.000       1     718   # west
5 6 6  0.000 0.000 0.000 0.000  4  0.000 0.000 0.000       2     719   # west
...

==> Since the list of bc-nodes (ie last column) is broken, it makes the mess when imposing the harmonics. Hence, the only thing to do is to reorder the .cli file by gathering boundaries together. It should look like:
5 6 6  0.000 0.000 0.000 0.000  4  0.000 0.000 0.000     939   1   # west
5 6 6  0.000 0.000 0.000 0.000  4  0.000 0.000 0.000    1006   2   # west
5 6 6  0.000 0.000 0.000 0.000  4  0.000 0.000 0.000       1   3   # west
5 6 6  0.000 0.000 0.000 0.000  4  0.000 0.000 0.000       2   4   # west
...
I came up with a (badly written) Python script:
merge_bcs.py


- the harmonics_constants.txt file needs the coordinates to be in WGS-84 lat/long (ie EPSG:4326); even if your simulation is in another referential. Hence, you need to convert your boundaries nodes location into WGS-84 before interpolating PREVIMER data at nodes location.


The (not user-friendly) script generating the harmonics_constants.txt :
gen_previmer_v2.py

Both scripts are available on my GitLab, but are likely to change : gitlab.com/phmusiedlak/public


Hopefully it works :)



btw, I hava a question: I am using the full list of components available by PREVIMER, but I was wondering what is the list that TELEMAC is capable of eating? (it didn't make any complains so far ><)


Pierre-Henri
The administrator has disabled public write access.

Previmer database 5 months 1 week ago #43753

  • pham
  • pham's Avatar
  • OFFLINE
  • Administrator
  • Posts: 1460
  • Thank you received: 563
Hello Pierre-Henri,

Thanks for having shared your scripts.

In TELEMAC, the convention is as BK (that is normal), the numbering of boundary nodes starts from the point located the more South-West of the domain (see x+y value). When dealing with PREVIMER, FES or NEA, the harmonic constituents should be read in the same order than the initial boundary nodes.

You can read the components available for BORD_TIDE_MISC (to use PREVIMER, FES or NEA tidal database) in DECLARATIONS_TELEMAC2D module:
      CHARACTER(LEN=4) :: MISC_CONSTID_BTM(MISC_NCMX_BTM) =
     &                 (/'2MK6','2MN6','2MS6','2N2 ','2Q1 ',
     &                   '2SM2','2SM6','E2  ','Tta1','J1  ',
     &                   'K1  ','K2  ','KJ2 ','KQ1 ','L2  ',
     &                   'La2 ','M1  ','M2  ','M3  ','M4  ',
     &                   'M6  ','M8  ','Mf  ','MK3 ','MK4 ',
     &                   'MKS2','Mm  ','MN4 ','MO3 ','MP1 ',
     &                   'MS4 ','MSf ','MSK6','MSN2','MSN6',
     &                   'MSqm','Mtm ','Mu2 ','N2  ','N4  ',
     &                   'Nu2 ','O1  ','OO1 ','P1  ','Pi1 ',
     &                   'Q1  ','R2  ','Ro1 ','S1  ','S2  ',
     &                   'S4  ','Sa  ','Sig1','SK4 ','SN4 ',
     &                   'Ssa ','T2  ','Phi1','Ki1 ','Psi1',
     &                   'Z0  '/)

There are currently 61 constituents including PREVIMER, NEA and FES2014 ones.

Hope this helps and thanks for your scripts,

Chi-Tuan
The administrator has disabled public write access.
The following user(s) said Thank You: phmusiedlak
  • Page:
  • 1
  • 2
Moderators: pham

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