爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 10518|回复: 7

[其他] CMIP5 资料 插值问题求助

[复制链接]

新浪微博达人勋

发表于 2018-5-27 10:42:21 | 显示全部楼层 |阅读模式

登录后查看更多精彩内容~

您需要 登录 才可以下载或查看,没有帐号?立即注册 新浪微博登陆

x
本人cmip5小白一枚,第一次用cmip5 的资料,对它的插值一窍不通,搜家园看到说ncl对cmip5的插值要用rcm2rgrid,但是出现了下面的错误:fatal:rcm2rgrid: The rightmost dimensions of fi must be nlat2d x nlon2d, where nlat2d and nlon2d are the dimensions of the lat2d/lon2d arraysfatal:["Execute.c":8638]:Execute: Error occurred at or near line 31
下面是我写的代码,麻烦各位大神帮我看看,是哪里的问题,
================================================================================
代码
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
begin



diri1="H:/work/data/CMIP5/historical/CMCC-CESM/"
fils1 = systemfunc("ls " + diri1 + "tos_Omon_CMCC-CESM_historical_r1i1p1_*-*")
;print(fils1)

f1=addfiles(fils1,"r")
ListSetType(f1,"cat")

tos=f1[:]->tos
;tos=lonPivot(tos,0.5)
printVarSummary(tos)
;print(tos)
;=============================插值================================
tos_lon=f1[:]->lon
tos_lat=f1[:]->lat
printVarSummary(tmp_lon)
print(tos_lon(0,0))
print(tos_lon(3873,181))
printVarSummary(tmp_lat)
print(tos_lat(0,0))
print(tos_lat(3873,181))
nlon=dimsizes(tos&i)
nlat=dimsizes(tos&j)
lon=fspan(tos_lon(0,0),tos_lon(3873,181),nlon)
lat=fspan(tos_lat(0,0),tos_lat(3873,181),nlat)
tos_new=rcm2rgrid(tos_lat,tos_lon,tos,lat,lon,0)
printVarSummary(tos_new)

end
===============================================================================
下面是资料说明
ncl 13> print(f1)

Variable: f1
Type: file
filename:       tos_Omon_CMCC-CESM_historical_r1i1p1_185001-185512
path:   H:/work/data/CMIP5/historical/CMCC-CESM/tos_Omon_CMCC-CESM_historical_r1i1p1_185001-185512.nc
   file global attributes:
      institution : CMCC - Centro Euro-Mediterraneo per i Cambiamenti Climatici, Bologna, Italy
      institute_id : CMCC
      experiment_id : historical
      source : CMCC-CESM
      model_id : CMCC-CESM
      forcing : Nat,Ant,GHG,SA,Oz,Sl
      parent_experiment_id : N/A
      parent_experiment_rip : N/A
      branch_time :    0
      contact : Marcello Vichi (marcello.vichi@cmcc.it)
      history : Model output postprocessed with Afterburner and CDO (https://code.zmaw.de/projects) 2012-08-22T10:29:27Z CMOR rewrote data to comply with CF standards and CMIP5 requirements.
      comment : Equilibrium reached after more than 1500-year spin-up of the physics, 200-year spin-up of carbon content and 276 year at pre-industrial GHG concentrations after which data were output wit
h nominal date of January 1850.
      references : model described in the documentation at http://www.cmcc.it/data-models/models
      initialization_method : 1
      physics_version : 1
      tracking_id : 514477e5-91ea-49bb-9cb9-1e7b0305ab67
      product : output
      experiment : historical
      frequency : mon
      creation_date : 2012-08-22T10:29:27Z
      Conventions : CF-1.4
      project_id : CMIP5
      table_id : Table Omon (27 April 2011) 340eddd4fd838d90fa9ffe1345ecbd73
      title : CMCC-CESM model output prepared for CMIP5 historical
      parent_experiment : N/A
      modeling_realm : ocean
      realization : 1
      cmor_version : 2.7.1
   dimensions:
      time = 72  // unlimited
      j = 149
      i = 182
      bnds = 2
      vertices = 4
   variables:
      double time ( time )
         bounds :       time_bnds
         units :        days since 1850-01-01
         calendar :     standard
         axis : T
         long_name :    time
         standard_name :        time

      double time_bnds ( time, bnds )

      integer j ( j )
         units :        1
         long_name :    cell index along second dimension

      integer i ( i )
         units :        1
         long_name :    cell index along first dimension

      float lat ( j, i )
         standard_name :        latitude
         long_name :    latitude coordinate
         units :        degrees_north
         bounds :       lat_vertices

      float lon ( j, i )
         standard_name :        longitude
         long_name :    longitude coordinate
         units :        degrees_east
         bounds :       lon_vertices

      float lat_vertices ( j, i, vertices )
         units :        degrees_north

      float lon_vertices ( j, i, vertices )
         units :        degrees_east

      float tos ( time, j, i )
         standard_name :        sea_surface_temperature
         long_name :    Sea Surface Temperature
         comment :      "this may differ from ""surface temperature"" in regions of sea ice."
         units :        K
         original_name :        sosstsst
         original_units :       degC
         history :      2012-08-22T10:29:27Z altered by CMOR: Converted units from 'degC' to 'K'.
         cell_methods : time: mean (interval: 1 month)
         cell_measures :        area: areacello
         missing_value :        1e+20
         _FillValue :   1e+20
         associated_files :     baseURL: http://cmip-pcmdi.llnl.gov/CMIP5/dataLocation gridspecFile: gridspec_ocean_fx_CMCC-CESM_historical_r0i0p0.nc areacello: areacello_fx_CMCC-CESM_historical_r0i0p0.n
c
         coordinates :  lat lon
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2019-6-5 20:55:31 | 显示全部楼层
楼主最后问题解决了吗???怎么解决的?????
密码修改失败请联系微信:mofangbao
回复 支持 1 反对 0

使用道具 举报

新浪微博达人勋

 楼主| 发表于 2018-5-28 15:14:39 | 显示全部楼层
我知道自己的问题出在哪,已经改好了,
但是换成其他模式又出现新的的问题
=============================================================
f1=addfile("H:\work\data\CMIP5\historical\CCSM4\r1i1p1\tos_Omon_CCSM4_historical_r1i1p1_185001-200512.nc","r")
time=f1->time
tos=f1->tos
tos_lon=f1->lon
tos_lat=f1->lat
printVarSummary(tos_lon)
printVarSummary(tos_lat)
printVarSummary(tos)
;=============================插值================================
print(tos_lon(0,:))
print(tos_lat(:,0))

;tos=lonPivot(tos,0.5)
lat_new=totype(tos_lat,"float")
lon_new=totype(tos_lon,"float")
tos_new=totype(tos,"float")
nlon=dimsizes(tos&i)
nlat=dimsizes(tos&j)
print(nlon)
print(nlat)

do iy=0,nlat-1
    ip=dim_pqsort_n(tos_lon(iy,:),1,0)
   ;printVarSummary(ip)
    lat_new(iy,:)=tos_lat(iy,ip)
    lon_new(iy,:)=tos_lon(iy,ip)
    tos_new(:,iy,:)=tos(:,iy,ip)
end do

lat=fspan(-90,90,73)
lon=fspan(0,357.5,144)
lat@units = "degrees_north"
lon@units = "degrees_east"
printVarSummary(lat)
printVarSummary(lon)
tos_interp=rcm2rgrid(lat_new,lon_new,tos_new,lat,lon,1)
printVarSummary(tos_interp)
tos_interp!0="time"
tos_interp!1   ="lat"
tos_interp!2   ="lon"
tos_interp&time=time
tos_interp&lat = lat
tos_interp&lon = lon
printVarSummary(tos_interp)

system("rm -f tos_Omon_CCSM4_historical_r1i1p1_interpolation_185001-200512.nc")
fo=addfile("tos_Omon_CCSM4_historical_r1i1p1_interpolation_185001-200512.nc","c")
fo->lat=lat
fo->lon=lon
fo->tos=tos_interp

==========================================================
错误
fatal:rcm2rgrid: Unable to coerce input lat/lon arrays to double precision
有人知道怎么改吗,,{:eb303:}
密码修改失败请联系微信:mofangbao
回复 支持 0 反对 1

使用道具 举报

新浪微博达人勋

 楼主| 发表于 2018-5-28 08:30:45 | 显示全部楼层
求不沉啊,,,
密码修改失败请联系微信:mofangbao
回复

使用道具 举报

新浪微博达人勋

发表于 2018-5-28 09:17:36 | 显示全部楼层
你说的是海洋模式数据吗?应该用ESMF
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2019-9-24 17:28:35 | 显示全部楼层
楼主你好,请问最后你的问题是怎么解决的呀?
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

新浪微博达人勋

发表于 2020-12-10 18:05:35 | 显示全部楼层
楼主你好,CMIP6的插值也是要用rcm2rgrid嘛?用linint2_Wrap不可以吗?
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

新浪微博达人勋

发表于 2020-12-13 21:01:09 | 显示全部楼层
请问楼主最后怎么解决的呀?
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

Copyright ©2011-2014 bbs.06climate.com All Rights Reserved.  Powered by Discuz! (京ICP-10201084)

本站信息均由会员发表,不代表气象家园立场,禁止在本站发表与国家法律相抵触言论

快速回复 返回顶部 返回列表