ESMG / pyroms

Python tools for the Regional Ocean Modeling System (ROMS)
Other
141 stars 88 forks source link

Importing ERROR while pyroms & pyroms_toolbox #32

Closed sameerCoder closed 3 years ago

sameerCoder commented 3 years ago

import pyroms Traceback (most recent call last): File "", line 1, in File "/home/user/python_learn_newfolder/pyroms/pyroms/pyroms/init.py", line 14, in from . import hgrid File "/home/user/python_learn_newfolder/pyroms/pyroms/pyroms/hgrid.py", line 22, in from mpl_toolkits.basemap import Basemap File "/home/user/anaconda3/envs/pyroms1/lib/python3.8/site-packages/mpl_toolkits/basemap/init.py", line 26, in from matplotlib.cbook import dedent ImportError: cannot import name 'dedent' from 'matplotlib.cbook' (/home/user/anaconda3/envs/pyroms1/lib/python3.8/site-packages/matplotlib/cbook/init.py) import pyroms_toolbox Traceback (most recent call last): File "", line 1, in File "/home/user/python_learn_newfolder/pyroms/pyroms_toolbox/pyroms_toolbox/init.py", line 12, in from .iview import iview File "/home/user/python_learn_newfolder/pyroms/pyroms_toolbox/pyroms_toolbox/iview.py", line 4, in from mpl_toolkits.basemap import Basemap File "/home/user/anaconda3/envs/pyroms1/lib/python3.8/site-packages/mpl_toolkits/basemap/init.py", line 26, in from matplotlib.cbook import dedent ImportError: cannot import name 'dedent' from 'matplotlib.cbook' (/home/user/anaconda3/envs/pyroms1/lib/python3.8/site-packages/matplotlib/cbook/init.py)

I have installed as per suggested and my installation was successful as well. Kindly let me know how to solve this error. I will really appreciate this help. Thank you.

sameerCoder commented 3 years ago

yup after changing lon_rho/lat_rho : lon/lat in roms file & xt_ocean/yt_ocean : lon /lat Progress happened but now the index Error as File "/home/sakib/Desktop/own_download_pyroms/pyroms/examples/Arctic_HYCOM_GLBy/remap_clm.py", line 138, in remap_clm print('before vertical remap 1', dst_varz[:,928,324]) IndexError: index 928 is out of bounds for axis 1 with size 757

kshedstrom commented 3 years ago

You've got choices - comment out those print statements or print out a point within your grid.

sameerCoder commented 3 years ago

Hi @kshedstrom, Hope you are very well. Here in INDIA situation is very bad due to COVID19. Soon the things will be good in INDIA. Coming to generation of Initial Condition and Boundary Condition. Initial condition Generation is excellent . Many Many Thank you for this. but Boundary Condition I am not getting the values which is required. Such as - 1- Boundary Condition values are correct but it's indexing system is wrong . showing the data in j index value instead of k. 2- Boundary Condition only showing one time stamp instead of 30 days timestamps(whole one month i am running).

MY Boundary Condition making code :


import matplotlib
matplotlib.use('Agg')

import subprocess
import os
import sys
import numpy as np
from multiprocessing import Pool
#import pdb

#increase the maximum number of open files allowed
#import resource
#resource.setrlimit(resource.RLIMIT_NOFILE, (3000,-1))

import pyroms
import pyroms_toolbox

from remap_bdry import remap_bdry
from remap_bdry_uv import remap_bdry_uv

lst_year = sys.argv[1:]
print("lst_year:",lst_year)
data_dir = '/home/msa/Desktop/own_download_pyroms/pyroms/examples/Arctic_HYCOM_GLBy/'
dst_dir='/home/msa/Desktop/own_download_pyroms/pyroms/examples/Arctic_HYCOM_GLBy/bdry/'

lst_file = []
for year in lst_year:
    lst = subprocess.getoutput('ls ' + data_dir + 'Godas_uvsshts_jan_' + year + '_.nc')
#   lst = subprocess.getoutput('ls ' + data_dir + 'HYCOM_GLBy0.08_' + year + '*')
#    lst = subprocess.getoutput('ls ' + data_dir + 'HYCOM_GLBy0.08_' + year + '_0*')
#    lst = subprocess.getoutput('ls ' + data_dir + 'HYCOM_GLBy0.08_' + year + '_0[4-9]*')
    lst = lst.split()
    lst_file = lst_file + lst

print('Build OBC file from the following file list:')
print(lst_file)
print(' ')

src_grd_file = data_dir  +'Godas_uvsshts_jan_2019_.nc'
src_grd = pyroms_toolbox.Grid_HYCOM.get_nc_Grid_HYCOM2(src_grd_file)
dst_grd = pyroms.grid.get_ROMS_grid('GODASROMS')
def do_file(file):
    zeta = remap_bdry(file, 'SSH', src_grd, dst_grd, dst_dir=dst_dir)
    dst_grd2 = pyroms.grid.get_ROMS_grid('GODASROMS', zeta=zeta)
    remap_bdry(file, 'temp', src_grd, dst_grd2, dst_dir=dst_dir)
    remap_bdry(file, 'salt', src_grd, dst_grd2, dst_dir=dst_dir)
#   pdb.set_trace()
    remap_bdry_uv(file, src_grd, dst_grd2, dst_dir=dst_dir)

    # merge file
    bdry_file = dst_dir + file.rsplit('/')[-1][:-3] + '_bdry_' + dst_grd.name + '.nc'

    out_file = dst_dir + file.rsplit('/')[-1][:-3] + '_SSH_bdry_' + dst_grd.name + '.nc'
    command = ('ncks', '-a', '-O', out_file, bdry_file)
    subprocess.check_call(command)
    os.remove(out_file)
    out_file = dst_dir + file.rsplit('/')[-1][:-3] + '_temp_bdry_' + dst_grd.name + '.nc'
    command = ('ncks', '-a', '-A', out_file, bdry_file)
    subprocess.check_call(command)
    os.remove(out_file)
    out_file = dst_dir + file.rsplit('/')[-1][:-3] + '_salt_bdry_' + dst_grd.name + '.nc'
    command = ('ncks', '-a', '-A', out_file, bdry_file)
    subprocess.check_call(command)
    os.remove(out_file)
    out_file = dst_dir + file.rsplit('/')[-1][:-3] + '_u_bdry_' + dst_grd.name + '.nc'
    command = ('ncks', '-a', '-A', out_file, bdry_file)
    subprocess.check_call(command)
    os.remove(out_file)
    out_file = dst_dir + file.rsplit('/')[-1][:-3] + '_v_bdry_' + dst_grd.name + '.nc'
    command = ('ncks', '-a', '-A', out_file, bdry_file)
    subprocess.check_call(command)
    os.remove(out_file)

processes = 4
p = Pool(processes)
results = p.map(do_file, lst_file)

I am not getting Any Error. ncdump -h Godas_uvsshts_jan2019.nc netcdf Godas_uvsshts_jan2019 { dimensions: xt = 720 ; bnds = 2 ; yt = 410 ; xt_ocean = 720 ; yt_ocean = 410 ; xu_ocean = 720 ; yu_ocean = 410 ; zt_ocean = 40 ; time = UNLIMITED ; // (31 currently)

Can you please guide me why only one timestamp i am getting even i have 30 timestamp in my source godas data? I will really Appreciate you. Thank you.

sameerCoder commented 3 years ago

My Boundary condition show data image I think my file should be k=1:40 and L-index will be L=1:31(for jan month) let me know where i am making mistake Any Help will be Appreciable. Thank you.

kshedstrom commented 3 years ago

I've heard things are bad in India, sorry about that. Things are also not great in Fairbanks, with the hospital full of angry, younger, unvaccinated people - when vaccines are available for all. People are acting unwisely in bars and some churches.

When I was making boundary files from HYCOM, the HYCOM variables are in one file per day. I loop over all the files and then concatenate the outputs into one file. If all your records are in one file, you have to loop over all the times in that file. The file you show is going to run on four processes and it wants to split it up by files - you'll have to rewrite that logic. The easy thing is to make it serial, strip out the multiprocessing.

The boundary file should look something like:

netcdf HYCOM_GLBy_2019_bdry {
dimensions:
    s_rho = 50 ;
    s_w = 51 ;
    eta_rho = 1090 ;
    xi_rho = 690 ;
    ocean_time = UNLIMITED ; // (349 currently)
    eta_u = 1090 ;
    xi_u = 689 ;
    eta_v = 1089 ;
    xi_v = 690 ;
    eta_psi = 1089 ;
    xi_psi = 689 ;
variables:
    double theta_s ;
        theta_s:long_name = "S-coordinate surface control parameter" ;
     :
    double ocean_time(ocean_time) ;
        ocean_time:long_name = "time" ;
        ocean_time:units = "days since 1900-01-01 00:00:00" ;
        ocean_time:field = " " ;
    double zeta_north(ocean_time, xi_rho) ;
        zeta_north:_FillValue = -30000. ;
        zeta_north:long_name = "free-surface north boundary condition" ;
        zeta_north:units = "meter" ;
        zeta_north:field = "zeta_north, scalar, series" ;
    :
    double temp_north(ocean_time, s_rho, xi_rho) ;
        temp_north:_FillValue = -30000. ;
        temp_north:long_name = "potential temperature north boundary condition" ;
        temp_north:units = "Celsius" ;
        temp_north:field = "temp_north, scalar, series" ;
    double temp_south(ocean_time, s_rho, xi_rho) ;
        temp_south:_FillValue = -30000. ;
        temp_south:long_name = "potential temperature south boundary condition" ;
        temp_south:units = "Celsius" ;
        temp_south:field = "temp_south, scalar, series" ;
    double temp_east(ocean_time, s_rho, eta_rho) ;
        temp_east:_FillValue = -30000. ;
        temp_east:long_name = "potential temperature east boundary condition" ;
        temp_east:units = "Celsius" ;
        temp_east:field = "temp_east, scalar, series" ;
    double temp_west(ocean_time, s_rho, eta_rho) ;
        temp_west:_FillValue = -30000. ;
        temp_west:long_name = "potential temperature west boundary condition" ;
        temp_west:units = "Celsius" ;
        temp_west:field = "temp_west, scalar, series" ;
kshedstrom commented 3 years ago

Example of looping over records:

time = root.variables['ocean_time'][:]
for t in range(len(time)):
      <do something with record[t]>
sameerCoder commented 3 years ago

Hi , Take care @kshedstrom This Covid19 is really very dangerous. Even after having negative Report still virus has bad impact on body. Take care alot. Be safe Be bold.

Coming to creation of boundary condition I am getting Error after changing the remap_bdry.py when second iteration of time loop in remap_bdry.py i am getting Error. Error coming is : -

write data in destination file
time bhai: 1
Traceback (most recent call last):
  File "mkebdry.py", line 64, in <module>
    zeta = remap_bdry(file1, 'SSH', src_grd, dst_grd, dst_dir=dst_dir)
  File "/home/msa/Desktop/own_download_pyroms/pyroms/examples/Arctic_HYCOM_GLBy/remap_bdry.py", line 51, in remap_bdry
    spval = src_var._FillValue
AttributeError: 'MaskedArray' object has no attribute '_FillValue'

As suggested i made by make_bdry.py file as single process file. My make_bdry.py just creating only zeta ssh parameter, rest parameters i commented.

import os

#file1=input("Enter the Godas full filename:")
file1=("Godas_uvsshts_jan_2019_.nc")
print("Build OBC file from the following file {}.".format(file1))
#directory=input("Enter Absolute Godas file path(Directory path):")
print("os getcwd:",os.getcwd())
directory=os.getcwd()
dst_dir=directory
src_grd=pyroms_toolbox.Grid_HYCOM.get_nc_Grid_HYCOM2(directory+"/"+file1)
dst_grd=pyroms.grid.get_ROMS_grid('GODASROMS')
print("Source grid:",src_grd)
#def do_file(file):
zeta = remap_bdry(file1, 'SSH', src_grd, dst_grd, dst_dir=dst_dir)
dst_grd2 = pyroms.grid.get_ROMS_grid('GODASROMS', zeta=zeta)
#remap_bdry(file1, 'temp', src_grd, dst_grd2, dst_dir=dst_dir)
#remap_bdry(file1, 'salt', src_grd, dst_grd2, dst_dir=dst_dir)
#   pdb.set_trace()
#msa comment remap_bdry_uv(file1, src_grd, dst_grd2, dst_dir=dst_dir)
print("#"*45)
    # merge file
bdry_file = dst_dir + file1.rsplit('/')[-1][:-3] + '_bdry_' + dst_grd.name + '.nc'

out_file = dst_dir + file1.rsplit('/')[-1][:-3] + '_SSH_bdry_' + dst_grd.name + '.nc'
command = ('ncks', '-a', '-O', out_file, bdry_file)
subprocess.check_call(command)
os.remove(out_file)
#out_file = dst_dir + file1.rsplit('/')[-1][:-3] + '_temp_bdry_' + dst_grd.name + '.nc'
#command = ('ncks', '-a', '-A', out_file, bdry_file)
#subprocess.check_call(command)
#os.remove(out_file)
#out_file = dst_dir + file1.rsplit('/')[-1][:-3] + '_salt_bdry_' + dst_grd.name + '.nc'
#command = ('ncks', '-a', '-A', out_file, bdry_file)
#subprocess.check_call(command)
#os.remove(out_file)
#out_file = dst_dir + file1.rsplit('/')[-1][:-3] + '_u_bdry_' + dst_grd.name + '.nc'
#command = ('ncks', '-a', '-A', out_file, bdry_file)
#subprocess.check_call(command)
#os.remove(out_file)
#out_file = dst_dir + file1.rsplit('/')[-1][:-3] + '_v_bdry_' + dst_grd.name + '.nc'
#command = ('ncks', '-a', '-A', out_file, bdry_file)
#subprocess.check_call(command)
#os.remove(out_file)
print("current working directory:",os.getcwd())
print("All task done !!!")

Above make_bdry.py is correct isn't it ?

######################################

coming to add more timestamp into my final nc file.

I edited remap_bdry.py as below

class nctime(object):
    pass

def remap_bdry(src_file, src_varname, src_grd, dst_grd, dxy=20, cdepth=0, kk=2, dst_dir='./'):

    print(src_file)

    # get time
    nctime.long_name = 'time'
    nctime.units = 'days since 1900-01-01 00:00:00'

    # create boundary file
    dst_file = src_file.rsplit('/')[-1]
    dst_file = dst_dir + dst_file[:-3] + '_' + src_varname + '_bdry_' + dst_grd.name + '.nc'
    print('\nCreating boundary file', dst_file)
    if os.path.exists(dst_file) is True:
        os.remove(dst_file)
    pyroms_toolbox.nc_create_roms_bdry_file(dst_file, dst_grd, nctime)
    # open boundary file
    nc = netCDF.Dataset(dst_file, 'a', format='NETCDF3_64BIT')
    #load var
    cdf = netCDF.Dataset(src_file)
    src_var = cdf.variables[src_varname]
    #msa COMMENTED THIS LINE --------time = cdf.variables['time'][0]
    **time=cdf.variables['time'][:]
    print("time:",time)
    for t in range(len(time)):
        print("time bhai:",t)**
        #get missing value
        spval = src_var._FillValue
        src_var = cdf.variables[src_varname][t]
        # determine variable dimension
        ndim = len(src_var.shape)
        if src_varname == 'SSH':
            pos = 't'
            Cpos = 'rho'
            z = src_grd.z_t
            Mp, Lp = dst_grd.hgrid.mask_rho.shape
            dst_varname = 'zeta'
            dimensions = ('time', 'eta_rho', 'xi_rho')
            long_name = 'free-surface'
            dst_varname_north = 'zeta_north'
            dimensions_north = ('time', 'xi_rho')
            long_name_north = 'free-surface north boundary condition'
            field_north = 'zeta_north, scalar, series'
            dst_varname_south = 'zeta_south'
            dimensions_south = ('time', 'xi_rho')
            long_name_south = 'free-surface south boundary condition'
            field_south = 'zeta_south, scalar, series'
            dst_varname_east = 'zeta_east'
            dimensions_east = ('time', 'eta_rho')
            long_name_east = 'free-surface east boundary condition'
            field_east = 'zeta_east, scalar, series'
            dst_varname_west = 'zeta_west'
            dimensions_west = ('time', 'eta_rho')
            long_name_west = 'free-surface west boundary condition'
            field_west = 'zeta_west, scalar, series'
            units = 'meter'
        elif src_varname == 'temp':
            pos = 't'
            Cpos = 'rho'
            z = src_grd.z_t
            Mp, Lp = dst_grd.hgrid.mask_rho.shape
            dst_varname = 'temperature'
            dst_varname_north = 'temp_north'
            dimensions_north = ('time', 's_rho', 'xi_rho')
            long_name_north = 'potential temperature north boundary condition'
            field_north = 'temp_north, scalar, series'
            dst_varname_south = 'temp_south'
            dimensions_south = ('time', 's_rho', 'xi_rho')
            long_name_south = 'potential temperature south boundary condition'
            field_south = 'temp_south, scalar, series'
            dst_varname_east = 'temp_east'
            dimensions_east = ('time', 's_rho', 'eta_rho')
            long_name_east = 'potential temperature east boundary condition'
            field_east = 'temp_east, scalar, series'
            dst_varname_west = 'temp_west'
            dimensions_west = ('time', 's_rho', 'eta_rho')
            long_name_west = 'potential temperature west boundary condition'
            field_west = 'temp_west, scalar, series'
            units = 'Celsius'
        elif src_varname == 'salt':
            pos = 't'
            Cpos = 'rho'
            z = src_grd.z_t
            Mp, Lp = dst_grd.hgrid.mask_rho.shape
            dst_varname = 'salinity'
            dst_varname_north = 'salt_north'
           dimensions_north = ('time', 's_rho', 'xi_rho')
            long_name_north = 'salinity north boundary condition'
            field_north = 'salt_north, scalar, series'
            dst_varname_south = 'salt_south'
            dimensions_south = ('time', 's_rho', 'xi_rho')
            long_name_south = 'salinity south boundary condition'
            field_south = 'salt_south, scalar, series'
            dst_varname_east = 'salt_east'
            dimensions_east = ('time', 's_rho', 'eta_rho')
            long_name_east = 'salinity east boundary condition'
            field_east = 'salt_east, scalar, series'
            dst_varname_west = 'salt_west'
            dimensions_west = ('time', 's_rho', 'eta_rho')
            long_name_west = 'salinity west boundary condition'
            field_west = 'salt_west, scalar, series'
            units = 'PSU'
        else:
            raise ValueError('Undefined src_varname')

        if ndim == 3:
            # build intermediate zgrid
            zlevel = -z[::-1,0,0]
            nzlevel = len(zlevel)
            dst_zcoord = pyroms.vgrid.z_coordinate(dst_grd.vgrid.h, zlevel, nzlevel)
            dst_grdz = pyroms.grid.ROMS_Grid(dst_grd.name+'_Z', dst_grd.hgrid, dst_zcoord)

        # create variable in boudary file
        print('Creating variable', dst_varname_north)
        nc.createVariable(dst_varname_north, 'f8', dimensions_north, fill_value=spval)
        nc.variables[dst_varname_north].long_name = long_name_north
        nc.variables[dst_varname_north].long_name = long_name_north
        nc.variables[dst_varname_north].units = units
        nc.variables[dst_varname_north].field = field_north

        print('Creating variable', dst_varname_south)
        nc.createVariable(dst_varname_south, 'f8', dimensions_south, fill_value=spval)
        nc.variables[dst_varname_south].long_name = long_name_south
        nc.variables[dst_varname_south].units = units
        nc.variables[dst_varname_south].field = field_south

        print('Creating variable', dst_varname_east)
        nc.createVariable(dst_varname_east, 'f8', dimensions_east, fill_value=spval)
        nc.variables[dst_varname_east].long_name = long_name_east
        nc.variables[dst_varname_east].units = units
        nc.variables[dst_varname_east].field = field_east

        print('Creating variable', dst_varname_west)
        nc.createVariable(dst_varname_west, 'f8', dimensions_west, fill_value=spval)
        nc.variables[dst_varname_west].long_name = long_name_west
        nc.variables[dst_varname_west].units = units
        nc.variables[dst_varname_west].field = field_west

        # remapping
        print('remapping', dst_varname, 'from', src_grd.name, \
                  'to', dst_grd.name)
        print('time =', time)

        if ndim == 3:
           print('flood the grid')
            src_varz = pyroms_toolbox.Grid_HYCOM.flood_fast(src_var, src_grd, pos=pos, spval=spval, \
                                    dxy=dxy, cdepth=cdepth, kk=kk)
        else:
            src_varz = src_var

        # horizontal interpolation using scrip weights
        print('horizontal interpolation using xESMF')
        dst_varz = regrid_GLBy(src_varz, method='nearest_s2d')

        if ndim == 3:
            # vertical interpolation from standard z level to sigma
            print('vertical interpolation from standard z level to sigma')
            dst_var_north = pyroms.remapping.z2roms(dst_varz[::-1, Mp-1:Mp, :], \
                              dst_grdz, dst_grd, Cpos=Cpos, spval=spval, \
                              flood=False, irange=(0,Lp), krange=(Mp-1,Mp))
            dst_var_south = pyroms.remapping.z2roms(dst_varz[::-1, 0:1, :], \
                              dst_grdz, dst_grd, Cpos=Cpos, spval=spval, \
                              flood=False, irange=(0,Lp), krange=(0,1))
            dst_var_east = pyroms.remapping.z2roms(dst_varz[::-1, :, Lp-1:Lp], \
                              dst_grdz, dst_grd, Cpos=Cpos, spval=spval, \
                              flood=False, irange=(Lp-1,Lp), krange=(0,Mp))
            dst_var_west = pyroms.remapping.z2roms(dst_varz[::-1, :, 0:1], \
                              dst_grdz, dst_grd, Cpos=Cpos, spval=spval, \
                              flood=False, irange=(0,1), krange=(0,Mp))
        else:
            dst_var_north = dst_varz[-1, :]
            dst_var_south = dst_varz[0, :]
            dst_var_east = dst_varz[:, -1]
            dst_var_west = dst_varz[:, 0]
       # write data in destination file
        print('write data in destination file')
        nc.variables['time'][t] = time #**here also i changed nc.variables['time'][0] to nc.variables['time'][t] all below [0] index to [t]**
        nc.variables[dst_varname_north][t] = np.squeeze(dst_var_north)
        nc.variables[dst_varname_south][t] = np.squeeze(dst_var_south)
        nc.variables[dst_varname_east][t] = np.squeeze(dst_var_east)
        nc.variables[dst_varname_west][t] = np.squeeze(dst_var_west)

        # close file
        nc.close()
        cdf.close()

    if src_varname == 'SSH':#these two lines are out of above for loop.
            return dst_varz

Any Help will be Appreciable. Thank you.

sameerCoder commented 3 years ago

Hi @kshedstrom Hope you everything is fine. I have solved the timestamp problem but still stuck at depth k problem I am getting k depth as null. Can you please guide me how to solve the k depth problem , I should get k 1;40 which i am getting in my final file. please let me know where i have to change the code line. either j value should be shift to k or k i have to create. For reference final month file detail as below:

yes? use month.nc 
           *** NOTE: Coordinates out of order or missing on axis time at subscript 31
           *** NOTE: A dummy axis of subscripts will be used
           *** NOTE:
           *** NOTE: Could not adjust grid for variable h
           *** NOTE: Axes in grids may be inconsistent.
           *** NOTE:
           *** NOTE: Could not adjust grid for variable lon_u
           *** NOTE: Axes in grids may be inconsistent.
           *** NOTE:
           *** NOTE: Could not adjust grid for variable lon_v
           *** NOTE: Axes in grids may be inconsistent.
yes? show data
     currently SET data sets:
    1> ./month.nc  (default)
 name     title                             I         J         K         L
 THETA_S  S-coordinate surface control pa  ...       ...       ...       ...
 THETA_B  S-coordinate bottom control par  ...       ...       ...       ...
 TCLINE   S-cordinate surface/bottom laye  ...       ...       ...       ...
 HC       S-coordinate parameter, critica  ...       ...       ...       ...
 CS_R     S-coordinate stretching curves   ...       1:50      ...       ...
 CS_W     S-coordinate stretching curves   1:51      ...       ...       ...
 H        bathymetry at RHO-points         1:1081    1:757     ...       ...
 TIME     time                             ...       ...       ...       1:31
       (invalid coordinate axis)
 ZETA_NORTH
          free-surface north boundary con  1:1081    ...       ...       1:31
 ZETA_SOUTH
          free-surface south boundary con  1:1081    ...       ...       1:31
 ZETA_EAST
          free-surface east boundary cond  1:757     ...       ...       1:31
 ZETA_WEST
          free-surface west boundary cond  1:757     ...       ...       1:31
 TEMP_NORTH
          potential temperature north bou  1:1081    1:50      ...       1:31
 TEMP_SOUTH
          potential temperature south bou  1:1081    1:50      ...       1:31
 TEMP_EAST
          potential temperature east boun  1:757     1:50      ...       1:31
 TEMP_WEST
          potential temperature west boun  1:757     1:50      ...       1:31
 SALT_NORTH
          salinity north boundary conditi  1:1081    1:50      ...       1:31
 SALT_SOUTH
          salinity south boundary conditi  1:1081    1:50      ...       1:31
 SALT_EAST
          salinity east boundary conditio  1:757     1:50      ...       1:31
 SALT_WEST
          salinity west boundary conditio  1:757     1:50      ...       1:31
 PM       curvilinear coordinate metric i  1:1081    1:757     ...       ...
 PN       curvilinear coordinate metric i  1:1081    1:757     ...       ...
 LON_RHO  longitude of RHO-points          1:1081    1:757     ...       ...
 LAT_RHO  latitude of RHO-points           1:1081    1:757     ...       ...
 LON_U    longitude of U-points            1:1080    1:757     ...       ...
 LAT_U    latitude of U-points             1:1080    1:757     ...       ...
 LON_V    longitude of V-points            1:1081    1:756     ...       ...
 LAT_V    latitude of V-points             1:1081    1:756     ...       ...
 LON_PSI  longitude of PSI-points          1:1080    1:756     ...       ...
 LAT_PSI  latitude of PSI-points           1:1080    1:756     ...       ...
 ANGLE    angle between XI-axis and EAST   1:1081    1:757     ...       ...
 MASK_RHO mask on RHO-points               1:1081    1:757     ...       ...
 MASK_U   mask on U-points                 1:1080    1:757     ...       ...
 MASK_V   mask on V-points                 1:1081    1:756     ...       ...
 MASK_PSI mask on PSI-points               1:1080    1:756     ...       ...
 U_NORTH  3D u-momentum north boundary co  1:1080    1:50      ...       1:31
 U_SOUTH  3D u-momentum south boundary co  1:1080    1:50      ...       1:31
 U_EAST   3D u-momentum east boundary con  1:757     1:50      ...       1:31
 U_WEST   3D u-momentum west boundary con  1:757     1:50      ...       1:31
 UBAR_NORTH
          2D u-momentum north boundary co  1:1080    ...       ...       1:31
 UBAR_SOUTH
          2D u-momentum south boundary co  1:1080    ...       ...       1:31
 UBAR_EAST
          2D u-momentum east boundary con  1:757     ...       ...       1:31
 UBAR_WEST
          2D u-momentum west boundary con  1:757     ...       ...       1:31
 V_NORTH  3D v-momentum north boundary co  1:1081    1:50      ...       1:31
 V_SOUTH  3D v-momentum south boundary co  1:1081    1:50      ...       1:31
 V_EAST   3D v-momentum east boundary con  1:756     1:50      ...       1:31
 V_WEST   3D v-momentum west boundary con  1:756     1:50      ...       1:31
 VBAR_NORTH
          2D v-momentum north boundary co  1:1081    ...       ...       1:31
 VBAR_SOUTH
          2D v-momentum south boundary co  1:1081    ...       ...       1:31
 VBAR_EAST
          2D v-momentum east boundary con  1:756     ...       ...       1:31
 VBAR_WEST
          2D v-momentum west boundary con  1:756     ...       ...       1:31

yes? 

Any Help will be Appreciable. Thank you.

kshedstrom commented 3 years ago

So you are getting 50 depths instead of 40. You tell it how many levels in the gridid.txt file:

id      = ARCTIC5
name    = ARCTIC5
grdfile = /import/AKWATERS/kshedstrom/gridpak/Arctic5/grid_Arctic_5.nc
N       = 50
grdtype = roms
Vtrans  = 4 
theta_s = 7 
theta_b = 2 
Tcline  = 250 

A lot of my examples have N=50. Do you have such a chunk in your gridid.txt?

sameerCoder commented 3 years ago

@kshedstrom Thanks for your reply and help. I am really honor and pleased that i am clearing my doubts and you are so kind kind hearted and helpful person. I am getting confuse in my j index there is not only 1:50 but some of the places 1:757 as well. I think k value is not writing itself. image and i have gridid.txt there before it changed N=40 but still same scenario. I am using previous IC created regrid_t.nc file, is it fine to use the same regrid_tc.nc file in Boundary condition creation. and i am not able to find the python script where the gridid.txt was read and variable values were assigned from gridid.txt. can you guide me please what was the python script name where gridid.txt file was read . is the python script regrid_Glby.py or make_remap_weights_file.py Any Help will be Appreciable. Thank you.

kshedstrom commented 3 years ago

If you are using xESMF, you do not need to run make_remap_weights_file.py. The file reading gridid.txt is make_bdry_file.py, the line with pyroms.grig.get_ROMS_grid('MYGRID'), where 'MYGRID' points to your grid blob in gridid.txt.

Using the old regrid_t.nc should be fine. It has the lateral remap weights, not the vertical ones.

I have no idea what code you are using to parse your output, but U_NORTH with 1:1080, 1:50 would be fine if you had 50 vertical levels.

sameerCoder commented 3 years ago

Great its done now its showing j 1:40 Question 1 -but how to show depth in k index instead of j ? i.e K 1:40 image

Question 2- I am using ncrcat to merge all the daily files to montly file ncrcat day*.nc month.nc Is there any better approch to merge the daily files to montly single file ? Any Help will be Appreciable. Thank you.

kshedstrom commented 3 years ago

Like I said, I have no idea what software you are using to show this. Therefore I can't tell you how to teach it about k.

Using ncrcat is what I do too. I don't know a better way.

sameerCoder commented 3 years ago

@kshedstrom ferret i am using to see the data. Below is ncdump of the nc file. image Any Help will be Appreciable. Thank you.

kshedstrom commented 3 years ago

The file is likely to be fine at this point. Next is to look at it in ncview and/or see if ROMS will happily read it.

sameerCoder commented 3 years ago

Hi @kshedstrom Thank for such a wonderful Support. You are really a very kind heart person and very very helpful person. I sincerely appreciate your support. Your generous help has made an impact. Because of your help I am able to make a setup. I appreciate the information and advice you have shared. I am looking forward to implementing many of your suggestions, In fact I will love to work under your guidance, Please let me know If you have any work related to software development or script. Please accept my deepest thanks.