ImageVerifierCode 换一换
格式:DOCX , 页数:11 ,大小:130.62KB ,
资源ID:4526144      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/4526144.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(nco常用命令及高级玩法.docx)为本站会员(b****5)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

nco常用命令及高级玩法.docx

1、nco常用命令及高级玩法NNco command:注意:nc文件中的文件名最好不要用数字开头,1.ncdumph nc文件名查看nc文件的信息2.ncrcat 2001.nc 2002.nc 2003.nc out.ncn个nc文件按时间顺序合并3.ncks:ncks -d time,624,635 nswrs.mon.mean.kang.nc nswrs.month.00.nc将时次624到635的资料从nswrs.mon.mean.kang.nc中分割出来放在nswrs.month.00.nc中ncks -A -v uavg,vavg in.nc out.nc将in.nc中的uavg,va

2、vg变量添加到out.nc中去,同时in.nc和out中的cordinate variable name重复,in.nc中的cordinate variable替换out.nc 中的coordinate variablencks -O -x -v US in.nc out.nc : Remove US variable from in.nc, that is, the out.nc contains all variables of in.nc except USncks O d lon,12 in.nc out.nc: subset variables with lon(12)ncks O

3、d lon,12. in.nc out.nc: subset variables with lon=12.4.ncea d time,0,2 d lat,0,36 85.nc 86.nc 87.nc ave.nc,对前面多个文件在规定的维数范围内求平均,放在后面一个文件里面。5.ncl_convert2nc a.grb,将grb文件转化成为nc文件6. ncl_filedump c a.grb7.8、ncatted:比较简单,但是也比较容易出错,最好参考教材ncatted -O -a units,y_T,o,c,nounits oda_test_restore.nc为变量y_T的units属性

4、修改为字符型属性nounitsncatted -O -a cartesian_axis,grid_y_T,c,c,Y oda_test_restore.nc为变量grid_y_T增加属性cartesian_axis”Y” ncatted -a case,global,m,c,fwf fwf.cpl.r.1941-01-01-00000.nc : change global attributes.ncatted -a missing_value,temp,m,f,36 oda_sub_kang.nc将变量的缺省值修改为36.0,注意,修改的不仅是metadata,而且也修改了temp变量里面缺省

5、值的值为36.0,注意,此时最好_Fill_Value最好不要出现ncatted -O -a filename,global,m,c,temp_sfc_restore.nc oda_test_restore.nc修改oda_test_restore.nc中global attributes下面filename的值为temp_sfc_restore.ncncatted -a TITLE,global,c,c,OUTPUT FROM WRF V3.3 MODEL wrf.d01.nc ncatted -O -a calendar,time,d,u10_07sep1_08mar2.nc删除time的

6、calendar属性9、ncrename:ncrenamev temp,tem in.nc给变量改名ncrenamed lat1,lat in.nc给坐标改名10、ncap2(ncap):必须要两个文件名:in.nc out.ncncap usually loses the attribute while ncap2 keeps attribute.ncap2 -O -s anomaly_2hour_outchange=temp-temp_restore in.nc out.nc两个变量相减生成第三个变量ncap2 -O -s temp_oda=float(temp_oda) in.nc ou

7、t.nc将in.nc中的变量temp_oda转变成float类型ncap2Oslon_latlon,lat=lat+lonin.nc out.nclat和lon分别是一维数组,产生一个二维数组lon_lat(lon,lat)11、ncpdq:ncpdq -a -lat oda_sub_kang.nc out.nc改变lat的排列方向ncpdq -a T,Z,Y,X -v temp temperature_jccom.nc out.nc改变变量temp的排放顺序为temp(t,z,y,x)ncpdq -a zt,TIME regrid_3d.nc out.ncchange the record

8、dimension from TIME to ztncpdq in.nc out.nc all variable to nc_shortncpdq U in.nc out.nc unpack all variable to float12、ncrancra -d TIME,0,30,1 u_10.nc u.nc对u_10.nc的第一个月求平均值13、ncwa: Note: only valid in one dimension average.ncwaOa lon in.nc out.ncstore the zonal mean of in.nc in out.nc14ncboneed onl

9、y 3 files.ncbo-O -op_typ=add/sub/mlt/dvd in1.nc in2.nc out.nc“ncbo performs binary operations(addition subtraction multiplication division, file1+-*/file2=out.nc) on variables in file1 and corresponding variables(those with the same name) in file2 and stores the results in file315ncflintncflint -O -

10、C -v prs_sfc -w 0.01,0.0 in.nc in.nc out.nc -C,which causesNCOtonot automatically add coordinates to the variables appearing in the output-file.Rescale the dimensional units of the surface pressure prs_sfc from Pascals to hectopascals(millibars)含nc文件的fortran编译命令ifort -o fortran.exe fortran1.f90 -I/u

11、sr/local/include -L/usr/local/liblnetcdf17上用32位编译:xlf90 layer.f90 -I/gpfs/fs4/kangxb/software/software.32bit/include -L /gpfs/fs4/kangxb/software/software.32bit/lib -lnetcdfXlf90c a.f90只编译不链接Segmentation fault:堆栈不够的标志,此时尝试用-q64编译,如果还不行,就只好修改程序,减少堆栈GRADS: 1、grads二进制文件转换成为nc文件: lats4d -i test.ctl -o t

12、est.nc -ftype ctl -vars clfmi2、命令行执行lats4d: gradsc-lbclats4d-v-q-imodel-oex1CDO./configure CC=pgcc -prefix=/global/u2/k/kang/software/cdo-1.4.3 -with-netcdf=/opt/cray/netcdf/4.0.1.0/netcdf-pgi/ -with-hdf5=/opt/cray/hdf5/1.8.3.0/hdf5-pgi/ -with-szlib=/usr/common/usg/szip/2.1/pgi/./configure CC=pgcc -

13、prefix=/global/u2/k/kang/software/cdo-1.4.3 -with-netcdf=/opt/cray/netcdf/4.0.1.0/netcdf-pgi-with-hdf5=/opt/cray/hdf5/1.8.5.0/hdf5-pgi/-with-szlib=/usr/common/usg/szip/2.1/pgi/on evergreen:./configure -prefix=/homes/xkang/software/cdo -with-netcdf=/cell_root/software/netcdf/4.1.1/intel400 CC=icc -wi

14、th-hdf5=/cell_root/software/hdf/1.8.6/intel/sys/includeLIBS=-lcurl./configure -prefix=/homes/xkang/software/cdo -with-netcdf=/cell_root/software/netcdf/4.1.1/intel400 CC=icc LIBS=-lcurl -lgssapi_krb5 -lssl -lcrypto -ldl -lidn -ldes425 -lkrb5 -lk5crypto -lcom_err -lkrb5support -lresolv1. binary - nc

15、/global/u2/k/kang/software/cdo-1.4.3/bin/cdo -f nc import_binary in.ctl out.nc2. nc - grib : https:/code.zmaw.de/boards/1/topics/2907operator strategies:1、specifying large number files :nc file name = alphanumeric_prefix+numeric_suffix+.+filetype #ncea/ncecat/ncra/ncrcatn file_number,digit_number,nu

16、meric_increment#where digit number is the fixed number of numeric digits comprising the numeric_suffix, as the following example:digit_number is 2, no alphanumeric_prefix, if digit_number is 1, then the alphanumeric_prefix is 8.ncran 5,2,1 85.nc 8589.nc# ncra 85.nc 86.nc 87.nc 88.nc 89.nc 8589.ncspe

17、cial skills:2、convert time from a record dimension to a non-record dimensionncecat in.nc out.nc# Convert time to non-record dimensionncwa -a record in.nc out.nc# Remove new degenerate record dimension3、convert time from a fixed dimension to a record dimensionncecat in.nc out.nc# create a record dime

18、nsion:“record”ncpdq -a TIME,record out.nc in.nc #change the record dimension from“record”to TIMEncwa -a record in.nc out.nc# Remove new degenerate record dimension4、how to glue time dimension lacking files together with time dimension added?(ex: temp_0hour(lat,lon), temp_6hour(lat,lon) to temp(time,

19、lon,lat) )ncecat temp1.nc temp_0hour.ncresult: temp(record,lat,lon), record = UNLIMITED ; / (1 currently)ncecat temp2.nc temp_6hour.ncresult: temp(record,lat,lon), record = UNLIMITED ; / (1 currently)ncrcat temp_0hour.nc temp_6hour.nc temp.nc,result: temp(record,lat,lon), record = UNLIMITED ; / (2 c

20、urrently)ncrenamed record,time temp.ncresult:temp(time,lat,lon)create time.nc file (like : time = UNLIMITED ; / (2 currently) , double time(time) ) with nclncksA time.nc temp.ncresult: temp(time,lat,lon)5、How to use .ps file in the word ?Open the *.ps file with gsv software - select the“PS to EPS”bu

21、tton in“file”menu - save as *.eps (the word supported format) Open .ps with gsview - convert -jpeg6、Ncl multiple input files skills:Ex:#define variable #name = new(/2/),string)in = new(/2/),file)temp=new(/2,50,200,360/),double)#give the variable the value#name(0) = (/temp.2005_1.nc/)name(1) = (/temp

22、.2005_2.nc/)do i = 0,1in(i) = addfile(name(i),r)in2 = in(i)temp(i,:,:,:)=in2-tempend do7、add time record#!/bin/cshset echo# attribute time dimension as record dimensionforeach label ( soda_u_1981.nc soda_v_1981.nc )ncecat -O $label out.ncncpdq -O -a time,record out.nc out1.ncncwa -O -a record out1.n

23、c $labelrm out*end8. daily mean to monthly mean including leap year.#!/bin/tcshset echorm *.tmp yr = 1951while ( $yr = 2007 ) set isleap = 0 foreach yr1 ( 1952 1956 1960 1964 1968 1972 1976 1980 1984 1988 1992 1996 2000 2004 2008 2012 ) if ( $yr = $yr1 ) then set isleap = 1 endif end if ( $isleap =

24、0 ) then ncra -O -d time,0,30 download/APHRO_MA_025deg_V1003R1.$yr.nc out.10.nc ncra -O -d time,31,58 download/APHRO_MA_025deg_V1003R1.$yr.nc out.11.nc ncra -O -d time,59,89 download/APHRO_MA_025deg_V1003R1.$yr.nc out.12.nc ncra -O -d time,90,119 download/APHRO_MA_025deg_V1003R1.$yr.nc out.13.nc ncr

25、a -O -d time,120,150 download/APHRO_MA_025deg_V1003R1.$yr.nc out.14.nc ncra -O -d time,151,180 download/APHRO_MA_025deg_V1003R1.$yr.nc out.15.nc ncra -O -d time,181,211 download/APHRO_MA_025deg_V1003R1.$yr.nc out.16.nc ncra -O -d time,212,242 download/APHRO_MA_025deg_V1003R1.$yr.nc out.17.nc ncra -O

26、 -d time,243,272 download/APHRO_MA_025deg_V1003R1.$yr.nc out.18.nc ncra -O -d time,273,303 download/APHRO_MA_025deg_V1003R1.$yr.nc out.19.nc ncra -O -d time,304,333 download/APHRO_MA_025deg_V1003R1.$yr.nc out.20.nc ncra -O -d time,334,364 download/APHRO_MA_025deg_V1003R1.$yr.nc out.21.nc else ncra -

27、O -d time,0,30 download/APHRO_MA_025deg_V1003R1.$yr.nc out.10.nc ncra -O -d time,31,59 download/APHRO_MA_025deg_V1003R1.$yr.nc out.11.nc ncra -O -d time,60,90 download/APHRO_MA_025deg_V1003R1.$yr.nc out.12.nc ncra -O -d time,91,120 download/APHRO_MA_025deg_V1003R1.$yr.nc out.13.nc ncra -O -d time,12

28、1,151 download/APHRO_MA_025deg_V1003R1.$yr.nc out.14.nc ncra -O -d time,152,181 download/APHRO_MA_025deg_V1003R1.$yr.nc out.15.nc ncra -O -d time,182,212 download/APHRO_MA_025deg_V1003R1.$yr.nc out.16.nc ncra -O -d time,213,243 download/APHRO_MA_025deg_V1003R1.$yr.nc out.17.nc ncra -O -d time,244,27

29、3 download/APHRO_MA_025deg_V1003R1.$yr.nc out.18.nc ncra -O -d time,274,304 download/APHRO_MA_025deg_V1003R1.$yr.nc out.19.nc ncra -O -d time,305,334 download/APHRO_MA_025deg_V1003R1.$yr.nc out.20.nc ncra -O -d time,335,365 download/APHRO_MA_025deg_V1003R1.$yr.nc out.21.nc endif ncrcat -O -n 12,2,1

30、out.10.nc month/APHRO_MA_025deg_V1003R1.$yr.nc rm out* yr += 1End9. Four times per daily mean to monthly meanfor var in slp_ t_10_mod q_10_mod u_10_mod v_10_moddofilein=$var.clim.ncfileout=$var.clim.monthly.nc ncra -O -d time,0,123 $filein out.10.nc ncra -O -d time,124,235 $filein out.11.nc ncra -O

31、-d time,236,359 $filein out.12.nc ncra -O -d time,360,479 $filein out.13.nc ncra -O -d time,480,603 $filein out.14.nc ncra -O -d time,604,723 $filein out.15.nc ncra -O -d time,724,847 $filein out.16.nc ncra -O -d time,848,971 $filein out.17.nc ncra -O -d time,972,1091 $filein out.18.nc ncra -O -d time,1092,1215 $filein out.19.nc ncra -O -d time,1216,1335 $fi

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1