4-7-20
Virtual Session 8
Before we start
1- What did you do over the weekend? What are you looking forward to after quarantine is over?
2- updates about the internship (no session this Thursday or next week)
3- announcement: tonight is a pink super moon!
Before we start
1- pull my changes
2- push your changes to your github
3- go to your code from session-4-1 (wherever you saved it on your computer) and file → save as → move it to session-4-2-recovered folder
Review
What did we do last time?
./vectorq.exec
./omegainv.exec
This
This
runs this
runs this
writing-exec-files.py
this
Creates these files
run-fortran-files.sh
Runs this for all dates in date_list.txt
Also runs these once they are made
1
2
3
4
5
Review
Someone volunteer to share your screen and explain your code for run-fortran-code.sh
Does everyone’s code work the same way? Does anyone have any questions?
If you haven’t already, run your code
(even if you have still run your code)
Turning our data into a netcdf file
Recall -- what is a netcdf file?
Demo: someone do ncdump -h
What are the characteristics of a netcdf file?
In today’s session
Open w-to-netcdf.py
Comment “scavenger hunt”�
#opens w file
#creates file name from date_list
#path to w files (created by fortran code)
#loops through number of dates
#skips the header in w file
#creates blank array to fill
# opens netcdf file
#loops through depth
# takes value from w file and puts it into numpy array
#loops through longitude
#loops through latitude
#creates numpy array with all of the latitude values
#adds units to netcdf variables
#creates variables in numpy array
#fills the variables in the netcdf file with the values from the numpy arrays
#f4 means that the values will be floats
#closes netcdf file
#creates dimensions in netcdf file
Run this code
Once you’ve run the code successfully, check out the netcdf file in terminal
Reminder: �To view header: ncdump -h FILENAME
To view a variable: ncdump -v VARIABLENAME FILENAME
What do you see? Is there anything surprising? Do you have any questions?
Next
Hovmoller plotting
Before we make hovmoller plots
First let’s just make something like this
What do we see? Which eddies are cyclonic and which are anticyclonic?
(then let’s make a loop that makes this plot for all dates)
Hovmoller plots -- what are the first steps?