angle = grdfile.variables['angle'][:] h2 = grdfile.variables['h'][:] rmask2 = grdfile.variables['mask_rho'][:] # DOING COMPUTATIONS TO INTERPOLATE THE FIELDS TO ROMS GRID ######### Jrho, Irho = rlon2.shape Mr2, Lr2 = rlon2.shape Lu2 = Lr2-1; Mu2 = Mr2 Lv2 = Lr2; Mv2 = Mr2-1 cosa = np.cos(angle); sina = np.sin(angle); del angle rmask2 = np.ma.masked_where(rmask2 == 0, rmask2) hu = griddata(rlon2.ravel(), rlat2.ravel(), h2.ravel(), ulon2, ulat2) hv = griddata(rlon2.ravel(), rlat2.ravel(), h2.ravel(), vlon2, vlat2) [Zsig,dZsig] = zlev(h2,roms.theta_s,roms.theta_b,roms.hmax,roms.N) [ZsigU,dZsigU] = zlev(hu,roms.theta_s,roms.theta_b,roms.hmax,roms.N) [ZsigV,dZsigV] = zlev(hv,roms.theta_s,roms.theta_b,roms.hmax,roms.N) ### Interpolating T, S to ROMS 3D S-COORD grid ############################### lN = roms.N lt = fields.ndays TEMP = np.zeros([lN, Mr2, Lr2]) SALT = np.zeros([lN, Mr2, Lr2]) z2 = np.zeros([N1, Jrho, Irho]) Zlev2 = np.zeros([N1, 1]) print ' \n' + '==> ' + ' INTERPOLATING TEMPERATURE ...\n' + ' '
ulat2 = grdfile.variables['lat_u'][:] angle = grdfile.variables['angle'][:] h2 = grdfile.variables['h'][:] rmask2 = grdfile.variables['mask_rho'][:] # DOING COMPUTATIONS TO INTERPOLATE THE FIELDS TO ROMS GRID ######### Jrho, Irho = rlon2.shape Mr2, Lr2 = rlon2.shape Lu2 = Lr2-1; Mu2 = Mr2 Lv2 = Lr2; Mv2 = Mr2-1 cosa = np.cos(angle); sina = np.sin(angle); del angle rmask2 = np.ma.masked_where(rmask2 == 0, rmask2) hu = griddata(rlon2.ravel(), rlat2.ravel(), h2.ravel(), ulon2, ulat2) hv = griddata(rlon2.ravel(), rlat2.ravel(), h2.ravel(), vlon2, vlat2) [Zsig,dZsig] = zlev(h2,roms.theta_s,roms.theta_b,roms.Tcline,float(roms.N)) [ZsigU,dZsigU] = zlev(hu,roms.theta_s,roms.theta_b,roms.Tcline,float(roms.N)) [ZsigV,dZsigV] = zlev(hv,roms.theta_s,roms.theta_b,roms.Tcline,float(roms.N)) ### Interpolating T, S to ROMS 3D S-COORD grid ############################### lN = float(roms.N) lt = 1 TEMP = np.zeros([lt, lN, Mr2, Lr2]) SALT = np.zeros([lt, lN, Mr2, Lr2]) z2 = np.zeros([N1, Jrho, Irho]) Zlev2 = np.zeros([N1, 1]) print ' \n' + '==> ' + ' INTERPOLATING TEMPERATURE ...\n' + ' '