JMMP-Group / GO_coordination

Repository to coordinate the joint development of GOSI configurations
6 stars 0 forks source link

GOSI10: NEMO optimisation and porting #2

Open oceanaguiar opened 10 months ago

oceanaguiar commented 10 months ago
dcalve commented 9 months ago

Delivery estimates

oceanaguiar commented 7 months ago

I've added Tim Graham here (action after the last JMMP-GO meeting) for consultation on the time-step to adopt for NEMO, ensuring we use the same value for forced and coupled model runs.

dcalve commented 5 months ago

Potential issues from the NEMO 5 port

These are a list of potential issues from the NEMO 5 beta release notes identified by Diego and myself.

atb299 commented 5 months ago

@dcalve , @oceandie , thanks for this breakdown, it is really helpful! Regarding:

My personal preference would be to make use of the namelist_ref and namelist_cfg, with only changes relevant to a configuration in the namelist_cfg. There have been other 'gotchas' in the past where the default behaviour has changed (e.g. with the EOS back in v3.6, or the way ln_closea is handled in v4 > v4.2), so keeping conscious choices separate from unconscious choices can be helpful. That said, I don't work a lot with rose suites, and there are utilities around that can cleanly separate just the _cfg changes from a rose generated namelist.

dcalve commented 2 months ago

See #22

dcalve commented 2 months ago

Code changes when moving from VVL to QCO (key_qco)

Overview

When key_qco is used, various arrays associated with the vertical coordinate system are substituted for arithmetic expressions via CPP macros defined in src/OCE/DOM/domzgr_substitute.h90. For example:

#   define  e3t(i,j,k,t)   (e3t_0(i,j,k)*(1._wp+r3t(i,j,t)*tmask(i,j,k)))
#   define  e3u(i,j,k,t)   (e3u_0(i,j,k)*(1._wp+r3u(i,j,t)*umask(i,j,k)))
#   define  e3v(i,j,k,t)   (e3v_0(i,j,k)*(1._wp+r3v(i,j,t)*vmask(i,j,k)))
#   define  e3f(i,j,k)     (e3f_0(i,j,k)*(1._wp+r3f(i,j)*fmask(i,j,k)))
#   define  e3w(i,j,k,t)   (e3w_0(i,j,k)*(1._wp+r3t(i,j,t)))
#   define  e3uw(i,j,k,t)  (e3uw_0(i,j,k)*(1._wp+r3u(i,j,t)))
#   define  e3vw(i,j,k,t)  (e3vw_0(i,j,k)*(1._wp+r3v(i,j,t)))

These were introduced in NEMO 4.2 as a replacement for VVL and are now the only option in NEMO 5.0.

The macros are a bit more complicated in NEMO 5.0 due to the introduction of key_vco* CPP keys. E.g. e3t in the above example becomes:

# if defined key_vco_1d
#   define  e3t(i,j,k,t)   (e3t_1d(k)*(1._wp+r3t(i,j,t)*tmask(i,j,k)))
# elif defined key_vco_1d3d || defined key_vco_3d
#   define  e3t(i,j,k,t)   (e3t_3d(i,j,k)*(1._wp+r3t(i,j,t)*tmask(i,j,k)))
# endif

In summary, QCO causes several vertical coordinate arrays in the NEMO source code to be replaced by algebraic expressions during the preprocessing step of compilation. The main purpose of this is to reduce memory consumption- in the above examples, e3t is no longer a 4D variable but instead comprised of 2D and 3D variables. A very small impact on results should be expected.

More information can be found in the migration section of the NEMO user guide and in this ticket.

Implications

These array changes should generally have little impact, but some use cases to bear in mind are:

These will generally cause compilation failures, and so should be easy to spot.

oceandie commented 2 months ago

Thanks @dcalve, very clear! One thing - do you know by any chance if we have say on how to document / explain things/changes in the manual and/or official web pages? For example, I think the way the key_qco is explained in relation to the type of vertical coordinates available in NEMO in migration section is not correct and misleading for the users ...

dcalve commented 2 months ago

The manual and user guide have their own repositories:

We are definitely encouraged to contribute to these and any changes go through a review process like the NEMO code. New versions are generally published with each NEMO release, so any corrections or clarifications you would like to make for the NEMO 5 release would be very much appreciated!