1

Hopefully this question is simple and easy enough to be solved.

I am having a trouble in opening the second file in GrADS. Suppose I have two files. The first is "sst06.ctl" and the second is "sst07.ctl", and within each files, there is only one variable named "sst"

Below are what happened when I tried opening both of them together:

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

Basically, I cannot plot the second file (sst07.ctl) and it produced "entire grid undefined" plot. Of course one might suspect that there is something wrong with the file "sst07.ctl". However if I only open "sst07.ctl" file alone, there is no problem as it can be successfullty contoured as it was with the "sst06.ctl" file previously. Below is the message:

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 

The same error happened if I change the order of file opening (sst07.ctl first). The "sst06.ctl" file that is opened as the second file would result in an entire grid undefined message for the latter opened file. Below is the message:

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 

Anybody willing to help me with this? Thanks before!

EDIT1: Response to Ngoan Tran's post

This is the result of your suggestion.

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-> 

Any ideas?

GTC
  • 13
  • 1
  • 4

2 Answers2

0

In order to handle multiple files at the same time, you have to change the descriptor file by using set dfile <file-number>. file-number is the order of files you opened.

In your case:

  • After reinit (it reset all your configuration) you open sst07.ctl ,so sst07.ctl is file 1 and will be used as default. And when you run command d sst, GrADS will draw data of sst from sst07.ctl file.

  • Then you open sst06.ctl, sst06.ctl will be file 2 and to use it you have to change the descriptor file by set dfile 2. And when you run command d sst, GrADS will draw data of sst from sst06.ctl file.

Try it.

Ngoan Tran
  • 1,507
  • 1
  • 13
  • 17
  • Hi! Thank you so much for your response! I really appreciate it. However, it still doesn't work and provide the same message. I've edited the question to show the result (since the characters in this comment post are limited). Can you help me? – GTC Feb 28 '17 at 20:14
  • If my answer helps you to solve the 1st problem, please accept it as the answer. The your 2nd question is other issue so you should make the new one. Regarding to 2nd issue, I also think that is the limit of your data file. Please only open and draw that file then show me the result. – Ngoan Tran Mar 01 '17 at 06:37
  • There are no 1st problem or 2nd problem. There is only one problem and what you've suggested did not solve the problem. Please read my question thoroughly. Also, I don't understand what you mean by "accept is as the answer". I am new to this platform so please let me know how to deal with it if such feature exists. – GTC Mar 01 '17 at 23:21
0

Looking at the output from the plot call from your second opened file you are requesting data beyond the available time and partially outside the horizontal domain:

 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 

In GrADS the environment axes (X, Y, Z, T, E) are set relative to the first file you open. In your case the time and part of the horizontal domain are not the same (the x axis in the 2nd file has 2 more points) in both of your files, so you need to set the environment relative to the first file's constraints to plot from the second. Before you issue your second plot call you need to set the environment to (or a subset of) the second file but relative to the first file:

set lon 0 361
set lat 1 180
set t 366

or (better)

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

It is usually better to close each file after use unless you are trying to plot a continuous output from both files as it can get confusing.

BoffWx
  • 106
  • 4
  • Correct me if I'm wrong, but as far as I'm concerned, the dimensions of both files are the same. I did the "q file" command for both and they produced same results (shown in the question). Also, as I mentioned in the question, the error message is always came up for whichever file that is opened as the second file. – GTC Mar 01 '17 at 23:30
  • 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] 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] – GTC Mar 01 '17 at 23:39
  • Nevermind. Ignore my comments above. I think I understand what you're saying. It was just issue in time though. Thank you very much! – GTC Mar 02 '17 at 22:47