Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Queries related to WW3 compilation and running in COAWST #342

Open
BilalYasirAlvi opened this issue Dec 19, 2024 · 5 comments
Open

Queries related to WW3 compilation and running in COAWST #342

BilalYasirAlvi opened this issue Dec 19, 2024 · 5 comments

Comments

@BilalYasirAlvi
Copy link

Hello everyone

I am new to wave modelling and esp COAWST framework. Right now, I am trying to set up WW3 application and run it independently. Later, I will couple it with ROMS (already ran the model in COAWST with some basic inputs). I consulted Section 11 of the manual and built the WW3. I have the executable coawstM in my project directory. WW3 utilities were updated in the ../build/bin directory as well. I have multiple queries related to the compilation in WW3. Here it goes:

  1. What CMake file does the build command call to create coawstM? Is it the file in ../WW3/build/CMake Files or ../WW3/model/build/ CMake Files? Is there any requirement to edit any of the CMake file before compilation? I am asking this because I created a switch file in my project directory and gave the path in build file but the CMakeCache.txt shows:

SWITCH:UNINITIALIZED=.../WW3/model/model/bin/switch_coawst(THIS IS NOT THE NAME OF MY SWITCH)

  1. I am using switch_UoM_nl1 (which I copied from my other WW3 project).
    F90 NOGRB DIST MPI PR3 UQ FLX4 LN1 ST6 NL1 BT1 DB1 MLIM TR0 BS0 IC0 IS0 REF0 XX0 WNT1 WNX1 CRT1 CRX1 RWND O0 O1 O2 O4 O5 O6 O7

The one available in COAWST is a bit different from that. Is it some requirement of COAWST?
NOGRB DIST MPI PR3 UQ FLX4 LN1 ST6 NL1 BT1 DB1 MLIM TR0 BS0 IC0 IS0 REF0 WNT1 WNX1 CRT1 CRX1 RWND O0 O1 O2 O4 O5 O6 O7

  1. The 2021 tutorials says that COAWST needs to be included in the switch. The manual does not mention it. What is the current regime?

  2. It was mentioned in 2021 tutorials that ./w3_clean -c; needs to be executed after building WW3 in COAWST. The manual does not mention it. Is this step necessary now? I tried it for learning purposes and got the following error:

[ERROR] no env file wwatch3.env found. (Is this file even necessary as we are defining the WW3 env in build file?)

  1. With respect to header file, is there any other change required other than #define and #undef of models and MCT?

  2. If I am running only WW3 (#undef ROMS and all other models), do I need to execute coawstM or the normal shel file?

@jcwarner-usgs
Copy link
Collaborator

Ok. glad you are giving WW3 a try. We have spent a lot of effort to get WW3 coupled into the system, and we are still working on several issues. I will try to answer the q's as best i can.

  1. Cmake files - there are probably several. i dont fully understand cmake, but i see WW3/model/src/CMAkeLists, WW3/model/src/cmake, etc. The WW3/model/build dir is created during the build, so any files in the /build would be copied or created from somewhere else. you should not need to modify any cmake files, although some users had issues with paths to some libs. The switch is a totally different file than cmake.

You need to make a switch file, and put it somewhere, and list the path to the switch file in the build_coawst.sh. Then, during the build, I copy your switch file, add some flags, and call it switch_coawst. So then ww3 will always look for switch_coawst. This magic happens in the COAWST/makefile, down near lines 700.

  1. For the switch
    NOPA DO NOT USE THIS.
    DIST, MPI These are needed, to use mpi.
    SCRIP this is needed for WW3to internally compute nesting weights between the WW3grids.
    you can also add SCRIP_MPI and SCRIP_NC. these will run scrip in mpi and create netcdf weight files that you can use on the next run (this is just for ww3).

  2. you dont need to add the COAWST switch. i add it automatically now.

  3. the ./w3 clean stuff is the old way to build ww3. not used any more. dont use the wwatch.env either. we now use cmake.

  4. For WW3, we have added some cpp options. But these are in testing phase. you can just add
    #define WW3_MODEL

define WAV2OCN_FLUXES - this will take the surface stresses from WW3 to be used in ROMS. With this option ROMS will not use bulk_fluxes for sustr or svstr. ROMS will use bulk_fluxes to compute the moisture and heat fluxes.

define DISSIP_BREAK_DIR - this computes the wave breaking dissipation in each direction, rather than based on the mean wave direction. you can give it a try.

  1. coawstM will always be the executable for coawst. if you have 1 model or 3, it will always be coawstM.

hope that helps. -j

@BilalYasirAlvi BilalYasirAlvi changed the title Issues related to WW3 compilation in COAWST Queries related to WW3 compilation and running in COAWST Dec 20, 2024
@BilalYasirAlvi
Copy link
Author

Thanks a lot John for a quick and elaborate response. It clears a lot of confusion in my head.

I am inclined to use the switch with options as given in the manual (instead of the one I am using right now) as the one in the manual has some additional mandatory and optional switches which (in my understanding) will be required for my project. However, I have a few queries about it:

  1. Can I use all these options with ST6 physics package? I still don't understand the compatibility of various options.

  2. The LRB4 switch is not given in the manual. Is it related to enabling the use of fourth-order accurate propagation scheme? (Not sure. I found that on internet).

I was just about to tell you to close this issue, But I changed the title, thinking that the entire process may be clarified in one go and that may be beneficial for other future users as well :)

I have some queries w.r.t the utilities (I am getting few errors upon running the WW3). I will post them after understanding the above queries and recompiling WW3 with the new switch.

Kind Regards

@jcwarner-usgs
Copy link
Collaborator

yes, you should be able to use ST4 or ST6 in WW3 switch file.
I have not used all the switches either, so i encourage you to try different things.

i dont think the LRB4 and LRB8 are in the WW3 code anymore. I should remove that from the manual.
thanks

@BilalYasirAlvi
Copy link
Author

Hello John. Sorry for bothering during the holiday season :)

I have compiled with different switch options and the compilation is done. But I need to run all sets of command to see if the model is working properly. I have recently shifted to a rectangular/curvilinear grid for my project. The matlab code available for creating ww3 grid files in COAWST (x, y, bathy and mapsta) is for unstructured grid. I modified the code and created these files (from the ROMS.nc grid which I was already using) but I have some queries/ issues:

  1. Any available matlab code for rectangular/curvilinear grid? I am fairly new to matlab/ python and I have created files using both but still not so sure about the validity of output files. I am saying this because I had to change the code many times as there were errors upon running grid preprocessor.

  2. Do I need x, y coord files or are they only required for purely curv grid? I am not defining these files anywhere, only the bathy and mapsta file in grid.nml.

  3. I am able to run ww3_grid (main input is grid.nml file) but once I run ww3_strt, I get the following error (which I am unable to understand; I don't know if it is related to computing or there is something wrong in the input):

          _shmem: posix: file name search - max attempts exceeded.cannot continue with posix._
    

-Wishing you lovely holiday season

@jcwarner-usgs
Copy link
Collaborator

  1. Tools/mfiles/mtools/create_ww3_grid_files.m creates both structured and unstructured grid files.

%1) Enter name of ROMS grid, or provide the varaibles of
roms_grid='../Sandy_roms_grid_ref3.nc';
% 2) Enter name of WW3 xcoord file to be created: - this is for structured
ww3_xcoord_file='ww3_sandy_xcoord_ref3.dat';
% 3) Enter name of WW3 ycoord file to be created:
ww3_ycoord_file='ww3_sandy_ycoord_ref3.dat'; - this is for structured
% 4) Enter name of WW3 bathy file to be created:
ww3_bath_file='ww3_sandy_bathy_ref3.bot'; - this is for structured
min_depth=5.1;
% 5) Enter name of WW3 mask file to be created:
ww3_mask_file='ww3_sandy_mapsta_ref3.inp'; - this is for structured
% 6) Enter name of WW3 unstructured msh file to be created:
ww3_msh_file='ww3_sandy_grid_ref3.msh'; - this is for unstructured
% 7) If nesting, enter ww grid number order (ie the parent is grid 1, first child = 2)
ww3_grdnum=2;

  1. please read the manual section 11. there are different requirements for structured vs unstructured. i tried to explain it there.

  2. i dont use the namelist files. i use ww3_grid.inp and that is read by the WW3/build/bin/ww3_grid utility.
    can u try to follow the methods i describe in the manual.

-j

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants