Ejemplo n.º 1
0
import time
start_time = time.time()

####
# Month selection
####

runtime = [datetime(2016,3,2), datetime(2016,3,3)]
finish_time = (datetime(2016,3,2) + timedelta(days = 31.0))


###############################
# MODEL SELECTION
###############################
o = BivalveLarvae(loglevel=100)
o.max_speed = 3#
###############################
# READERS
###############################
thredds_path_1 = 'http://thredds.moanaproject.org:8080/thredds/dodsC/moana/ocean/NZB/v1.9/monthly_avg/nz5km_avg_201603.nc'
reader_moana_v19 = reader_ROMS_native_MOANA.Reader(thredds_path_1) # load data for that year
reader_moana_v19.multiprocessing_fail = True # bypass the use of multi core for coordinates conversion and seems to make the model run much faster.

# # Making customised landmask - not required here, using ROMS landmask 
# reader_landmask = reader_global_landmask.Reader(
#                     llcrnrlon=171.0, llcrnrlat=184.5,
#                     urcrnrlon=-42.0, urcrnrlat=-34.0)
# max is 185deg

# use native landmask of ROMS files
o.add_reader([reader_moana_v19]) # [reader_landmask,reader_moana_v19]
#!/usr/bin/env python

import os
import sys
import numpy as np
from datetime import datetime, timedelta
from opendrift.readers import reader_global_landmask
from opendrift.readers import reader_ROMS_native_MOANA
from opendrift.models.bivalvelarvae import BivalveLarvae

###############################
# MODEL SELECTION
###############################

o = BivalveLarvae(loglevel=100)  # Set loglevel to 0 for debug information
o.max_speed = 5.0  #

###############################
# READERS
###############################

reader_moana_v19_1 = reader_ROMS_native_MOANA.Reader(
    '/nesi/nobackup/mocean02574/NZB_N50/nz5km_his_201706.nc')
reader_moana_v19_2 = reader_ROMS_native_MOANA.Reader(
    '/nesi/nobackup/mocean02574/NZB_N50/nz5km_his_201707.nc')
reader_moana_v19_3 = reader_ROMS_native_MOANA.Reader(
    '/nesi/nobackup/mocean02574/NZB_N50/nz5km_his_201708.nc')

o.add_reader([reader_moana_v19_1, reader_moana_v19_2, reader_moana_v19_3])
o.set_config('general:use_auto_landmask', False)  # dynamical landmask if true