ncl操作手册课件精品.pptVIP

  • 189
  • 0
  • 约1.95万字
  • 约 66页
  • 2017-02-02 发布于江苏
  • 举报
ncl操作手册课件精品

例二:地球表面温度分布 代码 load $NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl load $NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl begin a = addfile(atmos.nc,r) t = a-TS(0,:,:) wks = gsn_open_wks(ps,proj) gsn_define_colormap(wks,gui_default) res = True res@mpProjection = Mercator res@mpGridAndLimbOn = False res@mpPerimOn = False res@mpGridLatSpacingF = 20. res@mpGridLonSpacingF = 30. res@mpFillOn = False res@cnFillOn = True res@cnLineLabelsOn = False res@vpXF = 0.1 res@vpYF = 0.9 res@vpWidthF = 0.8 res@vpHeightF = 0.8 res@gsnSpreadColors = True res@gsnSpreadColorStart = 2 res@gsnSpreadColorEnd = -3 res@lbLabelFontHeightF = 0.015 res@tiMainString = Example of Mercator Projection res@tiMainFontHeightF = .018 contour = gsn_csm_contour_map(wks,t,res) end * * * * 5.6.2 类型转换 contributed.ncl中包含的将一个类型转换为另一类型的函数包括:short2flt、byte2flt、short2flt_hdf、numeric2int和dble2flt. 5.6.3 气候学函数 contributed.ncl中包含了一些处理气象的函数。 例如:clmMon*(),stdMon*()和month_to_month等。 5.7 用户自定义函数 例如 undef(function_name) function function_name(declaration_list) local local_variable_list begin [statement(s)] return (return_value) end undef(procedure_name) procedure procedure_name(declaration_list) local local_variable_list begin [statement(s)] end undef将以前定义的这个函数删除掉。 local用于列出本函数中的变量 undef和local不是必须的,但是推荐的。 5.8 与系统交互 可以通过systemfunc和system与系统进行交互。 基本上用户要将Unix命令放在一个字符串中,可以用”;”来分隔多行Unix命令。Unix命令中的选项用单引号括起来。 例: files_names = systemfunc(cd /my/data ; ls *.nc) 此命令将先转到/my/data目录下,然后得到此目录下所有的.nc文件,并将其列表赋予files_names变量。 x = stringtofloat(systemfunc(cut –c14-19 sample.txt)) 此命令将从”sample.txt”中截取第14到19列,然后返回一个一维字符串类型的数组给x。 system与systemfunc的不同是:system只是执行一个Unix命令而不会返回任何值。 例:system(“cp 10.nc /ptmp/user/”) ;复制10.nc到/ptmp/user 六、命令行选项 6.1 调用NCL的选项 -h 显示命令行选项的用法。 -n 不在print()中

文档评论(0)

1亿VIP精品文档

相关文档