[ncl-talk] Missing color fill when using gsn_csm_contour_map (ncl V 6.4.0)

adriana.bossolasco at cnrs-orleans.fr adriana.bossolasco at cnrs-orleans.fr
Mon Sep 3 03:59:49 MDT 2018


Dear all
Thank you very much for your answer and sorry for my late response, I 
was away the last week.

I try the Adam's suggestion running
ng4ex gsun01n
and I had the following msj:
NCAR Graphics NCL Example <gsun01n>

Warning: NCL directory </usr/share/ncarg/nclex> doesn't exist.
          Won't generate gsun01n example.

So I think that you are right regarding the way of installation, because 
I installed ncl from sudo apt-get. I will follow your suggestion and let 
you know how going on.

if you have any other advice please let me know.

Cheers!






Le 24/08/2018 16:26, Mary Haley a écrit :
> Adriana,
> 
> This is a mystery to all of us, but I noticed you are on an Ubuntu
> system and somebody else had issues running NCL under Ubuntu that
> appeared to be related to the cairo library being out of sync for what
> NCL expects.
> 
> How did you install NCL on your system? I noticed you are loading
> libraries with "/usr/lib" paths, which looks to me like you used
> "apt-get". This method of installing NCL could be the problem because
> it will use whatever cairo library is on your system. If your system
> cairo is too old or too new, then this can be an issue for
> color-filled plots.
> 
> If you did use apt-get, then please try installing NCL using conda
> instead, as this will give you the correct version of cairo. You can
> see our conda instructions here:
> 
> http://www.ncl.ucar.edu/Applications/system.shtml
> 
> However, before you do any of this, please follow Adam's suggestion of
> running gsun01n. If that example doesn't produce any color plots, then
> try the conda installation. In any case, post back to ncl-talk and let
> us know how it goes.
> 
> Good luck, and sorry about all the problems.
> 
> --Mary
> 
> On Thu, Aug 23, 2018 at 7:32 AM, <adriana.bossolasco at cnrs-orleans.fr>
> wrote:
> 
>> Hi Dennis
>> 
>> Yes I tryed your code with my file, but I  still have the same "no
>> color" graphic, I will attached again the png
>> 
>> Also I executed the command in the linux command line (I copy again
>> what I get):
>> 
>> abossola at olivia:~$ ncl -V
>> 6.4.0
>> abossola at olivia:~$ gcc --version
>> gcc (Ubuntu 7.3.0-16ubuntu3) 7.3.0
>> Copyright (C) 2017 Free Software Foundation, Inc.
>> This is free software; see the source for copying conditions.  There
>> is NO
>> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
>> PURPOSE.
>> 
>> abossola at olivia:~$ uname -a
>> Linux olivia 4.15.0-32-generic #35-Ubuntu SMP Fri Aug 10 17:58:07
>> UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
>> 
>> Le 23/08/2018 15:21, Dennis Shea a écrit :
>> [1] Run the code I sent you. Use your file.
>> 
>> [2] As noted by Guido, the commands are to be issued from the
>> unix/linux command line. NOT FROM WITHIN NCL.
>> 
>> %> ncl -V
>> %> uname -a
>> %> gcc --version
>> 
>> On Thu, Aug 23, 2018 at 4:39 AM,
>> <adriana.bossolasco at cnrs-orleans.fr>
>> wrote:
>> 
>> Thanks for the correction
>> 
>> Now I get
>> 
>> abossola at olivia:~$ gcc --version
>> gcc (Ubuntu 7.3.0-16ubuntu3) 7.3.0
>> Copyright (C) 2017 Free Software Foundation, Inc.
>> This is free software; see the source for copying conditions.  There
>> is NO
>> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
>> PURPOSE.
>> 
>> abossola at olivia:~$ uname -a
>> Linux olivia 4.15.0-32-generic #35-Ubuntu SMP Fri Aug 10 17:58:07
>> UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
>> 
>> I tryed the script that Denis send me and is the same I have the
>> contour lines but not the color (see the attached graphic)
>> 
>> Le 23/08/2018 12:09, Guido Cioni a écrit :
>> 
>> Be careful!
>> 
>> abossola at olivia:~/Adriana/CESM/MAM7/MAM7_tes4$  gcc--version
>> gcc--version: command not found
>> 
>> It should be gcc --version (NOTE THE SPACE!!) and not gcc--version
>> 
>> You do the same error afterwards
>> 
>> ncl 1> ncl-V
>> 
>> instead than ncl -V, although also this command should be executed
>> oustide of NCL (only in the bash). The commands uname -a and gcc
>> --version as well need to be executed outside of NCL.
>> 
>> I'd suggest you to have a general introduction on Linux and NCL
>> before
>> attempting to fix your plot.
>> 
>> However, did you try the script that Dennis sent?
>> 
>> On 23. Aug 2018, at 11:12, adriana.bossolasco at cnrs-orleans.fr
>> wrote:
>> 
>> Hi
>> 
>> I try the commands and this is what I obtain:
>> 
>> abossola at olivia:~/Adriana/CESM/MAM7/MAM7_tes4$  ncl -V
>> 6.4.0
>> abossola at olivia:~/Adriana/CESM/MAM7/MAM7_tes4$ uname -a
>> Linux olivia 4.15.0-32-generic #35-Ubuntu SMP Fri Aug 10 17:58:07
>> UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
>> abossola at olivia:~/Adriana/CESM/MAM7/MAM7_tes4$  gcc--version
>> gcc--version: command not found
>> 
>> Other wise if I type this command in the ncl shell, then says:
>> 
>> ncl 1> ncl-V
>> fatal:syntax error: line 1 before or near -
>> ncl-
>> 
>> ncl 3> uname -a
>> fatal:syntax error: line 3 before or near -
>> uname -
>> ------^
>> 
>> fatal:error in statement
>> ncl 4>  gcc--version
>> fatal:syntax error: line 4 before or near -
>> gcc-
>> ----^
>> 
>> fatal:error in statement
>> 
>> I know that it is very strange because in my old computer everything
>> working, it could be due to the version of Linux?
>> 
>> This is my version now:
>> NAME="Ubuntu"
>> VERSION="18.04.1 LTS (Bionic Beaver)"
>> ID=ubuntu
>> ID_LIKE=debian
>> PRETTY_NAME="Ubuntu 18.04.1 LTS"
>> VERSION_ID="18.04"
>> HOME_URL="https://www.ubuntu.com/ [1] [1]"
>> SUPPORT_URL="https://help.ubuntu.com/ [2] [2]"
>> BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/ [3] [3]"
>> 
>> 
> PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy
>> [4]
>> [4]"
>> 
>> VERSION_CODENAME=bionic
>> UBUNTU_CODENAME=bionic
>> 
>> I really appreciate any help!
>> 
>> Le 22/08/2018 17:58, Dennis Shea a écrit :
>> Sorry. I accidentally hit "Send".
>> Attached is the 2nd plot.
>> On Wed, Aug 22, 2018 at 9:56 AM, Dennis Shea <shea at ucar.edu> wrote:
>> Not sure why you are not getting color.
>> If the following does not create color then please send the output
>> from
>> %> ncl -V
>> %> uname -a
>> %> gcc--version
>> =========
>> ;---read in zonal winds
>> ;a = addfile("MAM_GEOS_1anee.cam.h0.2000-12-07-00000.nc [5] [5]
>> [1]","r")
>> ;u = a->U(0,35,:,:)
>> a = addfile("uwnd.2008.nc [6] [6] [2]","r")
>> 
>> u = a->uwnd(0,10,:,:)
>> printVarSummary (u)
>> ;print(u)
>> wks  = gsn_open_wks("png","adriana")  ; send graphics to PNG file
>> res                 = True
>> res at gsnMaximize     = True       ; maximize in frame
>> res at cnLinesOn       = True
>> res at cnFillOn        = True
>> res at cnFillPalette   = "BlueYellowRed"   ; change the color palette
>> res at tiMainString    = "Default"
>> plot = gsn_csm_contour_map(wks,u,res)
>> res at mpFillDrawOrder = "PostDraw" ; Make sure land fill is drawn
>> ; on top of filled contours
>> res at tiMainString    = "add gray land fill after contouring"
>> plot = gsn_csm_contour_map(wks,u,res)
>> On Wed, Aug 22, 2018 at 2:22 AM,
>> <adriana.bossolasco at cnrs-orleans.fr> wrote:
>> Hi thank you very much for the answer
>> I corrected U and print the variable for see if this have values
>> now is U(0,34,:,:)
>> Variable: u
>> Type: float
>> Total Size: 55296 bytes
>> 13824 values
>> Number of Dimensions: 2
>> Dimensions and sizes:    [lat | 96] x [lon | 144]
>> Coordinates:
>> lat: [ -90..  90]
>> lon: [   0..357.5]
>> Number Of Attributes: 6
>> lev :    581.2501460313797
>> time :     327
>> mdims :    1
>> units :    m/s
>> long_name :    Zonal wind
>> cell_methods :    time: mean
>> And also have values, I checked it with print(u)
>> But still the graphic is empty (white, no contour fill)
>> On the other hand I can not access to ftp.cgd.ucar.edu [7] [7] [1]
>> [3]
>> for
>> 
>> attach my file. Say:
>> ERROR
>> The requested URL could not be retrieved
>> Any other idea how can I pass the file
>> MAM_GEOS_1anee.cam.h0.2000-12-07-00000.nc [5] [5] [1]
>> Thank you very much
>> Le 21/08/2018 20:36, Dennis Shea a écrit :
>> [0]
>> If you are just learning NCL, I suggest you look at the USER MANUAL
>> at:
>> HTTP://WWW.NCL.UCAR.EDU/DOCUMENT/MANUALS/ [8] [8] [4] [6]
>> [1]
>> As noted by Toni,
>> u = U(0,,:,:)
>> is not correct. In fact, it should have generated a FATAL subscript
>> syntax error.
>> Note: although "fatal", NCL will continue. In fact, it will still
>> try
>> to create the plot. Since it did not have valid data, NCL generated
>> a
>> background and a default color lable bar. That is what you attached.
>> [2]
>> Your following resource setting needs some clarification:
>> res at tiMainString    = "NCL version 6.1.x will give you gray land"
>> For historical reasons, NCL's default graphic mode is
>> black-and-white
>> (B/W). This is true of *all* NCL versions. Not just 6.1.x.
>> When, 'gsn_csm_contour_map' is used, the default background is
>> continental outlines with light gray used to fill land areas. See:
>> HTTP://WWW.NCL.UCAR.EDU/APPLICATIONS/CYLINEQ.SHTML [9] [9] [5] [7]
>> Examples 1 and 2
>> Color is turned on via:
>> res at cnFillOn = True     ; make color graphic
>> When color is activated, (a) the background map including the light
>> gray land fil is generated; then, (b) the color contour are drawn
>> over
>> that background.  The light gray land fill is overwritten (no big
>> deal). The following resource setting tells the
>> 'gsn_csm_contour_map'
>> do the colr contours and then force the gray land fill last. [There
>> are some reasons for doing that.]
>> res at mpFillDrawOrder = "PostDraw" ; Make sure land fill is drawn
>> ; on top of filled contours
>> [3]
>> If you want you can ftp a sample file to:
>> ftp ftp.cgd.ucar.edu [7] [7] [1] [3] [8]
>> anonymous
>> your_email
>> cd incoming
>> put MAM_GEOS_1anee.cam.h0.2000-12-07-00000.nc [5] [5] [1] [9]
>> quit
>> On Tue, Aug 21, 2018 at 9:45 AM, Toni Klemm <toni-klemm at tamu.edu>
>> wrote:
>> Hi Adriana,
>> I noticed there are two commas in the command to extract the sind
>> vectors: u = a->U(0,,:,:)  Could that be the problem?
>> Could you attach the netCDF file from the example that you’re
>> using? (MAM_GEOS_1anee.cam.h0.2000-12-07-00000.nc [5] [5] [1] [1])
>> Toni
>> Toni Klemm, Ph.D.
>> Postdoctoral Research Associate
>> Department of Ecosystem Science and Management
>> College of Agriculture and Life Sciences
>> Texas A&M University, College Station, TX
>> Contributor to the Early Career Climate Forum [3]
>> www.toni-klemm.de [10] [10] [2] [6] [4] | @toniklemm [5]
>> 
>> On Aug 21, 2018, at 10:01 AM, adriana.bossolasco at cnrs-orleans.fr
>> wrote:
>> Hi all
>> I have a problem with ncl when I try to plot a contour graphic. I
>> thought it was a mistake I was making, but then when I try with a
>> example very simple still appears blank. And ncl does not tell me
>> any error.
>> Here is the script (have my file but is exactly the same that
>> newcolor_1.ncl)
>> ;************************************************
>> ; zonal_2.ncl
>> ;
>> ; Concepts illustrated:
>> ;   - Drawing a zonal means plot
>> ;   - Using dim_avg_Wrap to calculate a zonal average
>> ;************************************************
>> ;load "/usr/lib/ncarg/nclscripts/csm/gsn_code.ncl"
>> ;load "/usr/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
>> ;load "/usr/lib/ncarg/nclscripts/csm/contributed.ncl"
>> ;************************************************
>> begin
>> ;************************************************
>> ; variable and file handling
>> ;************************************************
>> ;---read in zonal winds
>> a = addfile("MAM_GEOS_1anee.cam.h0.2000-12-07-00000.nc [5] [5] [1]
>> 
>> [1]","r")
>> u = a->U(0,,:,:)                                ; July zonal
>> winds
>> wks  = gsn_open_wks("png","newcolor")  ; send graphics to PNG
>> file
>> res                 = True
>> res at gsnMaximize     = True       ; maximize in frame
>> res at cnLinesOn       = False
>> res at cnFillOn        = True
>> res at cnFillPalette   = "BlueYellowRed"   ; change the color
>> palette
>> res at mpFillDrawOrder = "PostDraw" ; Make sure land fill is drawn
>> ; on top of filled contours
>> res at tiMainString    = "NCL version 6.1.x will give you gray land"
>> plot = gsn_csm_contour_map(wks,u,res)
>> end
>> I obtained a map without color fill, I was looking in some
>> previous talk but nothing works. Can Anyone help me on this?
>> thanks
>> I attached the maps
>> Thank you
>> --
>> Adriana Bossolasco
>> LPC2E UMR 7328 (CNRS, Université d'Orléans)
>> 3A avenue de la Recherche Scientifique
>> 45071 Orléans Cedex 2 - FRANCE
>> Tel  +33 (0)2 38 25 52 85
>> e-mail:
>> 
>> 
> adriana.bossolasco at cnrs-orleans.fr<newcolor.png>_______________________________________________
>> 
>> ncl-talk mailing list
>> ncl-talk at ucar.edu
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk [11] [11] [7] [2]
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk at ucar.edu
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk [11] [11] [7] [2]
>> Links:
>> ------
>> [1] http://MAM_GEOS_1anee.cam.h0.2000-12-07-00000.nc [5] [5] [3] [1]
>> 
>> [2] http://mailman.ucar.edu/mailman/listinfo/ncl-talk [11] [11] [7]
>> [3] http://www.eccforum.org
>> [4] http://www.toni-klemm.de
>> [5] http://twitter.com/toniklemm
>> [6] http://www.ncl.ucar.edu/Document/Manuals/ [12] [12] [8]
>> [7] http://www.ncl.ucar.edu/Applications/cylineq.shtml [13] [13] [9]
>> [8] http://ftp.cgd.ucar.edu
>> [9] http://12-07-00000.nc
>> --
>> Adriana Bossolasco
>> LPC2E UMR 7328 (CNRS, Université d'Orléans)
>> 3A avenue de la Recherche Scientifique
>> 45071 Orléans Cedex 2 - FRANCE
>> Tel  +33 (0)2 38 25 52 85
>> e-mail: adriana.bossolasco at cnrs-orleans.fr
>> Links:
>> ------
>> [1] http://MAM_GEOS_1anee.cam.h0.2000-12-07-00000.nc [5] [5]
>> [2] http://uwnd.2008.nc
>> [3] http://ftp.cgd.ucar.edu
>> [4] HTTP://WWW.NCL.UCAR.EDU/DOCUMENT/MANUALS/ [8] [8]
>> [5] HTTP://WWW.NCL.UCAR.EDU/APPLICATIONS/CYLINEQ.SHTML [9] [9]
>> [6] http://www.toni-klemm.de
>> [7] http://mailman.ucar.edu/mailman/listinfo/ncl-talk [11] [11]
>> [8] http://www.ncl.ucar.edu/Document/Manuals/ [12] [12]
>> [9] http://www.ncl.ucar.edu/Applications/cylineq.shtml [13] [13]
>> 
>> --
>> Adriana Bossolasco
>> LPC2E UMR 7328 (CNRS, Université d'Orléans)
>> 3A avenue de la Recherche Scientifique
>> 45071 Orléans Cedex 2 - FRANCE
>> Tel  +33 (0)2 38 25 52 85
>> e-mail: adriana.bossolasco at cnrs-orleans.fr
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk at ucar.edu
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk [11] [11]
>> 
>> Guido Cioni
>> http://guidocioni.altervista.org [14] [14]
>> 
>> Links:
>> ------
>> [1] http://ftp.cgd.ucar.edu
>> [2] http://www.toni-klemm.de
>> [3] http://mam_geos_1anee.cam.h0.2000-12-07-00000.nc [15] [15]
>> 
>> --
>> Adriana Bossolasco
>> LPC2E UMR 7328 (CNRS, Université d'Orléans)
>> 3A avenue de la Recherche Scientifique
>> 45071 Orléans Cedex 2 - FRANCE
>> Tel  +33 (0)2 38 25 52 85
>> e-mail: adriana.bossolasco at cnrs-orleans.fr
>> 
>> Links:
>> ------
>> [1] https://www.ubuntu.com/
>> [2] https://help.ubuntu.com/
>> [3] https://bugs.launchpad.net/ubuntu/ [3]
>> [4] https://www.ubuntu.com/legal/terms-and-policies/privacy-policy
>> [4]
>> [5] http://MAM_GEOS_1anee.cam.h0.2000-12-07-00000.nc [5]
>> [6] http://uwnd.2008.nc
>> [7] http://ftp.cgd.ucar.edu
>> [8] HTTP://WWW.NCL.UCAR.EDU/DOCUMENT/MANUALS/ [8]
>> [9] HTTP://WWW.NCL.UCAR.EDU/APPLICATIONS/CYLINEQ.SHTML [9]
>> [10] http://www.toni-klemm.de
>> [11] http://mailman.ucar.edu/mailman/listinfo/ncl-talk [11]
>> [12] http://www.ncl.ucar.edu/Document/Manuals/ [12]
>> [13] http://www.ncl.ucar.edu/Applications/cylineq.shtml [13]
>> [14] http://guidocioni.altervista.org [14]
>> [15] http://mam_geos_1anee.cam.h0.2000-12-07-00000.nc [15]
> 
> --
> Adriana Bossolasco
> LPC2E UMR 7328 (CNRS, Université d'Orléans)
> 3A avenue de la Recherche Scientifique
> 45071 Orléans Cedex 2 - FRANCE
> Tel  +33 (0)2 38 25 52 85
> e-mail: adriana.bossolasco at cnrs-orleans.fr
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk [11]
> 
> 
> 
> Links:
> ------
> [1] https://www.ubuntu.com/
> [2] https://help.ubuntu.com/
> [3] https://bugs.launchpad.net/ubuntu/
> [4] https://www.ubuntu.com/legal/terms-and-policies/privacy-policy
> [5] http://MAM_GEOS_1anee.cam.h0.2000-12-07-00000.nc
> [6] http://uwnd.2008.nc
> [7] http://ftp.cgd.ucar.edu
> [8] HTTP://WWW.NCL.UCAR.EDU/DOCUMENT/MANUALS/
> [9] HTTP://WWW.NCL.UCAR.EDU/APPLICATIONS/CYLINEQ.SHTML
> [10] http://www.toni-klemm.de
> [11] http://mailman.ucar.edu/mailman/listinfo/ncl-talk
> [12] http://www.ncl.ucar.edu/Document/Manuals/
> [13] http://www.ncl.ucar.edu/Applications/cylineq.shtml
> [14] http://guidocioni.altervista.org
> [15] http://mam_geos_1anee.cam.h0.2000-12-07-00000.nc

-- 
Adriana Bossolasco
LPC2E UMR 7328 (CNRS, Université d'Orléans)
3A avenue de la Recherche Scientifique
45071 Orléans Cedex 2 - FRANCE
Tel  +33 (0)2 38 25 52 85
e-mail: adriana.bossolasco at cnrs-orleans.fr


More information about the ncl-talk mailing list