function create_winforc(frcname,grdname,N,title,smst,smsc)%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Create an empty netcdf forcing file% frcname: name of the forcing file% grdname: name of the grid file% title: title in the netcdf file % % Further Information: % http://www.brest.ird.fr/Roms_tools/% % This file is part of ROMSTOOLS%% ROMSTOOLS is free software; you can redistribute it and/or modify% it under the terms of the GNU General Public License as published% by the Free Software Foundation; either version 2 of the License,% or (at your option) any later version.%% ROMSTOOLS is distributed in the hope that it will be useful, but% WITHOUT ANY WARRANTY; without even the implied warranty of% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the% GNU General Public License for more details.%% You should have received a copy of the GNU General Public License% along with this program; if not, write to the Free Software% Foundation, Inc., 59 Temple Place, Suite 330, Boston,% MA 02111-1307 USA%% Copyright (c) 2001-2006 by Pierrick Penven % e-mail:Pierrick.Penven@ird.fr %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%nc=netcdf(grdname);L=length(nc('xi_psi'));M=length(nc('eta_psi'));close(nc);Lp=L+1;Mp=M+1;

--------------------------------------------------------------------------------------------------How can I add the coordinates to my file? and Do I need change to "lat" "lon" my "xi" and "eta" coordinates?

I will crate the forcing file with d_ecmwf2roms.m script to have the correct structure. But the script suggests annual archives, and the ECMWF link http://apps.ecmwf.int/datasets/data/interim_full_daily/ only leave me download monthly files.Do you know how can I do for get annual files?

Hi Kate!I did my forcing files with d_ecmwf2roms.m tool. I get 156 files (13 each month).

I wrote the forcing files names in my ocean.in file, like this:

! Input forcing NetCDF file name(s). The USER has the option to enter! several file names for each nested grid. For example, the USER may! have different files for wind products, heat fluxes, tides, etc.! The model will scan the file list and will read the needed data from! the first file in the list containing the forcing field. Therefore,! the order of the file names is very important. If using multiple forcing! files per grid, first enter all the file names for grid 1, then grid 2,! and so on. It is also possible to split input data time records into! several NetCDF files (see prologue instructions above). Use a single line! per entry with a continuation (\) or vertical bar (|) symbol after each! entry, except the last one.

CHECK_MULTIFILE - Error while checking input Forcing file: /media/SCRATCH/input_forcing_ECMWF/gt_cloud_era_01_12.nc last data time record available is for day: 0001-02-01 00:00:00.00 but data is needed to finish run until day: 0001-12-30 00:00:00.00

It's like only read the January file, I already check and do again each file... But the error continues.Why I get this ? How can I fix it?.. Do I write something wrong?Thanks in advance for your help...Cheers.Scarlett Mar.Mo.

I worked with the ecmwf2roms script a lot recently. How do you loop through the monthly input files? Maybe you accidentally call the same file all the time (i.e. January)? Just a thought...ADD: I looked into the ecmwf2roms file you shared in the other post and can see that you run the script for each moth manually, right? Or why is there a fix Feb starting and ending day? Are your input files also monthly or is it a concatenated file now? I think in the latter case the script will start reading the file always from the beginning each time... I'd make an annual file and run the code for the entire year once.

my input file have 8 times for day (8 times*31 days=248) and the first time for the next day (248+1=249)January file start in 2001-01-01 and end in 2001-02-01December file start in 2001-01-01 and end in 2002-12-01

It's possible that the model reads only one file and wants that all the year information were in one file, and not in twelve?How can I say it: It's month by month!! Or what else could be causing this problem?

Catherine

Quote:

How do you loop through the monthly input files?

I modified the script and I'm telling it month by month which one it should occupy.

Quote:

Maybe you accidentally call the same file all the time (i.e. January)?

It's possible, but I was so careful and I did the files many times more, and I got the same error

Quote:

Are your input files also monthly or is it a concatenated file now? I think in the latter case the script will start reading the file always from the beginning each time...I'd make an annual file and run the code for the entire year once.

Yes, my inputs files (the files that I downloaded from ECMWF) are monthly, and it was easier for me to modify the script to read them and create them monthly. I think that the better solution is make an annual file and run the code for the entire year once, like you suggest. If you could give me the script that does this or how can I modify this, I'll be eternally grateful.

The problem is that ROMS doesn't know the units "hours" at this time. It knows days and seconds. There is code in get_cycle.F to read the time units, with a default of days. You can add a new case for hours, setting Tscale to 1/24.

The ECMWF data has a minimal interval of 3 hours; you can easily create annual files instead monthly. It will be more efficient in ROMS to avoid inquiring and open so many NetCDF files.

The time units for forcing file is usually days since the reference date (epoch). However, you can have any time units by manipulating the metadata file for ROMS (varinfo.dat).

The coordinates and time attribute for any variable that ROMS process is crucial if you are regridding inside ROMS. You can easily add those attributes to your NetCDF files. There is various software that you can use. We provided a Matlab script to process the ECMWF data (d_ecmwf2roms.m). This data is quite peculiar, and you need to know what are you doing.

Anyway, in the Matlab scripts repository, there is a script to add or modify the values of a NetCDF variable attribute. It is very simple to use:

You are using Matlab scripts that were not developed by us and probably are not maintained. We never used the awkward nc object in Matlab. Nowadays, Matlab has their native NetCDF interface. Also, there are several Python packages developed by others. We don't distribute those in our repositories.

ROMS users need to master the favorite software to manipulate NetCDF. Otherwise, you may expend a lot of time setting applications.

Yes, my inputs files (the files that I downloaded from ECMWF) are monthly, and it was easier for me to modify the script to read them and create them monthly. I think that the better solution is make an annual file and run the code for the entire year once, like you suggest. If you could give me the script that does this or how can I modify this, I'll be eternally grateful.

You can either use e.g. nco or cdo commands to adjust your netcdf-files. Any of these have their goods and bads, though. You can use the cdo command "cdo cat infile.nc outfile.nc" to concatenate several files to one timeseries but cdo tends to alter some attributes. e.g. delete the coordinates attribute or change the time units attributes from two integers to one integers (e.g. 1970-01-01 00:00:00 to 1970-1-1 00:00:00 - fortunately, due to the recent update of the ROMS code this is not an issue anymore ). The coordinates attribute you can add (again) using the nco command "ncatted -O -h -a coordinates, myvar,c,c,"lon lat mytime" infile.nc outfile.nc", e.g. In any case you can (should!) always check the final result before preceding using e.g. "ncdump -h file.nc" and/or open it in a netcdf viewer to check the time steps etc.

In the d_ecmwf2roms code Herman mentioned you shouldn't have to change too much in order to postprocess your data, then. All is pretty much set up already.

The files in this case are climatology, boundary and initial files from SODA, converted to ROMS input by Python scripts. That number is time in days, rounded to half a day from the original SODA time. Change it to what makes sense in your case.

Who is online

Users browsing this forum: No registered users and 3 guests

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