爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 7262|回复: 0

ROMS提取Forcing文件求助!!!

[复制链接]
发表于 2022-3-16 21:58:01 | 显示全部楼层 |阅读模式
10金钱
我在获取ROMS所需要的运行文件中的forcing文件(可能是叫应力文件?)的时候从NARR网站提取数据却总是提取不全,请问各位大佬这样要怎么办啊。我用的是COAWST模式中的ncei_2roms.m文件,正常应该是运行得到 romsforc_NARR.nc文件,但是实际我在matlab中查看nc文件中的数值时发现总是会有缺失,具体代码在下面。

提取NAM数据的网址时使用的这个'https://www.ncei.noaa.gov/thredds/dodsC/model-namanl-old/'或者如果用NARR和GFS能提取到也可以)

  1. % (1) Select which variables to include in this netcdf forcing file.
  2. % put a '1' if you want to include it, '0' otherwise.
  3. % 1/0              Var description (Units)
  4. get_lwrad = 1;    % gets downward and upward longwave and computes net flux of down-up (W/m2)
  5.                   % this will also store lwrad_down so you can use LONGWAVE option.
  6. get_swrad = 1;    % gets downward and updward shortwave and computes net down-up flux (W/m2)
  7. get_rain  = 1;    % precipitation rate (kg/m2/s) at surface
  8. get_Tair  = 1;    % surface air temperature (C) at 2m
  9. get_Pair  = 1;    % pressure reduce to MSL (Pa)
  10. get_Qair  = 1;    % relative_humidity (percent) at 2m
  11. get_Wind  = 1;    % surface u- and v- winds (m/s) at 10m

  12. % (2) Enter name of output ROMS forcing file
  13. %ROMS_force_name = 'romsforc_GFS_Sandy2012.nc';
  14. %ROMS_force_name = 'romsforc_GFS_Mangkhut2018.nc';
  15. ROMS_force_name = 'romsforc_NAM_Mangkhut_0310_2.nc';

  16. % (3) Enter start and end dates
  17. time_start = datenum('15-Sep-2018');
  18. time_end   = datenum('18-Sep-2018');

  19. % (4) Select which data to obtain: NAM, NARR, both NAM+NARR -- or -- GFS.
  20. get_NARR = 0;  % NARR-A grid 221 32km data, available 1979-2014
  21. get_NAM  = 1;  % NAM grid 218 12km data
  22. % --- or ---
  23. get_GFS  = 0;  % GFS 0.5 degree
  24. % GFS is 6 hr and NAM/NARR is 3 hr. I dont have time interpolation
  25. % added in so you have to pick NAM/NARR or GFS.

  26. % (5) Select to interpolate to a roms grid or a user defined grid.
  27. % Set one of these to a 1, the other to a 0.
  28. interpto_roms_grid = 1;
  29. interpto_user_grid = 0;

  30. % The code has been written so that longitude is in -deg E.
  31. if interpto_roms_grid
  32.   model_grid = 'F:\COAWST\Roms\Mangkhut\Mangkhut_roms_grid.nc';
  33. elseif interpto_user_grid
  34. % Provide lon_rho, lat_rho, and angle_rho.
  35. % NAM / NARR grids are centered at~ -100 deg lon; GFS = 0:360 lon
  36.   if (get_NARR); offset=-360; end
  37.   if (get_NAM);  offset=-360; end
  38.   if (get_GFS);  offset=0;    end
  39. % You Probably want to make a finer resolution from 0.2 to 0.1.
  40.   lon_rho = [100:0.2:130]+offset;
  41.   lat_rho = [ 10:0.2:50 ];
  42.   lon_rho = repmat(lon_rho,size(lat_rho,2),1)';
  43.   lat_rho = repmat(lat_rho',1,size(lon_rho,1))';
  44.   angle_rho = lon_rho*0;
  45. else
  46.   disp('pick a grid')
  47. end

  48. % (6) Select which method to use: ncread or nctoolbox
  49. use_matlab = 0;
  50. use_nctoolbox = 1;
复制代码

ncei_2roms.m

36.29 KB, 下载次数: 1, 下载积分: 金钱 -5

密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

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

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