WRF学习笔记之四:撰写WPS intermediate file添加海冰场/NCL学习/WRF进阶:如何向WRF添加额外气象场?

问题简介

我们都知道,在运行WRF模式之前,需要使用其WPS前处理程序,制作对应的模拟域与气象场输入,而WPS主要由3个主程序组成,分别为:

  1. geogrid.exe定义模式的模拟域,并将静态地理数据插值到模式网格中。
  2. ungrib.exe 从Grib的格式的文件读取气象数据。
  3. metgrid.exe将读取的气象数据,水平插值到geogrid.exe定义的模拟域网格中。

通过以上介绍不难看出,整个WPS的处理流程并不复杂,而最后我们的目的就是要将模拟域与气象场结合,输入到WRF中。
在运行WPS过程中,metgrid.exe需要最后运行,因为它是将其他两个主程序处理后的数据进行插值结合的程序,即:从geogrid.exe中获得模拟域与地理信息,从ungrib.exe中获得气象数据,而metgrid.exe从两个程序中获取信息的方式则为:读取geogrid.exeungrib.exe运行生成的中间文件(intermediate file),即geo_dem和 FILE打头的文件。
那么,就有了问题,如果我们想添加额外的气象数据,而这个气象数据本身并不支持grib格式,无法用ungrib.exe处理,我们应当怎么做呢?
这时候,我们就需要自己根据我们的数据,撰写可以被metgrid.exe所读取的中间文件,并修改metgrid.TBL文件和namelist.wps,使得我们添加的数据与变量可以被metgrid.exe处理。
中间文件可分为三种格式:WPS、WRFSI、MM5。而WRF-ARW-online网站提供了三种格式的信息与描述: intermediate file这里主要介绍最简单与最常用的WPS FROMAT。

WPS intermediate file

在将数据写入WPS中间格式时,二维字段被写入实值的矩形数组。三维数组必须跨垂直维度拆分为独立编写的二维数组。还应注意的是,对于全局数据集,必须使用高斯投影或柱面等距投影,对于区域数据集,可以使用墨卡托投影、兰伯特共形投影、极坐标投影或柱面等距投影。
WRF的官网手册第三章,给出了如何将单个二维数组写成中间格式的Fortran代码:

integer :: version             ! Format version (must =5 for WPS format)
integer :: nx, ny              ! x- and y-dimensions of 2-d array
integer :: iproj               ! Code for projection of data in array:
!       0 = cylindrical equidistant
                               !       1 = Mercator
                               !       3 = Lambert conformal conic
                               !       4 = Gaussian (global only!)
                               !       5 = Polar stereographic
real :: nlats                  ! Number of latitudes north of equator
                               !       (for Gaussian grids)
real :: xfcst                  ! Forecast hour of data
real :: xlvl                   ! Vertical level of data in 2-d array
real :: startlat, startlon     ! Lat/lon of point in array indicated by
                               !       startloc string
real :: deltalat, deltalon     ! Grid spacing, degrees
real :: dx, dy                 ! Grid spacing, km
real :: xlonc                  ! Standard longitude of projection
real :: truelat1, truelat2     ! True latitudes of projection
real :: earth_radius           ! Earth radius, km
real, dimension(nx,ny) :: slab ! The 2-d array holding the data
logical :: is_wind_grid_rel    ! Flag indicating whether winds are                                        
                               !       relative to source grid (TRUE) or
                               !       relative to earth (FALSE)
character (len=8)  :: startloc ! Which point in array is given by
                               !       startlat/startlon; set either
                                      
                               !       to 'SWCORNER' or 'CENTER  '
character (len=9)  :: field    ! Name of the field
character (len=24) :: hdate    ! Valid date for data YYYY:MM:DD_HH:00:00
character (len=25) :: units    ! Units of data
character (len=32) :: map_source  !  Source model / originating center
character (len=46) :: desc     ! Short description of data
 
   
!  1) WRITE FORMAT VERSION
write(unit=ounit) version
 
!  2) WRITE METADATA
! Cylindrical equidistant
if (iproj == 0) then
      write(unit=ounit) hdate, xfcst, map_source, field, &
                        units, desc, xlvl, nx, ny, iproj
      write(unit=ounit) startloc, startlat, startlon, &
                        deltalat, deltalon, earth_radius
 
! Mercator
else if (iproj == 1) then
      write(unit=ounit) hdate, xfcst, map_source, field, &
                        units, desc, xlvl, nx, ny, iproj
      write(unit=ounit
  • 5
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 4
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值