training on pyroms ARCTIC2

Discussion about analysis, visualization, and collaboration tools and techniques

Moderators: arango, robertson

Post Reply
Message
Author
mdessert
Posts: 18
Joined: Thu Mar 15, 2018 3:00 pm
Location: EXWEXs - Plouzané - France

training on pyroms ARCTIC2

#1 Unread post by mdessert »

Hello everyone,
I'm trying to use the pyroms tools to create my own files for initializing, defining boundaries and forcing. As the files I want to use are from HYCOM outputs (from GLBv0.08), I first want to train on the Arctic_HYCOM example. To do it, I need a definition of the grid ARCTIC2 (that I could then add into my gridid.txt). Could someone help me to find these few text lines?
Thanks a lot,
Morgane

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

Re: training on pyroms ARCTIC2

#2 Unread post by kate »

The few lines you're asking for are:
id = ARCTIC2
name = ARCTIC2
grdfile = /archive/u1/uaf/AKWATERS/kshedstrom/gridpak/Arctic2/grid_Arctic_2.nc
N = 50
grdtype = roms
Vtrans = 4
theta_s = 7
theta_b = 2
Tcline = 250
The grid file itself is rather large, not a great starter grid.

mdessert
Posts: 18
Joined: Thu Mar 15, 2018 3:00 pm
Location: EXWEXs - Plouzané - France

Re: training on pyroms ARCTIC2

#3 Unread post by mdessert »

Thanks a lot! :)

mdessert
Posts: 18
Joined: Thu Mar 15, 2018 3:00 pm
Location: EXWEXs - Plouzané - France

Re: training on pyroms ARCTIC2

#4 Unread post by mdessert »

Hello everyone,
I try to interpolate some HYCOM output fields (temperature, salinity, ssh and wind velocity) to a ROMS grid thanks the pyroms tools. To achieve that, I try to reproduce the HYCOM_Arctic example from the examples directory. Yet, I succeed in interpolating the ssh from HYCOM GLBa0.08 to an ARCTIC2 grid.

Code: Select all

#----------------------------------------------------------------------------
#I defined ARCTIC2 grid with these characteristics : 
#----------------------------------------------------------------------------
Lp = 160
Mp = 300

# define the 4 corners of the grid
# first point is the top left corner then counter clock wise rotation
lon0=-20.5
lat0=80.8
lon1=20.75
lat1=80.8
lon2=20.75
lat2=48.75
lon3=-20.5
lat3=48.75
 …
hmin = 10.0
…
rx0_max = 0.2
…
gridid='ARCTIC2'
grd_name = 'ARCTIC2'
…
#----------------------------------------------------------------------------
That's means that :
  • I've well downloaded files from HYCOM.org.
    I've formatted them through get_hycom_GLBa0.08_'varname'_2014.py.
    I've built my source grid through get_hycom_GLBa0.08_grid.py.
    I've computed my weigth files from make_remap_weights_file.py.
    And then, I've 'concatenated' all my variable files to obtain one big file HYCOM_GLBa0.08_2014_095.nc.
    I've modified my make_ic_file.py while adding a “exit()” line just after the computation of the ssh on the destinated grid (because, I realize something was wrong with the interpolation of my following variables).

Code: Select all

#----------------------------------------------------------------------------
# remap
zeta = remap(file, 'ssh', src_grd, dst_grd, dst_dir=dst_dir)
exit() # <= the lien I added
st_grd = pyroms.grid.get_ROMS_grid('ARCTIC2', zeta=zeta)
#----------------------------------------------------------------------------
The scripts built a new ssh which seems to be OK.
Image

Then, I modified only the destination grid (actually, I tried a grid in the South Africa and keep exactly the same gridid parameters as ARCTIC2 to define the vertical grid) and I adapted the scripts get*.py , make_remap*.py, merge*.ksh, remap.py, remap_uv.py and make_ic_file*.py from the HYCOM_Arctic example to stay coherent.

Code: Select all

#----------------------------------------------------------------------------
#I defined an other grid with these characteristics : 
#----------------------------------------------------------------------------

#Grid dimension
Lp = 280 # i-direction
Mp = 230 # j-direction


# define the 4 corners of the grid
# first point is the top left corner then counter clock wise rotation
lon0=-2.5
lat0=-4.8
lon1=54.75
lat1=-4.8
lon2=54.75
lat2=-46.75
lon3=-2.5
lat3=-46.75
…
hmin = 10.0
…
rx0_max = 0.2
…
gridid='NEW_GRID'
grd_name = 'NEW_GRID'
#----------------------------------------------------------------------------------------
While the grid file seems OK (mask is correct), the scripts built a interpolated ssh file with errors in the mash and abnormal values of ssh (FillValue in the ocean).

Image

My source grid is well larger than my destination grid. I've verified that my longitudes and latitudes were defined the same than the example... Actually, I've no more ideas to test and I though that someone on the forum could have some new ones...

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

Re: training on pyroms ARCTIC2

#5 Unread post by kate »

When downloading HYCOM, pyroms expects the HYCOM grid file to be two grid cells larger in all directions than the other HYCOM files. Do you have that? It would be good to recode things so that that's not necessary, but we're not there yet.

Because of the North Pole, the Arctic is an especially challenging domain. There might be Arctic hacks that you don't want for a mid-latitude domain. We should provide examples for both kinds of domains - sorry about that.

mdessert
Posts: 18
Joined: Thu Mar 15, 2018 3:00 pm
Location: EXWEXs - Plouzané - France

Re: training on pyroms ARCTIC2

#6 Unread post by mdessert »

Thanks a lot!
Indeed, I did not notice the modification in the index as downloading the HYCOM files. Now, my ssh interpolation works correctly.


And at the same time, that explains the error I received after the ssh interpolation, as computing the interpolation of the following variables.

Code: Select all

Traceback (most recent call last):
  File "make_ic_file.py", line 29, in <module>
    remap(file, 'temp', src_grd, dst_grd, dst_dir=dst_dir)
  File "/home/mdessert/pyroms/mytools/caretta_test/remap.py", line 127, in remap
    dxy=dxy, cdepth=cdepth, kk=kk)
  File "/home/mdessert/usr/conda/envs/seasnake/lib/python3.6/site-packages/pyroms_toolbox/Grid_HYCOM/flood_fast.py", line 87, in flood_fast
    c = c1 & c2 & c3
Then, from some extra "print", I learned that :

Code: Select all

 grd.mask_t size = (33, 656, 4498)
 grd.mask_t[0,:,:] size = (656, 4498)
C1 size : (656, 4496)
C2 size : (658, 4496) #=> and I did not understand why these mask was bigger  ! It is from the mash while the two others are directly from the variable!
C3 size : (656, 4496)
Thanks you very much for these explanations !

Post Reply