Skip to content

Instantly share code, notes, and snippets.

View mark-petersen's full-sized avatar

Mark Petersen mark-petersen

View GitHub Profile
@mark-petersen
mark-petersen / streams_extra.xml
Last active March 19, 2021 18:21
streams file for longer runs
<stream name="output"
filename_template="output/snapshot.$Y-$M-$D_$h.$m.$s.nc"
clobber_mode="truncate"
reference_time="0001-01-01_00:00:00"
type="output"
filename_interval="01-00-00_00:00:00"
output_interval="00-00-10_00:00:00">
<var name="xtime"/>
<var name="daysSinceStartOfSim"/>
program hello
real*8, parameter :: ONE=1.0
real*8, parameter :: default_fill_value = -huge(ONE)
real*8 :: default_minimum
real*8, parameter :: default_maximum = huge(ONE)
default_minimum = default_fill_value + spacing(default_fill_value)
print *, 'default_fill_value ',default_fill_value
print *, 'spacing(default_fill_value) ',spacing(default_fill_value)
# This file is the ocean core's configuration file. It is specific to the ocean
# core, and a specific machine. Each machine will configure this file
# differently, but it can be used to point on version of the testing
# infrastructure at a different version of the model.
# The namelists section defines paths to template namelists that will be used
# to generate specific namelists. Typically these will point to the forward and
# init namelists in the default_inputs directory after a successful build of
# the ocean model.
import numpy as np
import xarray
from mpas_tools.io import write_netcdf
from mpas_tools.conversion import convert
from mpas_tools.viz.paraview_extractor import extract_vtk
import jigsawpy
import jigsaw_to_MPAS
def make_mesh():
def cell_size_color_map():
cmapArray = [
(.85, .93, .99), # white
(.28, .59, .82), # aqua blue
(.08, .36, .60), # blue
(.29, .57, .31), # dark green
(.40, .62, .31), # light green
(.99, .95, .58), # pastel yellow
(.92, .84, .60), # yellow
(.81, .49, .36), # orange
<streams>
<immutable_stream name="mesh"
type="none"
io_type="pnetcdf"
filename_template="mesh_variables.nc" />
<immutable_stream name="input"
type="input"
io_type="pnetcdf"
filename_interval="none"
<streams>
<immutable_stream name="mesh"
type="none"
io_type="pnetcdf"
filename_template="/projects/ccsm/acme/inputdata/ocn/mpas-o/oRRS30to10v3wLI/oRRS30to10v3wLI.171109.nc"
/>
<immutable_stream name="input"
type="input"
io_type="pnetcdf"
netcdf vertical_grid {
dimensions:
nVertLevels = 64 ;
variables:
double refBottomDepth(nVertLevels) ;
double refMidDepth(nVertLevels) ;
double refLayerThickness(nVertLevels) ;
// global attributes:
:_NCProperties = "version=2,netcdf=4.7.3,hdf5=1.10.5" ;
# find single pits. Testing in
# /lustre/scratch4/turquoise/mpeterse/runs/200311_EC60to30_OD_pits_1/ocean/global_ocean/EC60to30/init/initial_state
import numpy as np
from netCDF4 import Dataset
# load mesh variables
ncfile = Dataset('initial_state.nc', 'r')
nCells = ncfile.dimensions['nCells']
maxLevelCell = ncfile.variables['maxLevelCell']
cellsOnCell = ncfile.variables['cellsOnCell']
@mark-petersen
mark-petersen / gist:4d0fe39bc6d95590e1a42d9cf26ef318
Created January 15, 2020 15:14
Files needed by COMPASS from oceans11
gr-fe2:compass$ git grep -B 1 'oceans11'|grep file_name|grep landice
landice/Thwaites_variability/4km_varres/standard_configuration/config_setup_model_step.xml- <get_file dest_path="work_case_dir" file_name="thwaites.4km.nc">
landice/dome/variable_resolution/decomposition_test/config_setup_mesh_step.xml- <get_file hash="fs1ydwitqa" dest_path="work_resolution_dir" file_name="dome_varres_grid.nc">
landice/dome/variable_resolution/halfar_analytic_test/config_setup_mesh_step.xml- <get_file hash="fs1ydwitqa" dest_path="work_resolution_dir" file_name="dome_varres_grid.nc">
landice/dome/variable_resolution/ho_decomposition_test/config_setup_mesh_step.xml- <get_file hash="fs1ydwitqa" dest_path="work_resolution_dir" file_name="dome_varres_grid.nc">
landice/dome/variable_resolution/ho_restart_test/config_setup_mesh_step.xml- <get_file hash="fs1ydwitqa" dest_path="work_resolution_dir" file_name="dome_varres_grid.nc">
landice/dome/variable_resolution/restart_test/config_setup_mesh_step.