Matlab code(wikin code) for forcing

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

Matlab code(wikin code) for forcing

#1 Unread post by javadi »

Hi
I try to make a forcing file using era5. I use roms_get_era5_NCARds633_bulkflux in this code which is for wikin.

I can use it.

The problem is bbox.

latitude is work! Ok!

My domain along longitude is 12-20.8 E. But, the forcing gives me -348-339.5.

I put -348 -339.5, the problem has not been solved!

I can understand why?
As mentioned in the codes, it is for the western Atlantic!

But, when we use for eastern part positively longitude how we should define it?

Best,

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

Re: Matlab code(wikin code) for forcing

#2 Unread post by wilkin »

That was an easy to solve bug. It's fixed now and updated in 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: Matlab code(wikin code) for forcing

#3 Unread post by javadi »

Hi Wikin

Thanks!

This problem has been solved!
But,

Another point is that this error when applying on ROMS:

REGRID - input gridded data does not contain model grid:

Gridded: LonMin = 12.0000 LonMax = 20.5000
LatMin = 39.2500 LatMax = 45.7500
Model: LonMin = 12.0000 LonMax = 20.8000
LatMin = 38.9000 LatMax = 45.9044

This is because era5 data is 0.25 deg.

The code cannot interpolate correctly the exact grid as there is no data on the edge!

I remember that I had the same matter with d_ecmwf2roms. But, I have solved this matter by increasing my domain when downloading data! After that, the Matlab code makes the appropriate file due to the exact model grid!

Here, all of the actions are simultaneous! If I add my domain, again I will face the same error!

Best,

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

Re: Matlab code(wikin code) for forcing

#4 Unread post by wilkin »

Yes, you have to request a bounding box that is larger than your domain by at least the 0.25 deg resolution of ERA5. Make it 1 or 2 deg more ... there is no reason not to.
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: Matlab code(wikin code) for forcing

#5 Unread post by javadi »

Hi

Based on this method, I have made it for 7 years(84 months).

Now, I define it in .in file like this

NFFILES == 1 ! number of unique forcing files

FRCNAME == /scratch/f85015jb/MedSea/Adriatic/2012/frc_MY_APPLICATION_ERA5_bulkflux_201201.nc|
/scratch/f85015jb/MedSea/Ad/2012/frc_MY_APPLICATION_ERA5_bulkflux_201202.nc|
/scratch/f85015jb/MedSea/Ad/2012/frc_MY_APPLICATION_ERA5_bulkflux_201203.nc|
/scratch/f85015jb/MedSea/Ad/2012/frc_MY_APPLICATION_ERA5_bulkflux_201204.nc|
/scratch/f85015jb/MedSea/Ad/2012/frc_MY_APPLICATION_ERA5_bulkflux_201205.nc|
/scratch/f85015jb/MedSea/Ad/2012/frc_MY_APPLICATION_ERA5_bulkflux_201206.nc|
/scratch/f85015jb/MedSea/Ad/2012/frc_MY_APPLICATION_ERA5_bulkflux_201208.nc|
/scratch/f85015jb/MedSea/Ad/2012/frc_MY_APPLICATION_ERA5_bulkflux_201209.nc|
/scratch/f85015jb/MedSea/Ad/2012/frc_MY_APPLICATION_ERA5_bulkflux_201210.nc|
/scratch/f85015jb/MedSea/Ad/2012/frc_MY_APPLICATION_ERA5_bulkflux_201211.nc|
/scratch/f85015jb/MedSea/Adr/2012/frc_MY_APPLICATION_ERA5_bulkflux_201212.nc|
/scratch/f85015jb/MedSea/Adr/2013/frc_MY_APPLICATION_ERA5_bulkflux_201301.nc|
.
.
.
here Nfiles should be 1 as it is unique?? This style of definition is right?

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

Re: Matlab code(wikin code) for forcing

#6 Unread post by javadi »

I have faced an unusual error.
when defining forcing files with multiple files, I have faced this error

0 2012-01-01 00:00:00.00 0.000000E+00 3.029579E+03 3.029579E+03 9.673655E+13
(000,000,00) 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00
DEF_HIS - creating history file, Grid 01: roms_his.nc
Found Error: ** Line: 143 Source: ROMS/Utility/def_var.F

DEF_VAR - Grid 01, unable to define variable: Tobc_in
in NetCDF file: roms_his.nc
Found Error: 03 Line: 1933 Source: ROMS/Utility/def_info.F
Found Error: 03 Line: 411 Source: ROMS/Utility/def_his.F
Found Error: 03 Line: 151 Source: ROMS/Nonlinear/output.F
Found Error: 03 Line: 518 Source: ROMS/Nonlinear/main3d.F
Found Error: 03 Line: 302 Source: ROMS/Drivers/nl_ocean.h, ROMS_run

It seems that when defining 201201 up to 201607 files(55)! it works! but, I add 201608 I will face this error!

I downloaded the file again and then made it! The problem is the same!

I have separately added 201608 it works!

Is there any limitation to putting forcing? what to do?

Best,

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

Re: Matlab code(wikin code) for forcing

#7 Unread post by javadi »

Ok. It has been solved!

I try to explain it as others maybe use it!

There is a limitation in terms of the number of characters!

should use this
/scratch/f85015jb/MedSea/Ad/2012/201202.nc|

instead of:
/scratch/f85015jb/MedSea/Ad/2012/frc_MY_APPLICATION_ERA5_bulkflux_201202.nc|

Thanks!

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

Re: Matlab code(wikin code) for forcing

#8 Unread post by wilkin »

Or use NCO tools ncrcat to merge the monthly files into fewer files.

Also, perhaps it's not obvious in the script documentation but my intention with

Code: Select all

% Output file name prefix. If not set, name is MY_APPLICATION
if ~exist('ROMS_APP','var')
  ROMS_APP = 'MY_APPLICATION';
end
is that the user chooses a meaningful name and sets it in ROMS_APP, e.g.

>> ROMS_APP = 'BayBengal';

then line 69 in the script creates file names accordingly

Code: Select all

ncname = "frc_"+ROMS_APP+"_ERA5_"+fluxopt+"_"+YYYY+MM+".nc";
John Wilkin: DMCS Rutgers University
71 Dudley Rd, New Brunswick, NJ 08901-8521, USA. ph: 609-630-0559 jwilkin@rutgers.edu

Post Reply