爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 5397|回复: 2

替换met_em*中变量的问题

[复制链接]

新浪微博达人勋

发表于 2018-1-30 12:04:05 | 显示全部楼层 |阅读模式

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

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

x
本帖最后由 悠然一梦123 于 2018-1-30 12:31 编辑

替换met_em*中第一层土壤湿度,出现问不能读进去问题,
fatal:FileWriteVarVar: file (met_em.d01.2014-04-22_12:00:00) was opened for reading only, can not write
fatal:["Execute.c":8128]:Execute: Error occurred at or near line 38 in file chazhi

好吧,太粗心了原来要b = addfile("/wrf/WPS/met_em.d01.2014-04-22_12:00:00.nc","r")中r改成w.


还有几个问题,首先,我下载的GLADS土壤湿度数据是三小时一次的数据,这个数据是瞬时值还是三小时的平均值?
其次,met_em*是6小时一次的,那我把GLADS数据替换到met_em*中,是用GLADS的0,6,12,18,24时的数据分别替换到met_em*同样时次的吗?


脚本如下,
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"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"

begin

a = addfile("/GLDAS/GLDAS_NOAH025_3H.A20140422.1200.021.nc4.SUB.nc4","r")

smois=a->SoilMoi0_10cm_inst
;printVarSummary(smois)

;interpolate to new grid
b = addfile("/wrf/WPS/met_em.d01.2014-04-22_12:00:00.nc","r")

lat = b->XLAT_M(0,:,0)
lon = b->XLONG_M(0,0,:)
;print(lat)

c=new((/1,79,139/),"float")
c= linint2_Wrap(smois&lon,smois&lat,smois,True,lon,lat,0)
c=c/100
c@units = "m3 m-3“
;printVarSummary(c)

sm=new((/1,79,139/),"float")
sm=b->SM000010

do i=1,79,1
do j=1,139,1
sm(0,i-1,j-1)=c(0,i-1,j-1)
printVarSummary(sm)
end do
end do

b->SM000010=sm

end



密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2018-1-30 13:36:28 | 显示全部楼层
因为你的met文件标了r,也就是说只读,你改成w就能写进去了
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2019-3-22 21:36:43 | 显示全部楼层
请问楼主解决了吗
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

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

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

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