1 of 15

4-7-20

Virtual Session 8

2 of 15

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!

3 of 15

4 of 15

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

5 of 15

Review

What did we do last time?

6 of 15

./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

7 of 15

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?

8 of 15

If you haven’t already, run your code

(even if you have still run your code)

9 of 15

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?

10 of 15

In today’s session

Open w-to-netcdf.py

11 of 15

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

12 of 15

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?

13 of 15

Next

Hovmoller plotting

14 of 15

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)

15 of 15

Hovmoller plots -- what are the first steps?