Ocean Modeling Discussion

ROMS/TOMS

Search for:
It is currently Wed Jul 24, 2019 1:04 am




Post new topic Reply to topic  [ 6 posts ] 

All times are UTC

Author Message
PostPosted: Wed Aug 24, 2016 5:46 pm 
Offline
User avatar

Joined: Mon Apr 28, 2003 5:44 pm
Posts: 491
Location: Rutgers University
The Matlab script nam_narr_2roms.m in the coawst/Tools/mfiles/mtools distribution reads meteorology analysis fields from the NCDC NOMADS analysis archives and makes meteorology forcing files for ROMS. It's a very handy piece of code and easily customized to a new user domain.

But the wind components read are variables 'u_wind_height_above_ground' (and v_wind...) which have the attributes "GRIB_VectorComponentFlag: gridRelative" (see e.g. http://nomads.ncdc.noaa.gov/thredds/dod ... 0.grb.html)

After combing through GRIB documentation I'm pretty sure these are in the direction of the Lambert Conformal coordinates and not east-north. So nam_narr_2roms.m needs extra code to make the vector rotation. At the west and east limits of the NAM grid the u-grid-relative direction differs from east by about 15 degrees.

Anticipating someone might have done this already - would anyone care to share code to correct these wind components?

_________________
John Wilkin: DMCS Rutgers University
71 Dudley Rd, New Brunswick, NJ 08901-8521, USA. ph: 609-630-0559 jwilkin@rutgers.edu


Top
 Profile  
Reply with quote  
PostPosted: Wed Sep 21, 2016 5:32 pm 
Offline

Joined: Wed Dec 31, 2003 6:16 pm
Posts: 786
Location: USGS, USA
John-

thanks for spotting this. Yes, you are correct. These velocities from NAM/NARR via THREDDS need to be rotated from Lambert Conformal to Earth long lat. I found a set of code in a fortran file called nam2model.F and some corresponding code at the bottom of this page:
http://ruc.noaa.gov/RUC.faq.html
and then added the rotations to the m file for NAM/NARR winds. Also added the option to acquire GFS data as well (GFS does not need rotation because, well, it is the whole globe="G"). I then renamed the m file to nomads_2roms.m. I am going to push this out soon, as well as a few other updates from Rutgers ROMS and some from WRF.

thanks,
john


Top
 Profile  
Reply with quote  
PostPosted: Wed Jul 11, 2018 6:23 pm 
Offline

Joined: Wed Jun 04, 2014 10:46 pm
Posts: 5
Location: Florida State University
John W,

Did nomads_2roms.m end up being named ncei_2roms.m?

Thanks,

Steve


Top
 Profile  
Reply with quote  
PostPosted: Fri Jul 13, 2018 12:43 pm 
Offline

Joined: Wed Dec 31, 2003 6:16 pm
Posts: 786
Location: USGS, USA
possibly. they all get data from here:
https://www.ncdc.noaa.gov/nomads/data-products

but there had been some changes at the noaa site. I remember they add the 's' to https and that was a problem in matlab. Matblab had been comparing the first 5 letters of a file, and if it started with http:, then it went to thredds. But when noaa changed to https:, matlab saw https and it thought the file was local. This has been fixed in newer matlab.

but during that confusion Christie had to modify the m file to make it work , and she added the use of nctoolbox to read the data.
but nctoolbox only reads, it does not write, so we still need matlab native calls to write.

... but it should work now. i am sure the saga will continue. let us know.
thanks,
-j


Top
 Profile  
Reply with quote  
PostPosted: Thu Aug 16, 2018 5:54 pm 
Offline

Joined: Wed Jun 04, 2014 10:46 pm
Posts: 5
Location: Florida State University
Hi John,

Sorry to take so long to get back on this, got sidetracked on another project ...
Anyway I did get ncei_2roms.m to work. Here is a list of the changes I made. I only worked on the NAM and NARR sections since I didn't use GFS data. Nor did I make any changes to Matlab "ncread" parts of the code since it can't read the grib files. I will email you my version of ncei_2roms.m if you're interested.

Steve

% 1. Added NetCDF 64-bit file option.
% 2. Switched from native Matlab ncread to nctoolbox. ncread can't read grib files.
% 3. Removed several "echo on", "echo off" debugging statements from ncgeodataset.m left by acrosby
% nctoolbox issue #95: "nctoolbox makes MATLAB verbose?" #95
% https://github.com/nctoolbox/nctoolbox/issues/95
% 4. Fixed issue with closing geo when it wasn't successfully created.
% 5. Added report header, additional progress output and save report option.
% 6. Added filenames for GFS, NARR and NAM workspace dump .mat files.
% 7. NARR data: Changed server url from NOMADS to NECI and changed to NCEI variable names.
% 8. Added try catch blocks for ngeodataset creation and each variable download in the NARR and NAM sections.
% 9. NAM data:
% a. Changed server url from NOMADS to NECI.
% b. Added "NAM_grib_ver" switch to select .grb or .grb1 urls.
% c. Added "save_NAM_mask", "load_NAM_mask" switches to avoid recompute of large masks.
% d. Added squeeze_3Dvar function to check for 3D variable before squeezing Tair, Uwind, Vwind.


Top
 Profile  
Reply with quote  
PostPosted: Tue Sep 04, 2018 5:44 pm 
Offline

Joined: Sat Jul 14, 2012 2:04 am
Posts: 4
Location: University of California at Santa Cruz
Hi Steve,

Thanks for detailing the changes you made to ncei_2roms.m. I'm glad you got it to work for you. As John mentioned below, when the data was moved to the NCEI server, we made several changes to the script to accommodate issues with the opendap url and ncread, different grib extensions, and different variable names. We also changed some logic and interpolation. Would you mind sharing your script with me, chegermiller@whoi.edu, and John so that we can rectify your changes with ours?

For others, the ncread bug should be resolved in the most recent matlab release:
https://www.mathworks.com/support/bugre ... =ts_R2018a

Thank you,

Christie


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group