Skip to content

Instantly share code, notes, and snippets.

View pwolfram's full-sized avatar

Phillip J. Wolfram pwolfram

View GitHub Profile
MODEL_FORMULATION =
dummy:
( $(MAKE) error )
xlf:
( $(MAKE) all \
"FC_PARALLEL = mpifort" \
"CC_PARALLEL = mpicc" \
src/core_seaice/column/documentation/README:20:http://oceans11.lanl.gov/svn/CICE/branches/column_pkg/source_colpkg.
src/core_seaice/column/documentation/README:23:http://oceans11.lanl.gov/trac/CICE/attachment/wiki/WikiStart/cicedoc.pdf?format=raw.
testing_and_setup/compass/landice/Thwaites_variability/4km_varres/standard_configuration/config_setup_model_step.xml:6: <mirror protocol="wget" url="http://oceans11.lanl.gov/mpas_data/mpas_landice/test_cases/"/>
testing_and_setup/compass/landice/dome/variable_resolution/decomposition_test/config_setup_mesh_step.xml:6: <mirror protocol="wget" url="http://oceans11.lanl.gov/mpas_data/mpas_landice/test_cases/"/>
testing_and_setup/compass/landice/dome/variable_resolution/halfar_analytic_test/config_setup_mesh_step.xml:6: <mirror protocol="wget" url="http://oceans11.lanl.gov/mpas_data/mpas_landice/test_cases/"/>
testing_and_setup/compass/landice/dome/variable_resolution/ho_decomposition_test/config_setup_mesh_step.xml:6: <mirro
@pwolfram
pwolfram / mpas_for_paraview.sh
Created May 21, 2019 21:30 — forked from bradyrx/mpas_for_paraview.sh
extracts just the needed variables to trigger the Paraview reader to recognize it as an MPAS file
#!/bin/bash
GridVars=latCell,lonCell,maxLevelCell,nEdgesOnCell,xCell,yCell,zCell,dcEdge,dvEdge,indexToEdgeID,latEdge,lonEdge,nEdgesOnEdge,xEdge,yEdge,zEdge,areaTriangle,indexToVertexID,latVertex,lonVertex,xVertex,yVertex,zVertex,edgesOnVertex,cellsOnVertex,indexToCellID,indexToEdgeID,indexToVertexID,cellsOnEdge,edgesOnCell,edgesOnEdge,cellsOnCell,refBottomDepth,verticesOnCell,verticesOnEdge,bottomDepth
ncks -d Time,0 -v ${GridVars} file1.nc file2.nc
ncks -A -v ${GridVars} mpas_grid.nc mpas_file.nc
&run_modes
config_ocean_run_mode = 'forward'
/
&time_management
config_do_restart = .false.
config_restart_timestamp_name = 'Restart_timestamp'
config_start_time = '0001-01-01_00:00:00'
config_stop_time = 'none'
config_run_duration = '0001_00:00:01'
config_calendar_type = 'gregorian_noleap'
#! /usr/bin/env python
"""
Take an input netcdf database and extract particle information, converting to
vtu format for input into ParaView.
Usage exampe:
./animated_particles.py -f free_floating.nc
produces
#!/usr/bin/env python
"""
Interpolation of initial conditions from source grid onto a destination grid.
Currently implementation interpolates
* temperature
* salinity
* layerThickness
@pwolfram
pwolfram / a.rb
Created December 24, 2018 21:34
This file has been truncated, but you can view the full file.
<?xml version="1.0" encoding="UTF-8"?>
<gpx creator="StravaGPX" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd http://www.garmin.com/xmlschemas/GpxExtensions/v3 http://www.garmin.com/xmlschemas/GpxExtensionsv3.xsd http://www.garmin.com/xmlschemas/TrackPointExtension/v1 http://www.garmin.com/xmlschemas/TrackPointExtensionv1.xsd" version="1.1" xmlns="http://www.topografix.com/GPX/1/1" xmlns:gpxtpx="http://www.garmin.com/xmlschemas/TrackPointExtension/v1" xmlns:gpxx="http://www.garmin.com/xmlschemas/GpxExtensions/v3">
<metadata>
<time>2018-12-23T14:41:57Z</time>
</metadata>
<trk>
<name>HR test with polar</name>
<type>9</type>
<trkseg>
<trkpt lat="39.8870700" lon="-105.0340230">
function [Class, BroadClass] = KoppenGeiger(T,P) %,classes)
% [Class, BroadClass] = KoppenGeiger(T,P,classes)
%
% Classify monthly temperature and preciptiation climatologies according
% to the Koppen-Geiger climate classification. The T and P inputs
% represent the temperature and preciptiation climatologies,
% respectively. T and P should be provided as three dimensional arrays
% with the third dimension representing time (12 months). The temperature
% data should have units degrees Celsius and the precipitation data units
% mm/month.
#!/usr/bin/env python
import numpy as np
import scipy as sp
import xarray as xr
import netCDF4
forcing = xr.open_dataset('forcing.nc')
# build xtime
#!/bin/bash
#SBATCH --nodes=1
#SBATCH --time=4:00:00
#SBATCH --job-name=hurricane_test
#SBATCH --output=hurricane_test.o%j
#SBATCH --error=hurricane_test.e%j
#SBATCH --qos=interactive
#SBATCH -A w19_mpascoastal
#SBATCH --mail-user=pwolfram@lanl.gov
#SBATCH --mail-type=ALL