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.
2016WP/Simplif2-CNRS-simona (diff) – NEMO

Changes between Version 2 and Version 3 of 2016WP/Simplif2-CNRS-simona


Ignore:
Timestamp:
2016-03-09T18:47:18+01:00 (8 years ago)
Author:
acc
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • 2016WP/Simplif2-CNRS-simona

    v2 v3  
    6666}}} 
    6767Once the PI has completed this section, he should send a mail to the previewer(s) asking them to preview the work within two weeks. 
     68 
     69------------------------------------------------------------------ 
     70= Jointly Agreed Plan (in discussion with previewer) = 
     71The goal of this action is to continue Simplification started with ticket 1608, and 
     72https://forge.ipsl.jussieu.fr/nemo/wiki/ticket/1593_CNRS9_NOC3_LDF. For this action we 
     73will re-define interface between NEMO core and configurations and update all reference 
     74documentation to reflect the changes made. 
     75 
     76Configuration dependent code can be considered in four functional groups: 
     77 
     781. Domain setting 
     792. Initial state 
     803. Forcing  
     814. Physics 
     82 
     83=== Phase 1: === 
     84 
     85 
     86The first phase is to create a GYRE configuration which has no configuration dependent 
     87code in the standard modules.  This will be achieved by moving code in each of the 
     88functional groups (where appropriate) into 'user defined' modules which can be dropped 
     89into a MY_SRC directory and which are called by generic function names. Calls to these 
     90generic routines should be placed at appropriate points to be activated by suitable 
     91namelist switches. In the GYRE case this will involve relocating the following code 
     92segments: 
     93 
     94{{{ 
     95(Domain) : CASE 5 for jphgr_msh in dom_hgr (two segments: grid and corolis); 
     96           single tanh function from zgr_z. 
     97(Initial): istate_gyre in istate.F90 
     98(Forcing): sbc_gyre in sbcana.F90 
     99(Physics): None 
     100}}} 
     101 
     102Remove specific calls to *_gyre routines and verify results using the 'user defined' 
     103routines 
     104 
     105=== Phase 2: === 
     106 
     107The second phase of this task is to introduce a method of reading all domain settings from 
     108external files. Currently this is done for horizontal grid information if jphgr_msh=0 but 
     109there is no similar mechanism for the vertical grid. For a complete domain description 
     110(ignoring the possibility of iceshelves, for now) the following data are required: 
     111 
     112 
     113{{{ 
     114gphi[t,u,v,f], glam[t,u,v,f], e[1,2][t,u,v,f] ( and optionally e1e2[u,v] )  
     115gdep[t,w]_0 gdep[t,w]_1d 
     116e3[t,w,u,v,f]_0 e3[t,w,u,v,f]_1d 
     117tmask 
     118jperio, ln_zps, ln_zco, ln_sco, ln_isfcav 
     119}}} 
     120 
     121 
     122Note [u,v,f]masks can be derived from tmask. A configuration-dependent fmask, in 
     123particular, should be considered as a physics choice since it can be used to increase 
     124lateral friction. 
     125 
     126The phase 2 task is therefore to introduce code to produce a mesh and mask file with all 
     127the required content (by changing/adding to nn_msh options). A new namelist parameter can 
     128then be added (jpzgr_msh) such that when jpzgr_msh = 0,  a new routine, zgr_read, called 
     129in domzgr will read the vertical grid information from the mesh and mask file:  
     130 
     131{{{ 
     132SELECT CASE( jpzgr_msh )   !  type of vertical grid   
     133! 
     134CASE ( 0 )                     !==  read in domain.nc file  ==! 
     135   ! 
     136   IF(lwp) WRITE(numout,*) 
     137   IF(lwp) WRITE(numout,*) '          vertical grid read in "domain" file' 
     138   ! 
     139   CALL zgr_read() 
     140   ! add code to build mbathy from tmask: needed in zgr_bot_level  
     141   ! possibly build bathy too from gdepw_0 ; after zgr_bot_level? is it needed? 
     142   ! 
     143CASE DEFAULT 
     144   ! 
     145   ! Build the vertical coordinate system 
     146   ! ------------------------------------ 
     147   CALL zgr_z            ! Reference z-coordinate system (always called) 
     148   CALL zgr_bat          ! Bathymetry fields (levels and meters) 
     149   IF( lk_c1d      )   CALL lbc_lnk( bathy , 'T', 1._wp )   ! 1D config.: same bathy value over the 3x3 domain 
     150   IF( ln_zco      )   CALL zgr_zco          ! z-coordinate 
     151   IF( ln_zps      )   CALL zgr_zps          ! Partial step z-coordinate 
     152   IF( ln_sco      )   CALL zgr_sco          ! s-coordinate or hybrid z-s coordinate 
     153   ! 
     154   ! final adjustment of mbathy & check  
     155   ! ----------------------------------- 
     156   IF( .NOT.lk_c1d )   CALL zgr_bat_ctl      ! check bathymetry (mbathy) and suppress isolated ocean points 
     157END SELECT 
     158   IF( lzoom       )   CALL zgr_bat_zoom     ! correct mbathy in case of zoom sub 
     159                       CALL zgr_bot_level    ! deepest ocean level for t-, u- and v-points 
     160                       CALL zgr_top_level    ! shallowest ocean level for T-, U-, V- points 
     161}}} 
     162 
     163Note: The same domain file read in zgr_read is also to be accessed in hgr_read for the 
     164horizontal grid information (jphgr_msh=0). 
     165 
     166The ability to reproduce results from all reference configurations using the external 
     167files to define the domain should be verified at this stage. 
     168 
     169=== Phase 3: === 
     170 
     171 
     172The third phase will be to identify configuration dependent physics code and replicate the 
     173functions (or case statement blocks) either by providing user defined functions or reading 
     174appropriate fields from external files. The afore-mentioned fmask modifications are one 
     175example which could be replaced by reading a modified fmask from an external file. 
     176 
     177After this phase it should be possible to run an ORCA2 configuration with no hardcoded 
     178references in the trunk code. 
     179 
     180=== Phase 4: === 
     181 
     182Following success with phases 1-3 the next stage will be to systematically break down the 
     183multiple functionality in routines such as domhgr into separate examples of user-defined 
     184routines (in this case a set of routines, each of which sets a different vertical grid). 
     185Care should be taken to standardise subroutine arguments with inputs and return fields 
     186clearly documented. These new routines should be moved into the appropriate MY_SRC 
     187directory of a reference configuration or into a new directory under TOOLS or 
     188MISCELLANEOUS if they are not actively used in any of the reference configurations. 
     189domhgr.F90 and domzgr.F90, in particular, should be greatly simplified by this procedure. 
     190 
     191=== Phase 5 === 
     192  
     193Incorporate necessary additions to the domain.nc file to support ISF active configurations 
     194(misfdep, risfdep?) and check for possible redundancy in domain.nc (i.e. are all the 
     195fields really required?). Not sure _1d arrays are, for example? 
     196 
     197Finally check that documentation has been kept up to date. 
    68198 
    69199== Preview ==