Commit d9b8725b authored by Richard Hofmeister's avatar Richard Hofmeister

added BarentsSea setup

parent ff3d8241
from pylab import *
import netCDF4
import sys
nc = netCDF4.Dataset(sys.argv[1])
ncv = nc.variables
days = ncv['time'][:]/86400.
years = 1958 + days/365.
prefix='hzg_ecosmo'
prefix='ecosmo'
no3 = ncv[prefix+'_no3'][:,-1].squeeze()
nh4 = ncv[prefix+'_nh4'][:,-1].squeeze()
pho = ncv[prefix+'_pho'][:,-1].squeeze()
sil = ncv[prefix+'_sil'][:,-1].squeeze()
dia = ncv[prefix+'_dia'][:,-1].squeeze()
fla = ncv[prefix+'_fla'][:,-1].squeeze()
try:
bg = ncv[prefix+'_bg'][:,-1].squeeze()
except:
bg = zeros(dia.shape)
try:
dic = ncv['carbonate_dic'][:,-1].squeeze()
got_dic=True
except:
got_dic=False
microzoo = ncv[prefix+'_microzoo'][:,-1].squeeze()
mesozoo = ncv[prefix+'_mesozoo'][:,-1].squeeze()
sed1 = ncv[prefix+'_sed1'][:].squeeze()
sed2 = ncv[prefix+'_sed2'][:].squeeze()
sed3 = ncv[prefix+'_sed3'][:].squeeze()
h = ncv['h'][:]
pp = ncv[prefix+'_primprod'][:]
sp = ncv[prefix+'_secprod'][:]
pdays = arange(3.5,days.max(),7)
primprod = zeros((len(pdays),))
secprod = zeros((len(pdays),))
# time filter:
for i,pday in enumerate(pdays):
idx = where(abs(days-pday)<3.5)
inum = len(idx[0])
primprod[i] = sum(h[idx]*pp[idx])*86400.*365./1000./inum
secprod[i] = sum(h[idx]*sp[idx])*86400.*365./1000./inum
figure(figsize=(10,16))
xlabelstr='days'
days = years
pdays = 1958 + pdays/365.
xlabelstr='years'
subplot(511)
plot(days,no3,'-',label='no3')
plot(days,nh4,'-',label='nh4')
plot(days,pho,'-',label='pho')
plot(days,sil,'-',label='sil')
xlabel(xlabelstr)
ylabel(u'[mgC/m\u00b3]')
legend(frameon=False)
subplot(512)
plot(days,dia,'-',label='dia')
plot(days,fla,'-',label='fla')
plot(days,bg,'-',label='bg')
xlabel(xlabelstr)
ylabel(u'[mgC/m\u00b3]')
legend(frameon=False)
subplot(513)
plot(days,microzoo,'-',label='microzoo')
plot(days,mesozoo,'-',label='mesozoo')
xlabel(xlabelstr)
ylabel(u'[mgC/m\u00b3]')
legend(frameon=False)
subplot(514)
lw=1.5
plot(pdays,primprod,'-',lw=lw,label='prim. production')
plot(pdays,secprod,'-',lw=lw,label='sec. production')
legend(frameon=False)
ylabel(u'[gC/m\u00b2/y]')
subplot(515)
plot(days,sed1/1000.,'-',label='sed carbon')
plot(days,sed2/1000.,'-',label='sed opal')
plot(days,sed3/1000.,'-',label='ads. po4')
xlabel(xlabelstr)
ylabel(u'[gC/m\u00b2]')
legend(frameon=False)
if got_dic:
figure()
plot(days,dic,'-',lw=2.0,label='dic')
xlabel(xlabelstr)
ylabel('mmolC m-3')
legend(frameon=False)
show()
from pylab import *
import netCDF4
from netcdftime import utime
from matplotlib.colors import LogNorm
nc = netCDF4.Dataset('arctic1d.nc')
ncv = nc.variables
ut = utime(ncv['time'].units)
dates = ut.num2date(ncv['time'][:])
days = ncv['time'][:]/86400.
h = ncv['h'][:]
#h=asarray([0.0].extend(list(h)))
#depth = float(ncv['depth'][:])
depth = -285.
z = depth+cumsum(h[0],axis=0)
idx = argmin(abs(z+150.))
zsl = slice(None,None)
zz = squeeze(zsl)
zz = ncv['z'][0,zsl].squeeze()
def ucells(varname):
return squeeze(ncv[varname][:,zsl]).T
f = figure(figsize=(8,10))
right=0.15
width=0.8
height=0.2
bottom=0.1
space=0.03
xmin=0
xmax=10*365
i=0
phoname='hzg_ecosmo_pho'
dianame='hzg_ecosmo_dia'
flaname='hzg_ecosmo_fla'
phoname='ECO_pho'
dianame='ECO_dia'
flaname='ECO_fla'
uname='u'
vname='v'
nuhname='nuh'
tobsname='tobs'
rasterized=True
ax=axes([right,bottom+i*(space+height),width,height])
pcolormesh(days,zz,ucells('temp'),rasterized=rasterized)
#clim(-2,-1)
clim(-1,10)
xlim(xmin,xmax)
xlabel('days')
ylabel('z [m]')
colorbar(label='temperature [degC]')
i=1
ax=axes([right,bottom+i*(space+height),width,height])
if False:
pcolormesh(days,zz,ucells('salt'),rasterized=rasterized)
clim(34.75,34.9)
xlim(xmin,xmax)
ax.set_xticklabels([])
ylabel('z [m]')
colorbar(label='salinity [psu]')
else:
pcolormesh(days,zz,ucells('temp_obs'),rasterized=rasterized)
clim(-1,10)
xlim(xmin,xmax)
ax.set_xticklabels([])
ylabel('z [m]')
colorbar(label='obs. temperature [degC]')
i=2
ax=axes([right,bottom+i*(space+height),width,height])
exponents = list(linspace(-7,-1,7))
lognuh = log10(ucells(nuhname)[1:,:])
#contourf(days,zz,lognuh,levels=exponents,rasterized=rasterized,extend='both')
pcolormesh(days,zz,ucells(nuhname)[1:,:],norm=LogNorm(1.0e-7,1.0e-1),rasterized=rasterized)
#clim(0,0.8)
xlim(xmin,xmax)
ax.set_xticklabels([])
ylabel('z [m]')
cax = colorbar(label=u'turb. diffusivity\n[m\u00b2/s]')
i=3
ax=axes([right,bottom+i*(space+height),width,height])
#cc = contourf(days,zz,sqrt(ucells(uname)**2+ucells(vname)**2),levels=linspace(0.0,1.0,21),rasterized=rasterized)
cc = pcolormesh(days,zz,sqrt(ucells(uname)**2+ucells(vname)**2),rasterized=rasterized)
clim(0.0,1.0)
xlim(xmin,xmax)
ax.set_xticklabels([])
ylabel('z [m]')
colorbar(cc,label=u'velocity [m/s]')
savefig('arctic1d_phys_profiles.pdf')
show()
# Barents Sea setup
This setup is located in the Barents Sea and contains climatological forcing for salt, temperature profiles, ice cover. Meteorological forcing is taken from NCEP data.
!$Id: airsea.proto,v 1.1.1.1 2003/03/11 13:38:58 kbk Exp $
!-------------------------------------------------------------------------------
!
!-------------------------------------------------------------------------------
! air-sea interaction (heat, momentum and freshwater fluxes and solar radiation)
!
! calc_fluxes -> surface fluxes calculated by means of bulk formulae
! (.true./.false.). Solar radiation is calculated from
! time, latitude, longitude and clouds. If (.true.),
! meteo_file must be given and hum_mode must be specified.
! If (.false.), surface fluxes and solar radiation are
! prescribed.
!
! fluxes_method -> bulk formulae according to
! 1. Kondo (1975)
! 2. Fairall et al. (1996)
!
! back_radiation_method -> calculation of long-wave back radiation according to
! 1. Clark et al. (1974)
! 2. Hastenrath and Lamb (1978)
! 3. Bignami et al. (1995)
! 4. Berliandand Berliand (1952)
!
! meteo_file -> file with meteo data (for calc_fluxes=.true.) with
! - date (yyyy-mm-dd hh:mm:ss)
! - x-comp. of wind (10 m) in m/s
! - y-comp. of wind (10 m) in m/s
! - air pressure ( 2 m) in hectopascal
! - dry air temp. ( 2 m) in Celsius
! - relative humidity in % or wet bulb temperature in C
! or dew point temperature in C (depending on hum_mode)
! - cloud cover in 1/10
!
! hum_method -> decides what is given in 7. column in meteo_file
! 1: relative humidity
! 2: wet bulb temperature
! 3: dew point temperature
!
! heat_method -> method to provide short wave radiation (swr) and
! surface heat flux (qh)
! (only for calc_fluxes=.false.)
! 0: heat flux not prescribed
! 1: constant "const_swr" and "const_qh" given (see below)
! 2: swr and qh are read from heatflux_file
!
! rain_impact -> logical
! include sensible heat-flux from precipitation
! include momentum-flux from precipitation
!
! calc_evaporation -> logical - if rain_impact=.true.
! calculate evaporation/condensation (m/s)
!
! swr_method -> short wave radiation according to
! 1: constant swr=const_swr (see below)
! 2: read swr from file - swr_file (see below)
! 3: calculate swr=swr(t(lon),lat,clod)
!
! const_swr -> constant value of incoming short wave radiation in W/m^2
! (always positive)
!
! swr_file -> file with short wave radiation
!
! swr_factor -> scales data read from file to W/m2 - defaults to 1
!
! const_qh -> constant value of surface heat flux in W/m^2
! (negative for heat loss)
!
! heatflux_file -> sensible+latent+longwave given in W/m^2
! (negative for net outgoing)
!
! momentum_method -> method how momentum fluxes are given
! (only for calc_fluxes=.false.)
! 0: momentum flux not prescribed
! 1: constant surface momentum fluxes given
! 2: surface momentum fluxes given from file momentumflux_file
!
! const_tx -> x-component of surface momentum flux in N/m^2
! const_ty -> y-component of surface momentum flux in N/m^2
!
! momentumflux_file-> file with tx and ty given in N/m^2
!
! precip_method -> method for specifying precipitation
! 0: precipitation not included == precip=0
! 1: constant value for precipitation (in m/s)
! 2: values for precipitation read from file
!
! const_precip -> constant value for precipitation in m/s
!
! precip_file -> file with value for precipitation
! used if precip_method=2
!
! precip_factor -> scales data read from file to m/s - defaults to 1
!
! sst_method -> method how sea surface temperature (SST) is given
! 0: no independent SST observation is read from file
! 2: independent SST observation is read from file,
! only for output
!
! sst_file -> file with independent SST observation
!
! sss_method -> method how sea surface salinity (SSS) is given
! 0: no independent SSS observation is read from file
! 2: independent SSS observation is read from file,
! only for output
!-------------------------------------------------------------------------------
&airsea
calc_fluxes = .true.,
fluxes_method = 2,
back_radiation_method = 1,
meteo_file = 'meteo_ncepr2.dat',
hum_method = 1,
rain_impact = .false.,
calc_evaporation = .false.,
heat_method = 0,
const_heat = 0.0,
heatflux_file = 'heatflux.dat',
swr_method = 3,
const_swr = 0.01,
swr_file = 'swr_arctic.dat',
swr_factor = 1.0,
momentum_method = 0,
const_tx = 0.0,
const_ty = 0.0,
momentumflux_file = 'momentumflux.dat',
precip_method = 0,
const_precip = 0.0,
precip_file = 'precip.dat', !'precip_time_sclice_2068-2098.dat',
precip_factor = 0.0001,
sst_method = 0,
sst_file = 'sst.dat',
sss_method = 0,
sss_file = 'sss.dat',
ssuv_method=0
/
#!/bin/bash
name=$1
mkdir -p /scratch/local1/GotlandClcCo2/$name
cp *.nml /scratch/local1/GotlandClcCo2/$name
mv log.txt /scratch/local1/GotlandClcCo2/$name
mv /scratch/local1/gotland.nc /scratch/local1/GotlandClcCo2/$name
This diff is collapsed.
&observations
variable = 'icealgea/icethickness'
file = 'ideal_ice_data_90days_1.2m.dat'
index = 1
/
&observations
variable = 'icealgea/icedh'
file = 'ideal_ice_data_90days_1.2m.dat'
index = 2
/
&observations
variable = 'ice_concentration'
file = 'icedata.dat'
index = 1
/
&observations
variable = 'ice_thickness'
file = 'ideal_ice_data_90days_1.2m.dat'
index = 1
/
&gotm_fabm_nml
fabm_calc = .true.,
cnpar = 1.0,
w_adv_discr = 6,
ode_method = 3,
split_factor = 1,
bioshade_feedback = .false.,
bioalbedo_feedback = .false.,
biodrag_feedback = .false.,
repair_state = .true.
salinity_relaxation_to_freshwater_flux = .false.
no_precipitation_dilution = .false.
save_inputs = .false.
/
!$Id: gotmmean.proto,v 1.1.1.1 2003/03/11 13:38:58 kbk Exp $
!-------------------------------------------------------------------------------
! The namelists 'meanflow' is read in meanflow.F90.
!-------------------------------------------------------------------------------
!-------------------------------------------------------------------------------
! Specify variables related to the 1D meanflow model.
!
! h0b= bottom roughness - Note: z0b=0.03*h0b+0.1*nu/ustar [m]
! z0s_min= minimum value of z0s, default value if charnock=.false. [m]
! charnock= .true.: adaptation of Charnok 1955 formula used
! .false.: constant surface roughness length z0s_min used
! charnock_val= emp. constant in Charnok 1955 formula (default = 1400.)
! ddu= grid zooming (surface), 0: no zooming; > 3 strong zooming
! ddl= grid zooming (bottom), 0: no zooming; > 3 strong zooming
! grid_method= 0: zooming of grid with ddl, ddu >= 0
! 1: sigma grid (relative depth fractions) read from file
! 2: cartesian grid (fixed layer height in m) read from file
!
! grid_file= file for sigma or cartesian grid. the first line gives the
! number of layers, the following lines give fractions or
! layer heights in m from the surface down to the bottom.
! gravity= gravitational acceleration [m/s^2]
! rho_0= Reference density [kg/m^3].
! cp= Specific heat of sea water [J/kg/K].
! avmolu= molecular viscosity for momentum [m^2/s].
! avmolt= molecular diffusity for temperature [m^2/s].
! avmols= molecular diffusity for salinity [m^2/s].
! MaxItz0b= max # of iterations for z0b as function of u_taub.
! no_shear= .true.: shear production term P is set to zero
!-------------------------------------------------------------------------------
&meanflow
h0b= 0.05
z0s_min= 0.02
charnock= .false.
charnock_val= 1400.
ddu= 1.5
ddl= 0.1
grid_method= 0
grid_file= 'grid.dat'
gravity= 9.81
rho_0= 1027.
cp= 3985.
avmolu= 1.3e-6
avmolt= 1.4e-7
avmols= 1.1e-9
MaxItz0b= 1
no_shear= .false.
/
!$Id: gotmrun.proto,v 1.1.1.1 2003/03/11 13:38:58 kbk Exp $
!-------------------------------------------------------------------------------
!
!-------------------------------------------------------------------------------
! general model setup
!
! title -> title of simulation
! nlev -> number of levels
! dt -> time step in seconds
! cnpar -> parameter for "explicitness" of numerical scheme
! (between 0.0 and 1.0)
! buoy_method -> method to compute mean buoyancy
! 1: from equation of state
! (i.e. from potential temperature and salinity)
! 2: from prognostic equation
!
!-------------------------------------------------------------------------------
&model_setup
title= "Barents Sea"
nlev= 20
dt= 1800.
cnpar= 1.0
buoy_method= 1
/
!-------------------------------------------------------------------------------
! geographic location
!
! name -> name of the station
! latitude -> latitude in degree (north is positive)
! longitude -> longitude in degree (east is positive)
! depth -> water depth in meters
!
!-------------------------------------------------------------------------------
&station
name= "Barents Sea"
latitude= 73.0
longitude= 45.0
depth= 280.
/
!-------------------------------------------------------------------------------
! duration of run
!
! timefmt -> method to specify start and duration of model run
! 1: duration computed from number of time steps, MaxN
! (bogus start date used)
! 2: duration computed from given start and stop dates
! (number of time steps MaxN computed)
! 3: duration computed from number of time steps, MaxN
! (start date as specified, stop date computed)
!
! MaxN -> nominal number of time steps (see "timefmt")
! start -> nominal start date: YYYY/MM/DD HH:MM:SS (see "timefmt")
! stop -> nominal stop date: YYYY/MM/DD HH:MM:SS (see "timefmt")
!
!-------------------------------------------------------------------------------
&time
timefmt= 2
MaxN= 0
start= '2001-01-01 12:00:00'
stop= '2017-12-31 12:00:00'
/
!-------------------------------------------------------------------------------
! format for output and filename(s).
!
! out_fmt -> format for GOTM output
! 1: ASCII
! 2: NetCDF
! 3: GrADS
!
! out_dir -> path to output directory (set permissions)
! out_fn -> output string used to generate output file names
! nsave -> save results every 'nsave' timesteps
! diagnostics -> diagnostics are written to output (if .true.)
!
! mld_method -> how to diagnose mixed layer depth
! 1: mixed layer depth computed from TKE threshold
! 2: mixed layer depth from Ri threshold
! diff_k -> TKE threshold [m^2/s^2] for mixed layer depth
! ri_crit -> Ri threshold for mixed layer depth
!
! rad_corr -> correct surface buoyancy flux for solar radiation
! for output (if true)
!
!-------------------------------------------------------------------------------
&output
out_fmt= 2
out_dir= "/scratch/local1/"
out_fn= "gotland"
nsave= 48
sync_out= 120
diagnostics= .false.
mld_method= 1
diff_k= 1.e-5
Ri_crit= 0.5
rad_corr= .true.
/
!-------------------------------------------------------------------------------
! Specify variables related to the equation of state.
!
! eq_state_mode -> choice for empirical formula for equation of state
! 1: UNESCO equation of state by Fofonoff and Millard (1983)
! 2: equation of state according Jackett et al. (2005)
!
! eq_state_method -> method to compute density and buoyancy from salinity,
! potential temperature and pressure
! 1: full equation of state (i.e. with the LOCAL
! pressure). This implies that T is NOT treated as
! the potential temperature but rather as the in-situ
! temperature!
! 2: equation of state with pressure evaluated at the surface.
! This implies that T is treated as the potential
! temperature and thus rho as the potential density.
! 3: linearized equation of state at T0,S0,p0
! (again, use p0=p_surf to work with potential
! temperature and density.)
! 4: linear equation of state with T0,S0,dtr0,dsr0
!
! For the precise definition of the following quantities, see
! GOTM documentation:
!
! T0 -> reference temperature (deg C) for linear equation of state
! S0 -> reference salinity (psu) for linear equation of state
! p0 -> reference pressure (bar) for linear equation of state
! dtr0 -> thermal expansion coefficient for linear equation of state
! dsr0 -> saline expansion coefficient for linear equation of state
!-------------------------------------------------------------------------------
&eqstate
eq_state_mode = 2
eq_state_method= 2
T0= 10.
S0= 35.
p0= 0.
dtr0= -0.17
dsr0= 0.78
/
This diff is collapsed.
# date ice_thickness ice_concentration ice_top_temperature salt_ice icedh
2015-01-01 00:00:00 1.5 0.8 -10. 38 0.01 0.00 0.8
2015-12-25 23:00:00 1.0 0.7 -8. 37 0.008 0.00 0.8
2010-01-01 00:00:00 1.0
2015-12-31 00:00:00 1.0
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
arctic1d:
time_unit: hour
time_step: 24
sync_interval: 120
variables:
- source: *
This diff is collapsed.
2015-01-01 00:00:00 2 2
-1.0 34.8
-1000. 35.5
This diff is collapsed.
This diff is collapsed.
2015-01-01 00:00:00 2 2
-1.0 -1.87
-1000. 1.0
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment