DOI-USGS / COAWST

COAWST modeling system git repository
Other
104 stars 48 forks source link

Boundary conditions using roms_master_climatology #143

Open valitaxino opened 1 year ago

valitaxino commented 1 year ago

Hello, I have a question about how boundary files are build, and their visualization. I am configuring my model in west Japan using HYCOM data, and I am having problems to configure the phyhsics of my model, so I am following conditions at the borders. Doing this, I have found that I cannot visualize the west and north boundaries. I am using the matlab script roms_master_climatology_coawst_mw that is distributed with the source code to generate initial, clm and bdy conditions. I can effectively create and visualize initial, clm and boundaries in the southern and eastern sides without any problem (I am using ncview to visualize them). I can also run ROMS and WRF coupled without error messages, so I think the way the files are built is ok and they do not have any error. I was trying different things to see why I cannot visualize the boundary conditions: 1st I thought that maybe there was no HYCOM data series there, but the initial conditions have data, so that cannot be a problem. 2nd, I made my domain bigger to give more water cells on the north and west sides, but the result was the same 3rd, I was checking on the matlab scripts if there was something selected or to "touch" to turn off the way boundaries are made, but I did not find anything... 4th, I checked on the boundary conditions of the Sandy example that come with the source code, and I have found the same thing, the boundary conditions for the north and the west cannot be visualized. So my question is if is that ok? Is there any reason why I cannot see them? I know that the files distributed in the Projects folder as example work, because I could run many of them, the Sandy case included. Also, my own study case runs without problems (besides the quality of my results), but I am confuse about this... Thanks in advance! Valentina

jcwarner-usgs commented 1 year ago

the sandy case did not need north or west bc's for roms because those locations were on land. Make sure you have an updated version of the code. check the file create_roms_netcdf_bndry_mwUL.m and you should see that the boudnaries are being created for south east north and west for ubar vbar zeta u v salt temp, such as

ubsID = netcdf.defVar(nc_bndry,'ubar_south','float',[xudimID v2tdimID]); ... ubeID = netcdf.defVar(nc_bndry,'ubar_east','float',[eudimID v2tdimID]); ... ubwID = netcdf.defVar(nc_bndry,'ubar_west','float',[eudimID v2tdimID]); ... ubnID = netcdf.defVar(nc_bndry,'ubar_north','float',[xudimID v2tdimID]); ... etc

valitaxino commented 1 year ago

Ok, thanks a lot for your answer. I will check on that and I will update the code if it's necessary 👍

valitaxino commented 1 year ago

I think I have found and solved the problem... My code was updated, and create_roms_netcdf... was ok (I have checked and also update things from the repository), but the problem is in the beginning of roms_master_climatology_coawst_mw.m code.. If I am not misunderstanding, at the beginning of the code is called updatbdry_coawst_mw.m (and the corresponding for clm and init conditions) to get and prepare HYCOM data to be saved in bdy ncfiles, as:

% Call to create the boundary (bdy) file disp('going to create bndry file') updatbdry_coawst_mw(fn, gn, 'coawst_bdy.nc', wdr)

When I checked on updatbdry_coawst_mw.m I found that it only had south and east borders (same as my outputs...), so I modified it adding the west and north sides and now everything works ok. Thank you!

Valentina

jcwarner-usgs commented 1 year ago

ok great. can you send me your updated version? i will look it over and update it. jcwarner@usgs.gov thanks j

valitaxino commented 1 year ago

I have sent you email with the modified script. When I was testing it, it worked ok for a couple of days of data, but I was trying now to prepare 1 year of data and I got the following error when creating the merged files:

Defining Global Attributes... Defining Dimensions... Defining Dimensions, Variables, and Attributes... Filling Variables in netcdf file with data... Defining Global Attributes... Defining Dimensions... Defining Variables, and Attributes... Defining Global Attributes... Defining Dimensions... Not enough input arguments.

Error in create_roms_netcdf_bndry_mwUL (line 53) v3tdimID = netcdf.defDim(nc_bndry,'v3d_time',t3d_clim);

Error in roms_master_climatology_coawst_2010 (line 103) create_roms_netcdf_bndry_mwUL(foutb,gn,length(Dbdy));% converted to BI function

I will investigate more on it, maybe I forgot to modify sth else... I hope it helps : )

Valentina

valitaxino commented 1 year ago

I found why I was generating an error... I was mixing an old version od the code with new ones I actualized from the respositoty >.< Sorry!!

Valentina