This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
ps=polyconic_coast.ps | |
w=2.0944c | |
proj=Poly/${w} | |
lon0=-180 | |
lon1=`expr ${lon0} + 30` | |
reg=${lon0}/${lon1}/-90/90 | |
gmt psbasemap -R${reg} -J${proj} -K -Bg10/g10 > ${ps} | |
gmt pscoast -R${reg} -J${proj} -O -K -W -B >> ${ps} | |
while [ ${lon0} -lt 120 ]; do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template <typename Iter> | |
Iter cyclic(Iter begin, Iter end, int i) | |
{ | |
auto n = std::distance(begin, end); | |
while (i < 0) i += n; | |
return begin + (i % n); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iterator> | |
#include <algorithm> | |
template <typename Iter, typename T> | |
size_t find_index(Iter begin, Iter end, T x0) | |
{ | |
return std::distance(begin, std::find_if(begin, end, [x0](double x){return x >= x0;})); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'option_blogname', 'tr_option_blogname' ); | |
function tr_option_blogname( $blogname ) { | |
return __($blogname, 'my-theme-child'); | |
} | |
add_filter( 'option_blogdescription', 'tr_option_blogdescription' ); | |
function tr_option_blogdescription( $blogdescription ) { | |
return __($blogdescription, 'my-theme-child'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <fstream> | |
#include <vector> | |
template <typename T> | |
std::vector<T> read_binary(std::string fname, size_t n, size_t m, bool reverse = false, bool verbose = false) | |
{ | |
union u | |
{ | |
char c[sizeof(T)]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <fstream> | |
#include <vector> | |
template <typename T> | |
std::vector<T> read_ascii(std::string fname, bool verbose = false) | |
{ | |
std::vector<T> data; | |
std::ifstream ifs (fname); | |
T buf; | |
if (ifs.is_open()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
program grd2grb | |
use grib_api | |
implicit none | |
character(len=*), parameter :: & | |
ifname = "ICMSHepc8INIT", gfname = "out.grd", ofname = "out.grb" | |
integer, parameter :: & | |
ug = 41, ntrunc = 21, nv = (ntrunc + 2) * (ntrunc + 1) | |
real*4, dimension(nv) :: sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <ginac/ginac.h> | |
using namespace std; | |
using namespace GiNaC; | |
ex LegendrePoly(const symbol &x, int n) | |
{ | |
ex PKer = pow(x * x - 1, n); | |
return normal(1 / (pow(2, n) * factorial(n)) * diff(PKer, x, n)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
N=25 # number of ensembles | |
NFT0=9 # number of forecast time (including FT=0) | |
NFT=9 | |
VNAME="" | |
while getopts ":v:n:" opt; do | |
case $opt in | |
v) VNAME=$OPTARG ;; | |
n) NFT=$OPTARG ;; | |
\?) echo 'usage:: splitwfm [-v VARNAME -n NFT] FNAME' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" n prevents replace | |
" in line | |
:s/word//gn | |
" in file | |
:%s/word//gn |