Project

General

Profile

Zaxistype operator

Added by Guilherme Martins over 8 years ago

Hi users,

I'm trying to convert axistype generic->height but I'm not capable do that.

I created the file coordz.txt with the informations below, and then I used the setzaxis but the zaxistype don't change.

cdo zaxisdes soita.clay.nc

#
  1. zaxisID 1 #
    zaxistype = generic
    size = 6
    name = layer
    units = cm
    levels = 10 25 50 100 200 400

Later I did:

cdo setzaxis,../coordz.txt soita.clay.nc tmp.nc

cdo zaxisdes tmp.nc

#
  1. zaxisID 1 #
    zaxistype = generic => don't change
    size = 6
    name = layer
    longname = height => change only here
    units = cm
    levels = 10 25 50 100 200 400

But nothing.

Any help is very appreciated to change my file. My file is in attachment.

Thanks,

Guilherme.


Replies (2)

RE: Zaxistype operator - Added by Uwe Schulzweida over 8 years ago

Hi Guilherme,

The Z-axis type height is defined as "Height above ground in meters".
You have to change the units and levels to m:

zaxistype = height
size = 6
name = layer
units = m
levels = .10 .25 .5 1 2 4
The next CDO release will also support the units cm, dm and km!

Cheers,
Uwe

RE: Zaxistype operator - Added by Ella Gilbert over 1 year ago

Hi Uwe/CDO team.

I'm having a similar issue - while converting from netcdf to grib, the 'generic' z coordinate (era5 model levels) is incorrectly converted to pressure levels.

I have tried setting the zaxis using cdo setzaxis,zaxisdes.txt

(where the contents of zaxisdes.txt are:

zaxistype = model_level
size = 137
name = level
longname = "model_level_number"
levels = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132
133 134 135 136 137
lbounds = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132
133 134 135 136 137
ubounds = 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132
133 134 135 136 137 138
axis = "Z"
~
)

N.B. I also tried changing the name of the zaxistype variable, and added in the ubounds/lbounds but none of those methods have worked.

Please can you help? I need to produce a grib file - with 4 variables on model levels and 6 surface variables - from netcdf.

Many thanks
Ella

    (1-2/2)