Skip to content

Instantly share code, notes, and snippets.

View pukpr's full-sized avatar

Paul Pukite pukpr

View GitHub Profile
@pukpr
pukpr / CTFACI.md
Last active June 13, 2023 21:18
Common Tidal Forcing among Climate Indices

Comparison of LTE models applying slight variations of tidal forcing but larger allowance of basin tidal modulation

AMO

NINO4

IOD-East

initial_forcing = [64.79861184519945, -0.03956030217266119, -0.054641255219961, 0.1438437598358666, -0.006979979733325994, -0.018870338457863758, 0.0018286864505904798, 0.04255465840503827, 0.3659851712160052, 1.1678154520629573, -0.09920684852949448, -37.04190904240955, 0.134931019548738, -5.808707055633873, 0.04197231403115209, -0.191235897674358, -0.0005651295600417024, -0.09171877227387193, 8.1351216950623, 0.000826587745230315, 4.979592748986883, 0.3292794160236103, 0.06762453753371207, 0.168831120814038, 0.004048558625848306, 0.0008675782119757018, -0.01928763037706797, 0.5574567887828206, -0.015534993721929277, 0.011287179334352642, -0.058563893453183365, 0.013350864610056202, -0.04818672484320412, 0.04327800296616796, 0.14114202015747723]
function Tide_Sum (Template : in Data_Pairs;
Constituents : in Long_Periods_Amp_Phase;
Periods : in Long_Periods;
Ref_Time : in Long_Float := 0.0;
Scaling : in Long_Float := 1.0;
Cos_Phase : in Boolean := True;
Year_Len : in Long_Float := Year_Length;
Integ: in Long_Float := 0.0
) return Data_Pairs is
Pi : Long_Float := Ada.Numerics.Pi;
with Ada.Command_Line;
with System.Task_Info;
with GEM.LTE.Primitives.Solution;
with GEM.LTE.Primitives.Shared;
with Text_IO;
with GNAT.OS_Lib;
with Ada.Calendar;
procedure ENSO_Opt is
N : Positive := Gem.Getenv("NUMBER_OF_PROCESSORS", System.Task_Info.Number_Of_Processors);
if Lock_Freq then
M(NM) := 1.0/(Decay*D.B.mP); -- mP
end if;
@pukpr
pukpr / SpectralNino4Fit.py
Last active July 9, 2023 16:46
Overfitting example gen by Code Interpreter ChatGPT4
#
# See: https://chat.openai.com/share/d12f8a6e-8873-4aa4-992a-48125cc6aee5
#
import pandas as pd
import numpy as np
from scipy.optimize import minimize
from scipy.fftpack import fft, ifft, fftfreq
from scipy.stats import pearsonr
import matplotlib.pyplot as plt
@pukpr
pukpr / LTE_forcing_opt.jl
Last active July 10, 2023 16:43
Code Interpreter ChatGPT4 optimization of LTE modulation via Nelder-Mead or Gradient Descent algorithm on annualized tidal forcing
using Optim
using Statistics
using Plots
using CSV
using DataFrames
# Load the data
data = CSV.read("pdocalibrate.dat", DataFrame, delim='\t', header=false)
# Split the data into X and Y
https://chat.openai.com/share/7555f139-f9dc-4788-abbd-6e4b57b86a46
@pukpr
pukpr / amo_title.html
Last active September 19, 2023 15:20
AMO redefinition
<!DOCTYPE html>
<html>
<head>
<title> Morphing Text Animation </title>
<style>
canvas {
border: 1 px solid black;
} </style>
</head>
<body>