Re: D_ECMWF2ROMS Matlab scripts (ECMWF hourly data accumulation)

General scientific issues regarding ROMS

Moderators: arango, robertson

Post Reply
Message
Author
azamocndu
Posts: 5
Joined: Mon Mar 26, 2018 2:16 pm
Location: Ocean University of China

Re: D_ECMWF2ROMS Matlab scripts (ECMWF hourly data accumulation)

#1 Unread post by azamocndu »

Hello,
I am a new user of ROMS model. I a using D_ECMWF2ROMS Matlab scripts for ECMWF atmospheric forcing. Now in ERA5 data we are getting hourly data for latest year. so, for hourly data how will I handle with the accumulation data? The following part is for 3-hourly datasets. how to edit it for hourly. please help me.

{
if (F(n).scale < 0),
step = rem(frc_time,0.5)*24;
if step == 3
fieldfinal = field;
else
fieldfinal = field - field_previous; % At other steps subtract
end % the previous accumulation

frc_time = frc_time - 1.5/24; % Center forcing time on the
% accumulation interval

field_previous = field; % Save this accumulation
% to on the next step
}
end

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

Re: D_ECMWF2ROMS Matlab scripts (ECMWF hourly data accumulation)

#2 Unread post by wilkin »

I wrote that code long ago and have not updated from ERA-Interim to ERA5. You will have to figure out the accumulation logic yourself, if indeed that is still how the data are presented (it may not be, check the units).

I now access ERA5 from the NCAR Research Data Archive using roms_write_era5_NCARds633_frcfile.m from my code at
https://github.com/johnwilkin/roms_wilkin
John Wilkin: DMCS Rutgers University
71 Dudley Rd, New Brunswick, NJ 08901-8521, USA. ph: 609-630-0559 jwilkin@rutgers.edu

jc_Sun
Posts: 27
Joined: Fri Aug 19, 2022 12:24 pm
Location: Institute of Oceanology of the Chinese Academy

Re: D_ECMWF2ROMS Matlab scripts (ECMWF hourly data accumulation)

#3 Unread post by jc_Sun »

wilkin wrote: Thu May 20, 2021 11:32 am I wrote that code long ago and have not updated from ERA-Interim to ERA5. You will have to figure out the accumulation logic yourself, if indeed that is still how the data are presented (it may not be, check the units).

I now access ERA5 from the NCAR Research Data Archive using roms_write_era5_NCARds633_frcfile.m from my code at
https://github.com/johnwilkin/roms_wilkin
Hello wilkin,
Thank you for sharing the ROMS_WRITE_ERA5_NCAR_DS633 file, but when I used it as the driver field file, there was an error, missing some attribute. How to solve this problem?

Code: Select all

GET_CYCLE_NF90 - unable to get value for attribute: cycle_length
                  in variable: zeta_time
                  This attribute value is expected to be of
                  the same external type as the variable.
 Found Error: 02   Line: 346      Source: ROMS/Utility/inquiry.F, inquiry_nf90
 Found Error: 02   Line: 209      Source: ROMS/Utility/get_ngfld.F, get_ngfld_nf90
 Found Error: 02   Line: 107      Source: ROMS/Utility/get_ngfld.F
 Found Error: 02   Line: 888      Source: ROMS/Nonlinear/get_data.F
 Found Error: 02   Line: 670      Source: ROMS/Nonlinear/initial.F
 Found Error: 02   Line: 197      Source: ROMS/Drivers/nl_roms.h, ROMS_initialize

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

Re: D_ECMWF2ROMS Matlab scripts (ECMWF hourly data accumulation)

#4 Unread post by wilkin »

The netcdf files created by roms_write_era5_NCARds633_frcfile.m have a time coordinate variable called "time" (not zeta_time) and the "time" attribute of all variables will point ROMS to read "time" in preference the default in varinfo.dat.

But, I can't imagine what meteorology forcing file would have "zeta_time". Zeta is sea level. I doubt this error is associated with the ERA5 forcing data but you've given too few details to suggest what might be the problem.
John Wilkin: DMCS Rutgers University
71 Dudley Rd, New Brunswick, NJ 08901-8521, USA. ph: 609-630-0559 jwilkin@rutgers.edu

jc_Sun
Posts: 27
Joined: Fri Aug 19, 2022 12:24 pm
Location: Institute of Oceanology of the Chinese Academy

Re: D_ECMWF2ROMS Matlab scripts (ECMWF hourly data accumulation)

#5 Unread post by jc_Sun »

wilkin wrote: Thu Sep 22, 2022 1:53 pm The netcdf files created by roms_write_era5_NCARds633_frcfile.m have a time coordinate variable called "time" (not zeta_time) and the "time" attribute of all variables will point ROMS to read "time" in preference the default in varinfo.dat.

But, I can't imagine what meteorology forcing file would have "zeta_time". Zeta is sea level. I doubt this error is associated with the ERA5 forcing data but you've given too few details to suggest what might be the problem.
This are my h file and output log file.
Attachments
upwelling.h
(1.68 KiB) Downloaded 96 times
output.txt
(48.43 KiB) Downloaded 103 times

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

Re: D_ECMWF2ROMS Matlab scripts (ECMWF hourly data accumulation)

#6 Unread post by wilkin »

Your file output.txt indicates that the ERA5 forcing data were read successfully.

The next thing ROMS is doing when the error occurs is reading the open boundary conditions file, and the first variable it reads is zeta, so that's why you are getting an error about zeta_time.

The log says your Input Lateral Boundary File 01 is croco_bry_HYCOM_Y2019M8.nc, so that's where to look for what's wrong. If that's been made with CROCO tools, then you might have some inconsistency with MYROMS.
John Wilkin: DMCS Rutgers University
71 Dudley Rd, New Brunswick, NJ 08901-8521, USA. ph: 609-630-0559 jwilkin@rutgers.edu

jc_Sun
Posts: 27
Joined: Fri Aug 19, 2022 12:24 pm
Location: Institute of Oceanology of the Chinese Academy

Re: D_ECMWF2ROMS Matlab scripts (ECMWF hourly data accumulation)

#7 Unread post by jc_Sun »

wilkin wrote: Thu Sep 22, 2022 2:30 pm Your file output.txt indicates that the ERA5 forcing data were read successfully.

The next thing ROMS is doing when the error occurs is reading the open boundary conditions file, and the first variable it reads is zeta, so that's why you are getting an error about zeta_time.

The log says your Input Lateral Boundary File 01 is croco_bry_HYCOM_Y2019M8.nc, so that's where to look for what's wrong. If that's been made with CROCO tools, then you might have some inconsistency with MYROMS.
Thinks for your reply.

Post Reply