Author: Trond Kristiansen
(2011/01/31 01:27) Over 1 year ago
Just a minor commit to update repositories
41
self.grdName='NA'
42
elif grdfilename=="/Users/trond/Projects/Roms/Nordic/Inputs/imr_nordic_4km.nc":
43
self.grdName='Nordic'
44
elif grdfilename=="tromsN_800m_grid.nc":
45
self.grdName='Troms'
elif grdfilename=='/Users/trond/Projects/Nathan/NoMed47_GRID_Global.nc':
46
self.grdName='NA_Nathan'
47
elif grdfilename=='/Users/trond/Projects/Nathan/GOM_GRID_Global.nc':
48
...
187
189
188
self.maxval=1000
190
self.minDistPoints=5
191
self.maxDistHorisontal=50
192
self.maxDistHorisontal=40
self.maxDistVertical=50
193
self.maxDistVertical=40
194
self.message = None # Used to store the date for printing to screen (IOwrite.py)
195
self.time = 0
196
63
64
array1[k,:,:]=Zin
65
66
#plotData.contourMap(grdROMS,grdMODEL,Zin,k,var)
# plotData.contourMap(grdROMS,grdMODEL,Zin,k,var)
67
68
if show_progress is True:
69
p=int( ((k+1*1.0)/(1.0*grdMODEL.Nlevels))*100.)
70
hycompath="/Users/trond/Projects/arcwarm/SODA/HYCOM/"
71
72
"""Define the path to the grid file"""
73
romsgridpath="/Volumes/HankRaid/ROMS/GoM/grid/gom_grd.nc"
#romsgridpath="/Volumes/HankRaid/ROMS/GoM/grid/gom_grd.nc"
74
romsgridpath="/Users/trond/Projects/Roms/GOMfull/Inputs/gom_grd11022010.nc"
#romsgridpath="/Users/trond/Projects/Roms/GOMfull/Inputs/gom_grd11022010.nc"
75
romsgridpath="/Users/trond/Projects/Roms/GOMfull/SmoothTopo/gom_grdSmoothed.nc"
76
#romsgridpath="tromsN_800m_grid.nc"
#romsgridpath="/Users/trond/Projects/Roms/GOMsmall/Inputs/gom_grd_small.nc"
77
#romsgridpath="/Users/trond/Projects/Roms/GOMsmall/Inputs/ns8_grd.nc"
78
# CONTAINS NAN romsgridpath="/Users/trond/Projects/Roms/GOMfull/Inputs/gom_grd.nc"
79
#romsgridpath="/Users/trond/Projects/Roms/Nordic/Inputs/imr_nordic_4km.nc"
80
#romsgridpath="/Users/trond/Projects/Roms/Nordic/Inputs/imr_nordic_8km.nc"
81
romsgridpath="/Users/trond/Projects/Roms/Nordic/Inputs/imr_nordic_8km.nc"
#romsgridpath="/Users/trond/Projects/Roms/Julia/NATLC/Data/natl_40km.nc"
82
83
start_year =1960
84
end_year =1964
85
end_year =1961
start_julianday =0
86
end_julianday =365
87
end_julianday =35
88
"""Subset the input data. The more you subset the less memory is needed for calculations
89
and the faster the process is performed. The subset is initially performed in IOsubset.py"""
90
minLat=30; maxLat=55; minLon=-90; maxLon=-50
91
minLat=40; maxLat=90; minLon=-40; maxLon=136
subset=np.zeros(4); subset[0]=minLat; subset[1]=maxLat; subset[2]=minLon; subset[3]=maxLon
92
93
"""Name of output files for CLIM, BRY, and INIT files"""
94
97
98
"""Define what variables to include in the forcing files"""
99
vars=['temperature','salinity','ssh','uvel','vvel']
100
101
vars=['salinity']
"""5 day or 30 day average files for SODA"""
102
if type=='SODA': aveDays=5.0
103
if type=='SODAMONTHLY': aveDays=30.0
104
33
map = Basemap(lon_0=25,boundinglat=50,
34
resolution='l',area_thresh=100.,projection='npstere')
35
levels = np.arange(-2.0, 15.0, 0.1)
36
37
if grdROMS.grdName=='Troms':
38
map = Basemap(projection='merc',llcrnrlat=68,urcrnrlat=72,\
39
llcrnrlon=15,urcrnrlon=24,lat_ts=70,resolution='h',area_thresh=0.)
40
levels = np.arange(-2.0, 8.0, 0.25)
if grdROMS.grdName=='NorthSea':
map = Basemap(llcrnrlon=grdROMS.lon_rho[0,:].min()-15.25,
map.drawcountries()
#map.drawmapboundary()
#map.drawmeridians(np.arange(0,360,5))
#map.drawmeridians(np.arange(0,360,1))
#map.drawparallels(np.arange(0,90,5))
#map.drawparallels(np.arange(0,90,1))
temp = np.ma.masked_values(temp,grdROMS.fill_value)
if var=='salinity':
plt.colorbar(orientation='horizontal')
96
else:
CS1 = map.contourf(x,y,temp,levels,cmap=cm.get_cmap('jet',len(levels)-1) )#,alpha=0.5)
plt.colorbar(CS1,orientation='vertical',extend='both', shrink=0.5)
95
#plt.colorbar(orientation='horizontal')
#CS2 = contour(x,y,temp,CS1.levels[::2],
# colors = 'k',
52
53
#if var in ['temperature','salinity']:
54
# for k in range(grdROMS.Nlevels):
55
# plotData.contourMap(grdROMS,grdMODEL,np.squeeze(outdata[k,:,:]),k,var)
plotData.contourMap(grdROMS,grdMODEL,np.squeeze(outdata[34,:,:]),34,var)
56
return outdata
57
58
self.maxDistHorisontal=50self.maxDistHorisontal=40self.maxDistVertical=50self.maxDistVertical=40#plotData.contourMap(grdROMS,grdMODEL,Zin,k,var)# plotData.contourMap(grdROMS,grdMODEL,Zin,k,var)#romsgridpath="/Volumes/HankRaid/ROMS/GoM/grid/gom_grd.nc"#romsgridpath="/Users/trond/Projects/Roms/GOMfull/Inputs/gom_grd11022010.nc"#romsgridpath="/Users/trond/Projects/Roms/Nordic/Inputs/imr_nordic_8km.nc"end_year =1964end_year =1961end_julianday =365minLat=30; maxLat=55; minLon=-90; maxLon=-50minLat=40; maxLat=90; minLon=-40; maxLon=136vars=['salinity']#map.drawmeridians(np.arange(0,360,5))#map.drawmeridians(np.arange(0,360,1))#map.drawparallels(np.arange(0,90,5))#map.drawparallels(np.arange(0,90,1))CS1 = map.contourf(x,y,temp,levels,cmap=cm.get_cmap('jet',len(levels)-1) )#,alpha=0.5)CS1 = map.contourf(x,y,temp,levels,cmap=cm.get_cmap('jet',len(levels)-1) )#,alpha=0.5)plt.colorbar(CS1,orientation='vertical',extend='both', shrink=0.5)# plotData.contourMap(grdROMS,grdMODEL,np.squeeze(outdata[k,:,:]),k,var)plotData.contourMap(grdROMS,grdMODEL,np.squeeze(outdata[34,:,:]),34,var)