Exemple #1
0
if nc.y_periodic == 1: y_periodic = True
elif nc.y_periodic == 0: y_periodic = False

ng = 0  # ghost points in the horizontal

nq = len(nc.dimensions['nq'])
ntime = len(nc.dimensions['time'])
nc.close()

###################################################################################
# load simulation parameters
###################################################################################

print('Loading simul')
simul = load(simul=parameters)
depths = simul.coord[4]

###################################################################################
# get time
###################################################################################

ocean_time = ionetcdf.get(ncfile, 'ocean_time', simul)

# old version (output generated before 16/12/20)
#time = np.round(ionetcdf.get(ncfile,'time_int',simul),2)
#time += time[2] - time[1]
# new version
time = np.round(ionetcdf.get(ncfile, 'time', simul), 3)

dtime = time[2] - time[1]
Exemple #2
0
import sys
sys.path.append('../../Modules/')
# only for JC
sys.path.append('home/jeremy/Bureau/Project/Pyticles/')
from R_files import load
import visual_tools as vt

##############################################################################
# INPUT PARAMETERS
##############################################################################
start_file = 1020
end_file = 1040

my_simul = 'polygr_apero'
parameters = my_simul + ' [0,10000,0,10000,[1,100,1]] ' + format(start_file)
simul = load(simul=parameters, floattype=np.float64)

ncfile = '/home/jeremy/Bureau/Data/Pyticles/Visual_2_depths/' \
         + 'Case_1_Visual_2_depths_1_1510.nc'
roms_file = '/home/jeremy/Bureau/Data/Pyticles/chaba_his.1550.nc'
grd_file = '/home/jeremy/Bureau/Data/Pyticles/chaba_grd.nc'
##############################################################################
# COMPUTING TEST ZONE
##############################################################################
# Case Adv3d
# Given a variable at particle location and a 2D var over wall domain
zeta = vt.get_var('zeta', roms_file, itime=0, ndims=3)
temp = vt.get_var('temp', roms_file, itime=0, ndims=4)
salt = vt.get_var('salt', roms_file, itime=0, ndims=4)

topo_roms = vt.get_var('h', grd_file)
Exemple #3
0
# parameters = my_simul + [0,nx,0,ny,[1,nz,1]] ; nx, ny, nz Roms domain's shape
my_simul = 'gigatl6_1h_surf'

##########
if 'surf' in my_simul or advsurf:
    advsurf = True
    light = True  # do not load unnecessary files for a pure surface advection
else:
    light = False

#########

# user may add my_simul in Module/R_files.py to indicate roms output path and
# parameters
parameters = my_simul + ' [0,15000,0,15000,[1,300,1]] ' + format(start_file)
simul = load(simul=parameters, light=light, floattype=np.float64)

##############################################################################
# Pyticles numerical schemes (TO BE EDITED)
#
#time-stepping Default is RK4
timestep = 'RK4'  # Choices are
# FE (forward-Euler)
# RK2, RK4 (Runge-Kutta 2nd and 4th order)
# AB2, AB3, AB4 (Adams-Bashforth 2,3,4th order)
# ABM4 (Adams-Bashforth 4th order + Adams-Moulton corrector).

nsub_steps = 10  # Number of time steps between 2 roms time steps

# Spatial interpolation
# Default is linear