Welcome, Guest
Username: Password: Remember me

TOPIC: ecmwf2srf Spatial range out of bound

ecmwf2srf Spatial range out of bound 2 years 5 months ago #40560

  • TomS
  • TomS's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 71
  • Thank you received: 8
Hi,

I am trying to convert some ECMWF .nc data to .slf using the command:

converter.py ecmwf2srf --from '2011-05-01' --stop '2011-05-02' --bl '(52.41,-10.12)' --tr '(56.98,-4.93)' --dataset copernicus.nc --stream oper ecmwf.slf

but am getting the error:

+> set the mesh and connectivity
Traceback (most recent call last):
File "/home/tom/telemac/v8p2/scripts/python3/converter.py", line 295, in <module>
main()
File "/home/tom/telemac/v8p2/scripts/python3/converter.py", line 198, in main
ecmwf2srf(options.tfrom, options.tstop, options.blcorner,
File "/home/tom/telemac/v8p2/scripts/python3/data_manip/conversion/convert_ecmwf.py", line 340, in ecmwf2srf
write_file(req, file_type, download, dataset, stream,
File "/home/tom/telemac/v8p2/scripts/python3/data_manip/conversion/convert_ecmwf.py", line 268, in write_file
ecmwf2slf.set_geometry()
File "/home/tom/telemac/v8p2/scripts/python3/data_manip/formats/ecmwf.py", line 456, in set_geometry
raise TelemacException(
utils.exceptions.TelemacException: ... your spatial range seems out of bound:
you asked for [ 349.88-355.07], while x is:
array([-10.12, -9.87, -9.62, -9.37, -9.12, -8.87, -8.62, -8.37,
-8.12, -7.87, -7.62, -7.37, -7.12, -6.87, -6.62, -6.37,
-6.12, -5.87, -5.62, -5.37, -5.12], dtype=float32)

The data downloaded from the ECMWF site was in the box zone North 56.98°, West -10.12°, South 52.41°, East -4.93°.

Can anyone advise? I have attached the .nc file.

Thanks,

Tom
Attachments:
The administrator has disabled public write access.

ecmwf2srf Spatial range out of bound 2 years 4 months ago #40566

  • jtravert
  • jtravert's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 36
  • Thank you received: 23
Hello,
There may be an error in one of the scripts related to the procedure, but it needs further investigation.
For now, so that you can use it, there seems to be a solution :
In your telemac installation, go to /scripts/python3/data_manip/formats folder and edit the script ecmwf.py.
At line 449 comment or erase the following lines :
if float(x_1) < 0.:
    x_1 = float(x_1) + 360.0
if float(x_2) < 0.:
    x_2 = float(x_2) + 360.0

It should work fine with these modifications.


PS : In your file there is no surface pressure variable "sp" which is included in the script process, so you should add it in your .nc file or adapt the script for instance in the "append_core_vars_ecmwf" function in the ecmwf.py script.

Good luck with modifying the scripts,
Jean-Paul
The administrator has disabled public write access.

ecmwf2srf Spatial range out of bound 2 years 4 months ago #40567

  • TomS
  • TomS's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 71
  • Thank you received: 8
Thanks very much, Jean-Paul. I'll keep you posted as to how things work out.

Tom
The administrator has disabled public write access.

ecmwf2srf Spatial range out of bound 2 years 4 months ago #40592

  • TomS
  • TomS's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 71
  • Thank you received: 8
Just to let you know that the script appeared to work well, Jean-Paul.

Unfortunately, when I try to couple the BINARY ATMOSPHERIC DATA FILE with Waqtel for heat transfer (WATER QUALITY PROCESS = 11) and ATMOSPHERE-WATER EXCHANGE MODEL = 1, I am getting the error:

ERROR 1000 DURING CALL OF METEO,INIT_FIC_BINARY:GET_DATA_TIME:I
ERROR TEXT: HERMES_RECORD_UNKNOWN_ERR
ERROR IN /home/tom/telemac/v8p2/run/west_coast_linnhe_focus_MAY_2018_10_layers_FINAL_COPERNICUS/t3d_tide-ES_real_gen_coast.cas_2022-07-05-15h25min40s/T3ATMB: RECORD: 8 IS NOT WITHIN [0, 7

PLANTE: PROGRAM STOPPED AFTER AN ERROR
RETURNING EXIT CODE: 2

I wonder if anyone could possibly advise on this?

Thanks,

Tom
The administrator has disabled public write access.

ecmwf2srf Spatial range out of bound 2 years 4 months ago #40594

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

Which release do you use? If it is a v8p2r0 or older, there is a bug solved from v8p2r1:
"all modules with binary meteo data: error of index when initialising BINARY ATMOSPHERIC DATA FILE in METEO_TELEMAC module".

The usual good advice is to use the latest release of the TELEMAC-MASCARET system.

Chi-Tuan
The administrator has disabled public write access.

ecmwf2srf Spatial range out of bound 2 years 4 months ago #40596

  • TomS
  • TomS's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 71
  • Thank you received: 8
Hi Chi-Tuan,

It is indeed v8p2r0, I will upgrade and let you know how things go.

Many thanks,

Tom
The administrator has disabled public write access.

ecmwf2srf Spatial range out of bound 2 years 4 months ago #40609

  • TomS
  • TomS's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 71
  • Thank you received: 8
Hi Chi-Tuan,

Upgrading to v8p3r1 has done the trick and the binary weather data file is being read by WAQTEL for heat and momentum exchange.

For info., the only way I could get it to function properly in parallel was to set the slf as:

BINARY DATA FILE 2 = ecmwf_may_2018.slf

Thanks,

Tom
The administrator has disabled public write access.

ecmwf2srf Spatial range out of bound 2 years 4 months ago #40612

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

This is interesting. Can you tell me what is inside your file ecmwf_may_2018.slf and where data are located please, probably not at the same nodes as in your geometry file?

Can you run the following command for the 2 files (ecmwf_may_2018.slf and your geometry file):
run_telfile.py scan ecmwf_may_2018.slf and run_telfile.py scan ecmwf_may_2018.slf name_geometry_file
and copy the results here please.

Can you also upload your steering files + possible Fortran files please?

Chi-Tuan
The administrator has disabled public write access.

ecmwf2srf Spatial range out of bound 2 years 4 months ago #40613

  • TomS
  • TomS's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 71
  • Thank you received: 8
Hi Chi-Tuan,

The data were downloaded from the ECMWF web site for U,V,T and surface pressure. They were then converted to binary slf format using the ecmwf2srf conversion script.

The weather data are not located at the same nodes as my geometry file and I note that the X and Y ranges are different - the weather data is in lon/lat and the geometry is projected to WGS84 UTM 30N. Is this an issue?


run_telfile.py scan ecmwf_april_2018.slf

Interpreting command line options
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Warning: Using SerafinFile. It is recommended to compile Hermes api
~> Generic info

- Title:
- Date: 2018-03-31 13:00:00
- Format: SERAFIN
- Endianess: BIG_ENDIAN
- Precision: Single precision

~> Mesh info

- Number of dimensions: 2
- Element type: triangle
- Number of points: 399
- Number of elements: 720
- Number of points per element: 3
- Number of planes: 1

+> Coordinates

- X offset, Y offset = 0, 0
- X range [-10.119999885559082, -5.119999885559082]
- Y range [52.40999984741211, 56.90999984741211]

~> Parallel info

- No parallel information

~> Boundary info

- No boundary file given

~> Data info

- Number of records: 120
- Time range: [0.0, 2570400.0]
- Number of variables: 4
- Name: SURFACE PRESSURE Unit: UI
- Name: WIND VELOCITY U Unit: M/S
- Name: WIND VELOCITY V Unit: M/S
- Name: AIR TEMPERATURE Unit: DEGREES

//////////////////////////////////////////////


run_telfile.py scan geo_tide_west_coast.slf

Interpreting command line options
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Warning: Using SerafinFile. It is recommended to compile Hermes api
~> Generic info

- Title: west_coast_final
- Date: 1900-01-01 00:00:00
- Format: SERAFIN
- Endianess: BIG_ENDIAN
- Precision: Single precision

~> Mesh info

- Number of dimensions: 2
- Element type: triangle
- Number of points: 142205
- Number of elements: 256057
- Number of points per element: 3
- Number of planes: 1

+> Coordinates

- X offset, Y offset = 0, 0
- X range [188243.671875, 410789.21875]
- Y range [6107188.0, 6562891.5]

~> Parallel info

- No parallel information

~> Boundary info

- No boundary file given

~> Data info

- Number of records: 1
- Time range: [0.0, 0.0]
- Number of variables: 1
- Name: BOTTOM Unit:

//////////////////////////////////////////////////////////////

There does appear to be heat transfer occuring over the first 100 or so iterations.

Thanks,

Tom
Attachments:
The administrator has disabled public write access.

ecmwf2srf Spatial range out of bound 2 years 4 months ago #40614

  • TomS
  • TomS's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 71
  • Thank you received: 8
Hi Chi-Tuan,

I've carried out the following steps which appear to work for my model.

1) Convert weather data from nc to slf:

converter.py ecmwf2srf --from '2018-04-10' --stop '2018-04-30' --bl '(53.9,-8.5)' --tr '(60.,-3.6)' --dataset ecmwf_10_30_april_2018_ok.nc --stream oper ecmwf_april_2018.slf

2) Transform slf weather data in lon/lat (from ECMWF site) to UTM 30 N:

run_telfile.py alter --ll2utm 30 ecmwf_april_2018.slf ecmwf_april_2018_UTM.slf

3) Date appears to be slightly out in the ecmwf_april_2018_UTM.slf file, so modify:

run_telfile.py alter ecmwf_april_2018_UTM.slf --date '2018-04-10 00:00:00' ecmwf_april_2018_new.slf

4) Finally, map the UTM weather data on to my geometry mesh:

converter.py generate_atm geo_tide_west_coast.slf ecmwf_april_2018_new.slf ecmwf_april_2018_final.slf

The following command now works correctly:

BINARY ATMOSPHERIC DATA FILE = ecmwf_april_2018_final.slf

Samples of the mapped weather data on to the mesh are shown.

Thanks,

Tom
Attachments:
The administrator has disabled public write access.
The following user(s) said Thank You: Cyangou
Moderators: borisb

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