1

希望这个问题足够简单和容易解决。

在 GrADS 中打开第二个文件时遇到问题。假设我有两个文件。第一个是“sst06.ctl”,第二个是“sst07.ctl”,每个文件中只有一个名为“sst”的变量

以下是我尝试同时打开它们时发生的情况:

ga-> open sst06.ctl
Scanning description file:  sst06.ctl
Data file rcp4.5/y2006/sst is open as file 1
LON set to 0 360 
LAT set to -89.5 89.5 
LEV set to 1000 1000 
Time values set: 2006:1:1:0 2006:1:1:0 
E set to 1 1 
ga-> q file
File 1 : 
  Descriptor: sst06.ctl
  Binary: rcp4.5/y2006/sst
  Type = Gridded
  Xsize = 360  Ysize = 180  Zsize = 37  Tsize = 365  Esize = 1
  Number of Variables = 1
     sst  0  99  sea surface temperature [K]
ga-> d sst
Contouring: -0 to 30 interval 3 
ga-> c
ga-> open sst07.ctl 
Scanning description file:  sst07.ctl
Data file rcp4.5/y2007/sst is open as file 2
ga-> d sst.2
Data Request Warning:  Request is completely outside file limits
  Entire grid contents are set to missing data 
  Grid limits of file:     X = 1 360  Y = 1 180  Z = 1 37  T = 1 365  E = 1 1 
  Grid limits of request:  X = 0 361  Y = 1 180  Z = 1 1  T = -364 -364  E = 1 1 
  Warning issued for variable = sst.2
Cannot contour grid - all undefined values

基本上,我无法绘制第二个文件(sst07.ctl),它产生了“整个网格未定义”图。当然,人们可能会怀疑文件“sst07.ctl”有问题。但是,如果我只单独打开“sst07.ctl”文件,则没有问题,因为它可以像之前的“sst06.ctl”文件一样成功地进行轮廓化。以下是留言:

ga-> reinit
No hardcopy metafile open
All files closed; all defined objects released;
All GrADS attributes have been reinitialized
ga-> open sst07.ctl 
Scanning description file:  sst07.ctl
Data file rcp4.5/y2007/sst is open as file 1
LON set to 0 360 
LAT set to -89.5 89.5 
LEV set to 1000 1000 
Time values set: 2007:1:1:0 2007:1:1:0 
E set to 1 1 
ga-> q file
File 1 : 
  Descriptor: sst07.ctl
  Binary: rcp4.5/y2007/sst
  Type = Gridded
  Xsize = 360  Ysize = 180  Zsize = 37  Tsize = 365  Esize = 1
  Number of Variables = 1
     sst  0  99  sea surface temperature [K]
ga-> d sst
Contouring: -0 to 30 interval 3 

如果我更改文件打开的顺序(首先是 sst07.ctl),也会发生同样的错误。作为第二个文件打开的“sst06.ctl”文件将导致后一个打开的文件的整个网格未定义消息。以下是留言:

ga-> reinit
ga-> open sst07.ctl 
Scanning description file:  sst07.ctl
Data file rcp4.5/y2007/sst is open as file 1
LON set to 0 360 
LAT set to -89.5 89.5 
LEV set to 1000 1000 
Time values set: 2007:1:1:0 2007:1:1:0 
E set to 1 1 
ga-> q file
File 1 : 
  Descriptor: sst07.ctl
  Binary: rcp4.5/y2007/sst
  Type = Gridded
  Xsize = 360  Ysize = 180  Zsize = 37  Tsize = 365  Esize = 1
  Number of Variables = 1
     sst  0  99  sea surface temperature [K]
ga-> d sst
Contouring: -0 to 30 interval 3 
ga-> c
ga-> open sst06.ctl 
Scanning description file:  sst06.ctl
Data file rcp4.5/y2006/sst is open as file 2
ga-> q file
File 1 : 
  Descriptor: sst07.ctl
  Binary: rcp4.5/y2007/sst
  Type = Gridded
  Xsize = 360  Ysize = 180  Zsize = 37  Tsize = 365  Esize = 1
  Number of Variables = 1
     sst  0  99  sea surface temperature [K]
ga-> d sst.2
Data Request Warning:  Request is completely outside file limits
  Entire grid contents are set to missing data 
  Grid limits of file:     X = 1 360  Y = 1 180  Z = 1 37  T = 1 365  E = 1 1 
  Grid limits of request:  X = 0 361  Y = 1 180  Z = 1 1  T = 366 366  E = 1 1 
  Warning issued for variable = sst.2
Cannot contour grid - all undefined values 

有人愿意帮我解决这个问题吗?之前谢谢!

EDIT1:回应 Ngoan Tran 的帖子

这是你建议的结果。

ga-> reinit
No hardcopy metafile open
All files closed; all defined objects released;
All GrADS attributes have been reinitialized
ga-> open sst07.ctl 
Scanning description file:  sst07.ctl
Data file rcp4.5/y2007/sst is open as file 1
LON set to 0 360 
LAT set to -89.5 89.5 
LEV set to 1000 1000 
Time values set: 2007:1:1:0 2007:1:1:0 
E set to 1 1 
ga-> d sst
Contouring: -0 to 30 interval 3 
ga-> open sst06.ctl
Scanning description file:  sst06.ctl
Data file rcp4.5/y2006/sst is open as file 2
ga-> set dfile 2
Default file set to: rcp4.5/y2006/sst 
ga-> d sst
Data Request Warning:  Request is completely outside file limits
  Entire grid contents are set to missing data 
  Grid limits of file:     X = 1 360  Y = 1 180  Z = 1 37  T = 1 365  E = 1 1 
  Grid limits of request:  X = 0 361  Y = 1 180  Z = 1 1  T = 366 366  E = 1 1 
  Warning issued for variable = sst
Cannot contour grid - all undefined values 
ga-> 

有任何想法吗?

4

2 回答 2

0

查看第二个打开文件的绘图调用的输出,您正在请求超出可用时间且部分超出水平域的数据:

 Grid limits of file:     X = 1 360  Y = 1 180  Z = 1 37  T = 1 365  E = 1 1 
 Grid limits of request:  X = **0 361**  Y = 1 180  Z = 1 1  T = **366 366**  E = 1 1 

在 GrADS 中,环境轴(X、Y、Z、T、E)是相对于您打开的第一个文件设置的。在您的情况下,两个文件中的时间和水平域的一部分都不相同(第二个文件中的 x 轴还有 2 个点),因此您需要设置相对于第一个文件的约束的环境以从中进行绘图第二。在发出第二个绘图调用之前,您需要将环境设置为第二个文件(或其子集),但相对于第一个文件:

set lon 0 361
set lat 1 180
set t 366

或更好)

set time 00z01Jan2006;* <--- I've guessed at data dates here

通常最好在使用后关闭每个文件,除非您尝试绘制两个文件的连续输出,因为它可能会令人困惑。

于 2017-03-01T04:31:55.073 回答
0

为了同时处理多个文件,您必须使用set dfile <file-number>. file-number 是您打开文件的顺序。

在你的情况下:

  • reinit(它重置所有配置)之后open sst07.ctlsst07.ctl文件 1 也是如此,并将用作默认值。当您运行 command 时d sst,GrADSsst将从sst07.ctl文件中提取数据。

  • 然后open sst06.ctl,您sst06.ctl将成为文件 2,并且要使用它,您必须将描述符文件更改为set dfile 2. 当您运行 command 时d sst,GrADSsst将从sst06.ctl文件中提取数据。

试试看。

于 2017-02-28T03:47:34.047 回答