[ncl-talk] select sub_region

Karin Meier-Fleischer meier-fleischer at dkrz.de
Thu Dec 16 04:51:40 MST 2021


Running your script causes the following error which tells you exactly 
what is going wrong.

ncl NCL_Talk.ncl
  Copyright (C) 1995-2019 - All Rights Reserved
  University Corporation for Atmospheric Research
  NCAR Command Language Version 6.6.2
  The use of this software is governed by a License Agreement.
  See http://www.ncl.ucar.edu/ for more details.
fatal:["Execute.c":133]:variable *(tauuo)* is not in file (./tauuo_ssp.nc)
fatal:["Execute.c":6378]:variable *(tauuo)* is not in file (f)
fatal:["Execute.c":8637]:Execute: *Error occurred at or near line 9 in 
file NCL_Talk.ncl*

fatal:Variable (tauuo_ssp) is undefined
fatal:["Execute.c":8637]:Execute: Error occurred at or near line 10 in 
file NCL_Talk.ncl

fatal:Variable (tauuo_ssp) is undefined
fatal:["Execute.c":8637]:Execute: Error occurred at or near line 11 in 
file NCL_Talk.ncl


The variable you try to read has the name tauuo_ssp and not tauuo! And 
NCL is so kind to tell you at which line you have to look first.
Change the variable name from tauuo to tauuo_ssp and it works fine.

If you do not know the contents of a netCDF file you should have a look 
at it with the command line programs /*ncl_filedump*/ or /*ncdump*/.


Am 15.12.21 um 13:43 schrieb Chathurika:
>
> Dear Karin,
>
>
> Thank you very much for your reply. Please find the attached script 
> and data file (one time step). I want to select the pacific ocean 
> (120E-120W).
>
>
> Thanks again and best regards,
>
> Chathu
>
>
>     -----Original Messages-----
>     *From:*"Karin Meier-Fleischer" <meier-fleischer at dkrz.de>
>     *Sent Time:*2021-12-15 19:00:13 (Wednesday)
>     *To:* Chathurika <chatu at scsio.ac.cn>
>     *Cc:* "ncl-talk at ucar.edu" <ncl-talk at ucar.edu>
>     *Subject:* Re: [ncl-talk] select sub_region
>
>     Hi Chatchurika,
>
>     it is very hard to say what is going wrong without the data and
>     only the information 'It does not select the Pacifik Ocean'. Can
>     you send one timestep of your data and best would be to provide
>     your NCL script.
>
>     -Karin
>
>     Am 14.12.21 um 18:17 schrieb Chathurika:
>>
>>     Dear Karin,
>>
>>
>>     Many many thanks for your email. I am sorry It is a typo. I
>>     actually did try this
>>
>>>     = f->tauuo(:,{10:75},{-120:120}) and vice versa.
>>>     = f->tauuo(:,{10:75},300:60}) and vice versa.
>>>
>>     However, It does not select the Pacific Ocean.
>>
>>     Summary of longitude is;
>>
>>
>>
>>     Variable: lon (coordinate)
>>
>>     Type: double
>>
>>     Total Size: 2888 bytes
>>
>>     361 values
>>
>>     Number of Dimensions: 1
>>
>>     Dimensions and sizes: [lon | 361]
>>
>>     Coordinates:
>>
>>     Number Of Attributes: 4
>>
>>     standard_name : longitude
>>
>>     long_name : longitude
>>
>>     units : degrees_east
>>
>>     axis : X
>>
>>     (0) -180
>>
>>     (1) -179
>>
>>     (2) -178
>>
>>     (3) -177
>>
>>     (4) -176
>>
>>     (5) -175
>>
>>     (6) -174
>>
>>     (7) -173
>>
>>     (8) -172
>>
>>     (9) -171
>>
>>     (10) -170
>>
>>     (11) -169
>>
>>     (12) -168
>>
>>     (13) -167
>>
>>     (14) -166
>>
>>     (15) -165
>>
>>     (16) -164
>>
>>     (17) -163
>>
>>     (18) -162
>>
>>     (19) -161
>>
>>     (20) -160
>>
>>     (21) -159
>>
>>     (22) -158
>>
>>     (23) -157
>>
>>     (24) -156
>>
>>     (25) -155
>>
>>     (26) -154
>>
>>     (27) -153
>>
>>     (28) -152
>>
>>     (29) -151
>>
>>     (30) -150
>>
>>     (31) -149
>>
>>     (32) -148
>>
>>     (33) -147
>>
>>     (34) -146
>>
>>     (35) -145
>>
>>     (36) -144
>>
>>     (37) -143
>>
>>     (38) -142
>>
>>     (39) -141
>>
>>     (40) -140
>>
>>     (41) -139
>>
>>     (42) -138
>>
>>     (43) -137
>>
>>     (44) -136
>>
>>     (45) -135
>>
>>     (46) -134
>>
>>     (47) -133
>>
>>     (48) -132
>>
>>     (49) -131
>>
>>     (50) -130
>>
>>     (51) -129
>>
>>     (52) -128
>>
>>     (53) -127
>>
>>     (54) -126
>>
>>     (55) -125
>>
>>     (56) -124
>>
>>     (57) -123
>>
>>     (58) -122
>>
>>     (59) -121
>>
>>     (60) -120
>>
>>     (61) -119
>>
>>     (62) -118
>>
>>     (63) -117
>>
>>     (64) -116
>>
>>     (65) -115
>>
>>     (66) -114
>>
>>     (67) -113
>>
>>     (68) -112
>>
>>     (69) -111
>>
>>     (70) -110
>>
>>     (71) -109
>>
>>     (72) -108
>>
>>     (73) -107
>>
>>     (74) -106
>>
>>     (75) -105
>>
>>     (76) -104
>>
>>     (77) -103
>>
>>     (78) -102
>>
>>     (79) -101
>>
>>     (80) -100
>>
>>     (81) -99
>>
>>     (82) -98
>>
>>     (83) -97
>>
>>     (84) -96
>>
>>     (85) -95
>>
>>     (86) -94
>>
>>     (87) -93
>>
>>     (88) -92
>>
>>     (89) -91
>>
>>     (90) -90
>>
>>     (91) -89
>>
>>     (92) -88
>>
>>     (93) -87
>>
>>     (94) -86
>>
>>     (95) -85
>>
>>     (96) -84
>>
>>     (97) -83
>>
>>     (98) -82
>>
>>     (99) -81
>>
>>     (100) -80
>>
>>     (101) -79
>>
>>     (102) -78
>>
>>     (103) -77
>>
>>     (104) -76
>>
>>     (105) -75
>>
>>     (106) -74
>>
>>     (107) -73
>>
>>     (108) -72
>>
>>     (109) -71
>>
>>     (110) -70
>>
>>     (111) -69
>>
>>     (112) -68
>>
>>     (113) -67
>>
>>     (114) -66
>>
>>     (115) -65
>>
>>     (116) -64
>>
>>     (117) -63
>>
>>     (118) -62
>>
>>     (119) -61
>>
>>     (120) -60
>>
>>     (121) -59
>>
>>     (122) -58
>>
>>     (123) -57
>>
>>     (124) -56
>>
>>     (125) -55
>>
>>     (126) -54
>>
>>     (127) -53
>>
>>     (128) -52
>>
>>     (129) -51
>>
>>     (130) -50
>>
>>     (131) -49
>>
>>     (132) -48
>>
>>     (133) -47
>>
>>     (134) -46
>>
>>     (135) -45
>>
>>     (136) -44
>>
>>     (137) -43
>>
>>     (138) -42
>>
>>     (139) -41
>>
>>     (140) -40
>>
>>     (141) -39
>>
>>     (142) -38
>>
>>     (143) -37
>>
>>     (144) -36
>>
>>     (145) -35
>>
>>     (146) -34
>>
>>     (147) -33
>>
>>     (148) -32
>>
>>     (149) -31
>>
>>     (150) -30
>>
>>     (151) -29
>>
>>     (152) -28
>>
>>     (153) -27
>>
>>     (154) -26
>>
>>     (155) -25
>>
>>     (156) -24
>>
>>     (157) -23
>>
>>     (158) -22
>>
>>     (159) -21
>>
>>     (160) -20
>>
>>     (161) -19
>>
>>     (162) -18
>>
>>     (163) -17
>>
>>     (164) -16
>>
>>     (165) -15
>>
>>     (166) -14
>>
>>     (167) -13
>>
>>     (168) -12
>>
>>     (169) -11
>>
>>     (170) -10
>>
>>     (171) -9
>>
>>     (172) -8
>>
>>     (173) -7
>>
>>     (174) -6
>>
>>     (175) -5
>>
>>     (176) -4
>>
>>     (177) -3
>>
>>     (178) -2
>>
>>     (179) -1
>>
>>     (180) 0
>>
>>     (181) 1
>>
>>     (182) 2
>>
>>     (183) 3
>>
>>     (184) 4
>>
>>     (185) 5
>>
>>     (186) 6
>>
>>     (187) 7
>>
>>     (188) 8
>>
>>     (189) 9
>>
>>     (190) 10
>>
>>     (191) 11
>>
>>     (192) 12
>>
>>     (193) 13
>>
>>     (194) 14
>>
>>     (195) 15
>>
>>     (196) 16
>>
>>     (197) 17
>>
>>     (198) 18
>>
>>     (199) 19
>>
>>     (200) 20
>>
>>     (201) 21
>>
>>     (202) 22
>>
>>     (203) 23
>>
>>     (204) 24
>>
>>     (205) 25
>>
>>     (206) 26
>>
>>     (207) 27
>>
>>     (208) 28
>>
>>     (209) 29
>>
>>     (210) 30
>>
>>     (211) 31
>>
>>     (212) 32
>>
>>     (213) 33
>>
>>     (214) 34
>>
>>     (215) 35
>>
>>     (216) 36
>>
>>     (217) 37
>>
>>     (218) 38
>>
>>     (219) 39
>>
>>     (220) 40
>>
>>     (221) 41
>>
>>     (222) 42
>>
>>     (223) 43
>>
>>     (224) 44
>>
>>     (225) 45
>>
>>     (226) 46
>>
>>     (227) 47
>>
>>     (228) 48
>>
>>     (229) 49
>>
>>     (230) 50
>>
>>     (231) 51
>>
>>     (232) 52
>>
>>     (233) 53
>>
>>     (234) 54
>>
>>     (235) 55
>>
>>     (236) 56
>>
>>     (237) 57
>>
>>     (238) 58
>>
>>     (239) 59
>>
>>     (240) 60
>>
>>     (241) 61
>>
>>     (242) 62
>>
>>     (243) 63
>>
>>     (244) 64
>>
>>     (245) 65
>>
>>     (246) 66
>>
>>     (247) 67
>>
>>     (248) 68
>>
>>     (249) 69
>>
>>     (250) 70
>>
>>     (251) 71
>>
>>     (252) 72
>>
>>     (253) 73
>>
>>     (254) 74
>>
>>     (255) 75
>>
>>     (256) 76
>>
>>     (257) 77
>>
>>     (258) 78
>>
>>     (259) 79
>>
>>     (260) 80
>>
>>     (261) 81
>>
>>     (262) 82
>>
>>     (263) 83
>>
>>     (264) 84
>>
>>     (265) 85
>>
>>     (266) 86
>>
>>     (267) 87
>>
>>     (268) 88
>>
>>     (269) 89
>>
>>     (270) 90
>>
>>     (271) 91
>>
>>     (272) 92
>>
>>     (273) 93
>>
>>     (274) 94
>>
>>     (275) 95
>>
>>     (276) 96
>>
>>     (277) 97
>>
>>     (278) 98
>>
>>     (279) 99
>>
>>     (280) 100
>>
>>     (281) 101
>>
>>     (282) 102
>>
>>     (283) 103
>>
>>     (284) 104
>>
>>     (285) 105
>>
>>     (286) 106
>>
>>     (287) 107
>>
>>     (288) 108
>>
>>     (289) 109
>>
>>     (290) 110
>>
>>     (291) 111
>>
>>     (292) 112
>>
>>     (293) 113
>>
>>     (294) 114
>>
>>     (295) 115
>>
>>     (296) 116
>>
>>     (297) 117
>>
>>     (298) 118
>>
>>     (299) 119
>>
>>     (300) 120
>>
>>     (301) 121
>>
>>     (302) 122
>>
>>     (303) 123
>>
>>     (304) 124
>>
>>     (305) 125
>>
>>     (306) 126
>>
>>     (307) 127
>>
>>     (308) 128
>>
>>     (309) 129
>>
>>     (310) 130
>>
>>     (311) 131
>>
>>     (312) 132
>>
>>     (313) 133
>>
>>     (314) 134
>>
>>     (315) 135
>>
>>     (316) 136
>>
>>     (317) 137
>>
>>     (318) 138
>>
>>     (319) 139
>>
>>     (320) 140
>>
>>     (321) 141
>>
>>     (322) 142
>>
>>     (323) 143
>>
>>     (324) 144
>>
>>     (325) 145
>>
>>     (326) 146
>>
>>     (327) 147
>>
>>     (328) 148
>>
>>     (329) 149
>>
>>     (330) 150
>>
>>     (331) 151
>>
>>     (332) 152
>>
>>     (333) 153
>>
>>     (334) 154
>>
>>     (335) 155
>>
>>     (336) 156
>>
>>     (337) 157
>>
>>     (338) 158
>>
>>     (339) 159
>>
>>     (340) 160
>>
>>     (341) 161
>>
>>     (342) 162
>>
>>     (343) 163
>>
>>     (344) 164
>>
>>     (345) 165
>>
>>     (346) 166
>>
>>     (347) 167
>>
>>     (348) 168
>>
>>     (349) 169
>>
>>     (350) 170
>>
>>     (351) 171
>>
>>     (352) 172
>>
>>     (353) 173
>>
>>     (354) 174
>>
>>     (355) 175
>>
>>     (356) 176
>>
>>     (357) 177
>>
>>     (358) 178
>>
>>     (359) 179
>>
>>     (360) 180
>>
>>
>>     It always select the middle part instead of Pacific.
>>
>>
>>     Thank you very very much and best regards,
>>
>>     Chathu
>>
>>         -----Original Messages-----
>>         *From:*"Karin Meier-Fleischer via ncl-talk"
>>         <ncl-talk at mailman.ucar.edu>
>>         *Sent Time:*2021-12-14 20:33:47 (Tuesday)
>>         *To:* ncl-talk at mailman.ucar.edu
>>         *Cc:*
>>         *Subject:* Re: [ncl-talk] select sub_region
>>
>>         Hi Chatchu,
>>
>>         you should have received an error message because you try to
>>         extract data from a 4D variable tauuo which seems to be a 3D
>>         variable (with a different name tauuo_ssp ??).
>>
>>         Variable: tauuo_ssp
>>         ...
>>         Dimensions and sizes: [time | 720] x [lat | 66] x [lon | 360]
>>         Coordinates:
>>                time: [569784..744360]
>>                lat: [  10..  75]
>>                lon: [ 180..-180]
>>
>>         Try
>>
>>            variable = f->tauuo_ssp(:,:,{-120.:120.})
>>
>>         -Karin
>>
>>
>>         Am 14.12.21 um 13:12 schrieb Chathurika via ncl-talk:
>>>
>>>         Hello Everyone,
>>>
>>>
>>>         I have a dataset and the variable summary as follows;
>>>
>>>
>>>         Variable: tauuo_ssp
>>>         Type: float
>>>         Total Size: 45809280 bytes
>>>          11452320 values
>>>         Number of Dimensions: 3
>>>         Dimensions and sizes: [time | 720] x [lat | 66] x [lon | 360]
>>>         Coordinates:
>>>          time: [569784..744360]
>>>          lat: [  10..  75]
>>>          lon: [ 180..-180]
>>>         Number Of Attributes: 7
>>>         depth :   0
>>>         standard_name : surface_downward_x_stress
>>>         long_name : Surface downward x stress
>>>         units : N m-2
>>>           code : 548
>>>         _FillValue : -9e+33
>>>         missing_value : -9e+33
>>>
>>>         I want to select the pacific ocean (-120:120). However, this
>>>         does not work. I tried out several ways to choose this
>>>         subsection, but I always got the part that I wanted to
>>>         subtract between -120:120 (means Atlantic plus the Indian
>>>         Ocean instead of Pacific Ocean).
>>>
>>>
>>>         I tried this
>>>
>>>
>>>         = f->tauuo(:,0,{10:75},{-120:120}) and vice versa.
>>>         = f->tauuo(:,0,{10:75},300:60}) and vice versa.
>>>
>>>         Nothing selected the Pacific Ocean from 120E to 120W.
>>>
>>>
>>>         Could you please give me a hint on how I could do this? That
>>>         would be a great help.
>>>
>>>
>>>         Thank you very very much and best regards,
>>>         Chathu
>>>
>>>         ------------------------------------------------------------------------
>>>
>>>
>>>
>>>
>>>             //
>>>             //
>>>             //
>>>             //
>>>
>>>
>>>         _______________________________________________
>>>         ncl-talk mailing listncl-talk at mailman.ucar.edu  List instructions, subscriber options, unsubscribe:https://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>>
>>
>>
>>     ------------------------------------------------------------------------
>>
>>
>>
>>         Wickramage Chathurika Hemamali
>>         Msc in Physical Oceanography
>>         State Key Laboratory of Tropical Oceanography
>>         South China Sea Institute of Oceanology
>>         University of Chinese Academy of Science
>>         China
>>
>>         /Specialized in Oceanography and Marine Geology (Bachelor)/
>>         /University of Ruhuna/
>>         /Matara/
>>         /Sri Lanka/
>>
>>         Email : wickramagechathurika at rocketmail.com
>>         chatu at scsio.ac.cn
>>
>
>
>
>
> ------------------------------------------------------------------------
>
>
>
>     Wickramage Chathurika Hemamali
>     Msc in Physical Oceanography
>     State Key Laboratory of Tropical Oceanography
>     South China Sea Institute of Oceanology
>     University of Chinese Academy of Science
>     China
>
>     /Specialized in Oceanography and Marine Geology (Bachelor)/
>     /University of Ruhuna/
>     /Matara/
>     /Sri Lanka/
>
>     Email : wickramagechathurika at rocketmail.com
>     chatu at scsio.ac.cn
>

-- 
Dipl. Geophys. Karin Meier-Fleischer
Visualization Group - NCL, CDO, Python
Application Support

Deutsches Klimarechenzentrum GmbH (DKRZ)
Bundesstrasse 45a - D-20146 Hamburg - Germany

Phone:    +49 (0)40 460094 126
Fax:      +49 (0)40 460094 270
E-Mail:meier-fleischer at dkrz.de
URL:www.dkrz.de

Geschäftsführer: Prof. Dr. Thomas Ludwig
Sitz der Gesellschaft: Hamburg
Amtsgericht Hamburg HRB 39784
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20211216/3809bb23/attachment.html>


More information about the ncl-talk mailing list