Skip to content

Instantly share code, notes, and snippets.

@mathomp4
mathomp4 / setting-up-uv-on-discover.md
Last active August 11, 2026 18:49
Setting up uv on Discover

Setting up uv on Discover

This setup keeps uv, its cache, managed Python installations, and tools on $NOBACKUP storage instead of in your home directory.

Configure uv

Add the following to ~/.bashrc:

MERRA-2 Zonal Mean File Conversion Analysis

Executive Summary

This document details the reverse-engineering analysis of how 3D MERRA-2 NetCDF files (on a $576 \times 361 \times 72$ grid) are processed to produce the corresponding zonal-mean files (MERRA-2.inst3_3d_asm_Nv.monthly.YYYYMM.0001x0091x0072.nc4 on a $1 \times 91 \times 72$ grid), specifically focusing on ozone ($O_3$/$OX$).

It includes comparison between two input sources:

  1. Pre-made Monthly Means (MERRA-2.inst3_3d_asm_Nv.monthly.YYYYMM.nc4)
  2. Daily Instantaneous Files (MERRA2_400.inst3_3d_asm_Nv.YYYYMMDD.nc4, 3-hourly, 240 timesteps/month)

The June 2012 validation changes an important earlier conclusion: the dominant difference from the canonical ozone field is a unit conversion, not numerical precision or the use of monthly rather than daily input. The canonical field is approximately the zonal mean of MERRA-2 mass mixing ratio converted to volume (mole) mixing ratio:

@mathomp4
mathomp4 / run_indent_matrix.sh
Created March 5, 2026 14:22
Flang Label Reproducer
#!/usr/bin/env bash
set -euo pipefail
# ---- config ----
FLANG="${FLANG:-flang}"
FLAGS=(-O0 -g -fno-integrated-as -save-temps=obj)
OUTDIR="${OUTDIR:-obj}"
MAX=8
mkdir -p "$OUTDIR"
@mathomp4
mathomp4 / Miniforge.md
Last active February 14, 2025 18:52
Using Miniforge to make a Python stack

Making a Python stack with Miniforge

In the examples below, I'll mainly be using Discover at NCCS as my guide for paths, etc., but it can be genericized

Preliminary Setup

You want to make sure mamba, et al, do no cache files in your home dir as that can kill quota.

So:

@mathomp4
mathomp4 / MITgcm-move.md
Last active March 6, 2023 14:32
Moving MITgcm code from GCM GC repo to Ocean preserving the history
@mathomp4
mathomp4 / brewlist.md
Last active February 25, 2022 13:13
List of Brew Packages

List of packages to install with Brew.

Some of these are needed for GEOS, Baselibs, etc. Some are things I personally just need.

Formulae

  • autoconf
  • autogen
  • automake
  • cmake
@mathomp4
mathomp4 / cmake-ignore-build-install.md
Last active February 24, 2021 21:55
Automatically ignore CMake build and install directories

This bit of CMake is based off of code from Michael Hirsch (aka @scivision)

# https://www.scivision.dev/cmake-auto-gitignore-build-dir/
# --- auto-ignore build directory
if(NOT EXISTS ${PROJECT_BINARY_DIR}/.gitignore)
  file(WRITE ${PROJECT_BINARY_DIR}/.gitignore "*")
endif()

# Piggyback that file into install
@mathomp4
mathomp4 / import-github-labels.md
Last active November 27, 2019 13:35 — forked from cdlhub/import-github-labels.md
Script to import labels to Github issue page
@mathomp4
mathomp4 / mpi_reproducer.F90
Last active August 29, 2015 14:05
Open MPI Stall Reproducer
module CommsMod
implicit none
private
public SetDistGrid
public CreateRequest
public DistGrid
public CommRequest
public ArrayIGather