Penguinpocalypse climate modeling practice

Alice Bradley, Williams College, Geosciences
Author Profile


This is a programming exercise that walks students through developing a very small model before we start

Learning Goals

Students will gain practice with MATLAB and the basics of model development from this activity.

Context for Use

This activity is designed as the second step in an introduction to MATLAB for upper-level undergraduate students who will be using it in a series of climate modeling projects over the course of the term. In this activity, students will get practice with indexing, loops, conditional logic, masks, plotting, and breaking a larger programming challenge into smaller pieces.

It is a lab activity, expected to take 1-3 hours. Students with some programming background will complete it fairly quickly, and may add additional features to their penguin-apocalypse models. Students without any programming experience (except the initial tutorials) will need additional help and encouragement along the way, but will gain a lot of confidence when they can watch their penguin maps update.
Students will need to be pointed to the ncread function to access the land mask.

Description and Teaching Materials

In this upper-level lab activity, students follow the instructions in the pdf handout to develop a model of a penguin-covered ocean surface where penguins flip belly up or down based on the ones around them. It is a lighthearted introduction to model development and programming basics.

A MATLAB script for part 1.3 (the final step) is provided for guidance.

Student instructions for Penguin-pocalypse model assignment (Microsoft Word 2007 (.docx) 11kB Sep18 20)
Reference MATLAB script (Matlab File 2kB Sep18 20)

Teaching Notes and Tips

Students who are new to programming and Matlab will ask a lot of questions. I have found it important for this lab to encourage them to try something and to work with their peers in order to keep students moving forward.


If students have a working, commented script that produces the penguin flipping outcomes, they will have succeeded in getting practice with model development in MATLAB.

References and Resources