




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)
文檔簡介
NNcocommand:注意:nc文件中的文件名最好不要用數(shù)字開頭,1.
ncdump
–hnc文件名
查看nc文件的信息2.
ncrcat2001.nc2002.nc2003.ncout.nc
n個nc文件按時間順序合并3.
ncks:ncks-dtime,624,635nswrs.mon.mean.kang.ncnswrs.month.00.nc
將時次624到635的資料從nswrs.mon.mean.kang.nc中分割出來放在nswrs.month.00.nc中ncks-A-vuavg,vavgin.ncout.nc
將in.nc中的uavg,vavg變量添加到out.nc中去,同時in.nc和out中的cordinatevariablename重復,in.nc中的cordinatevariable
替換out.nc中的coordinatevariablencks-O-x-vUSin.ncout.nc:RemoveUSvariablefromin.nc,thatis,theout.nccontainsallvariablesofin.ncexceptUSncks–O–dlon,12in.ncout.nc:subsetvariableswithlon(12)ncks–O–dlon,12.in.ncout.nc:subsetvariableswithlon=12.4.
ncea–dtime,0,2–dlat,0,3685.nc86.nc87.ncave.nc,
對前面多個文件在規(guī)定的維數(shù)范圍內(nèi)求平均,放在后面一個文件里面。5.ncl_convert2nca.grb
,將grb文件轉(zhuǎn)化成為nc文件6.ncl_filedump–ca.grb7.8、ncatted:
比較簡單,但是也比較容易出錯,最好參考教材
ncatted-O-aunits,y_T,o,c,nounitsoda_test_restore.nc
為變量y_T的units屬性修改為字符型屬性nounits
ncatted-O-acartesian_axis,grid_y_T,c,c,Yoda_test_restore.nc
為變量grid_y_T
增加屬性cartesian_axis=”Y”ncatted-acase,global,m,c,fwffwf.cpl.r.1941-01-01-00000.nc:changeglobalattributes.ncatted-amissing_value,temp,m,f,36oda_sub_kang.nc
將變量的缺省值修改為36.0,注意,修改的不僅是metadata,而且也修改了temp變量里面缺省值的值為36.0,注意,此時最好_Fill_Value最好不要出現(xiàn)
ncatted-O-afilename,global,m,c,temp_sfc_restore.ncoda_test_restore.nc
修改oda_test_restore.nc中g(shù)lobalattributes
下面filename的值為temp_sfc_restore.ncncatted-aTITLE,global,c,c,"OUTPUTFROMWRFV3.3MODEL"wrf.d01.nc
ncatted-O-acalendar,time,d,,,
u10_07sep1_08mar2.nc
刪除time的calendar屬性9、ncrename:
ncrename
–vtemp,temin.nc
給變量改名
ncrename
–dlat1,latin.nc
給坐標改名10、ncap2(ncap):必須要兩個文件名:in.ncout.ncncapusuallylosestheattributewhilencap2keepsattribute.ncap2-O-s'anomaly_2hour_outchange=temp-temp_restore'in.ncout.nc
兩個變量相減生成第三個變量ncap2-O-s'temp_oda=float(temp_oda)'in.ncout.nc
將in.nc中的變量temp_oda轉(zhuǎn)變成float類型ncap2
–O
–s
‘lon_lat[lon,lat]=lat+lon’
in.ncout.nc
lat和lon分別是一維數(shù)組,產(chǎn)生一個二維數(shù)組lon_lat(lon,lat)11、ncpdq:ncpdq-a-latoda_sub_kang.ncout.nc
改變lat的排列方向ncpdq-aT,Z,Y,X-vtemptemperature_jccom.ncout.nc
改變變量temp的排放順序為temp(t,z,y,x)ncpdq-azt,TIMEregrid_3d.ncout.nc
changetherecorddimensionfromTIMEtoztncpdqin.ncout.ncallvariabletonc_shortncpdq–Uin.ncout.ncunpackallvariabletofloat12、ncrancra-dTIME,0,30,1u_10.ncu.nc
對u_10.nc的第一個月求平均值13、ncwa:Note:onlyvalidinonedimensionaverage.ncwa
-O
–alonin.ncout.nc
storethezonalmeanofin.ncinout.nc14
ncboneedonly3files.ncbo
-O--op_typ=add/sub/mlt/dvdin1.ncin2.ncout.nc
“ncboperformsbinaryoperations(additionsubtractionmultiplicationdivision,file1+-*/file2=out.nc)onvariablesinfile1andcorrespondingvariables(thosewiththesamename)infile2andstorestheresultsinfile315
ncflintncflint-O-C-vprs_sfc-w0.01,0.0in.ncin.ncout.nc
-C,
whichcauses
NCO
to
notautomaticallyaddcoordinatestothevariablesappearingintheoutput-file.
Rescalethedimensionalunitsofthesurfacepressureprs_sfcfromPascalstohectopascals
(millibars)含nc文件的fortran編譯命令ifort-ofortran.exefortran1.f90-I/usr/local/include-L/usr/local/lib
–lnetcdf17上用32位編譯:xlf90layer.f90-I/gpfs/fs4/kangxb/software/software.32bit/include-L/gpfs/fs4/kangxb/software/software.32bit/lib-lnetcdfXlf90
–ca.f90
只編譯不鏈接Segmentationfault:堆棧不夠的標志,此時嘗試用-q64編譯,如果還不行,就只好修改程序,減少堆棧GRADS:1、grads二進制文件轉(zhuǎn)換成為nc文件:lats4d-itest.ctl-otest.nc-ftypectl-varsclfmi2、命令行執(zhí)行l(wèi)ats4d:gradsc
-lbc
"lats4d
-v
-q
-i
model
-o
ex1"CDO./configureCC=pgcc--prefix=/global/u2/k/kang/software/cdo-1.4.3--with-netcdf=/opt/cray/netcdf//netcdf-pgi/--with-hdf5=/opt/cray/hdf5//hdf5-pgi/--with-szlib=/usr/common/usg/szip/2.1/pgi/./configureCC=pgcc--prefix=/global/u2/k/kang/software/cdo-1.4.3--with-netcdf=/opt/cray/netcdf//netcdf-pgi--with-hdf5=/opt/cray/hdf5//hdf5-pgi/
--with-szlib=/usr/common/usg/szip/2.1/pgi/onevergreen:./configure--prefix=/homes/xkang/software/cdo--with-netcdf=/cell_root/software/netcdf/4.1.1/intel400CC=icc--with-hdf5=/cell_root/software/hdf/1.8.6/intel/sys/include
LIBS='-lcurl'./configure--prefix=/homes/xkang/software/cdo--with-netcdf=/cell_root/software/netcdf/4.1.1/intel400CC=iccLIBS='-lcurl-lgssapi_krb5-lssl-lcrypto-ldl-lidn-ldes425-lkrb5-lk5crypto-lcom_err-lkrb5support-lresolv'1.
binary->nc
/global/u2/k/kang/software/cdo-1.4.3/bin/cdo-fncimport_binaryin.ctlout.nc2.nc->grib:https://code.zmaw.de/boards/1/topics/2907operatorstrategies:1、
specifyinglargenumberfiles:ncfilename=alphanumeric_prefix+numeric_suffix+’.’+filetype#ncea/ncecat/ncra/ncrcat
–nfile_number,digit_number,numeric_increment
#wheredigitnumberisthefixednumberofnumericdigitscomprisingthenumeric_suffix,asthefollowingexample:digit_numberis2,noalphanumeric_prefix,ifdigit_numberis1,thenthealphanumeric_prefixis8.ncra
–n5,2,185.nc8589.nc
#ncra85.nc86.nc87.nc88.nc89.nc8589.ncspecialskills:
2、
converttimefromarecorddimensiontoanon-recorddimensionncecatin.ncout.nc
#Converttimetonon-recorddimensionncwa-arecordin.ncout.nc
#Removenewdegeneraterecorddimension
3、
converttimefromafixeddimensiontoarecorddimensionncecatin.ncout.nc
#createarecorddimension:
“record”ncpdq-aTIME,recordout.ncin.nc#changetherecorddimensionfrom
“record”
toTIMEncwa-arecordin.ncout.nc
#Removenewdegeneraterecorddimension
4、
howtogluetimedimensionlackingfilestogetherwithtimedimensionadded?
(ex:temp_0hour(lat,lon),temp_6hour(lat,lon)totemp(time,lon,lat))ncecattemp1.nctemp_0hour.nc
result:temp(record,lat,lon),record=UNLIMITED;//(1currently)ncecattemp2.nctemp_6hour.nc
result:temp(record,lat,lon),record=UNLIMITED;//(1currently)ncrcattemp_0hour.nctemp_6hour.nctemp.nc,result:temp(record,lat,lon),record=UNLIMITED;//(2currently)ncrename
–drecord,timetemp.nc
result:temp(time,lat,lon)createtime.ncfile(like:time=UNLIMITED;//(2currently),doubletime(time))withncl
ncks
–Atime.nctemp.nc
result:temp(time,lat,lon)5、
Howtouse.psfileintheword?
Openthe*.psfilewithgsvsoftware->selectthe
“PStoEPS”
buttonin
“file”
menu->saveas*.eps(thewordsupportedformat)Open.pswithgsview->convert->jpeg6、
Nclmultipleinputfilesskills:Ex:######definevariable#################name=new((/2/),string)in=new((/2/),file)temp=new((/2,50,200,360/),double)######givethevariablethevalue#######
name(0)=(/"temp.2005_1.nc"/)
name(1)=(/"temp.2005_2.nc"/)
doi=0,1
in(i)=addfile(name(i),"r")
in2=in(i)
temp(i,:,:,:)=in2->temp
enddo7、
addtimerecord
#!/bin/csh
setecho
#attributetimedimensionasrecorddimension
foreachlabel(soda_u_1981.ncsoda_v_1981.nc
)
ncecat-O$labelout.nc
ncpdq-O-atime,recordout.ncout1.nc
ncwa-O-arecordout1.nc$label
rmout*
end8.dailymeantomonthlymeanincludingleapyear.#!/bin/tcshsetechorm*.tmp@yr=1951while($yr<=2007)setisleap=0foreachyr1(1952195619601964196819721976198019841988199219962000200420082012)if($yr==$yr1)thensetisleap=1endifendif($isleap==0)thenncra-O-dtime,0,30download/APHRO_MA_025deg_V1003R1.$yr.ncout.10.ncncra-O-dtime,31,58download/APHRO_MA_025deg_V1003R1.$yr.ncout.11.ncncra-O-dtime,59,89download/APHRO_MA_025deg_V1003R1.$yr.ncout.12.ncncra-O-dtime,90,119download/APHRO_MA_025deg_V1003R1.$yr.ncout.13.ncncra-O-dtime,120,150download/APHRO_MA_025deg_V1003R1.$yr.ncout.14.ncncra-O-dtime,151,180download/APHRO_MA_025deg_V1003R1.$yr.ncout.15.ncncra-O-dtime,181,211download/APHRO_MA_025deg_V1003R1.$yr.ncout.16.ncncra-O-dtime,212,242download/APHRO_MA_025deg_V1003R1.$yr.ncout.17.ncncra-O-dtime,243,272download/APHRO_MA_025deg_V1003R1.$yr.ncout.18.ncncra-O-dtime,273,303download/APHRO_MA_025deg_V1003R1.$yr.ncout.19.ncncra-O-dtime,304,333download/APHRO_MA_025deg_V1003R1.$yr.ncout.20.ncncra-O-dtime,334,364download/APHRO_MA_025deg_V1003R1.$yr.ncout.21.ncelsencra-O-dtime,0,30download/APHRO_MA_025deg_V1003R1.$yr.ncout.10.ncncra-O-dtime,31,59download/APHRO_MA_025deg_V1003R1.$yr.ncout.11.ncncra-O-dtime,60,90download/APHRO_MA_025deg_V1003R1.$yr.ncout.12.ncncra-O-dtime,91,120download/APHRO_MA_025deg_V1003R1.$yr.ncout.13.ncncra-O-dtime,121,151download/APHRO_MA_025deg_V1003R1.$yr.ncout.14.ncncra-O-dtime,152,181download/APHRO_MA_025deg_V1003R1.$yr.ncout.15.ncncra-O-dtime,182,212download/APHRO_MA_025deg_V1003R1.$yr.ncout.16.ncncra-O-dtime,213,243download/APHRO_MA_025deg_V1003R1.$yr.ncout.17.ncncra-O-dtime,244,273download/APHRO_MA_025deg_V1003R1.$yr.ncout.18.ncncra-O-dtime,274,304download/APHRO_MA_025deg_V1003R1.$yr.ncout.19.ncncra-O-dtime,305,334download/APHRO_MA_025deg_V1003R1.$yr.ncout.20.ncncra-O-dtime,335,365download/APHRO_MA_025deg_V1003R1.$yr.ncout.21.ncendifncrcat-O-n12,2,1out.10.ncmonth/APHRO_MA_025deg_V1003R1.$yr.ncrmout*@yr+=1End9.Fourtimesperdailymeantomonthlymeanforvarinslp_t_10_modq_10_modu_10_modv_10_moddofilein=$var.clim.ncfileout=$var.clim.monthly.ncncra-O-dtime,0,123$fileinout.10.ncncra-O-dtime,124,235$fileinout.11.ncncra-O-dtime,236,359$fileinout.12.ncncra-O-dtime,360,479$fileinout.13.ncncra-O-dtime,480,603$fileinout.14.ncncra-O-dtime,604,723$fileinout.15.ncncra-O-dtime,724,847$fileinout.16.ncncra-O-dtime,848,971$fileinout.17.ncncra-O-dtime,972,1091$fileinout.18.ncncra-O-dtime,1092,1215$fileinout.19.ncncra-O-dtime,1216,1335$fileinout.20.ncncra-O-dtime,1336,1459$fileinout.21.ncncrcat-O-n12,2,1out.10.nc$fileoutrmout*done
10.#rearrangelon(lon:-180:180to0:360)ncpdq-O-alon,timein.ncout.ncncks-O-dlon,0,179out.ncout1.ncncap2-O-s'lon=lon+360'out1.ncout3.ncncks-O-dlon,180,359out.ncout2.ncncatted-along_name,lon,d,,out3.ncncatted-aaxis,lon,d,,out3.ncncatted-aunits,lon,d,,out3.ncncatted-astandard_name,lon,d,,out3.ncncatted-along_name,lon,d,,out2.ncncatted-aaxis,lon,d,,out2.ncncatted-aunits,lon,d,,out2.ncncatted-astandard_name,lon,d,,out2.ncncrcat-Oout2.ncout3.ncout.ncncatted-along_name,lon,c,c,"longitude"out.ncncatted-aaxis,lon,c,c,"X"out.ncncatted-aunits,lon,c,c,"degrees_east"out.ncncatted-astandard_name,lon,c,c,"longitude"out.ncncpdq-O-atime,lonout.ncin.nc11.climatology,anomaly,standarddeviation#!/bin/bashset-xbe=0#recordofdatabegined=215#recordofdataendfilein=chla.9801-1512.nc#forclimatologymon0=$belet"mon11=$mon0+11"num=100while[$mon0-le$mon11]doncra-O-dtime,$mon0,$ed,12$fileinout.$num.nclet"mon0=$mon0+1"let"num=$num+1"donelet"num=$num-100"ncrcat-O-n$num,2,1out.100.ncltm.nc#foranomalymon0=$belet"mon11=$mon0+11"num=100while[$mon11-le$ed]doncks-O-dtime,$mon0,$mon11$fileinout.ncncbo-O--op_typ=subout.ncltm.ncout.$num.nclet"mon0=$mon0+12"let"mon11=$mon11+12"let"num=$num+1"donelet"num=$num-
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 創(chuàng)城專員面試題及答案
- 2025年崗巴縣教育系統(tǒng)招聘教師考試筆試試題(含答案)
- 2025年非高危行業(yè)生產(chǎn)經(jīng)營單位主要負責人及安全管理人員安全生產(chǎn)知識和管理能力考試試卷(含答案)
- 面試即興演講試題及范例
- 2024血透治療中的監(jiān)護及護理要點試題及答案
- 新進員工崗前安全教育培訓試題及答案
- 2025年新《公司法》知識競賽題庫(含答案)
- 2024年大學禮儀知識競賽題庫與答案
- 2024年公職人員考試時事政治考試題庫(附答案)
- 北京戶外徒步知識培訓課件
- 第三章:堤防工程加固施工
- 蒂森CTU2調(diào)試說明附件
- GB/T 21837-2023鐵磁性鋼絲繩電磁檢測方法
- SX-22163-QR345工裝維護保養(yǎng)記錄
- JJF 2025-2023高動態(tài)精密離心機校準規(guī)范
- 2023年航空職業(yè)技能鑒定考試-候機樓服務技能考試題庫(含答案)
- 醫(yī)院腹腔鏡手術(shù)知情同意書
- p型半導體和n型半導體課件
- GB/T 748-2005抗硫酸鹽硅酸鹽水泥
- 走好群眾路線-做好群眾工作(黃相懷)課件
- 民間文學(全套課件)
評論
0/150
提交評論