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 / remove-periodic.cpd
Created September 26, 2013 20:07
Paraview filter to remove error in plotting periodic boundaries
<CustomFilterDefinitions>
<CustomProxyDefinition name="Remove Periodic Sides" group="filters">
<CompoundSourceProxy id="5150" servers="1">
<Proxy group="filters" type="ProgrammableFilter" id="4476" servers="1" compound_name="ProgrammableFilter1">
<Property name="CopyArrays" id="4476.CopyArrays" number_of_elements="1">
<Element index="0" value="0"/>
<Domain name="bool" id="4476.CopyArrays.bool"/>
</Property>
<Property name="InformationScript" id="4476.InformationScript" number_of_elements="1">
<Element index="0" value=""/>
@mark-petersen
mark-petersen / test_associated.f90
Created May 14, 2015 18:46
program to test if a pointer association works
program test_associated
implicit none
real, target :: tgt(2) = (/1., 2./)
real, pointer :: ptr1(:), ptr2(:)
ptr1 => tgt
if (associated(ptr1)) then
print *, 'ptr1 is associated'
else
@mark-petersen
mark-petersen / gist:a0424deb7e5cfe7915c3
Created May 18, 2015 20:51
Description of CORE-II corrected data sets.
Mark,
CPL_ALBAV should be set to true. There may be additional settings needed. Have you checked your settings against a G case created by a CESM version? I suggest performing such a check just to make sure.
Regarding the data sets..... You can take a look at the site http://data1.gfdl.noaa.gov/nomads/forms/core/COREv2.html. At NCAR, we only have the uncorrected data sets. The corrections are applied on the fly. The data atmospheric model knows (via settings) that it is using the CORE data sets and it applies the needed corrections. If you are using the CESM datm and CESM settings and if you have downloaded you data sets from NCAR, then all should be OK. So, please check all you settings for all component models against a CESM G compset. For the data sets, you can download corrected and uncorrected data sets from the above web site for a few of the variables and years and check them against what you use. Some data sets will be the same for corrected and uncorrected sets.
Best,
Gokhan
On Mon, May 11, 2015
@mark-petersen
mark-petersen / gist:469182597ec1cbd80ce9
Created May 20, 2015 13:50
git diff on nag seaIceEnergy fix
make[1]: Leaving directory `/turquoise/usr/projects/climate/mpeterse/mpas_git/nag_error_fix_v3.3'
wf-fe2.lanl.gov> git diff HEAD~1
diff --git a/src/core_ocean/mode_forward/mpas_ocn_time_integration_rk4.F b/src/core_ocean/mode_forward/mpas_ocn_time_integration_rk4.F
index 2f35d8e..63d3fb5 100644
--- a/src/core_ocean/mode_forward/mpas_ocn_time_integration_rk4.F
+++ b/src/core_ocean/mode_forward/mpas_ocn_time_integration_rk4.F
@@ -118,6 +118,7 @@ module ocn_time_integration_rk4
logical, pointer :: config_filter_btr_mode, config_use_freq_filtered_thickness
logical, pointer :: config_use_standardGM
logical, pointer :: config_use_cvmix_kpp
@mark-petersen
mark-petersen / mht.m
Created May 22, 2015 15:10
plot fields from MHT
wd = '/local1/mpetersen/runs/';
subdir='/analysis_members/';
dir='t04';
abc='v';
title_txt = 'MPAS-Ocean, QU.15km';
filename='meridional_heat_transport.0010-01-01_00.00.00.nc'
%data_fields={ ...
@mark-petersen
mark-petersen / remove-periodic.cpd
Created October 6, 2015 19:56
paraview filter to remove connected periodic sides in an MPAS domain
<CustomFilterDefinitions>
<CustomProxyDefinition name="Remove Periodic Sides" group="filters">
<CompoundSourceProxy id="5150" servers="1">
<Proxy group="filters" type="ProgrammableFilter" id="4476" servers="1" compound_name="ProgrammableFilter1">
<Property name="CopyArrays" id="4476.CopyArrays" number_of_elements="1">
<Element index="0" value="0"/>
<Domain name="bool" id="4476.CopyArrays.bool"/>
</Property>
<Property name="InformationScript" id="4476.InformationScript" number_of_elements="1">
<Element index="0" value=""/>
&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 = '0000-00-00_04:00:00'
config_calendar_type = 'gregorian_noleap'
from netCDF4 import Dataset
from numpy import arange, dtype # array module from http://numpy.scipy.org
"""
Write simple points.nc file
"""
# the output array to write will be nPoints
nPoints = 20
# open a new netCDF file for writing.
ncfile = Dataset('points.nc','w')
# create the nPoints dimension.
@mark-petersen
mark-petersen / ten_deg_bands.geojson
Created March 7, 2016 14:57
6 regions, simply ten degree bands in Southern Hemisphere.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mark-petersen
mark-petersen / drake_channel.geojson
Last active April 5, 2016 21:04
coordinates of drake channel
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.