pyschism icon indicating copy to clipboard operation
pyschism copied to clipboard

Adding vgrid support for PySCHISM

Open saeed-moghimi-noaa opened this issue 2 years ago • 7 comments

@cuill @BahramKhazaei-NOAA A place holder to follow up with Portugal team for their python implementation and more advanced methods

saeed-moghimi-noaa avatar Jul 17 '23 14:07 saeed-moghimi-noaa

Let's consider incorporating LSC2 vgrid generation in pyschism.

@cuill Please provide us additional resources you have regarding that.

BahramKhazaei-NOAA avatar Jul 19 '23 15:07 BahramKhazaei-NOAA

@BahramKhazaei-NOAA We mainly use this Fortran script to generate vqs vgrid for STOFS3D: https://github.com/schism-dev/schism/blob/master/src/Utility/Pre-Processing/STOFS-3D-Atl-shadow-VIMS/Pre_processing/Vgrid/gen_vqs.f90

pylib has a script to generate this type of vgrid: https://github.com/wzhengui/pylibs/blob/master/pyScripts/gen_vqs.py

cuill avatar Jul 19 '23 20:07 cuill

@BahramKhazaei-NOAA @cuill @SorooshMani-NOAA

Would you test the script and suggest how we may implement this within the pyschim framework?

Thanks, -Saeed

saeed-moghimi-noaa avatar Jul 19 '23 22:07 saeed-moghimi-noaa

@BahramKhazaei-NOAA @cuill @SorooshMani-NOAA

Would you test the script and suggest how we may implement this within the pyschim framework?

Thanks, -Saeed @cuill This is very good to start with. Thanks for sharing. @saeed-moghimi-noaa I will test the script shortly.

BahramKhazaei-NOAA avatar Jul 20 '23 12:07 BahramKhazaei-NOAA

I tested the script provided and it works for cases where hsm and nv increase constantly by +1.

However if I tried to use a custom nv (e.g., [2,4,6,8,11,14,17,20,20]) it would result in NaN sigma values, please see the vgrid.in below: vgrid_py_nan

To solve this I had to modify the script, you can see the jupyter notebook here.

I also changed the way the file is written, so it matches the LSC2 format.

I was able to run SCHISM with the vgrid I created.

felicio93 avatar Apr 26 '24 20:04 felicio93

@josephzhang8 @feiye-vims

We here at OCS want to push for implementing a lsc2-based vgrid support for PySCHISM.

What do you recommend? We want to make sure you guy are not already developing a solution so we don't duplicate work.

@saeed-moghimi-noaa, feel free to add here if I am missing anything,

felicio93 avatar Apr 26 '24 20:04 felicio93

We're not developing a LSC2 vgrid support under pyschism.

Please go ahead.

Thanks! Fei

feiye-vims avatar Apr 26 '24 20:04 feiye-vims