Roms failing to read from surface forcing file

Report or discuss software problems and other woes

Moderators: arango, robertson

Post Reply
Message
Author
itswx
Posts: 3
Joined: Wed Sep 03, 2025 10:03 pm
Location: Weather Routing, Inc.

Roms failing to read from surface forcing file

#1 Post by itswx »

Hey all,

I'm having some difficulties with my input surface stress forcing file. Ive downloaded some era5 data from my time period of interest for forcing, but when I attempt to use it, ROMS reads it in as all 0s. The data is on a lat lon grid, so I am relying on ROMS' regridding function. Reading the logs:

Code: Select all

GET_2DFLD_NF90   - surface u-momentum stress,                           2025-01-01 17:00:00.00
                      (Grid=01, Rec=18, Index=1, File: forcing.nc)
                      (Tmin=      20089.0000 Tmax=      20112.9583)   t =      20089.7083
                      (Min =  1.00000000E+35 Max = -1.00000000E+35)   regrid = T
 GET_2DFLD_NF90   - surface v-momentum stress,                           2025-01-01 17:00:00.00
                      (Grid=01, Rec=18, Index=1, File: forcing.nc)
                      (Tmin=      20089.0000 Tmax=      20112.9583)   t =      20089.7083
                      (Min =  1.00000000E+35 Max = -1.00000000E+35)   regrid = T
ROMS is able to find the data on the time domain just fine, but looking at the max and min its having some issues reading the data in. I set ROMS to log sustr and svstr in the history files, and it seems like as a result ROMS is setting the stress to 0 across the domain, which I have verified does not reflect the actual data.

Looking at the era5 netcdf file I'm using, I see the metadata property 'stored_direction = "decreasing"' on the latitude field. Could this be causing issues?

Has anyone else run into this issue using era5 data?

Thanks! :D

itswx
Posts: 3
Joined: Wed Sep 03, 2025 10:03 pm
Location: Weather Routing, Inc.

Re: Roms failing to read from surface forcing file

#2 Post by itswx »

Not 5 minutes later, I tried and yes, it WAS the problem.

To any future users struggling to use era5 data (or any data for that matter), check for the 'stored_direction = "decreasing"' field on latitude or longitude, it will prevent ROMS from being able to regrid the data properly. Reversing the order of the problem axis should fix the problem:

Code: Select all

out = xr.Dataset(
        {
            "sustr": (("sms_time", "lat", "lon"), np.flip(file.iews.data,1), {
                "coordinates": "lon lat",
                "time": "sms_time",
                "units": "newton meter-2",
                "field": "wind x-stress"
            }),
            "svstr": (("sms_time", "lat", "lon"), np.flip(file.inss.data,1) ,{
                "coordinates": "lon lat",
                "time": "sms_time",
                "units": "newton meter-2",
                "field": "wind x-stress"
            }),
        },
        coords={"sms_time": (("sms_time"), file.valid_time.data, {
            "units": "seconds since 1970-01-01"
        }), "lon": (("lon"), file.longitude.data, {
            "units": "degrees east"
        }), "lat": (("lat"), np.flip(file.latitude.data), {
            # "stored_direction": "decreasing",
            "units": "degrees north"
        })}
    )

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

Re: Roms failing to read from surface forcing file

#3 Post by wilkin »

Yes, that is the issue. In my MATLAB code that accesses ERA5 from the NCAR Data Store https://github.com/johnwilkin/roms_wilk ... bulkflux.m I see

Code: Select all

lat = ncread(url,'latitude',Js,Jlen);
lat = flip(lat);
I forgot that was even there.
John Wilkin: DMCS Rutgers University
71 Dudley Rd, New Brunswick, NJ 08901-8521, USA. ph: 609-630-0559 jwilkin@rutgers.edu

Post Reply