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.
ticket/1430_WETTING_AND_DRYING – NEMO
wiki:ticket/1430_WETTING_AND_DRYING

Version 2 (modified by acc, 9 years ago) (diff)

--

1430_WETTING_AND_DRYING Branch developments carried out by Hedong Liu (NOC, Liverpool) Merge preparations and these notes completed by Andrew Coward (NOC, Southampton)

Page describing 2015 developments concerning wetting and drying and preparations to bring branches into a merge-ready state.

(Recent) History

This year's development has occurred on two branches. Initially: branches/2015/dev_r4826_NOC_WAD which was created from the trunk@4826 and was associated with ticket #1430. More recently, a fresh start was made in branches/2015/dev_r5803_NOC_WAD from the trunk@5803. There is no ticket associated with this branch and no record of the reason behind the restart but it appears that all changes have been transplanted from dev_r4826_NOC_WAD which should be considered frozen. These notes refer to current work to tidy and test the dev_r5803_NOC_WAD branch prior to the 2015 merge.

Step 1. Merging trunk changes between revision 5803 and the current HEAD (rev 5869)

The first priority is to bring this branch up to date with the trunk. Since this will include the major simplification changes that have already been made on the trunk there is a danger that the actual Wetting and drying changes will be obscured. It is therefore worth noting that prior to this step changes on the branch occurred only in the following modules:

NEMOGCM/NEMO/OPA_SRC/DOM/domzgr.F90
NEMOGCM/NEMO/OPA_SRC/DOM/dom_oce.F90
NEMOGCM/NEMO/OPA_SRC/DOM/domvvl.F90
NEMOGCM/NEMO/OPA_SRC/nemogcm.F90
NEMOGCM/NEMO/OPA_SRC/DYN/sshwzv.F90
NEMOGCM/NEMO/OPA_SRC/DYN/dynspg_ts.F90
NEMOGCM/NEMO/OPA_SRC/DYN/wadlmt.F90
NEMOGCM/NEMO/OPA_SRC/DYN/dynhpg.F90
NEMOGCM/CONFIG/AMM12/cpp_AMM12.fcm
NEMOGCM/CONFIG/cfg.txt

and the last two can be ignored since they introduce unwanted changes (a non-reference configuration and unwanted cpp key changes to an existing configuration).

After merging there were conflicts to resolve in nearly all these files but many were simply name changes (for example: e12t has become e1e2t). All conflicts were resolved.

Step 2 Improving code layout and modularity

Further examination of the code revealed some unwanted redundant code (essentially commented out debug statements) and some inappropriate coding practises. Chief amongst the latter was the failure to modularise correctly. Variables associated with wetting and drying were defined in dom_oce.F90 instead of their own module and there was no easily identified initialisation routine. It does appear, however, that all wetting and drying additions have been correctly contained within logical blocks that are not activated unless ln_wad=.true.. It is also clear from the above list that entries to the reference name list and documentation are missing.

The following rectification steps were taken:

  1. Renaming wadlmt.F90 to wetdry.F90 and, internally, its module from wad_lmt to wet_dry.
  2. Moving variable and array declarations from dom_oce.F90 to wetdry.F90
  3. Introducing a wad_init routine to wetdry.F90 and relocating name list reading and allocations to this routine
  4. Removal of all redundant code and styling of remaining code
  5. Introducing "USE wet_dry" statements in those modules previously relying on the presence of dom_oce. The full list is currently: domvvl.F90, domzgr.F90, dynhpg.F90, dynspg_ts.F90, nemogcm.F90, sshwzv.F90

After these changes, dom_oce.F90 is identical to the trunk version and nemogcm.F90 changes are limited to:

diff dev_r5803_NOC_WAD/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90 NEMOGCM/NEMO/OPA_SRC/nemogcm.F90
35d34
<    !!            3.6.?! 2015-11  (H. Liu) Add Wetting and Drying 
90d88
<    USE wet_dry         ! Wetting and drying setting   (wad_init routine)
398d394
<                             CALL     wad_init   ! Wetting and drying options

The following was also added to the reference name list:

!-----------------------------------------------------------------------
&namwad  !   Wetting and drying
!-----------------------------------------------------------------------
   ln_wd             = .false.  ! T/F activation of wetting and drying
   rn_wdmin1         =  0.1     ! Minimum wet depth on dried cells
   rn_wdmin2         =  0.01    ! Tolerance of min wet depth on dried cells
   rn_wdld           =  20.0    ! Land elevation below which wetting/drying is allowed
   nn_wdit           =  10      ! Max iterations for W/D limiter
/

Finally the full set of SETTE tests were run and passed:

GYRE        restartability  passed
ORCA2LIMPIS restartability  passed
ORCA2OFFPIS restartability  passed
AMM12       restartability  passed
ORCA2LIM3   restartability  passed
SAS         restartability  inconclusive (  solver.stat  not found )
GYRE        reproducibility passed
ORCA2LIMPIS reproducibility passed
ORCA2OFFPIS reproducibility passed
AMM12       reproducibility passed
ORCA2LIM3   reproducibility passed
SAS         reproducibility inconclusive (  solver.stat  not found )

These changes were submitted to the branch at revision 5870 with the following commit message:

Branch 2015/dev_r5803_NOC_WAD. Merge in trunk changes from 5803 to 5869 in preparation for merge. Also tidied and reorganised some wetting and drying code. 
Renamed wadlmt.F90 to wetdry.F90. Wetting drying code changes restricted to domzgr.F90, domvvl.F90 nemogcm.F90 sshwzv.F90, dynspg_ts.F90, wetdry.F90 and 
dynhpg.F90. Code passes full SETTE tests with ln_wd=.false.. Still awaiting test case for checking with ln_wd=.true.

Step 3. To do

  1. Try to extract some documentation
  2. Obtain a test configuration to test the restyled code with ln_wd=.true.