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

Generating SZ vgrid with pyschism #86

Closed BahramKhazaei-NOAA closed 1 year ago

BahramKhazaei-NOAA commented 1 year ago

I think it would be very useful if the capability for writing SZ-type vgrid.in files with more than 1 layer (for 3D modeling) is considered in future developments.

https://github.com/schism-dev/pyschism/blob/main/pyschism/mesh/vgrid.py

cuill commented 1 year ago

@BahramKhazaei-NOAA I was wrong. This capability is already in pyschism. The script to generate SZ vgrid is:

import numpy as np
from pyschism.mesh.vgrid import SZ

nvrt = 20
gd = SZ(h_s=1.e6, ztot=[-1.e6], h_c=30, theta_b=0.7, theta_f=5., sigma=np.linspace(-1, 0, nvrt))
gd.write('vgrid.in.S', overwrite=True)
BahramKhazaei-NOAA commented 1 year ago

@cuill Thank you for following up. I tested and it worked. This is very helpful.

Jung-ocean commented 4 months ago

Hi all, @BahramKhazaei-NOAA @cuill

My name is Jihun who started learning the SCHISM model.

I have a question about following vgrid.py code lines:

180  class SZ(Vgrid):
...
264  @property
265  def nvrt(self):
266  return self.sigma.shape[0]

In this case, the nvrt is always the number of sigma layer regardless of the number of z layer (kz). Could you tell me if this is right?

josephzhang8 commented 4 months ago

nvrt is the sum of S and Z. In any case, try to use LSC^2 instead.

Jung-ocean commented 4 months ago

Thanks @josephzhang8 ! I will try to use LSC^2 instead of SZ.