pism-exp-gsw

ice stream and sediment transport experiments
git clone git://src.adamsgaard.dk/pism-exp-gsw # fast
git clone https://src.adamsgaard.dk/pism-exp-gsw.git # slow
Log | Files | Refs | README | LICENSE Back to index

commit 8f5f2cf210626f9f532093fab4c53626fd078a97
parent 67cc411b812c5b5294d00318345a3977068da6f5
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date:   Fri, 26 Nov 2021 10:48:38 +0100

generate simple sea level forcing

Diffstat:
MMakefile | 6+++++-
Asealvl.py | 22++++++++++++++++++++++
2 files changed, 27 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile @@ -1,4 +1,5 @@ NPROC != awk '/^cpu cores/ {print $$4; exit}' /proc/cpuinfo +SLSERIES=sealvl.nc all: \ ABC1_1a_M1_A1-flux.pdf\ @@ -42,7 +43,10 @@ experiment-1a-mode-1.sh: run.py experiment-1a-mode-3.sh: run.py ./run.py -e 1a --mode=3 --Mx=1201 > $@ +${SLSERIES}: sealvl.py + ./sealvl.py + clean: - rm -f out.* experiment-*.sh *.nc *.pdf + rm -f out.* experiment-*.sh *.nc *.pdf ${SLSERIES} .PHONY: all clean \ No newline at end of file diff --git a/sealvl.py b/sealvl.py @@ -0,0 +1,21 @@ +#!/usr/bin/env python +import numpy as np +import netCDF4 as nc4 + +f = nc4.Dataset("sealvl.nc", "w", format="NETCDF4") + +f.createDimension("time", None) +time = f.createVariable("time", "f4", ("time",)) +time.calendar = "365_day" +time.units = "years since 1-1-1" +time.long_name = "Time" + +delta_SL = f.createVariable("delta_SL", "f4", "time") +delta_SL.long_name = "Sea Level (variation from present)" +delta_SL.standard_name = "global_average_sea_level_change" +delta_SL.units = "meters" + +time[:] = [0, 1000] +delta_SL[:] = [0, 10] + +f.close()+ \ No newline at end of file