Skip to content

Instantly share code, notes, and snippets.

View uturuncoglu's full-sized avatar
🎯
Focusing

Ufuk Turunçoğlu uturuncoglu

🎯
Focusing
View GitHub Profile
@uturuncoglu
uturuncoglu / process_uxarray.py
Last active June 26, 2025 18:09
Conduit -> UXarray and Conduit -> Xarray
import os
import numpy as np
import xarray as xr
import uxarray as ux
from uxarray.conventions import ugrid
import conduit
from conduit import Node
import holoviews as hv
import cartopy.crs as ccrs
@uturuncoglu
uturuncoglu / interpolate.ipynb
Last active June 30, 2025 12:39
Interpolates global ADCIRC output to regional lat-lon grid using UXArray and ESMPy
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@uturuncoglu
uturuncoglu / README.md
Created April 23, 2025 17:08
Scripts to attach GDB to hanged processes

The following scripts can be used to collect backtrace from hanged processes using GDB.

How it works?

  • Edit trace.sh and modify the exename variable with the one used.
  • Run script as ./trace.sh JOB_ID. In this case, JOB_ID is the job id provided by the job schedular.
  • The script will trigger trace_cmd.sh and collect trace.

Limitations

  • The trace.sh script is designed to run with openPBS job schedular.
@uturuncoglu
uturuncoglu / esmf_mesh.py
Created February 4, 2025 20:55
New tool to create SCRIP or ESMF Mesh file for regular lat-on and curvilinear grids
import os
import sys
import argparse
import subprocess
import numpy as np
import xarray as xr
from datetime import datetime
def file_type(x):
if x.lower() == 'scrip' or x.lower() == 'esmf':
@uturuncoglu
uturuncoglu / config.yaml
Last active July 2, 2024 22:37
Testing CDEPS driver under UWTools
cdeps:
execution:
executable: /usr/bin/date
batchargs:
nodes: 1
stdout: /work2/noaa/nems/tufuk/COASTAL/ufs-coastal-app/sorc/uwtools/runscript.out
walltime: "00:05:00"
atm_in:
update_values:
datm_nml:
@uturuncoglu
uturuncoglu / README.md
Last active October 20, 2024 06:07
Cookbook for FV3 CDEPS Inline Implementation and using Great Lakes FVCOM Data
@uturuncoglu
uturuncoglu / plot_cubed.ncl
Last active January 19, 2024 18:59
AMS 2024 Tutorial
load "$NCARG_ROOT/lib/ncarg/nclscripts/contrib/ut_string.ncl"
procedure add_box(wks,plot,ll[2],width,cname,oval)
local xbox, ybox, gsres, dumstr
begin
xbox = (/ll(0),ll(0)+width,ll(0)+width,ll(0),ll(0)/)
ybox = (/ll(1),ll(1),ll(1)+width,ll(1)+width,ll(1)/)
gsres = True
gsres@gsFillColor = cname
@uturuncoglu
uturuncoglu / reshape.ncl
Created November 10, 2023 22:47
Convert regional FV3ATM output on mediator history file from 1d to 2d
begin
;--- arguments ---
nx = 720
ny = 600
;--- get list of files ---
files = systemfunc("ls -al ufs.hafs.cpl.hi.* | awk '{print $9}' | grep -v '_reshp.nc'")
nfiles = dimsizes(files)
;--- loop over files and reshape atm ones ---
@uturuncoglu
uturuncoglu / plot_fvcom.ncl
Last active March 22, 2024 14:55
WW3 NCL script
begin
;--- arguments ---
vname = "zeta"
vname = "uwind_speed"
vname = "vwind_speed"
tindx = 71
;--- open file ---
nc = addfile("sci_0001.nc", "r")
@uturuncoglu
uturuncoglu / README.md
Last active September 25, 2023 17:24
ESMF Mesh file for unstructured grid