Scheduled Downtime
On Tuesday 24 October 2023 @ 5pm MT the forums will be in read only mode in preparation for the downtime. On Wednesday 25 October 2023 @ 5am MT, this website will be down for maintenance and expected to return online later in the morning.
Normal Operations
The forums are back online with normal operations. If you notice any issues or errors related to the forums, please reach out to help@ucar.edu

CAM Tutorial -- Example 2a -- change sst dataset

Hello,all:

I try to change the sst data followed the cam tutorial.

And there was no "ncap2", just a "ncap". So I entered as:


Code:
ncap -O -s 'lat2d[lat,lon]=lat ; lon2d[lat,lon]=lon' 
    -s 'omask=(lat2d >= -10. && lat2d <= 10.) && (lon2d >= 180. && lon2d <= 240.)' 
    -s 'SST_cpl=(SST_cpl+omask*2.)' 
    domain.ocn.gx1v6.090206.orig.nc  domain.ocn.gx1v6.090206.nc


After the command line, it told me it was failed:


Code:
ncap: WARNING Variable SST_cpl has attribute "missing_value" but not "_FillValue". To comply with netCDF conventions, NCO ignores values that equal the _FillValue attribute when performing arithmetic. Confusingly, values equal to the missing_value should also be neglected. However, it is tedious and (possibly) computationally expensive to check each value against multiple missing values during arithmetic on large variables. So NCO thinks that processing variables with a "missing_value" attribute and no "_FillValue" attribute may produce undesired arithmetic results (i.e., where values that were intended to be neglected were not, in fact, neglected). We suggest you rename all "missing_value" attributes to "_FillValue" or include both "missing_value" and "_FillValue" attributes (with the _same values_) for all variables that have either attribute. Because it is long, this message is only printed once per operator even though multiple variables may have the same attribute configuration. More information on missing values is given at:
http://nco.sf.net/nco.html#mss_val
Examples of renaming attributes are at:
http://nco.sf.net/nco.html#xmp_ncrename
Examples of creating and deleting attributes are at:
http://nco.sf.net/nco.html#xmp_ncatted
WARNING unable to find omask in sst_HadOIBl_bc_64x128_clim_c020411.orig.nc or sst_HadOIBl_bc_64x128_clim_c020411.nc
Segment Fault!
 

andrew

Member
Not sure why this would occurred. It probably has to do with the structure of the missing values in the two fields. Perhaps try a different tool to re-construct the SST file?
 
andrew,
I re-build my nco and enabled the "ncap2", and the command line works now. It works like this:

Code:
ncap2 -O -s 'lat2d[lat,lon]=lat ; lon2d[lat,lon]=lon' 
 -s 'omask=(lat2d >= -10. && lat2d <= 10.) && (lon2d >= 180. && lon2d <= 240.)' 
 -s 'SST_cpl=(SST_cpl+omask*2.)' 
 sst_HadOIBl_bc_64x128_clim_c020411.orig.nc sst_HadOIBl_bc_64x128_clim_c020411.nc

ncap2: WARNING Variable SST_cpl has attribute "missing_value" but not "_FillValu
e". To comply with netCDF conventions, NCO ignores values that equal the _FillVa
lue attribute when performing arithmetic. Confusingly, values equal to the missi
ng_value should also be neglected. However, it is tedious and (possibly) computa
tionally expensive to check each value against multiple missing values during ar
ithmetic on large variables. So NCO thinks that processing variables with a "mis
sing_value" attribute and no "_FillValue" attribute may produce undesired arithm
etic results (i.e., where values that were intended to be neglected were not, in
 fact, neglected). We suggest you rename all "missing_value" attributes to "_Fil
lValue" or include both "missing_value" and "_FillValue" attributes (with the _s
ame values_) for all variables that have either attribute. Because it is long, t
his message is only printed once per operator even though multiple variables may
 have the same attribute configuration. More information on missing values is gi
ven at:
http://nco.sf.net/nco.html#mss_val
Examples of renaming attributes are at:
http://nco.sf.net/nco.html#xmp_ncrename
Examples of creating and deleting attributes are at:
http://nco.sf.net/nco.html#xmp_ncatted


So the output is correct.
Thank you!
Leo
 
Top