[ncl-talk] Problem with Roms_utils.ncl

leilane.passos at inpe.br leilane.passos at inpe.br
Mon Oct 3 10:21:55 MDT 2016


 

Hi Mr. Shea, 

the variable out1 is the result of a interpolation
made by roms_3d_interp (function of Roms_utils.ncl -
https://www.ncl.ucar.edu/Applications/Scripts/ROMS_utils.ncl [1]). If
you looking for the temp values in the problem region in original file
(nested_avg_19811216_LEILANE.nc) you will see this file is fine, I
checked with Ncview, Ferret, Matlab and Ncdump. Because this I guess
that problem is in my Roms_utils.ncl 

Thank you for trying to help.


Leilane

Em 03-10-2016 12:27, Dennis Shea escreveu: 

> Sometimes the
oldest debug tools (eg: print) can be used to check an issue:
> 
> out1
= roms_3d_interp(his1,grid,variable,rec,depth)
> printVarSummary(out1)
>
printMinMax(out1,1)
> 
> print(out1(52:65,85:105)) ; print values in
region with 'blank
> 
> Variable: OUT1
> Type: float
> Total Size: 32292
bytes
> 8073 values
> Number of Dimensions: 2
> Dimensions and sizes:
[69] x [117]
> Coordinates: 
> Number Of Attributes: 1
> _FillValue :
1e+37
> (0) 
> (0) min=19.8764 max=26.2272
> 
> Variable: OUT1
(subsection)
> Type: float
> Total Size: 1176 bytes
> 294 values
>
Number of Dimensions: 2
> Dimensions and sizes: [14] x [21]
>
Coordinates: 
> Number Of Attributes: 1
> _FillValue : 1e+37
> (0,0)
25.70767
> (0,1) 25.75091
> (0,2) 25.79064
> (0,3) 25.85184 [snip]
>
(2,5) 25.95704
> (2,6) 25.99549
> (2,7) 26.03482
> (2,8) 1e+37 <=====
>
(2,9) 1e+37
> (2,10) 1e+37
> (2,11) 1e+37
> (2,12) 26.1619
> (2,13)
26.16949
> (2,14) 26.16148 [snip]
> 3,4) 25.89764
> (3,5) 25.95115
>
(3,6) 1e+37
> (3,7) 1e+37
> (3,8) 1e+37
> (3,9) 1e+37
> (3,10) 1e+37
>
(3,11) 1e+37
> (3,12) 1e+37
> (3,13) 1e+37
> (3,14) 1e+37
> (3,15)
1e+37
> (3,16) 1e+37
> (3,17) 26.16814
> (3,18) 26.16628
> (3,19)
26.1693
> (3,20) 26.16752
> (4,0) 25.71928
> (4,1) 25.74613
> (4,2)
25.78636
> (4,3) 25.83197
> (4,4) 25.89648
> (4,5) 1e+37
> (4,6) 1e+37
>
(4,7) 1e+37
> (4,8) 1e+37
> (4,9) 1e+37
> (4,10) 1e+37
> (4,11) 1e+37
>
(4,12) 1e+37
> (4,13) 1e+37
> (4,14) 1e+37
> (4,15) 1e+37
> (4,16)
1e+37
> (4,17) 1e+37
> (4,18) 1e+37
> (4,19) 26.17847
> (4,20)
26.19264
> (5,0) 25.70962
> (5,1) 25.73441
> (5,2) 25.76884
> (5,3)
25.8217
> (5,4) 25.87821
> (5,5) 1e+37
> (5,6) 1e+37
> (5,7) 1e+37
[SNIP]
> 
> re: "I can usually plot in other languages (matlab, for
example)..."
> 
> If that region is being plotted, then Matlab is
filling the region.
> 
> Good luck
> 
> On Mon, Oct 3, 2016 at 6:16 AM,
<leilane.passos at inpe.br> wrote:
> 
>> Hi, 
>> 
>> I'm plotting sea
surface temperature from an output of the ROMS, but a plot region is
completely white. I checked the file and it is correct, I can usually
plot in other languages (matlab, for example), the problem occurs after
calling the script Roms_utils.ncl
(https://www.ncl.ucar.edu/Applications/Scripts/ROMS_utils.ncl [1]).
>>

>> I had to make 2 modifications to be able to use this script:
>> 
>>
1 - comment some lines: 5-133 - I do not know why, but the script does
not run if these lines are uncommented.
>> 
>> 2 - add another parameter
to call function roms_3d_interp: in my case the variable h (Final
bathymetry at RHO-points) and the variable that will be interpolated
(temp: time-averaged potential temperature) don't be in the same file. h
is in my GRID FILE and temp is in the OUTPUT MODEL FILE. So, I added a
new parameter when I calling the function - the file_grid: 
>> 
>> 137
function roms_3d_interp( file_handle, FILE_GRID, var:string, 
>> 138
rec:integer, z:numeric ) 
>> 
>> and I changed the lines 166-176 and
208: to call the file that contains the variable h 
>> 
>> 166
if(typeof(file_grid).eq."file") then
>> 167 ISFILE = True
>> 168 nc_grid
= file_grid
>> 169 else if(typeof(file_grid).eq."list") then
>> 170
ISFILE = False
>> 171 nc_grid = file_grid[0]
>> 172 else
>> 173
print("roms_interp_3d: error: the first argument must be a file or a
list of files opened with addfile or addfiles")
>> 174 return
>> 175 end
if
>> 176 end if 
>> 
>> ...
>> 
>> 208 if(isfilevar(NC_GRID,"h")) 
>>

>> After this function a region with constant temperature is
interpolated with missing values. The figures and the scripts are
attached. The files: nested_avg_19811216_LEILANE.nc and
mesh_donor_grd_004nested_ 
>> LEILANE.nc are in the FTP server. My NCL
version is 6.3.0. 
>> 
>> I'm new in NCL and I'll appreciate any help.

>> 
>> Best regards. 
>> 
>> Leilane 
>> 
>>
_______________________________________________
>> ncl-talk mailing
list
>> ncl-talk at ucar.edu
>> List instructions, subscriber options,
unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk [2]




Links:
------
[1]
https://www.ncl.ucar.edu/Applications/Scripts/ROMS_utils.ncl
[2]
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20161003/03878428/attachment.html 


More information about the ncl-talk mailing list