how to compute wind (uv) stream function?
Added by paolo de luca almost 4 years ago
Hi,
I am struggling quite a lot for computing the stream function from u and v wind at 500hPa.
From what I understood I can do this with CDO as follows:
cdo merge u and v wind netcdfs
cdo remapbil to gaussian of the uv_ncfile
cdo uv2dv
and finally cdo dv2ps.
I tried all these passages but my output is not right. Maybe I am doing wrong the merging of the datasets...I don't know..
Would you be so kind to help a little bit?
I attach you here two ERA5 (0.25deg) ncfiles of u and v wind at 500hPa. Ideally I would like to retain the original ERA5 horizontal resolution for the stream function.
Thank you,
Paolo
ERA5_v_500hPa_test.nc (29.7 MB) ERA5_v_500hPa_test.nc | v_data.nc | ||
ERA5_u_500hPa_test.nc (29.7 MB) ERA5_u_500hPa_test.nc | u_data.nc |
Replies (6)
RE: how to compute wind (uv) stream function? - Added by Ralf Mueller almost 4 years ago
hi paolo!
I am not sure, but what have divergence and vorticity in common with the stream function? Maybe I miss the correct definition of the term stream function here, sry.
best wishes
ralf
RE: how to compute wind (uv) stream function? - Added by paolo de luca almost 4 years ago
hi Ralf,
I referred to divergence and vorticity because cdo functions: uv2dv and dv2ps. to me these two steps were the only way I could get the stream function of u and v.
but yes, divergence and vorticity are not mentioned in the definition of the stream function
and still my question remains: (how) can I compute the stream function of u and v with cdo?
Thanks for your help,
P
RE: how to compute wind (uv) stream function? - Added by Ralf Mueller almost 4 years ago
hi again!
I still miss your definition of the stream function of a velocity field.
cheers
ralf
RE: how to compute wind (uv) stream function? - Added by paolo de luca almost 4 years ago
hello Ralf,
thanks again
see here for the definition of the stream function: https://en.wikipedia.org/wiki/Stream_function (Two-dimensional stream function, Definitions, Definition by use of a vector potential)
Best,
Paolo
RE: how to compute wind (uv) stream function? - Added by Uwe Schulzweida almost 4 years ago
Hi Paolo,
Can you please describe what is wrong with your output?
We need the CDO version number (cdo -V) and the result of:
cdo -b F32 sp2gp -dv2ps -uv2dv -remapbil,F360 -seltimestep,1 -merge ERA5_u_500hPa_test.nc ERA5_v_500hPa_test.nc resultCheers,
Uwe
RE: how to compute wind (uv) stream function? - Added by paolo de luca almost 4 years ago
dear Uwe,
thanks!
here CDO -V:
(base) paolo@paolos-mbp Desktop % cdo -V
Climate Data Operators version 1.9.8 (https://mpimet.mpg.de/cdo)
System: x86_64-apple-darwin19.4.0
CXX Compiler: clang++ -std=gnu++11 -g -O2 -D_THREAD_SAFE -pthread
CXX version : Apple clang version 11.0.3 (clang-1103.0.32.59)
C Compiler: clang -g -O2 -D_THREAD_SAFE -pthread -D_THREAD_SAFE -D_THREAD_SAFE -pthread
C version : Apple clang version 11.0.3 (clang-1103.0.32.59)
F77 Compiler: gfortran -g -O2
F77 version : GNU Fortran (Homebrew GCC 9.3.0_1) 9.3.0
Features: 64GB 12threads C++11 Fortran DATA PTHREADS HDF5 NC4/HDF5 OPeNDAP SZ SSE4_2
Libraries: HDF5/1.12.0
Filetypes: srv ext ieg grb1 grb2 nc1 nc2 nc4 nc4c nc5
CDI library version : 1.9.8
cgribex library version : 1.9.4
ecCodes library version : 2.17.0
NetCDF library version : 4.7.4 of Jan 3 2021 17:05:10 $
hdf5 library version : 1.12.0
exse library version : 1.4.1
FILE library version : 1.8.3
and results attached:
(base) paolo@paolos-mbp Desktop % cdo -b F32 sp2gp -dv2ps -uv2dv -remapbil,F360 -seltimestep,1 -merge ERA5_u_500hPa_test.nc ERA5_v_500hPa_test.nc result
cdo(1) dv2ps: Process started
cdo(2) uv2dv: Process started
cdo(3) remapbil: Process started
cdo(4) seltimestep: Process started
cdo(5) merge: Process started
cdo(3) remapbil: Bilinear weights from lonlat (1440x721) to gaussian (1440x720) grid
cdo(5) merge: Processed 2 variables over 30 timesteps.
cdo(4) seltimestep: Processed 2076480 values from 2 variables over 2 timesteps.
cdo(3) remapbil: Processed 2076480 values from 2 variables over 1 timestep.
cdo(2) uv2dv: Processed 2073600 values from 2 variables over 1 timestep.
cdo(1) dv2ps: Processed 461760 values from 2 variables over 1 timestep.
cdo sp2gp: Processed 461760 values from 2 variables over 1 timestep [13.23s 4215MB].
looks like correct!
thanks,
Paolo