Exemple #1
0
    def test10(self):

        p = POP(**default_options)

        self.assertTrue(
            p.parameters.windstress_monthly_file == '',
            msg=
            "Default value for windstress_monthly_file should be empty string")
        self.assertTrue(
            p.parameters.surface_heat_flux_monthly_file == '',
            msg=
            "Default value for surface_heat_flux_monthly_file should be empty string"
        )
        self.assertTrue(
            p.parameters.surface_freshwater_flux_monthly_file == '',
            msg=
            "Default value for surface_freshwater_flux_monthly_file should be empty string"
        )

        self.assertTrue(p.parameters.windstress_forcing == 'none',
                        msg="Default for windstress forcing should be none")
        self.assertTrue(
            p.parameters.surface_heat_flux_forcing == 'none',
            msg="Default for surface heat flux forcing should be none")
        self.assertTrue(
            p.parameters.surface_freshwater_flux_forcing == 'none',
            msg="Default for surface freshwater flux forcing should be none")

        bogus_file = '/path/to/non-existent/file'

        p.set_monthly_ws_file(bogus_file)
        p.set_monthly_shf_file(bogus_file)
        p.set_monthly_sfwf_file(bogus_file)

        self.assertTrue(
            p.parameters.windstress_monthly_file == bogus_file,
            msg="Error retrieving set value for windstress_monthly_file")
        self.assertTrue(
            p.parameters.surface_heat_flux_monthly_file == bogus_file,
            msg="Error retrieving set value for surface_heat_flux_monthly_file"
        )
        self.assertTrue(
            p.parameters.surface_freshwater_flux_monthly_file == bogus_file,
            msg=
            "Error retrieving set value for surface_freshwater_flux_monthly_file"
        )

        self.assertTrue(p.parameters.windstress_forcing == 'monthly',
                        msg="Setting for windstress forcing should be monthly")
        self.assertTrue(
            p.parameters.surface_heat_flux_forcing == 'monthly',
            msg="Setting for surface heat flux forcing should be monthly")
        self.assertTrue(
            p.parameters.surface_freshwater_flux_forcing == 'monthly',
            msg="Setting for surface freshwater flux forcing should be monthly"
        )
Exemple #2
0
instance.pilots.add_pilot(pilot)

instance.use_for_all_workers()


from omuse.community.pop.interface import POP
p=POP(channel_type="distributed", redirection="none", number_of_workers=24)
p.change_directory('/home/ben/amuse/amuse-svn/src/omuse/community/pop/')

p.set_horiz_grid_file('data/input/grid/horiz_grid_20010402.ieeer8')
p.set_vert_grid_file('data/input/grid/in_depths.dat')
p.set_topography_file('data/input/grid/topography_20010702.ieeei4')
p.set_ts_file('data/input/restart/r.x1_SAMOC_control.00750101')

p.set_monthly_shf_file('data/input/shf_monthly/shf.normal_year+flux.mon')
p.set_monthly_sfwf_file('data/input/sfwf/sfwf_phc0-50_ncarp_r46+g8_0.5Sv_flux.mon')
p.set_monthly_ws_file('data/input/ws_monthly/ws.1958-2000.mon')


#raw_input()


#prepare the plot stuff
pyplot.ion()
#lats,lons = get_lats_lons(p)
#xs,ys = get_xy()
sst = p.elements.temp.value_in(units.C)
#sst = p.elements.shf.value_in(units.W/units.m**2)

print sst[100,120]
Exemple #3
0
from omuse.community.pop.interface import POP
p = POP(channel_type="distributed", redirection="none", number_of_workers=600)
p.change_directory('/home/ben/amuse/amuse-svn/src/omuse/community/pop/')
p.set_namelist_filename('pop_in_highres')

p.set_horiz_grid_file('/home/ben/pop/input/grid/grid.3600x2400.fob.da')
p.set_vert_grid_file('/home/ben/pop/input/grid/in_depths.42.dat')
p.set_topography_file(
    '/home/ben/pop/input/grid/kmt_pbc.p1_tripole.s2.0-og.20060315.no_caspian_or_black'
)
p.set_bottom_cell_file(
    '/home/ben/pop/input/grid/dzbc_pbc.p1_tripole.s2.0-og.20060315.no_caspian_or_black'
)
p.set_ts_file('/home/ben/pop/input/r.t0.1_42l_greenland.01150501')

p.set_monthly_shf_file('/home/ben/pop/input/forcing/shf.NY+H+f.mon')
p.set_monthly_sfwf_file('/home/ben/pop/input/forcing/sfwf.C+r+g8+f.mon')
p.set_monthly_ws_file('/home/ben/pop/input/forcing/ws.o_n_avg.mon')

#raw_input()

#prepare the plot stuff
pyplot.ion()
sst = p.elements.temp.value_in(units.C)
#sst = p.elements.shf.value_in(units.W/units.m**2)

print sst[100, 120]
print sst.min(), sst.max()

#lats,lons = get_lats_lons(p)
#xs,ys = get_xy(p)