Description

The PME-WRF Image Viewer displays images generated from the running of each model cycle.  The display is organized by plot type (surface, upper air, maps) where the fields menu displays images from that plot type.  Images are also broken out by domain and by valid hour:  images from previous model runs get over-written so that one is viewing an image from the latest model run at any given time (the label on the image tells from which cycle it came).

The PME-WRF Cycles shows the same images, this time organized by the cycle that generated them - clicking on a cycle will display images from that cycle only.

The PME-WRF Soundings Viewer displays soundings generated from the running of each model cycle.  These are given by station and grouped by domain what produced the sounding.  These images are showing the one from the latest available model run.

Scripts

These web links run a perl script wrapper around javascript that display images.  The perl script reads image directories in order to get current available cycles, and reads a javascript array to define available menu items.  The javascript passes values to an animation script to march through cycle times for a given image.

The web link for the Image Viewer runs the script /d2/www/cgi-bin/model/ugui, which displays images in /d2/www/htdocs/projects/GWPME/web/gifs as defined by /d2/www/htdocs/projects/GWPME/js_file and passes values to /d2/www/htdocs/projects/anim.html to animate the images in a movie loop.

The web link for Cycles runs the script /d2/www/cgi-bin/model/list_ugui_dirs, which lists contents from /d2/www/htdocs/projects/GWPME/web/cycles to call the same script as used for the Image Viewer (using the same js_file and animation script) to display the contents of /d2/www/htdocs/projects/GWPME/web/cycle/<cycle>/gifs

The web link for the Soundings Viewer runs the script /d2/www/cgi-bin/model/ugui.sndg, which displays sounding images found in /d2/www/htdocs/projects/GWPME/web/gifs as defined by /d2/www/htdocs/projects/sng_file and passes values to /d2/www/htdocs/projects/anim.html to animate the images in a movie loop.

These images are generated as part of the WRF model runs (see below section on how to modify them).  They are removed after 10 days by user pmefdda running in cron /home/pmefdda/bin/scrub_master.sh

Modifying the images

The model images are made by the Read/Interpolate/Plot (RIP) program (documentation here).  RIP reads input files that define each plot (using keywords that are defined in the documentation).  The RIP input files for the WRF model are located in /d1/pmefdda/GMODJOBS/GWPME/postprocs and are named Mdomain<domain>.<season>.GRM - one file per domain per summer/winter, where the difference between domains are the increasing of detail in inner domains (closer contours, listing of stations) and the difference between summer and winter plots are the endpoints of color scales.  Each 'Mdomain' file starts with headers that RIP needs, then a custom color table is defined, then the individual plots are defined, roughly in order of the menu items as seen in the image viewer.   The definitions of the soundings for the Soundings VIewer are at the end of the Mdomain 2 and 3 files.

These files may be modified in order to change the output products.  To change an existing plot, read the RIP documentation and try changing things (see section under Testing Changes below).  If new plots are desired to be added, it is strongly recommended to delete an equal number of plots.  This is because the postprocessing is running a maximum capacity and additional plots may cause the model output to not finish.

Testing Changes

It is strongly recommended to test any changes outside of the operational system,  as one typo in a 'Mdomain' file may cause the entire postprocessing to fail.  To set up a test area outside of the operational area, do the following:

  • as user pmefdda, make a test directory somewhere
  • prepare the model data:
    • copy a set of wrf output files do this directory - files can be found in /d2/pmefdda/cycles/GWPME/GRM/output/netcdf/<cycle>; pick a time and copy over a file from each domain
    • make a subdirectory called ripscr and cd to this directory
    • set the RIP_ROOT environment variable:  setenv RIP_ROOT /d1/pmefdda/builds/build_mm_nightly/wrfv3.3.1/cycle_code/CONSTANT_FILES/RIP4
    • run this command once for each domain (this splits out the wrf input into products): /d1/pmefdda/builds/build_mm_nightly/wrfv3.3.1/cycle_code/EXECUTABLE_ARCHIVE /ripdp_wrf.exe Domain_<domain number) all ../<wrf output file by domain>
    • cd back to the test directory
  • prepare the input namelists
    • copy the Mdomain files (for either summer or winter) to this test area and rename them to domain1.in, domain2.in and domain3.in
    • modify the headers to hard-coded values:
      • in the 4th line, replace the word 'plttime' with the 4-digit number found after the domain number the name of every file in the ripscr subdirectory
      • in the 7th line, delete the words 'fcoffset=OFFSET'
      • in the 9th line, replace the word 'IMGFMT' with the word 'ps' (this will output into postscript format)
    • adjust image definitions (suggestion - find a similar plot to modify, and delete off plots that aren't being tested)
  • run this command to run rip on a prepared input namelist:  /d1/pmefdda/builds/build_mm_nightly/wrfv3.3.1/cycle_code/EXECUTABLE_ARCHIVE/rip.exe ripscr/Domain_<number> domain<number>.in
    • If successful, a file called domain<number>.ps will be created (and the output-to-screen will end with the message "We're outta here like Vladimir !!")
    • If rip didn't finish, look for error messages in the output-to-screen (rip will exit in the image frame where it encountered the problem)
  • view output - you will be able to view the .ps file in postscript viewer of your choice.

Once satisfied with results, adjust the operational system

  • Recommended - make backup copies of any files that will be modified
  • Make the desired changes to the Mdomain files in /d1/pmefdda/GMODJOBS/GWPME/postprocs
  • If you have added or deleted images, you will need to update the perl-script array that maps the images defined in the Mdomain files to image names.
    • Make a backup copy of /d1/pmefdda/GMODJOBS/GWPME/postprocs/image-fields.pl
    • if you have deleted an image in an Mdomain file, delete the name from that same spot in the fields_d<domain> array in image_fields.pl
    • If you have added an image to an Mdomain file, pick a name for the image and add it to that same spot in the fields_d<domain> array in image_fields.pl
  • If you have added or deleted images, you will also need to update the javascript array that defines the menus in the Image Viewer
    • Make a backup copy of /d2/www/htdocs/projects/GWPME/js_file
    • If you have deleted an image, find its name in the js_file and delete the lines associated with it:
      • 'value' is the name of the image deleted from image_fields.pl
      • 'text' is the name that shows up in the Image Viewer menu
      • Renumber all entries from that point forward to the end of the domain to account for the deleted value.  You will also have to adjust the numbers of any begin/end pair after this point.
    • If you have added an image, pick a spot in the js_file to add it (pick a menu to put it on - Surface, Upper Air, Other.  This does not have to be 'in order' with the image_fields.pl file)
    • Add the new image with both a text and value entry ('value' is the name of the new image as defined in image_fields.pl; 'text' will be the name that will show up in the Image Viewer menu).
    • Renumber all entries from that point forward to the end of the domain to account for the inserted value.  You will also have to adjust the numbers of any begin/end pair after this point.

Adding a sounding

Follow the steps above under 'Modifying the Images', with these added considerations:

  • soundings are currently defined at the end of the Mdomain2 and Mdomain3 files
  • add the new sounding to either domain2 or domain3 (if outside of domain 3 or inside but close to the domain 3 boundary, add it to domain2)
  • Check the file /d1/pmefdda/GMODJOBS/GWPME/postprocs/stationlist for existence of the 4-letter code to define the new sounding.  If the stationlist file does not have this site, add it to the file
  • The javascript array that defines the menus in the Soundings Image Viewr is /d2/www/htdocs/projects/GWPME/sndg_file (not the js_file used for the other images)
  • No labels