How to use ECMWF product

Discussion about tangent linear and adjoint models, variational data assimilation, and other related issues.

Moderators: arango, robertson

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

How to use ECMWF product

#1 Unread post by javadi »

Dear users,
I do not understand a point when making forcing. I try to use d_ecmwf2roms.m but I have a problem. Which of the following scenarios can be true?
1. When I run d_ecmwf2roms.m , these codes automatically download data from ECMWF and then convert to ROMS. Before that, I log in ECMWF.
2. Initially, I should download data separately from ECMWF and then place in my computer and then use these MATLAB codes.
I kindly ask users and modelers to answer this question simply as I am a new user with limited modeling background.
Thank you so much for your cooperation.

smchen
Posts: 11
Joined: Sat Mar 21, 2015 12:38 am
Location: TORI, Taiwan

Re: How to use ECMWF product

#2 Unread post by smchen »

It is 2. You also have to check d_ecmwf2roms.m to know how to name those files downloaded from ECMWF.

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

Re: How to use ECMWF product

#3 Unread post by javadi »

Hello users,
Thank you so much for your help. It means that I should download all of files http://apps.ecmwf.int/datasets/data/interim_full_daily/ and then put all of them in one folder. Then I should define direction to this folder. However, there are some questions in this case:
1- The d_ecmwf2roms.m can be only file which should use to make forcing or we should use other MATLAB scripts? This is mainly because there are other files on the MATLAB scripts like add_heat flux, d_core2_frc, and etc.
2- Where can I define the location of prepared file which download from ECMWF for d_ecmwf2roms.m? In this manuscript I found only following codes
Dir = fullfile(getenv('HOME'), ...
'ocean/repository/Projects/gom/Data/Forcing2');
3- Which location the output will be stored after running codes?

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

Re: How to use ECMWF product

#4 Unread post by wilkin »

The preamble comments in d_ecmwf2roms.m note that it is a "ussr modifiable script" and a "template". You have to configure this for your own purposes - several pieces of the code are examples only.

Code: Select all

% Path to downloaded ERA data files.
Dir = fullfile(getenv('HOME'),                                          ...
               'ocean/repository/Projects/gom/Data/Forcing2');
is an example of how a user might point this script to where they downloaded the data. You need to enter where you put the files from ecmwf, and what you happened to have named them.

I have not updated this code in a long time. I'm not sure it works with ERA-5, which you should be using instead of the older ERA-Interim.
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: How to use ECMWF product

#5 Unread post by javadi »

Dear wikin
Thank you so much for your help. I learned many things and I did some steps with new strategies. I download data from ECMWF and then I tried to use d_ecmwf2roms.m. I ran this code when checking line by line to detect error of this code in my system. The first time I have faced an error in line 396 before starting Convert forcing data to floating-point and scale to ROMS units.

** Creating ROMS NetCDF forcing file: gom_sms_era.nc **
Error: File: nc_read.m Line: 91 Column: 2
This statement is not inside any function.
(It follows the END that terminates the definition of the function "nc_read".)
This refer to this line in nc_read.m
[method,~,~] = nc_interface(ncfile);

switch(method)
case {'native'}
f = nc_read_matlab(ncfile,Vname,Tindex,ReplaceValue,PreserveType,Info);
case {'java'}
f = nc_read_java (ncfile,Vname,Tindex,ReplaceValue,PreserveType,Info);
case {'mexnc'}
f = nc_read_mexnc (ncfile,Vname,Tindex,ReplaceValue,PreserveType,Info);
otherwise
error('NC_READ: unable to determine NetCDF processing interface');
end

To solve this error, I did many actions:
1- It is not related to the version of my MATLAB as I checked both the 2014a and 2020a version. Both of them I have the same error.
2- It is not related to the wrong direction of NetCDF as I put all files (interface, NC read.) in one folder
3- I added all folders to my MATLAB path
4- I reviewed other comments in this forum and I understood the philosophy of this method. I guessed that my MATLAB tested all methods to read but this could not.


Please help me with your interesting comments
Thank you so much for your cooperation.

Post Reply