Skip to content

Instantly share code, notes, and snippets.

View pwolfram's full-sized avatar

Phillip J. Wolfram pwolfram

View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/bin/bash
trash composed
mkdir composed
for i in mill/*; do
name=`basename $i`
montage -geometry +2+2 mill/$name mill2/$name southpole/$name northpole/$name composed/$name
done
#!/usr/bin/env python
# Phillip Wolfram, 06/30/2015
import netCDF4
def main(fname, xperiod, yperiod):
f = netCDF4.Dataset(fname,'r+')
f.is_periodic = "YES"
f.x_period = xperiod
f.y_period = yperiod
f.close()
#!/usr/bin/env python
# Phillip J. Wolfram 02/05/2015
# map points in grid onto a cylinder and replace values
import netCDF4
import numpy as np
import copy
def remap_points(f_in, name, width):
# get the data
@pwolfram
pwolfram / fast_hist.py
Last active August 29, 2015 14:24 — forked from nkeim/fast_hist.py
#!/usr/bin/env python
import numpy as np
def fast_hist(data, bin_edges):
"""Fast 1-dimensional histogram. Comparable to numpy.histogram(), but careless.
'bin_edges' should encompass all values in 'data'; the first and last elements
in 'bin_edges' are ignored, and are effectively (-infinity, infinity).
&run_modes
config_ocean_run_mode = 'forward'
/
&time_management
config_do_restart = .false.
config_restart_timestamp_name = 'Restart_timestamp'
config_start_time = '0000-01-01_00:00:00'
config_stop_time = 'none'
config_run_duration = '0010_00:00:00'
config_calendar_type = 'gregorian_noleap'
module tester
integer, parameter :: RKIND = selected_real_kind(12)
real (kind=RKIND), parameter :: pii = 3.141592653589793_RKIND
real (kind=RKIND), parameter :: radius = 6371220._RKIND
contains
!***********************************************************************
!
! routine mpas_triangle_signed_area_sphere
!
#!/usr/bin/env python
import netCDF4
import numpy as np
def test_assert(logexpr, msg):
#assert logexpr, msg
if not logexpr:
print msg
return True
Using / setting up a new test case:
1. Download and compile tracerInfrastructure
2. Copy existing 32km SOMA test case as an example of the grid SOMA_32km.nc / graph file OR get mesh from https://docs.google.com/spreadsheets/d/1H7f58cnBylfBlhjAbKWTUsbHks4ehON8oZTX8x8Fpyc/edit#gid=0
3. Setup with minor modifications to namelist and streams
4. Run in init mode
5. Use cell culler to remove culledCells
6. Run in init mode again
7. Run in forward mode
@pwolfram
pwolfram / forcing.ipynb
Created October 13, 2015 14:21
Todd's original analysis
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.