Problem using wikin's matlab code

General scientific issues regarding ROMS

Moderators: arango, robertson

Post Reply
Message
Author
javadi
Posts: 118
Joined: Mon Jan 27, 2020 5:55 pm
Location: UoT

Problem using wikin's matlab code

#1 Unread post by javadi »

Hi,

I use the roms_wikin-master code to download ERA5 data from NCAR. It worked nicely. I have used it many times. Now I have faced this error; Maybe because of some changes in the NCAR accessibility.

Please guide me to solve it

Reading variable 1 of 9: mean sea-level pressure
e5.oper.an.sfc.128_151_msl.ll025sc. Year/month 2015-01
Error using matlab.internal.imagesci.netcdflib
The NetCDF library encountered an error during execution of 'open' function - 'file not found (-90)'.

Error in netcdf.open (line 67)
[varargout{:}] = matlab.internal.imagesci.netcdflib ( 'open', filename, varargin{1} );

Error in internal.matlab.imagesci.nc/openToRead (line 1280)
this.ncRootid = netcdf.open(this.Filename,'NOWRITE');

Error in internal.matlab.imagesci.nc (line 121)
this.openToRead();

Error in ncread (line 61)
ncObj = internal.matlab.imagesci.nc(ncFile);

Error in roms_get_era5_NCARds633_bulkflux (line 404)
lon = ncread(url,'longitude');

User avatar
wilkin
Posts: 922
Joined: Mon Apr 28, 2003 5:44 pm
Location: Rutgers University
Contact:

Re: Problem using wikin's matlab code

#2 Unread post by wilkin »

Yes, there were some changes at NCAR. I updated my code some weeks ago and it seems to be working robustly. I just uploaded the changes to my GitHub https://github.com/johnwilkin/roms_wilkin so please refresh and see if that solves the problem.
John Wilkin: DMCS Rutgers University
71 Dudley Rd, New Brunswick, NJ 08901-8521, USA. ph: 609-630-0559 jwilkin@rutgers.edu

rduran
Posts: 152
Joined: Fri Jan 08, 2010 7:22 pm
Location: Theiss Research

Re: Problem using wikin's matlab code

#3 Unread post by rduran »

John,

Thanks for sharing your code. Is it fair to say the subversion branch has been discontinued? If so, I will move my local repo to download from github.

Code: Select all

svn up
Updating '.':
At revision 606.
I was able to update Hernan's code with svn (Updated to revision 1208), but perhaps these are old updates. Do you know if Hernan's code is only updated at a github repo at this point?

Rodrigo.

User avatar
wilkin
Posts: 922
Joined: Mon Apr 28, 2003 5:44 pm
Location: Rutgers University
Contact:

Re: Problem using wikin's matlab code

#4 Unread post by wilkin »

Correct. I am not updating the svn version. In the contents.m ...

Code: Select all

% This collection of tools was originally created March 2008 (some are much
% older) for release to the ROMS User community.  Prior to December 2020 
% the code set was managed by svn and accessible with login credentials for
% the myroms.org portal ...
%    svn checkout https://www.myroms.org/svn/om/matlab/roms_wilkin
% 
% Presently the code is managed via github at: 
%    https://github.com/johnwilkin/roms_wilkin
but I haven't taken down the repo because if folks follow old links to this location I want them to be able to then discover the GitHub version.

For all other ROMS versions and supporting code, yes, go to GitHub.
John Wilkin: DMCS Rutgers University
71 Dudley Rd, New Brunswick, NJ 08901-8521, USA. ph: 609-630-0559 jwilkin@rutgers.edu

javadi
Posts: 118
Joined: Mon Jan 27, 2020 5:55 pm
Location: UoT

Re: Problem using wikin's matlab code

#5 Unread post by javadi »

Hi John

Thanks for the update!

It works perfectly now!

Best,

javadi
Posts: 118
Joined: Mon Jan 27, 2020 5:55 pm
Location: UoT

Re: Problem using wikin's matlab code

#6 Unread post by javadi »

Dear John,

Now it is the first time I have tried to extract data with a domain that is both a negative and positive longitude(-5 to 5).

I remember that your Matlab code worked only for positive or negative separately in the past. Your updated code now works for both negative and positive longitude simultaneously? or should we one time extract data for -5 to 0 and then 0 to 5 and then merge them with some software?

Do you have any idea?

Best,

User avatar
wilkin
Posts: 922
Joined: Mon Apr 28, 2003 5:44 pm
Location: Rutgers University
Contact:

Re: Problem using wikin's matlab code

#7 Unread post by wilkin »

Code: Select all

%   bbox - A 4-element vector in the format of Matlab axis defining the
%      lon/lat bounding box region to subset with the OPeNDAP query
%      e.g. bbox = [-110 -30 0 55] or [250 330 0 55] for West Atlantic.
%      NOTE: The longitude coordinate in ERA5 breaks at the prime meridian. 
%      This function detects whether the input longitudes in BBOX are 
%      negative (west of prime meridian) or positive (east of prime 
%      and adjusts accordingly, but the query cannot stradle the prime 
%      meridian. For such a case the user has to make two files and merge 
%      them. If I ever have a project in the east Atlantic I might code 
%      this merger automatically, but until then you are on your own.
John Wilkin: DMCS Rutgers University
71 Dudley Rd, New Brunswick, NJ 08901-8521, USA. ph: 609-630-0559 jwilkin@rutgers.edu

Post Reply