schism-dev / schism

Semi-implicit Cross-scale Hydroscience Integrated System Model (SCHISM)
http://ccrm.vims.edu/schismweb/
Apache License 2.0
86 stars 86 forks source link

Interpolation of parent grid outputs on the boundaries of a child grid #142

Open pierrechabert opened 1 month ago

pierrechabert commented 1 month ago

Hello,

I'm trying to interpolate the outputs of a parent grid (STOFS3D) on the boundaries of a child grid, using the function OneWayNestScripts/interpolate_variables8.f90.

The following error is returned when it checks that the new netcdf file created is not corrupted (exactly at iret=nf90_enddef(ncid)): """Program received signal SIGBUS: Access to an undefined portion of a memory object."""

If I understand correctly, this is either due to a problem of dimension or to an incorrect definition of type of variable. I was wondering if this error occurred to someone already and how it can be fixed,

Thank you in advance for any help,

Pierre

feiye-vims commented 1 month ago

Hi Pierre,

I haven't met this problem myself, but we can take a look at it if it's okay for you to share the related files.

Fei

pierrechabert commented 1 month ago

Hi Fei,

Thank you for the quick answer! Below is a link to a .zip file that includes: the parent and child horizontal and vertical grids, along with the "interpolate_variables" .exe,.f90 and .in files. Concerning the output file to interpolate from, any out2d.nc from the second link below can make it (I tried with one in 20240730/).

Cheers, Pierre

link zip file: https://we.tl/t-SNC0txGCAq

link data STOFS3D: https://noaa-nos-stofs3d-pds.s3.amazonaws.com/index.html#STOFS-3D-Atl/

feiye-vims commented 1 month ago

Hi Pierre,

It seems the problem is with the outputs from the operational forecast. The script works fine on the outputs from the shadow forecast and hindcast studies. The problem may be due to some postprocessing steps in the operational forecast, which may change SCHISM's raw outputs. In contrast, the shadow forecast does not have any postprocessing, so it is free of the problem.

I will work with Zizang, who is in charge of the operation on the NOAA side, to fix this problem.

Thanks very much for pointing out the issue for us.

Fei

josephzhang8 commented 1 month ago

Thx @feiye-vims for looking into this. Maybe an easy way is for Zizang or Pierre to send you a few outputs they are using.

feiye-vims commented 1 month ago

@josephzhang8 Yes, that will help, and they have already shared outputs with me. Only the outputs from the operational forecast have problems with the one-way nesting script.

I will do some debugging later when I have time. After I locate the source of the error, I'll work with Zizang on fixing it in the post-processing script.

feiye-vims commented 1 month ago

Problem found: nSCHISM_vgrid_layers is missing in the post-processed out2d from the operational forecast. Not sure if this is deliberate or not, because this only occurs in out2d which does not depend on the variable. In any case, I see no harm in adding it back in.

Since I'm not familiar with all post-processing scripts on the operational side, I'll create a ticket in STOFS-3D github repo tomorrow and work on it with Zizang.

pierrechabert commented 1 month ago

Hi Fei,

Thank you so much for this quick answer and information.

It is true that the dimension “nSCHISM_vgrid_layers” is missing from the “out2d*” outputs. If I understand correctly, this makes the interpolation not possible also for other variables as the out2d seems to be necessary for all of them (even with “ifile=2" in “interpolate_variables.in”).

It is nice to hear that this works well for the shadow VIMS forecast. Because the shadow grid seems to differs slightly from the stofs one (and I couldn’t find shadow staticfiles), I couldn’t try it. Anyways, I’m happy to have news if changes are made in the stofs3d outputs,

Thanks again,

Cheers, Pierre

feiye-vims commented 1 month ago

@pierrechabert

I'm working with Zizang from the operational team to fix the issue. Although it is an easy fix, it may take some time for any change to be incorporated in the operational forecast.

If you would like to try the shadow forecast, here are the static files: https://ccrm.vims.edu/yinglong/feiye/Public/v7_static_inputs_20240521/ , and here is the aws link to the outputs: https://noaa-nos-stofs3d-pds.s3.amazonaws.com/index.html#STOFS-3D-Atl-shadow-VIMS/ However, the shadow forecast may have missing dates due to the long queue time on Frontera recently.