pyroms error during initial condition remapping process

Discussion about analysis, visualization, and collaboration tools and techniques

Moderators: arango, robertson

Post Reply
Message
Author
nilodna
Posts: 6
Joined: Thu May 02, 2013 6:38 pm
Location: Oceanographic Institute from University of Sao Pau

pyroms error during initial condition remapping process

#1 Unread post by nilodna »

Hi!

First of all, I hope you all are safe and healthy in your homes during this pandemic.

I'm trying to interpolate initial fields from SODA3.3.1 to my domain, but during the zeta remapping process I've got this error:

Code: Select all

/home/danilo/Research/PhD/repos/pyroms/pyroms_toolbox/pyroms_toolbox/nc_create_roms_file.py:51: UserWarning: WARNING: valid_min cannot be safely cast to variable dtype
  nc.variables['s_rho'].valid_min = '-1.0'
/home/danilo/Research/PhD/repos/pyroms/pyroms_toolbox/pyroms_toolbox/nc_create_roms_file.py:52: UserWarning: WARNING: valid_max cannot be safely cast to variable dtype
  nc.variables['s_rho'].valid_max = '0.0'
/home/danilo/Research/PhD/repos/pyroms/pyroms_toolbox/pyroms_toolbox/nc_create_roms_file.py:58: UserWarning: WARNING: valid_min cannot be safely cast to variable dtype
  nc.variables['s_w'].valid_min = '-1.0'
/home/danilo/Research/PhD/repos/pyroms/pyroms_toolbox/pyroms_toolbox/nc_create_roms_file.py:59: UserWarning: WARNING: valid_max cannot be safely cast to variable dtype
  nc.variables['s_w'].valid_max = '0.0'
/home/danilo/Research/PhD/repos/pyroms/pyroms_toolbox/pyroms_toolbox/nc_create_roms_file.py:65: UserWarning: WARNING: valid_min cannot be safely cast to variable dtype
  nc.variables['Cs_r'].valid_min = '-1.0'
/home/danilo/Research/PhD/repos/pyroms/pyroms_toolbox/pyroms_toolbox/nc_create_roms_file.py:66: UserWarning: WARNING: valid_max cannot be safely cast to variable dtype
  nc.variables['Cs_r'].valid_max = '0.0'
/home/danilo/Research/PhD/repos/pyroms/pyroms_toolbox/pyroms_toolbox/nc_create_roms_file.py:72: UserWarning: WARNING: valid_min cannot be safely cast to variable dtype
  nc.variables['Cs_w'].valid_min = '-1.0'
/home/danilo/Research/PhD/repos/pyroms/pyroms_toolbox/pyroms_toolbox/nc_create_roms_file.py:73: UserWarning: WARNING: valid_max cannot be safely cast to variable dtype
  nc.variables['Cs_w'].valid_max = '0.0'
Traceback (most recent call last):
  File "initial_cond_soda.py", line 34, in <module>
    zeta = remap('ssh', filein, src_grd, dst_grd, zeta_dst_file, dst_dir=dst_dir)
  File "/home/danilo/Research/PhD/ROMS/routines/pyroms_soda/Initials/remap.py", line 135, in remap
    dst_varz = pyroms.remapping.remap(src_varz, wts_file, spval=spval)
  File "/home/danilo/Research/PhD/repos/pyroms/pyroms/pyroms/remapping/remap.py", line 65, in remap
    dst_add, src_add, tmp_src_array)
ValueError: unexpected array size: new_size=1, got array with arr_size=0
Digging a little, it appears that this is caused because the variable num_links is zero and, since it is used to create an array [tmp_map_wts = np.zeros((num_links,4))], the error occurs.

Does anyone have any idea on how to solve or what is leading to this problem?

I'll appreciate any comments.

PS: If helps, I'm using the CCS1_SODA3.3.1 example as a guide, provided by the pyroms repository on github, and I create a simple numerical grid with 10km resolution and with ETOPO bathymetry.

User avatar
kate
Posts: 4088
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: pyroms error during initial condition remapping process

#2 Unread post by kate »

I think perhaps you need to change this in make_ic_file.py: xrange=(400, 500), yrange=(180, 280)
To save time, it doesn't search the whole world, but just the part of the world where your grid is (or in this case where the CCS1 grid is). In my case, num_links is rather large:

Code: Select all

netcdf remap_weights_SODA3.3.1_to_CCS_10_bilinear_t_to_rho {
dimensions:
	src_grid_size = 10201 ;
	dst_grid_size = 43264 ;
	src_grid_corners = 4 ;
	dst_grid_corners = 4 ;
	src_grid_rank = 2 ;
	dst_grid_rank = 2 ;
	num_links = 141880 ;
	num_wgts = 1 ;

nilodna
Posts: 6
Joined: Thu May 02, 2013 6:38 pm
Location: Oceanographic Institute from University of Sao Pau

Re: pyroms error during initial condition remapping process

#3 Unread post by nilodna »

Thank you, Kate.

I was setting the limits for my domain. However, I was careless and mistaken xrange for yrange in both make_weights and make_initial routines.

Your comment raised my attention to this specific line and I solved the problem.

Once again, thank you.

Post Reply