ClimateGlobalChange/tempestextremes

Working with custom data raises error due to "time" dimension

Closed this issue · 4 comments

Hi
I have created a sample .nc file set as :
: cat aifs_files.txt
mean_sea_level_pressure.nc;VAR_10U.nc;VAR_10V.nc;geopotential_at_surface.nc;geopotential.nc

and try to run:

DetectNodes --in_data_list aifs_files.txt --mergedist 6.0 --searchbymin mean_sea_level_pressure --closedcontourcmd "mean_sea_level_pressure,
200.0,5.5,0;_DIFF(geopotential(300hPa),geopotential(500hPa)),-58.8,6.5,1.0" --outputcmd "mean_sea_level_pressure,min,0;_DIV(geopotential_at_surface,9.81),max,0;_VECMAG(VAR_10U,VAR_1
0V),max,2" --latname lat --lonname lon --regional

When I run this script it comes back with the following error:
Parsing closed contour operations
..mean_sea_level_pressure increases by 200.000000 over 5.500000 degrees (min search 0.000000 deg)
.._DIFF(geopotential(300hPa),geopotential(500hPa)) decreases by 58.800000 over 6.500000 degrees (max search 1.000000 deg)
..Done
Parsing output operations
..Minimum of mean_sea_level_pressure within 0.000000 degrees
..Maximum of _DIV(geopotential_at_surface,9.81) within 0.000000 degrees
..Maximum of _VECMAG(VAR_10U,VAR_10V) within 2.000000 degrees
..Done
Begin search operation
..Generating RLL grid data
....Total calculated grid area: 1.331664972180414e+00 sr
....Done
..Time 2024-06-26 00:00:00
....EXCEPTION (/home/conda/feedstock_root/build_artifacts/tempest-extremes_1710939574090/work/src/base/Variable.cpp, Line 865) Variable "mean_sea_level_pressure" in file "mean_sea_level_pressure.nc" has inconsistent auxiliary dimensions (3) than specified on command line (2)

I have to somehow supply time dimension here but not sure how. Documentation says these parameters are 2D but somehow time has to play a role here so that I can stack up 6 hourly input fields. I tried to follow .cpp files but It will make my life much simpler if there is an easy way here. Also this is how mean_sea_level_pressure .nc file is:
netcdf mean_sea_level_pressure {
dimensions:
lat = 200 ;
lon = 398 ;
time = 12 ;
variables:
float lat(lat) ;
lat:_FillValue = NaNf ;
lat:long_name = "latitude" ;
lat:units = "degrees_north" ;
float lon(lon) ;
lon:_FillValue = NaNf ;
lon:long_name = "longitude" ;
lon:units = "degrees_east" ;
int64 time(time) ;
time:units = "hours since 2024-06-26 00:00:00" ;
time:calendar = "proleptic_gregorian" ;
float mean_sea_level_pressure(lat, lon, time) ;

Any help on this? Thank you very much

In TempestExtremes time needs to be the first dimension of each variable. So you'd need to reshape mean_sea_level_pressure to float mean_sea_level_pressure(time,lat,lon).

Thank you for a quick reply.. I actually started in that order but I ran into the following error:
....EXCEPTION (/home/conda/feedstock_root/build_artifacts/tempest-extremes_1710939574090/work/src/base/NetCDFUtilities.cpp, Line 1025) Specified dimension "300hPa" for variable "geopotential" is incompatible with dimension units "degrees_north"

It suggested that x,y,t had to be the order so I reshaped the files. If all variables are in (time,lat,lon,level) I get the error above..
Thanks
here is again .nc header:
netcdf mean_sea_level_pressure {
dimensions:
lat = 200 ;
lon = 398 ;
time = 12 ;
variables:
float lat(lat) ;
lat:_FillValue = NaNf ;
lat:long_name = "latitude" ;
lat:units = "degrees_north" ;
float lon(lon) ;
lon:_FillValue = NaNf ;
lon:long_name = "longitude" ;
lon:units = "degrees_east" ;
int64 time(time) ;
time:units = "hours since 2024-06-26 00:00:00" ;
time:calendar = "proleptic_gregorian" ;
float mean_sea_level_pressure(time, lat, lon) ;

Dimension ordering should be (time,level,lat,lon). This allows TE to more rapidly extract 2D timeslices from the file.

Great.. That worked.. Thank you very much