爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 6802|回复: 7

一个ctl描述多个nc文件的问题

[复制链接]

新浪微博达人勋

发表于 2014-4-9 11:01:05 | 显示全部楼层 |阅读模式
GrADS
系统平台:
问题截图: -
问题概况: 用一个ctl文件批量描述多个nc文件
我看过提问的智慧: 看过
自己思考时长(天): 2

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

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

x
数据格式为5年的月资料,存放在形如1.nc,2.nc……的文件中,即每个nc文件有5年共60个月的资料值
单独对每个nc文件处理的时候,可以出图,没有问题,但涉及到批量处理的时候,有点问题,以处理两个nc文件为例
ctl文件如下:
dset ^%t1.nc
title monthly mean SAT
dtype netcdf
options template
options 365_day_calendar
undef 1.0e+20
xdef lon 144 linear 2.5 2.5
ydef lat 90 linear -90 2
tdef time 120 linear 00z1jan1900 1mo
vars 1
tas=>tas 1 99 SAT
endvars


总共120个时次,但只能画出前两个时次的图,后面的结果显示: entire grids undefined
个人觉得可能是 dset ^%t1.nc 这个地方的问题,也试过官网上 %ch chsub等方法,但始终没能解决
请教各位大神
(该数据不能直接用sdfopen打开,必须写说明文件,用xdfopen打开)
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2014-4-9 22:18:39 | 显示全部楼层
有木有大神知道怎么解决的
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2014-4-10 08:35:52 | 显示全部楼层
先去论坛搜索NC资料批量描述,看一下相关的帖子
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2014-4-10 09:08:23 | 显示全部楼层
dset ^%t1.nc 这个应该没有问题的,我觉得你应该把GS也贴上来
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2014-4-10 09:20:22 | 显示全部楼层
把用ncdump打开的nc描述文件贴出来
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2014-4-11 21:55:22 | 显示全部楼层
冰枫 发表于 2014-4-10 09:08
dset ^%t1.nc 这个应该没有问题的,我觉得你应该把GS也贴上来

后面只是用xdfopen打开这个ctl文件
比如说再set t 1 10
但图只能画出前两个时次的结果,后面的时次显示:all grid undefined
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2014-4-11 22:10:52 | 显示全部楼层
linikiku 发表于 2014-4-10 09:20
把用ncdump打开的nc描述文件贴出来

netcdf 01 {
dimensions:
        time = UNLIMITED ; // (60 currently)
        bnds = 2 ;
        lat = 90 ;
        lon = 144 ;
variables:
        double time(time) ;
                time:long_name = "time" ;
                time:units = "days since 1860-01-01 00:00:00" ;
                time:cartesian_axis = "T" ;
                time:calendar_type = "noleap" ;
                time:calendar = "noleap" ;
                time:bounds = "time_bnds" ;
                time:standard_name = "time" ;
                time:axis = "T" ;
        double time_bnds(time, bnds) ;
                time_bnds:long_name = "time axis boundaries" ;
                time_bnds:units = "days since 1860-01-01 00:00:00" ;
        double lat(lat) ;
                lat:long_name = "latitude" ;
                lat:units = "degrees_north" ;
                lat:bounds = "lat_bnds" ;
                lat:standard_name = "latitude" ;
                lat:axis = "Y" ;
        double lat_bnds(lat, bnds) ;
        double lon(lon) ;
                lon:long_name = "longitude" ;
                lon:units = "degrees_east" ;
                lon:bounds = "lon_bnds" ;
                lon:standard_name = "longitude" ;
                lon:axis = "X" ;
        double lon_bnds(lon, bnds) ;
        float tas(time, lat, lon) ;
                tas:long_name = "Near-Surface Air Temperature" ;
                tas:units = "K" ;
                tas:valid_range = 100.f, 400.f ;
                tas:cell_methods = "time: mean" ;
                tas:interp_method = "conserve_order2" ;
                tas:coordinates = "height" ;
                tas:missing_value = 1.e+20f ;
                tas:_FillValue = 1.e+20f ;
                tas:standard_name = "air_temperature" ;
                tas:original_units = "deg_k" ;
                tas:original_name = "t_ref" ;
                tas:cell_measures = "area: areacella" ;
                tas:associated_files = "baseURL: http://cmip-pcmdi.llnl.gov/CMIP5/dataLocation areacella: areacella_fx_GFDL-CM3_historical_r0i0p0.nc" ;
        double average_T1(time) ;
                average_T1:long_name = "Start time for average period" ;
                average_T1:units = "days since 1860-01-01 00:00:00" ;
        double average_T2(time) ;
                average_T2:long_name = "End time for average period" ;
                average_T2:units = "days since 1860-01-01 00:00:00" ;
        double average_DT(time) ;
                average_DT:long_name = "Length of average period" ;
                average_DT:units = "days" ;
        double height ;
                height:units = "m" ;
                height:positive = "up" ;
                height:long_name = "height" ;
                height:standard_name = "height" ;
                height:axis = "Z" ;

// global attributes:
                :title = "NOAA GFDL GFDL-CM3, historical (run 1) experiment output for CMIP5 AR5" ;
                :institute_id = "NOAA GFDL" ;
                :source = "GFDL-CM3 2010 atmosphere: AM3 (AM3p9,C48L48); sea ice: SIS (SISp2,Tripolar360x200); land: LM3 (LM3p7_cCM3,C48); ocean: MOM4 (MOM4p1_x1_Z50_cCM3,Tripolar360x200L50)" ;
                :contact = "gfdl.climate.model.info@noaa.gov" ;
                :project_id = "CMIP5" ;
                :table_id = "Table Amon (31 Jan 2011)" ;
                :experiment_id = "historical" ;
                :realization = 1 ;
                :modeling_realm = "atmos" ;
                :tracking_id = "4fcf61e5-ee34-49b5-b41c-9e114497a06a" ;
                :Conventions = "CF-1.4" ;
                :references = "The GFDL Data Portal (http://nomads.gfdl.noaa.gov/) provides access to NOAA/GFDL\'s publicly available model input and output data sets. From this web site one can view and download data sets and documentation, including those related to the GFDL coupled models experiments run for the IPCC\'s 5th Assessment Report and the US CCSP." ;
                :comment = "GFDL experiment name: CM3Z_D1_1860-2005_AllForc_H1\n",
                        "GFDL parent experiment name: CM3Z_Control-1860_D1\n",
                        "CMIP5 experiment ID: historical\n",
                        "Initial conditions from this experiment (CMIP5 expt. 3.2 Core) were taken from 01Jan0001 of the 1860 control model experiment CM3Z_Control-1860_D1.\n",
                        "Forcing agents (7 WMGGs, tropospheric and stratospheric ozone, land use, volcanoes, solar, sulfate, black carbon,\n",
                        "organic carbon, dust, and sea salt) vary historically from 1860-2005 following prescribed emission or concentration\n",
                        "timeseries or internally calculated emissions. This model includes direct and indirect aerosol effects." ;
                :gfdl_experiment_name = "CM3Z_D1_1860-2005_AllForc_H1" ;
                :creation_date = "2011-09-15T18:47:13Z" ;
                :model_id = "GFDL-CM3" ;
                :branch_time = "0.0" ;
                :experiment = "historical" ;
                :forcing = "GHG,SA,Oz,LU,Sl,Vl,SS,BC,MD,OC (GHG includes CO2, CH4, N2O, CFC11, CFC12, HCFC22, CFC113)" ;
                :frequency = "mon" ;
                :initialization_method = 1 ;
                :parent_experiment_id = "piControl" ;
                :physics_version = 1 ;
                :product = "output1" ;
                :institution = "NOAA GFDL(201 Forrestal Rd, Princeton, NJ, 08540)" ;
                :history = "File was processed by fremetar (GFDL analog of CMOR). TripleID: [exper_id_1XhP9uft45,realiz_id_4e0zLckGg3,run_id_HhaU8NYVBh]" ;
                :parent_experiment_rip = "r1i1p1" ;
}
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2014-4-12 08:48:23 | 显示全部楼层
坏拖鞋_丑小鞋 发表于 2014-4-11 22:10
netcdf 01 {
dimensions:
        time = UNLIMITED ; // (60 currently)

不会写这种nc格式的ctl,你写的ctl应该有问题。之前我也遇到过sdfopen打开后有问题的nc4格式的文件。没办法,只好用R语言把数据读出来。

你的ctl要是解决了,希望你能分享出来。
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

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

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

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