New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
#2691 (Weighted interpolation for the initiale conditions and the bdy) – NEMO

Opened 3 years ago

Last modified 3 years ago

#2691 new Request

Weighted interpolation for the initiale conditions and the bdy

Reported by: lambertn Owned by: systeam
Priority: low Milestone:
Component: MULTIPLE Version: v4.0.*
Severity: minor Keywords: BDY, istate, fld_read, interpolation, weights
Cc: nicolas.lambert@…

Description

Context

I change the code in NEMO4.0 so it is now possible to use the weight files to do an interpolation "on-the-fly" for the initial conditions and the bdy values (3D fields). It was already possible to use this feature for the atmospherics forcing but the operation was not available for those inputs. The land/sea mask and the vector pairing options were implemented as well. To pair u2d and u3d separately, simply used different keyword starting with U and V (e.g., U_2d <=> V_2d ; U_3d <=> V_3d ). To activate, simply add the relevant key words in the last 3 available slots when defining the input parameters (same way as the atm. conditions).
IMPORTANT : for the bdy, the weight files need to cover the entire domain. The simplest way to do it is to use the same weight files as the initial conditions.

And I made the vertical interpolation available for the initial conditions (via ln_zinterp) and it works like for the bdy (gdep[tuv] and e3[tuv] need to be present in the inputs files). Both options, the weight files and the vertical interpolation, can be activated at the same time so inputs fields with a different horizontal grid and different vertical divisions and be automatically integrated in the simulation. But in that case, the land/sea mask and nn_lsm>0 are almost mandatory to avoid using dry cells in both horizontal or vertical interpolation.

Proposal

I had some variables in the namelist as follows :

&namtsd        !    Temperature & Salinity Data  (init/dmp)             (default: OFF)
+++ nn_lsm      = 0
+++ ln_zinterp  = .false. 
/
&nambdy_dta
+++ nn_lsm      = 0
/

Those variables are used in other groups of the namelist (e.g. &namsbc) but they need to be specified again for the istate and the bdy so values can be different.


I made changes in those files to integrate the new functionality (files coming soon in a tar) :

minor changes : bdydta.F90, dtatsd.F90, istate.F90, sbcblk.F90, sbcflx.F90
major changes : fldread.F90

Some comments : This functionality is working well but some rough edges could be smoother. Particularly the way the fldread routine deals with the 2D fields that could have a z dimension of "one". And the land/sea mask need to be the same dimension as the variable (u2d => 2D, u3d => 3D) and this could be changed to use the 3D mask for all the variables (2D => only take the top layer). And overall, there can be more "diagnostic message" around this feature so the user will be advice when the option are misaligned.

Commit History (0)

(No commits)

Attachments (1)

Ticket_2691.tar (530.0 KB) - added by lambertn 3 years ago.
Files changed with this ticket.

Download all attachments as: .zip

Change History (3)

Changed 3 years ago by lambertn

Files changed with this ticket.

comment:1 follow-up: Changed 3 years ago by jamesharle

Hi Nicolas,
FYI this feature would also solve 6 year old ticket #1579!
I also have some code in NEMO4.0 to interpolate initial conditions when the vertical grids differ (either number of levels or sigma coordinates ln_sco etc), but your solution sounds a more complete one. I'll grab the code, have a test and report back.
All the best
James

comment:2 in reply to: ↑ 1 Changed 3 years ago by lambertn

Replying to jamesharle:

Hi Nicolas,
FYI this feature would also solve 6 year old ticket #1579!
I also have some code in NEMO4.0 to interpolate initial conditions when the vertical grids differ (either number of levels or sigma coordinates ln_sco etc), but your solution sounds a more complete one. I'll grab the code, have a test and report back.
All the best
James

Hi.
I did not used this code with sigma coordinates but with partial steps. I hope it will do the tric anyway.
Nicolas

Note: See TracTickets for help on using tickets.