Ocean Modeling Discussion

ROMS/TOMS

Search for:
It is currently Thu Oct 18, 2018 10:25 pm




Post new topic Reply to topic  [ 9 posts ] 

All times are UTC

Author Message
 Post subject: Weights file
PostPosted: Sun May 22, 2016 7:43 pm 
Offline

Joined: Wed Apr 13, 2016 7:37 pm
Posts: 25
Location: University of Sao Paulo (USP)
Hi all,
I am trying to generate boundary file from HYCOM-NCODA data using as background pyroms/examples. My grid was generate through Seagrid. The problem is I get an error while this process, which I think is probably related with the weight file ("wts_file"). The question: how do I get this file? Is this file really necessary to generate Bry files from HYCOM ?
Just another brief question: Why does some people use Cli and Bry files at the same input file (ocean.in)? Are not Climatology and Bry different methodologies?

Thanks in advance.

Fernando Tulio Camilo Barreto


Top
 Profile  
Reply with quote  
 Post subject: Re: Weights file
PostPosted: Sun May 22, 2016 8:42 pm 
Offline
User avatar

Joined: Wed Jul 02, 2003 5:29 pm
Posts: 3515
Location: IMS/UAF, USA
In all of the interpolating, you need to run "python make_remap_weights_file.py" before creating the boundary files. I thought I wrote that somewhere, but it's not in the examples/README.

I always start with just the boundary files and not the climatology nudging. Then, depending on the quality of the boundary results, I might decide to resort to the climatology nudging as well. It just depends on the domain and the boundary file used. Some combinations result in strong boundary currents, some don't. I'm talking about unsightly currents along the domain boundary in the open ocean.


Top
 Profile  
Reply with quote  
 Post subject: Re: Weights file
PostPosted: Sun May 22, 2016 10:03 pm 
Offline

Joined: Wed Apr 13, 2016 7:37 pm
Posts: 25
Location: University of Sao Paulo (USP)
Thank you, I managed to generate the weight files.
During make_bdry I got the following error in the temperature part:
''ValueError: operands could not be broadcast together with shapes (117,124) (119,126)''

I tracked down the error as belonging to flood_fast.py in the following part:

if kk == 0:
c3 = np.ones(mask.shape).astype(bool)
else:
c3 = np.isnan(varz[max(k-kk,0),:,:]) == 0
c = c1 & c2 & c3

It enters in else.

The numbers are related with my HYCOM file (I am using reanalysis), which presents the dimension
Dimensions:
MT = 1
Y = 119
X = 126
Depth = 33

Do you have any idea of this error's cause. Should my input Hycom file be square, or something like that?

Thank you a lot


Top
 Profile  
Reply with quote  
 Post subject: Re: Weights file
PostPosted: Mon May 23, 2016 12:06 pm 
Offline

Joined: Wed Dec 03, 2014 1:46 am
Posts: 35
Location: University of Georgia
Hi Fernando,

this error is more related to python. If you quickly take a look you'll see that your HYCOM data domain is bigger than your grid/mask_rho maybe. I am not sure what domain has the shape (117,124), but try to re-run this command and always make the command name_of_your_array.shape() to see if at least in the flood part they have the same shapes. I hope this help a bit.

Cheers,

Matheus


Top
 Profile  
Reply with quote  
 Post subject: Re: Weights file
PostPosted: Wed May 25, 2016 2:00 pm 
Offline

Joined: Wed Apr 13, 2016 7:37 pm
Posts: 25
Location: University of Sao Paulo (USP)
Hi Matheus, thanks a lot for your reply.
After checking the flood_fast.py file In realized that 4 2d arrays are generated in the section, MASK, C1, C2, C3. The shape of C2 and C3 is 119-126 (equal Hycom's), although the shape of MASK and C1 is 117-124, which causes the error. I set MASK and C1 to C2, which solved my problem (The files were generated). However the results are not correct, of course, since I spoiled mask. What I've gotta do now is to increase the dimension o MASK (from 117-124 to 119-126). I think it is my only way out, I really have no idea of the reason why MASK is being generated with -2 points in each dimension (C1 is created from MASK)

Thanks a lot,

Fernando T C Barreto


Top
 Profile  
Reply with quote  
 Post subject: Re: Weights file
PostPosted: Wed May 25, 2016 9:10 pm 
Offline

Joined: Wed Dec 03, 2014 1:46 am
Posts: 35
Location: University of Georgia
Hi Fernando,

it will seem a dumb question but have you interpolated first the temp data to your grid?

Matheus


Top
 Profile  
Reply with quote  
 Post subject: Re: Weights file
PostPosted: Thu Jun 16, 2016 10:46 am 
Offline

Joined: Fri Jul 12, 2013 5:46 pm
Posts: 1
Location: CNRS
Hi Fernando,

I had the same problem with the c1, c2 and c3 arrays and I found that when you create the HYCOM grid with the get_hycom_GLBa0.08_grid script, you have to do it with two more nodes than those you actually need, because, for some reason, the longitude and latitude vector that is used in the weights calculations and remapping only uses the interior grid nodes.

If you check get_hycom_GLBa0.08_grid that is in the examples/Arctic_HYCOM you'll see that the grid is using the following:

lon = dataset.variables['Longitude'][2100-1:,550-1:4040+1]
lat = dataset.variables['Latitude'][2100-1:,550-1:4040+1]

But in the get_hycom_GLBa0.08_temp the grid is defined using:

lon = dataset.variables['Longitude'][2100:,550:4040]
lat = dataset.variables['Latitude'][2100:,550:4040]

So the temp, salt, etc grid use only the interior points of the HYCOM grid.

Hope this helps,
Joao


Top
 Profile  
Reply with quote  
 Post subject: Re: Weights file
PostPosted: Tue Nov 22, 2016 9:24 pm 
Offline

Joined: Wed Apr 13, 2016 7:37 pm
Posts: 25
Location: University of Sao Paulo (USP)
Hi João,
thanks a lot for your help. Sorry for the late reply, I was working in other projects and completely forgot the thread.
You are completely right,
Thank you

Regards,

Fernando.


Top
 Profile  
Reply with quote  
 Post subject: Re: Weights file
PostPosted: Mon Jun 11, 2018 1:53 pm 
Offline

Joined: Tue Aug 22, 2017 5:38 pm
Posts: 8
Location: Second Institute of Oceanography
joaob wrote:
Hi Fernando,

I had the same problem with the c1, c2 and c3 arrays and I found that when you create the HYCOM grid with the get_hycom_GLBa0.08_grid script, you have to do it with two more nodes than those you actually need, because, for some reason, the longitude and latitude vector that is used in the weights calculations and remapping only uses the interior grid nodes.

If you check get_hycom_GLBa0.08_grid that is in the examples/Arctic_HYCOM you'll see that the grid is using the following:

lon = dataset.variables['Longitude'][2100-1:,550-1:4040+1]
lat = dataset.variables['Latitude'][2100-1:,550-1:4040+1]

But in the get_hycom_GLBa0.08_temp the grid is defined using:

lon = dataset.variables['Longitude'][2100:,550:4040]
lat = dataset.variables['Latitude'][2100:,550:4040]

So the temp, salt, etc grid use only the interior points of the HYCOM grid.

Hope this helps,
Joao


Hi Joao,
you also help me when I make weight file ,thank you very much! :D

WangQian


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group