爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 17038|回复: 12

萌新想请教一下wrfout文件里时间(times)的维度问题

[复制链接]

新浪微博达人勋

发表于 2019-7-4 22:32:41 | 显示全部楼层 |阅读模式
1金钱
这里想请教一下各位大佬,一个wrfout文件里包含的时间有多少呢?我理解的是,在namelist.input里设置的interval_seconds为21600,即6个小时输出一次,所以一个wrfout文件包含这六个小时的信息。为什么我用ncl后处理时,printsummary(times),显示的维度是1呢?是这两个解释的不是同一个东西,还是我的模拟计算有误呢?以下附上我的参数设置和脚本信息。

最佳答案

查看完整内容

interval_seconds是由你的气象输入文件决定的,要根据你的输入文件时间间隔确定。 根据你的描述,你应该修改history_interval的值,它决定你每隔多长时间输出一次wrfout文件。这个值设置设置的小,不会影响计算量,但需要更多的存储空间。 可以看一下users guide中对namelist相关条目的说明。
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2019-7-4 22:32:42 | 显示全部楼层
本帖最后由 今朝几朵白云生 于 2019-7-5 13:58 编辑
羽陌轻寒 发表于 2019-7-5 10:15
谢谢您的解答!也就是说,我如果想得到具体某个时刻的信息,只能修改interval_seconds 了吗?我之前看到 ...

interval_seconds是由你的气象输入文件决定的,要根据你的输入文件时间间隔确定。
根据你的描述,你应该修改history_interval的值,它决定你每隔多长时间输出一次wrfout文件。这个值设置设置的小,不会影响计算量,但需要更多的存储空间。
可以看一下users guide中对namelist相关条目的说明。
密码修改失败请联系微信:mofangbao
回复

使用道具 举报

新浪微博达人勋

 楼主| 发表于 2019-7-4 22:36:28 | 显示全部楼层
namelist的输入:

&time_control
run_days                            = 6,
run_hours                           = 0,
run_minutes                         = 0,
run_seconds                         = 0,
start_year                          = 2010, 2010,
start_month                         = 10,   10,  
start_day                           = 18,   18,   
start_hour                          = 00,   00,   
start_minute                        = 00,   00,  
start_second                        = 00,   00,  
end_year                            = 2010, 2010,
end_month                           = 10,   10,  
end_day                             = 24,   24,  
end_hour                            = 00,   00,   
end_minute                          = 00,   00,  
end_second                          = 00,   00,  
interval_seconds                    = 21600,
input_from_file                     = .true.,.true.,
history_interval                    = 180,  60,  
frames_per_outfile                  = 1,  1,
restart                             = .false.,
restart_interval                    = 5000,
io_form_history                     = 2,
io_form_restart                     = 2,
io_form_input                       = 2,
io_form_boundary                    = 2,
debug_level                         = 0,
/

&domains
time_step                           = 60,
time_step_fract_num                 = 0,
time_step_fract_den                 = 1,
max_dom                             = 2,
e_we                                = 100,  148,
e_sn                                = 83,  136,   
e_vert                              = 32,  32,   
p_top_requested                     = 5000,
num_metgrid_levels                  = 27,
num_metgrid_soil_levels             = 4,
dx                                  = 15000, 5000,  
dy                                  = 15000, 5000,
grid_id                             = 1,     2,   
parent_id                           = 0,     1,     
i_parent_start                      = 1,     22,   
j_parent_start                      = 1,     14,
parent_grid_ratio                   = 1,     3,
parent_time_step_ratio              = 1,     3,   
feedback                            = 1,
smooth_option                       = 0,
/

&physics
mp_physics                          = 6,  6,     
ra_lw_physics                       = 1,  1,     
ra_sw_physics                       = 1,  1,      
radt                                = 30, 30,      
sf_sfclay_physics                   = 1,  1,   
sf_surface_physics                  = 2,  2,     
bl_pbl_physics                      = 1,  1,   
bldt                                = 0,  0,      
cu_physics                          = 3,  3,      
cudt                                = 5,  5,   
isfflx                              = 1,
ifsnow                              = 0,
icloud                              = 1,
surface_input_source                = 1,
num_soil_layers                     = 4,
! num_land_cat                      = 21,
sf_urban_physics                    = 0,  0,   
maxiens                             =1,
maxens                              =3,
maxens2                             =3,
maxens3                             =16,
ensdim                              =144,
/

&fdda
/

&dynamics
w_damping                           = 0,
diff_opt                            = 1,     1,   
km_opt                              = 4,     4,
diff_6th_opt                        = 0,     0,        
diff_6th_factor                     = 0.12, 0.12,  
base_temp                           = 290.,
damp_opt                            = 0,
zdamp                               = 5000., 5000.,
dampcoef                            = 0.2,   0.2,     
khdif                               = 0,     0,   
kvdif                               = 0,     0,      
non_hydrostatic                     = .true., .true.,
moist_adv_opt                       = 1, 1,         
scalar_adv_opt                      = 1, 1,            
/

&bdy_control
spec_bdy_width                      = 5,
spec_zone                           = 1,
relax_zone                          = 4,
specified                           = .true.,  .false.,
nested                              = .false., .true.,
/

&grib2
/

&namelist_quilt
nio_tasks_per_group = 0,
nio_groups = 1,
/
密码修改失败请联系微信:mofangbao
回复

使用道具 举报

新浪微博达人勋

 楼主| 发表于 2019-7-4 22:38:49 | 显示全部楼层
用ncl绘图(脚本应该是来自ncl官网):

;----------------------------------------------------------------------
; WRF_cn_1.ncl
;
; Concepts illustrated:
;   - Plotting WRF data
;----------------------------------------------------------------------
; This script creates two simple contour views of pressure at a
; specific time and level. No map background is generated.
;----------------------------------------------------------------------
; These files are loaded by default in NCL V6.2.0 and newer
; 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/wrf/WRFUserARW.ncl"

begin
;---Open file; substitute your own WRF output file here
  f = addfiles ("/home/WRF/wrfout/2010-10-18/wrfout_d01_2010-10-19_06:00:00.nc", "r")

;--Read variables
  times = wrf_user_getvar(f,"times",-1)  ; get all time values on file
  p    = wrf_user_getvar(f,"p",-1)  ; calculate pressure across all time, levels

;printVarSummary(p)   ; Look at your data
;printMinMax(p,0)
  printVarSummary(times)

  nt = 0 ; timestep to plot
  nl = 19 ; level to plot

;---Create simple contour plots  
  wks = gsn_open_wks("x11" ,"WRF_0703")

  res                       = True            ; plot mods desired
  res@gsnMaximize           = True            ; maximize plot size
  res@tiMainString          = times(nt)       ; main title
  plot                      = gsn_csm_contour(wks,p(nt,nl,:,:),res)

  res@cnFillOn              = True                 ; turn on color
  res@cnFillPalette         = "BlAqGrYeOrRe"  ; change color map : http://www.ncl.ucar.edu/Document/Graphics/color_table_gallery.shtml
  res@cnLinesOn             = True           ; turn off contour lines
  plot                      = gsn_csm_contour(wks,p(nt,nl,:,:),res)
end
密码修改失败请联系微信:mofangbao
回复

使用道具 举报

新浪微博达人勋

 楼主| 发表于 2019-7-4 22:41:18 | 显示全部楼层
提示的times信息:

Variable: times
Type: string
Total Size: 8 bytes
            1 values
Number of Dimensions: 1
Dimensions and sizes:        [1]
Coordinates:
Number Of Attributes: 2
  _FillValue :        missing
  description :        times in file
密码修改失败请联系微信:mofangbao
回复

使用道具 举报

新浪微博达人勋

 楼主| 发表于 2019-7-4 22:43:46 | 显示全部楼层
因为我刚学习wrf以及它的后处理没多久,论坛的帖子我也浏览了很多,现在这个问题比较困扰,感觉整个体系的一些细节上的物理意义还没有搞清楚。今后如果我想要生成具体哪一时刻的风速数据,目前显示的times维度和值只有1个,感觉跟我预想的不太一样
密码修改失败请联系微信:mofangbao
回复

使用道具 举报

新浪微博达人勋

发表于 2019-7-5 09:22:19 | 显示全部楼层
interval_seconds是输入文件的时间间隔,以秒为单位。你namelist中的frames_per_outfile设置为1,即每个wrfout文件只记录一个时次的气象数据。如果你成功转完应该有多个wrfout文件。
密码修改失败请联系微信:mofangbao
回复

使用道具 举报

新浪微博达人勋

 楼主| 发表于 2019-7-5 09:42:35 | 显示全部楼层
今朝几朵白云生 发表于 2019-7-5 09:22
interval_seconds是输入文件的时间间隔,以秒为单位。你namelist中的frames_per_outfile设置为1,即每个wrf ...

谢谢大佬的解答!确实是每六个小时生成了一个wrfout文件,我本来以为每个wrfout文件里包含的是这六个小时所有时刻的信息。我看的资料里没有对frames_per_outfile的注释,导致一直不知道怎么回事。这个就是比如我每隔六小时输出一次wrfout,这个参数设置为6的话,就可以查看每个整点时的信息了吗?
密码修改失败请联系微信:mofangbao
回复

使用道具 举报

新浪微博达人勋

发表于 2019-7-5 10:02:36 | 显示全部楼层
羽陌轻寒 发表于 2019-7-5 09:42
谢谢大佬的解答!确实是每六个小时生成了一个wrfout文件,我本来以为每个wrfout文件里包含的是这六个小时 ...

不是这样的。现在是 6 小时输出一次,假如你模拟 36 小时,就有 6 个 wrfout。如果frames_per_outfile设置为 6 的话,只会出来一个 wrfout 会包括 6 个时刻的结果,每个时刻间隔 6 小时,相当于把 之前6 个 wrfout 合并成一个了。
密码修改失败请联系微信:mofangbao
回复

使用道具 举报

新浪微博达人勋

 楼主| 发表于 2019-7-5 10:15:46 | 显示全部楼层
本帖最后由 羽陌轻寒 于 2019-7-5 10:19 编辑
hanf 发表于 2019-7-5 10:02
不是这样的。现在是 6 小时输出一次,假如你模拟 36 小时,就有 6 个 wrfout。如果frames_per_outfile设 ...

谢谢您的解答!也就是说,我如果想得到具体某个时刻的信息,只能修改interval_seconds 了吗?我之前看到过别人每隔几秒钟出了一张图(图附在楼下),那这个interval_seconds不是得设置的特别小,导致计算量特别大吗?

点评

interval_seconds是输入的气象场的时间间隔,wrf输出的时间间隔是history_interval  发表于 2019-7-14 17:00
密码修改失败请联系微信:mofangbao
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

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

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

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