CodeBreak

Introduction

The CMS team is running CodeBreak sessions every fortnight.

Those sessions are an opportunity to come and have your questions answered by the CMS team, or to listen in to learn something new. Queries can be on some specific code you are writing, about a training you are trying to understand or broader questions about programming or scientific modelling.
At the start of each session, we will ask you to provide a brief summary of your query so we can organise break-out rooms themed on topics, in order to make it possible to cover as many questions as possible and keep each room focussed on related problems.
When appropriate we will take a few minutes at the beginning of a session to present useful new software or language features, interesting blogs or highlight new developments in modelling. These topics will be announced beforehand as they arise.

CodeBreak sessions synopsis

2022

13/04/2022

  • Accessing files on OOD from remote computer
  • Loading hh5 conda environment in OOD jupyterlab
  • Convert model longitude to value between 0 and 360 degrees
  • Interpolate density profiles to new vertical grid
  • General Matplotlib Questions
  • How to apply an analysis to a bigger dataset in Python

30/03/2022

  • Understanding error in Python
  • Avoiding repetition in Python through code organisation
  • Count the number of elements that follow a given condition

16/03/2022

  • Copying global attributes from a NetCDF file
  • Calculating differential in xarray
  • Regression analysis on spatial data

02/03/2022

  • Problem installing the climextRemes Python package
  • Understand and use a Fortran program

16/02/2022

  • Looping in Python and code organisation
  • Memory Consumption and optimisation in Python.
  • UM Model Crash explanation
  • How to use Gibbs-SeaWater (GSW) Oceanographic Toolbox to calculate the dynamic height
  • Code organisation with NCL and more generally.

2021

1/9/2021

  • How to organise plotting large numbers of plots from heterogenous models in python
  • Layout of subplots with matplotlib in python
  • Fast percentile calculation in python

 

15/9/2021

  • How to analyse data weekly and creating weekly climatology
  • Curl calculations
  • Weighted function in xarray
  • How to organise calculations dynamically with python data structure (dict) e.g. looping over seasons

 

29/9/2021

  • What to do when variables have coordinates that are not quite equal.
  • Calculate daily means of ERA5 pressure-level data
  • Conversion of UM outputs between pressure and model levels
  • Writing a Xarray DataArray sub-class
  • Incompatible datetime and cftime error
  • Reprojecting data from metres to lat/lon in python

 

13/10/2021

  • Applying land masking to CMIP data
  • netCDF compression
  • Bathymetry data

27/10/2021

  • Panel plot or facet plot along the time axis

24/11/2021

  • Using dask when calculating Eddy Kinetic Energy for high resolution ocean model
  • How to calculate antecedent precipitation index efficiently for entire AGCD dataset

08/12/2021

  • Particle trajectory data analysis.
  • Fortran code strange behaviour
  • Old Python code crash due to user-installed package needing update
  • Using ERA5 data as input for the HySplit trajectory model
  • ACCESS-OM2 output: selection of time slice
  • Understanding xarray, chunking, queue