Derek Mallia STILT tutorial v08/20/2015

Slides:



Advertisements
Similar presentations
Using Outlook Benefits of Using Outlook Now – Better formatting of HTML mail (with bullets, fonts, etc.) – Great calendar, ability to send meeting.
Advertisements

ATMO5332 WRF-ARW Tutorial 0.01”.
Student Manager Catalog Builder An ACEware Webinar.
Irish Butterfly Monitoring Scheme Tutorial for online system
The main tools and functions of the system can be accessed via this side bar Allometric equations editor can be accessed under utilities, and user.
Weather Research and Forecasting – Stochastic Time-Inverted Lagrangian Transport (WRF-STILT) model Derek Mallia LAIR tutorial 12/17/2013.
Slides for IPCC. Inverse Modeling of CO 2 Air Parcel Sources Sinks wind Sample Changes in CO 2 in the air tell us about sources and sinks Atmospheric.
Guide To UNIX Using Linux Third Edition
Introduction to Unix (CA263) Introduction to Shell Script Programming By Tariq Ibn Aziz.
S. Maksyutov, P.K. Patra and M. Ishizawa Jena; 13 May 2003 TDI experiment with NIES model and interannually varying NCEP winds.
Installing geant4 v9.5 using Windows Daniel Brandt, 06 April 2012 Installing Geant4 v9.5 for Windows A step-by-step guide for Windows XP/Vista/7 using.
Part 4: Local scale dispersion calculation
Tianfeng Chai 1,2, Alice Crawford 1,2, Barbara Stunder 1, Roland Draxler 1, Michael J. Pavolonis 3, Ariel Stein 1 1.NOAA Air Resources Laboratory, College.
Working with SharePoint Document Libraries. What are document libraries? Document libraries are collections of files that you can share with team members.
Using Endnote Tiffany M. Bludau September 5, 2007.
A detailed guide on how to set-up your printing storefront. Please Note: Storefronts are compatible with all browsers, however for optimal use of the admin.
Introduction to UNIX/Linux Exercises Dan Stanzione.
CprE 288 – Quick intro for compiling C in Linux
Let’s Make An Form! Bonney Armstrong GD 444 Westwood College February 9, 2005.
Introduction to Shell Script Programming
Using IC KY Data Extract Utility and VB Scripts to automate student account management. Time: 1:15-2:15 Session #4 Date: 3/8/2012 Session Room: Beckham.
What is Sure BDCs? BDC stands for Batch Data Communication and is also known as Batch Input. It is a technique for mass input of data into SAP by simulating.
– Introduction to the Shell 10/1/2015 Introduction to the Shell – Session Introduction to the Shell – Session 2 · Permissions · Users.
Modelling of Acid deposition in South Asia Magnuz Engardt Swedish Meteorological and Hydrological Institute (SMHI) Introduction to Acid deposition.
Playing Music in Alice By David Yan Under the direction of Professor Susan Rodger July 2015.
1 Functions 1 Parameter, 1 Return-Value 1. The problem 2. Recall the layout 3. Create the definition 4. "Flow" of data 5. Testing 6. Projects 1 and 2.
QT - a C++ based GUI QT’s Designer and Assistant.
Compiled Matlab on Condor: a recipe 30 th October 2007 Clare Giacomantonio.
How to run RSM on imtf4 As of 2010/8/2 by Kei Yoshimura (AORI)
Just as there are many human languages, there are many computer programming languages that can be used to develop software. Some are named after people,
Methane and Nitrous Oxide in North America: Using an LPDM to Constrain Emissions Eric Kort Non-CO2 Workshop October 23, 2008.
DireXions – Your Tool Box just got Bigger PxPlus Version Control System Using TortoiseSVN Presented by: Jane Raymond.
HYSPLIT Part 1: Trajectories Glenn Gehring, Office of Air Quality Dept. of Science and Engineering Confederated Tribes of the Umatilla Indian Reservation.
Forms and Server Side Includes. What are Forms? Forms are used to get user input We’ve all used them before. For example, ever had to sign up for courses.
ENEE150 – 0202 ANDREW GOFFIN Introduction to ENEE150.
How to Request Materials Tutorial Order, Borrow, Renew made easy (expected running time: ~7 minutes) Oregon State Library.
TA SURVEY Have the TA write their name on the board Fill out the survey at: The TA should walk out 5 minutes.
2 March 2007 Running MATCH. 2 March 2007 MATCH is running on: Linux, Solaris PCs (not Windows PC!) Unix workstations Possible to compile on most hardware.
Installing and Running the WPS Michael Duda 2006 WRF-ARW Summer Tutorial.
1.NET Web Forms Visual Studio © 2002 by Jerry Post.
Exercise Your your Library ® RefWorks: The Basics October 10, 2006.
University of Wisconsin – Madison Engine Research Center GTI-ERC Senkin Quick Reference pg. 1 Sponsors and Contributors Chol-Bum Kweon and John Pratapas.
This document gives one example of how one might be able to “fix” a meteorological file, if one finds that there may be problems with the file. There are.
1 EndNote X2 Your Bibliographic Management Tool 29 September 2009 Humanities and Social Sciences Resource Teams.
Beginning Fortran Fortran (77) Advanced 29 October 2009 *Black text on white background provided for easy printing.
Lecture Objectives -Finish Particle dynamics modeling -See some examples of particle tracking -Eulerian Modeling -Define deposition velocity -Fluid Dynamics.
JDS5 Training Guide. On Start Up you will see this screen click the OK button Click OK.
Types of Models Marti Blad Northern Arizona University College of Engineering & Technology.
171 PC-HYSPLIT WORKSHOP Workshop Agenda Model Overview Model history and features Computational method Trajectories versus concentration Code installation.
More Unix Naomi Altman. Directories Directory = folder mkdir - makes a new directory rmdir - removes an empty directory cd mydirectory - moves you into.
Version Control and SVN ECE 297. Why Do We Need Version Control?
BARCA Telecon MPI for Biogeochemistry Jena BARCA CH 4 data analysis Flight 3 (17/06/2009) during BARCA Phase B in the wet season covering wetland.
PBL FTS Institute Retreat June 16-19, 2008 – Chorus ATM-Group Simultaneous use of greenhouse gas concentration measurements and meteorological measurements.
Installing and Running the WPS Michael Duda 2006 WRF-ARW Summer Tutorial.
Wildfire activity as been increasing over the past decades Cites such as Salt Lake City are surrounded by regions at a high risk for increased wildfire.
16-1 PC-HYSPLIT WORKSHOP Workshop Agenda Introduction to HYSPLIT Introduction.ppt Model Overview Model_Overview.ppt Meteorological Data Meteorological_Data.ppt.
Using atmospheric CO2 data More than 100 CO2 records Use LMDz model as an “offline” transport tool based on “retro-plumes” (pre-calculated response function)
DES 606: Watershed Modeling with HEC-HMS Historical Rainfall Theodore G. Cleveland, Ph.D., P.E. 6 OCT 11.
© 2008, Renesas Technology America, Inc., All Rights Reserved 1 Introduction Purpose  This training course demonstrates the use of the High-performance.
Software Development Languages and Environments. Computer Languages Just as there are many human languages, there are many computer programming languages.
Development Environment
Chapter 11 Command-Line Master Class
Introduction to Metview
STILT-ASP: A Trajectory-Based Modeling Tool for Assessing the Impacts of Biomass Burning on Air Quality C. M. Brodowski1, M. J. Alvarado1, C. R. Lonsdale1,
Adding Assignments and Learning Units to Your TSS Course
Engineering Innovation Center
Stata Basic Course Lab 2.
Functions continued.
Quick reference: entering a requisition In escape RECEIVING AN ITEM
Presentation transcript:

Derek Mallia STILT tutorial v08/20/2015 Derek.Mallia@utah.edu Weather Research and Forecasting – Stochastic Time-Inverted Lagrangian Transport (WRF-STILT) model Derek Mallia STILT tutorial v08/20/2015 Derek.Mallia@utah.edu

PART I: STILT basics

Backward trajectory simulation using the WRF-STILT model for Hurricane Sandy Why are the particles come from the SW and then from the SE. *HINT* we are by a Hurricane

Basics of the STILT model The STILT model is a 4D (x,y,z,t) Lagrangian particle dispersion model (LDPM) for atmospheric transport http://www.stilt-model.org The model was primarily developed to derive upstream source regions for a receptor Can also be used qualitatively to determine the source region of your air mass (similar to HYSPLIT) Driven by meteorological models/analyses such as the ECMWF, GDAS, NAM, and WRF However, WRF output cannot be directly used with the STILT model without converting the netcdf file format to “ARL” format which is used by the HYSPLIT model core in STILT For optimal results, time averaged mass fluxes are required (better mass conservation) [Nehrkorn et al., 2010] Much more difficult as this requires a working knowledge of WRF

For non-WRF analyses Go to: http://www.ready.noaa.gov/archives.php I generally use these to get a “quick” first look Also good for using as an outer domain I.E if your particles leaves your outer WRF domain, you can still track them beyond that domain if you nest it with something like GDAS which is “global” Downside of these products? Generally, lower spatial and temporal resolution Worse mass conservation (see Nehrkorn et al. 2010) Not necessarily tailored to your needs GDAS domain Nested WRF domain

Basic STILT output Uinta Basin example: In the inversion… Outside of the inversion…

Relevant papers for details Lin, J.C., C. Gerbig, S.C. Wofsy, et al., A near-field tool for simulating the upstream influence of atmospheric observations: The Stochastic Time-Inverted Lagrangian Transport (STILT) model, J. Geophy. Res., 108(D16), 4493, doi:10.1029/2002JD003161, 2003. Nehrkorn, T., J. Eluszkiewicz, S.C. Wofsy, Lin, J.C., C. Gerbig, M. Longo, and S. Freitas. Coupled Weather Research and Forecasting--Stochastic Time-Inverted Lagrangian Transport (WRF-STILT) Model, Meteorology and Atmospheric Physics, 107, 51-64, 2010.

Cool model bro, where do I get this model? First, need to download the STILT model by checking it out from our local SVN (type the following into your linux terminal): svn checkout https://svn.chpc.utah.edu/repo/lair/stilt/trunk/merged_stilt_hysplit Model uses name list file to run simular to that of WRF, however, can be ran using a “R” using the scripts provided in the stiltR directory Makes the model less clunky to use, however it requires becoming slightly familiar with R (very easy to use)

How do I compile STILT? After you have downloaded STILT from the SVN make yourself a working directory such as “STILT_modeling” mkdir STILT_modeling Copy the R scripts relevant for STILT (which are within the STILT_svn directory) to your working directory cp –R STILT_svn/trunk/stiltR STILT_modeling Copy from the stiltR subdirectory the file “setup.sh” in the newly created STILT modeling working directory and set the execution permission: cp STILT_modelling/stiltR/setup.sh STILT_modelling chmod +x STILT_modelling/setup.sh

Run the script “setup. sh” Run the script “setup.sh”. This script will create some sub-directories (output, STILT_Exe) in the STILT modelling working directory and will setup some files for you. These files should include: A “stiltR” subdirectory STILT_Exe subdirectory Is is recommended that you install the following R libraries since many of the R scripts within stiltR will require them: foreign fields maps chron netcdf

cp hymodelc <your path>/STILT_modelling/STILT_Exe/Copy0/hymodelc In addition, put the following line in your .bashrc file located in your home directory. This will set the path for the R libraries once you have them installed: export R_LIBS=/uufs/chpc.utah.edu/common/home/<USERNAME>/R/x86_64-unknown-linux-gnu-library/2.15/ Reset your terminal (close out and log back in) Compile an executable called “hymodelc” from source by entering the following directory: trunk/merged_stilt_hysplit/ To compile the STILT FORTRAN code type make into the command line and press enter (this will take approximately 30 seconds) Copy the hymodelc program from your merged_stilt_hysplit directory to your working STILT modeling directory that you created earlier, and stick it within the STILT_Exe/Copy0 cp hymodelc <your path>/STILT_modelling/STILT_Exe/Copy0/hymodelc

Great, if everything successfully compiled you should be ready to go!

How do I run STILT? There are two ways to run STILT, you can either run it from: The FOTRAN level by typing in hymodelc in your terminal within the Copy0 directory Or by running it using the R interface code which primarily uses the trajec.r code (this is the preferred method)

How does STILT work? STILT hymodec codes looks for several namelist files that are located within the executable directory STILT_Exe/Copy0/ CONTROL SETUP.CFG The CONTROL file determines the simulation time, length, which met fields are used, and the location of the receptor (lat/lon/agl height [m]) SETUP.CFC controls the STILT trajectory settings such as the timestep, number of trajectories, trajectory information such as lat/lon/temp/pressure ect…

CONTROL Only these lines need to be modified… Line 1: year, month, day, hour Only these lines need to be modified… Line 3: lat, lon, agl height of receptor Line 4: simulation length (hours, negative denotes backwards simulation Line 7: number of met fields that we are going to use for our simulation Line 8-9: path of ARL formatted file, and ARL file name ***The order here is based on priority, use our high resolution WRF first, and if our trajectories drop out of that domain, look in the subsequent WRF domains (I.E STILT SUPPORTS nested MET fields! See STILThowtoV8.pdf for additional details

SETUP.CFG See STILThowtoV8.pdf for variable descriptions (REVIEW CAREFULLY!!!)

Type hymodelc into you command line once we have finished editing our CONTROL file… If the CONTROL file was properly edited your code should be running! (will take a few minutes)

Sample output file…

WRF-STILT test case WRF-STILT test case files for August 15th 2012 can be found in at the following link:http://home.chpc.utah.edu/~u0703457/STILT_tutorial/test_case/ Met input files: wrfout_d01_aug.arl -WRF input file gdas1.aug12 -GDAS input file Namelist files: CONTROL SETUP.CFG Sample output file for comparison: sample_PARTICLE.DAT

Running STILT using the stiltR interface GDAS Let’s cd into the stiltR directory and get familiar with some of the most important subroutines Once your have your bearings lets open up 0wrf_stilt_tutorial.r with your favorite text editor Download this from the test case link from before and add the code to the stilt R directory… Enter R now (type R into the command line within the stiltR directory and run our tutorial code. While doing this we’ll need to set the appropriate variables to get it to run Note that this code via the trajec.r code will edit the CONTROL and SETUP.CDF files so we don’t have to do it manually! d01 d02 & 3

Hint The code that we really need to change is the following: path<-"/home/johnlin/Rdat/" #path where output gets saved, #also input data (Receptor locations and times) #and boundary mixing ratio objects are read from 'path' metpath<-"/deas/group/stilt/Metdata/" #where met data are stored in ARL format, see tutorial about #important note for this link…. rundir<-"/home/johnlin/STILT/Exe/" #specifies main directory where different directories are found #to run hymodelc

Some Debugging Pro tips… I primarily run it from FORTRAN when I’m debugging STILT RANDOM should be set to 0 in SETUP.CFG to use the same random seed, so that the pseudo-random trajectories always look the same when you repeat a run (for debugging purposes only). Otherwise set RANDOM = 1 (default setting).

Sample output when you’re done Units: PPM / μmoles m-2 s-1

Sample output…

PART II: STILT w/ WRF

STILT model installed now what? Need to get WRF data in ARL format and need to output specific variables that are required by the STILT model Involves installing a converter program and editing the WRF registry + recompiling the WRF Also had to fix some bugs as well No worries, I supplied the ARL converter code, additional FORTRAN fixes, and easy to read instructions for WRF registry editing: http://home.chpc.utah.edu/~u0703457/STILT_tutorial/WRF_STILT_code/ARL_converter_kingspeak/ Directions for ARL converter code installation and running can be found here: http://home.chpc.utah.edu/~u0703457/STILT_tutorial/WRF_STILT_code/ARL_converter_kingspeak/ Most of the starting steps can be skipped as I did this already! Don’t bother with having more than 100 WRF vertical levels… lots of ISSUES ZSG code can be found here (for STEP #8) : http://home.chpc.utah.edu/~u0703457/STILT_tutorial/WRF_STILT_code/Elena_codes/

Some PRO tips for installing the ARL converter… this is fairly easy if you KNOW what you are doing The trick is to set the CORRECT PGI compilers, if you do this you’re going to be golden— (this is when compiling the hysplit library code) Also make sure you properly reference the hysplit library code when compiling the ARL converter All the gory details can be found in this document: http://home.chpc.utah.edu/~u0703457/WRF_STILT_code/ARL_converter_kingspeak/ARL_CONVERTER_USER_GUIDE

PART II: STILT-CO2 runs

Getting STILT to run CO2 simulations takes a fair share of work, especiall if you are doing this for the first time For example you need to match up STILT footprints with the correct emission and biospheric fluxes in space and time

Units: PPM / (μmoles m-2 s-1) Units: μmoles m-2 s-1 Footprint x Emissions = Contribution of emission source (mole fraction) Biomass Burning-derived CO emissions for : 2007-08-25 Units: PPM / (μmoles m-2 s-1) Units: μmoles m-2 s-1 μmoles m-2 s-1 X PPM /(μmoles m-2 s-1)

= concentration of species (ppm, ppb, other…)

This will then have to be done for all emission and flux types to get the total CO2 concentration which can be matched up to an observation In addition, you will also need to calculate the background concentration of CO2 (i.e your initial model condition) If done correctly you should get the following when you plot it up in a time series:

*Subtracted out the background in this example!

Sounds like a lot of work right? Yup! But why reinvent the wheel when we have code lying around that does this!

This code then generates the footprints Currently, we have STILT CO2 simulation code which runs trajectories for a receptor for a specified length of time This code then generates the footprints And with 3 subroutines the code matches your footprint with the emission/biospheric flux fields in time and space, automatically! Anthropogenic emissions Wildfire emissions (if relevant) Biospheric fluxes (if dealing with CO2) This code also has the ability to calculate the background CO2 concentration (your initial condition)

The relevant code can be found in the following directory: /uufs/chpc.utah.edu/common/home/lin-group1/dvm/STILT_modelling/stiltR The relevant subroutines and “master” code are the following: carbonTrack_v5_subroutine.r “biospheric flux code” EDGAR_v2_subroutine.r “Anthropogenic code” WFEI_v3_subroutine.r “Wildfire emission code” CTbackground_subroutine.r “Background CO2 calculator” STILT_co2_simulations.r “Master code” The master code is responsible for running for 4 different subroutines (bioflux, anthropogenic, wildfire, background CO2) Note that each of the subroutines have a ton of bells and whistles, so its important for you to understand the code inside and out in order to get the most out of your research projects! (i.e STILT should not be used as a black box… a model is only as good as its modeler)

Lastly, additional code exists for CO and PM2 Lastly, additional code exists for CO and PM2.5, contact me if you need this and I’ll be more than happy to pass it along! As with any code, there may be bugs, so please report these to Derek.Mallia@utah.edu if you find any! If you have any questions or concerns, please email me and I will be more than happy to assist you!