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

Error when running WRF-ROMS-SWAN,problems seem occuring when SWAN reading Scrip information #310

Open
yuke4500 opened this issue Sep 3, 2024 · 13 comments

Comments

@yuke4500
Copy link

yuke4500 commented Sep 3, 2024

Dear Mr Warner,
I tried to run the 3-way coupled WRF-ROMS-SWAN
I defined the model following Project Sandy,with #undef NESTING

Here is the error report of the LOG FILE

 GET_SPARSE - cannot inquire ID for variable: src_grid_dims

 GET_SPARSE - cannot inquire ID for variable: dst_grid_dims

 GET_SPARSE - cannot inquire ID for variable: dst_grid_imask

 GET_SPARSE - cannot inquire ID for variable: num_links

 GET_SPARSE - cannot inquire ID for variable: dst_address

 GET_SPARSE - cannot inquire ID for variable: src_address

 GET_SPARSE - cannot inquire ID for variable: remap_matrix
forrtl: severe (174): SIGSEGV, segmentation fault occurred
Image              PC                Routine            Line        Source
coawstM            000000000381E9C3  Unknown               Unknown  Unknown
libpthread-2.17.s  00002B75AAAF7630  Unknown               Unknown  Unknown
coawstM            000000000090341D  waves_coupler_mod         279  waves_coupler.f90
coawstM            000000000095607B  swan_initialize_          464  swanmain.f90
coawstM            00000000008F0C2C  waves_control_mod          77  waves_control.f90
coawstM            0000000000419E3C  MAIN__                    354  master.f90
coawstM            0000000000416122  Unknown               Unknown  Unknown
libc-2.17.so       00002B75AAD26555  __libc_start_main     Unknown  Unknown
coawstM            0000000000416029  Unknown               Unknown  Unknown

I made the swan grids and forcing data by using create_swanTpar_from_WW3.m and roms2swan.m

SCRIP FILE made by:

SWAN_COORD(1)='./test_zj2_files/swan_coord_zj2.grd',
!SWAN_COORD(2)='../../Projects/Sandy/Sandy_swan_coord_ref3.grd',
SWAN_BATH(1)='./test_zj2_files/swan_bathy_zj2.bot',
!SWAN_BATH(2)='../../Projects/Sandy/Sandy_swan_bathy_ref3.bot',
SWAN_NUMX(1)=192,
!SWAN_NUMX(2)=116,
SWAN_NUMY(1)=204,
!SWAN_NUMY(2)=86,
CARTESIAN(1)=0,
!CARTESIAN(2)=0,

Here are the grid files and the log information
COAWST-FILES-LOGS.zip

@jcwarner-usgs
Copy link
Collaborator

let me see you sandy.h file

@yuke4500
Copy link
Author

yuke4500 commented Sep 3, 2024

test_zj2.h.txt
I tried #define or #undef MCT_INTERP_OC2WV and got the same errors.

@jcwarner-usgs
Copy link
Collaborator

not sure.

is this the correct path to the scrip file
SCRIP_COAWST_NAME = Projects/test_zj2/scrip_test_zj2.nc

can you run this m file
Tools/mfiles/mtools/plot_scrip_weights.m

@yuke4500
Copy link
Author

yuke4500 commented Sep 3, 2024

the path is correct.
I ran plot_scrip_weights.m and got this

>> plot_scrip_weights
Error using internal.matlab.imagesci.nc/getGroupAndVarid (line 2096)
Could not find variable or group '/wav1_to_atm1_weights.nc/remap_matrix' in file.

Error in internal.matlab.imagesci.nc/read (line 593)
            [gid, varid] = getGroupAndVarid(this, location);

Error in ncread (line 66)
vardata = ncObj.read(varName, varargin{:});

Error in plot_scrip_weights (line 86)
  remap=ncread(fname,['/',str,'_weights.nc/remap_matrix']);

@jcwarner-usgs
Copy link
Collaborator

ok so i think your scrip file is messed up.
can u remake it?

@yuke4500
Copy link
Author

yuke4500 commented Sep 3, 2024

I remake the scrip file, it still does not contain the variable remap_matrix,plot_scrip_weights.m gots the same error.
scrip_test_zj2.zip
scrip_coawst_zj2.in.txt
log_runscrip_1.txt
from the end of log_runscrip_1.txt:
../../Projects/test_zj2/roms_zj2_4km_grid.nc

grid1 sweep
grid2 sweep
Total number of links = 137619

Reached the end of mapping one set of grids

Begin mapping between the two grids

The interp file is:
wav1_to_atm1_weights.nc

The src grid is:
../../Projects/test_zj2/swan_coord_zj2.grd

The dst grid is:
../../wrfinput_d01


grid1 dimensions= 192 204


grid2 dimensions= 192 204

Using latitude bins to restrict search.
Computing remappings between:
../../Projects/test_zj2/swan_coord_zj2.grd

                       and

../../wrfinput_d01

grid1 sweep

the scrip_coawst.exe shut down at grid1 sweep?

@fs-jbzambon
Copy link

I have occasionally seen it where the input path exceeds the allowable char limit for the SCRIP fortran program. I usually will create a symbolic link to the grid files in the working SCRIP directory so that all paths are ./ relative and it cuts down on the character length of the grid files.

Pretty sure that's not what's happening here, just something to be aware of.

@jcwarner-usgs
Copy link
Collaborator

how are you launching the scrip job?
maybe you are running on the head node and they are stopping the job.
launch it like a regular run and use
mpirun -np X ./scip_coawst scrip_coawst_zj2.in

@yuke4500
Copy link
Author

yuke4500 commented Sep 4, 2024

I launched it with ./scip_coawst scrip_coawst_zj2.in
Each time I used scip_coawst, "integration stalled: num_subseg exceeded limit" was appended to the end of swan coord file
swan_coord_grd

I also tried mpirun -np 4 ./scip_coawst scrip_coawst_zj2.in, but still fails and something weird happens:
It says "Error in netCDF:
Permission denied"
log_runscrip_7.txt

@jcwarner-usgs
Copy link
Collaborator

i am not sure what is happening.
If you built scrip with mpi on, then you should run it as an mpi job, mpirun -np 4 ./scrip_coawst scrip_coawst_zj2.in

If you do an
ls -ltr
do you see the scrip_test_zj2.nc file? what are the permissions for it? can you delete it and try again.
Also, make sure the swan files are ok. i am completely not sure why those files are being written to.

@yuke4500
Copy link
Author

yuke4500 commented Sep 6, 2024

I make 2 new nested WRF domains, ROMS and SWAN grid is as large as the WRF d02. This time SCRIP works well. Seems SCRIP do not support WRF,ROMS,and SWAN with all the same domain. Nothing to do with compilation of SCRIP. Thanks for your help, Mr Warner.

Also, when I want to try more types of WRF or SWAN simulations, I try to compile WRF ONLY or SWAN ONLY in the COAWST directory(ifort, intel mpi),
it always says
cp -p /home/keyu/make_macros.mk ./Build
Infinite loop...and the compilation cannot continue, how to fix it?
coawst.bash.txt
log_coawst_compile_1.txt
Linux-ifort.mk.txt

@jcwarner-usgs
Copy link
Collaborator

glad you have the wrf roms swan going.
for most of my apps, the wrf is larger, or at least different grid dimensions. i can give a test to all 3models having the same grid.
for the infinite loop - not sure. but the app name
export COAWST_APPLICATION=swanonly
should be all caps.

@hato-hhu
Copy link

I had the same problem when I was working on scrip, and I also changed the ROMS grid at the beginning so that the ROMS and WRF grids were different, and this problem was solved

Later, I discovered that my error was caused by parent_id in the namelist.wps, namelist.input and scrip files. Because the parent_id of namelist.wps and namelist.input is different for domaind01, I later make sure all three parent_id are correct, and the error disappears

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

4 participants