schism-dev / pyschism

Python interface for handling the SCHISM model.
https://schism-dev.github.io/schism/master/getting-started/pre-processing-with-pyschism/overview.html
Apache License 2.0
23 stars 18 forks source link

Adding vgrid support for PySCHISM #87

Open saeed-moghimi-noaa opened 1 year ago

saeed-moghimi-noaa commented 1 year ago

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

BahramKhazaei-NOAA commented 12 months ago

Let's consider incorporating LSC2 vgrid generation in pyschism.

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

cuill commented 12 months ago

@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

saeed-moghimi-noaa commented 12 months ago

@BahramKhazaei-NOAA @cuill @SorooshMani-NOAA

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

Thanks, -Saeed

BahramKhazaei-NOAA commented 12 months ago

@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.

felicio93 commented 2 months ago

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 commented 2 months ago

@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,

feiye-vims commented 2 months ago

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

Please go ahead.

Thanks! Fei