Skip to content

Instantly share code, notes, and snippets.

View gaelforget's full-sized avatar

Gael Forget gaelforget

View GitHub Profile
using Luxor, Colors
function main(fname)
Drawing(600, 600, fname)
origin()
circle(O, 290, :clip)
sethue("white")
paint()
colors = [Luxor.julia_purple, Luxor.julia_blue, Luxor.julia_green, Luxor.julia_red]
@gaelforget
gaelforget / ora_IP_solutions.m
Created June 22, 2018 19:00
Return reanalysis code names and rgb colors (for NA-ORA-IP)
function [nam,col]=ora_IP_solutions(iSol);
%Solution code names:
ora_IP_solutions_nam={'ECCOv4r3','GLOSEA5','ORAS5','UR025','GLORYS2V4','cglorsv7','GLORYS12V1'};
ora_IP_solutions_nam={ora_IP_solutions_nam{:},'GECCO2','GFDL_ECDA','GONDOLA100A','NorCPM_V0','NorCPM_V1'};
%Color code names selected below are based on:
%https://www.mathworks.com/matlabcentral/fileexchange/24497-rgb-triple-of-color-name--version-2
%https://www.mathworks.com/matlabcentral/mlc-downloads/downloads/submissions/24497/versions/2/screenshot.PNG
@gaelforget
gaelforget / grid_load_lonlat.m
Created April 2, 2018 19:27
Extract the lat-lon part of ecco v4 grid variables (see doi.org/10.5194/gmd-8-3071-2015)
function []=grid_load_lonlat();
global mygrid;
mygrid=[];
do_gcmfaces=~isempty(which('gcmfaces'));
%defining the grid
mygrid.dirGrid='nctiles_grid/';
if do_gcmfaces;
@gaelforget
gaelforget / eccov4_lonlat.m
Created April 2, 2018 19:21
Extract the lat-lon part of ecco v4 fields (see doi.org/10.5194/gmd-8-3071-2015)
function [FLD,varargout]=eccov4_lonlat(fldLoc,fldName,numRec,varargin);
%
% Extract the lat-lon part of ecco v4 fields.
% FLD=eccov4_lonlat(fldLoc,fldName,numRec) reads record
% numRec (set to [] for all records) of fldName in fldLoc
% ---> assumption : fldName designates a variable located at grid cell
% centers (e.g. RAC)
%
% [FLD,MATE]=eccov4_lonlat(fldLoc,fldName,numRec,mateLoc,mateName,1)
% reads record numRec of fldName,mateName in fldLoc,mateLoc