DOI-USGS / COAWST

COAWST modeling system git repository
Other
105 stars 50 forks source link

Unable to create surface forcing file in a ROMS only application #199

Open qwdy opened 10 months ago

qwdy commented 10 months ago

Dear Dr. Warner I'm following the COAWST manual to run a ROMS-only Sandy application. In step 7 'Surface forcings', there are 3 ways to create surfacing files. But none of them worked for me. The first way using 'create_roms_forcings.m' converts data from matlab workspce to a netcdf forcing file which means I must have data in matlab workspace first ,right? How can I get the data I need in the right type? I'm confused about this method. As for the second way, the ftp link you provieded seemed unavailable. The last way also has many problems for me. When I selected ncread (ie,use_matlab = 1;),I got an error like this after running neci_2roms.m: "The NetCDF library encountered an error during execution of 'open' function - 'Malformed or inaccessible DAP DDS (NC_EDDS)'. If the data source was an OPeNDAP URL, see the OPeNDAP Troubleshooting section in the Users Guide." This is an error related to MATLAB that other matlab users also encountered, and I didn't find a suitable solution. Then I tried to use nctoolbox instead of ncread and modified "use_nctoolbox = 1". But this error occurred after running "setup_nctoolbox.m": "Failed to setup the Java classpath". So I ran the "setup_nctoolbox_java.m", an error like this: "No constructor with matching signature was found 'org.apache.log4j.ConsoleAppender', error in setup_nctoolbox_java ( the 6 line) root.addAppender(org.apache.log4j.ConsoleAppender(org.apache.log4j.PatternLayout('%d{ISO8601} [%t] %-5p %c %x - %m%n'))); " The nctoolbox requires Java 1.6 but I only have Java1.8 in my machine. I downloaded log4j-2.22.0.jar and created a log4j2.xml file to set up nctoolbox. I thought I succeeded, because I got a message like this"NCTOOLBOX added to Matlab path", but after I ran ncei_2roms again, I still got an error: wrong use ncdataset Failed to open http://www.ncei.noaa.gov/thredds/dodsC/narr-a-files/201210/20121028/narr-a_221_20121028_0000_000.grb

error cfdataset ( 59 line) obj = obj@ncdataset(url);

error ncgeodataset ( 74 line) obj = obj@cfdataset(url);

error ncei_2roms ( 476 line) geo = ncgeodataset(url);

error run ( 91 line) evalin('caller', strcat(script, ';'));

reaseon: wrong use ncdataset Java exception occurred: java.io.IOException: http://www.ncei.noaa.gov/thredds/dodsC/narr-a-files/201210/20121028/narr-a_221_20121028_0000_000.grb is not a valid URL, return status=400 at ucar.nc2.dataset.NetcdfDataset.disambiguateHttp(NetcdfDataset.java:881) at ucar.nc2.dataset.NetcdfDataset.disambiguateURL(NetcdfDataset.java:772) at ucar.nc2.dataset.NetcdfDataset.openOrAcquireFile(NetcdfDataset.java:660) at ucar.nc2.dataset.NetcdfDataset.openDataset(NetcdfDataset.java:421) at ucar.nc2.dataset.NetcdfDataset.openDataset(NetcdfDataset.java:404) at ucar.nc2.dataset.NetcdfDataset.openDataset(NetcdfDataset.java:389) at ucar.nc2.dataset.NetcdfDataset.openDataset(NetcdfDataset.java:376) Can you give me some advice for dealing these problems? Thank you so much.

qwdy commented 10 months ago

Hi, I want to say I created the surface forcing files by the second way. It turns out the ftp link works fine through FileZilla. But it would be nice if you could give me some advice about the other two methods. Thank you so much!

jcwarner-usgs commented 10 months ago

If you are having trouble to create ROMS forcing files, you can ask a direct question on the ROMS forum. Sometimes the tools we have stop working due to NOAA changing paths, etc.
I know that Rutgers has an ECMWF download tools, those might work for you.
I usually use the ncei2roms tools. have you tried them?

it also depends on your coverage area. i do a lot of work on the US, but if you need global then the ECMWF or ncei2roms using GFS might work better.

qwdy commented 10 months ago

Thank you for your in-time reply! I will post my question on ROMS forum later and ask for ECMWF tools and give it a try.

I have tried ncei_2roms.m using NARR dataset (GFS not yet).The error is as I mentioned above: ncread can't read data through OPENDAP URL. Even though I changed to nctoolbox, something went wrong and I couldn't figure out for now.

I succeeded in 2rd way, but I suppose the data in that ftp link only covers US?

Anyway I really appreciate your help!

qwdy commented 10 months ago

HI, John. I have some new findings and questions about ncei_2roms.m.

1) I'm finally able to run ncei_2roms.m to access NARR data and create surface_forcing1 file. The reason I failed is the url mismatch and variable name mismatch between the .m file and dataset.

2) Next, I want to use GFS to create surface_forcing2 file. You mentioned that lwrad, swrad and rain are not available for GFS, so in the output file, these variables are assigned to 0. Is it suitable to use such a file containing many 0 value to run COAWST? (i.e., if I use surface_forcing1 and surface_forcing2 to run COAWST respectively, won't the output be very different?

3)I have a question beyond COAWST field (forgive me please), since you must be familiar with NAM/GFS dataset. I found these descriptions confusing, for example: Dataset: 20200508/gfsanl_4_20200508_0000_000.grb2 and Dataset: 20231203/nam_218_20231203_1800_084.grb2 Dataset: 20200508/gfsanl_4_20200508_0000_003.grb2 and Dataset: 20231203/nam_218_20231203_1800_081.grb2 Dataset: 20200508/gfsanl_4_20200508_0000_006.grb2 and Dataset: 20231203/nam_218_20231203_1800_078.grb2 What does the last 3 numbers(000/003/006/084) mean?

4)By the way, I failed to use NAM to create surface_forcing3 file correctly, all variables are assigned to 0. I suppose it maybe caused by grib1 format or the .m file is outdated(I'm using v3.7). I'll test my idea tomorrow.

Sorry for many questions again. I'd appreciate if you could share any suggestion with me!

jcwarner-usgs commented 10 months ago

i think these last set of questions are best suited to post on the ROMS forum. these are just roms questions, how do you get data etc. There are other posts there that may be of help. sometimes the tools we distribute get outdated, or new data sets come available. You can look at Wilkins ecmwf tools.

qwdy commented 10 months ago

Thanks John. (If I make any offense is not my intention).

jcwarner-usgs commented 10 months ago

all good! I just know there are tools other than what i send out, so if you ask on Rutgers you can get other people.