Bug report: GMAO_FP ancillary data, inconsistent pressure units

Post Reply
sakvaka_env
Posts: 25
Joined: Mon Mar 07, 2022 9:54 am
company / institution: Finnish Environment Institute
Location: Helsinki, Finland

Bug report: GMAO_FP ancillary data, inconsistent pressure units

Post by sakvaka_env »

Bug report

Surface pressure is in millibars/hectopascals for previous NASA ancillary data sets, but in GMAO GEOS-5 FP-IT ancillary data files, the pressure unit is in pascals (1 mbar = 1 hPa = 100 Pa). Polymer v.4.16 doesn't do the conversion to millibars while it loads GMAO_FP ancillary data, which leads to 100-fold too high atmospheric pressures and then gives index overflow in the LUT table lookup.
sakvaka_env
Posts: 25
Joined: Mon Mar 07, 2022 9:54 am
company / institution: Finnish Environment Institute
Location: Helsinki, Finland

Re: Bug report: GMAO_FP ancillary data, inconsistent pressure units

Post by sakvaka_env »

Patch to fix it.

Code: Select all

--- ancillary.original  2023-04-06 12:56:14.614553779 +0300
+++ ancillary.py        2023-04-06 12:56:47.183812874 +0300
@@ -214,6 +214,8 @@

         elif param == 'surf_press':
             press = ds['PS'].values
+            if 'units' in ds['PS'].attrs.keys() and ds['PS'].units == 'Pa':
+                press /= 100.
             D = LUT_LatLon(press[::-1,:])
             D.filename = {'meteo': orig_filename}
User avatar
fsteinmetz
Site Admin
Posts: 314
Joined: Fri Sep 07, 2018 1:34 pm
company / institution: Hygeos
Location: Lille, France
Contact:

Re: Bug report: GMAO_FP ancillary data, inconsistent pressure units

Post by fsteinmetz »

Hi Sakari,
Many thanks for your bug report and for the patch, this is great!
I will provide your fix as an update.
Cheers, François
Post Reply