Visualization Without X-forwarding

If you are unable to use x-forwarding to have plots display as pop-ups directly from NCAR’s HPC, an alternative method is to create the plots in a different format, “scp” them to your local system, and open them there. Follow these instructions to do this.


Note

This will not work for the Ncview program, but will work for NCL.



  1. Use a text editor, such as vi, emacs, gedit, or Nano to open the util/plotgrids_new.ncl script. Find the following section:

    ; We generate plots, but what kind do we prefer?
    type = "x11"
    ; type = "pdf"
    ; type = "ps"
    ; type = "ncgm"
    wks = gsn_open_wks(type,"wps_show_dom")
    

    Currently, it is set to output type “x11”, which needs x-forwarding to work. Change this by commenting out that line (i.e, adding a semicolon in front of it) and removing the semicolon from the line for “pdf.”

    ; We generate plots, but what kind do we prefer?
    ; type = "x11"
    type = "pdf"
    ; type = "ps"
    ; type = "ncgm"
    wks = gsn_open_wks(type,"wps_show_dom")
    

    This will allow you to run the NCL program and create a plot that will be output as wps_show_dom.pdf. If you prefer a name other than “wps_show_dom,” simply modify the name in the last line in the section above.



  2. Once you are done with modifications to the NCL file, save the file and then run the NCL program.

    ncl util/plotgrids_new.ncl
    

  3. Now, go to your local machine and open a new terminal window. From there, enter the following command (all one line):

    scp your-NCAR-HPC-user-name@derecho.hpc.ucar.edu:/glade/derecho/your-NCAR-HPC-user-name/scratch/practice_exercises/wps/wps_show_dom.pdf .
    

    where you will replace your-NCAR-HPC-user-name with your actual user name in both locations. Don’t forget the space, then dot ( .) at the end! This instructs the file to be placed in the current directory.



You will then be asked to enter your NCAR-HPC password again, and you will need to use DUO to agree to the transfer. After that, the file should be copied to your local directory, where you can open it with whatever method you typically use to open .pdf files.

Note

If the image is sideways, you can go to the top of the display and turn it.


You can use this same method for any NCL scripts in the future - just make sure to pay attention to the correct path on the NCAR HPC for your “scp” command, as well as the file name specified in each NCL script.

You can now go back to the exercise you were working on and continue where you left off.