Skip to content
endaodea edited this page Nov 2, 2021 · 18 revisions

Table of contents

  1. Some notes on using adhoc code to create a NEMO 4.0.x WEAD CFG FILE
  2. Sample Namelists
  3. What the changes in the code does
  4. Other out of date CEOD comments
  5. Code to write out data
  6. Sample Outputs

Some notes on using this Ad-hoc code to create a NEMO 4.0.X WAD CFG fILE

Most important note is not to rely on this code. Ideally we need to get NEMO tools to do this in the first place.

Key parts of the namelist are:

&namzgr_sco
ln_s_sf12=.true.,
ln_s_sh94=.false.,
ln_sigcrit=.true.,
rn_alpha=4.4,
rn_bb=0.8,
rn_efold=0.0,
rn_hc=60,
rn_rmax=0.1,
rn_sbot_max=10000.0,
rn_sbot_min=1.0e-5,
rn_theta=6.0,
rn_thetb=1.0,
rn_zb_a=0.024,
rn_zb_b=-0.2,
rn_zs=1.0,
/

and

&namdom
ldbletanh=.false.,
nn_bathy=1,
nn_msh=1,
ppa0=999999.0,
ppa1=999999.0,
ppa2=999999.0,
ppacr=9.0,
ppacr2=999999.0,
ppdzmin=6.0,
ppe1_deg=999999.0,
ppe1_m=999999.0,
ppe2_deg=999999.0,
ppe2_m=999999.0,
ppglam0=999999.0,
ppgphi0=999999.0,
pphmax=5720.0,
ppkth=23.563,
ppkth2=999999.0,
ppsur=999999.0,
rn_bathy=100.0,
rn_rdt=60.0,
rn_wd_ref_depth=10.0,
/

rn_wd_ref_depth = 10 . means we set the reference level as 10 m. In a non WAD case this might be 0 m. We also need to set a minimum s bot level to some small >0 value.

Note for SF12 Coordinates they use the value of rn_hc to go form pure sigma to s coordinates. on a regular grid that is set as 50 m as in AMM15 we have 50 levels. To get that to occur in the same place wit the reference height of 10 m we need to change that to 60 m. rn_hc=60,

The key piece of src code is:

https://github.com/endaodea/DOMAINCFG_BASED_ON_36_NEMO/blob/main/NEMOGCM/NEMO/OPA_SRC/DOM/domzgr.F90

in particular zgr_sco: https://github.com/endaodea/DOMAINCFG_BASED_ON_36_NEMO/blob/eb765e0019ba3f76fff14300ef71dc50765de0ea/NEMOGCM/NEMO/OPA_SRC/DOM/domzgr.F90#L1762

Other setups are under the same directory, e.g the case where we explicitly set the minimum depth to 10 m (no WAD).

Sample Namelists

Sample namelists are under: https://github.com/endaodea/DOMAINCFG_BASED_ON_36_NEMO/tree/main/namelist

note the reference namelist is just that and the cfg one is the one where we have changed things.

There is also a sample output of where the two are merge, and a sample of ocean.output from NEMO itself.

What the changes in the code do

First off it ensures the points in the bdy rim (15 points wide hardwired here) are not going to contain any WAD points by explicitly making them deep. https://github.com/endaodea/DOMAINCFG_BASED_ON_36_NEMO/blob/eb765e0019ba3f76fff14300ef71dc50765de0ea/NEMOGCM/NEMO/OPA_SRC/DOM/domzgr.F90#L1870

      DO jj = 1, jpj
         DO ji = 1, jpi
            !CEODIF( mig(ji) <= 2 .or. mjg(jj) <= 2  .or. mig(ji) >= jpiglo-2 .or.  mjg(jj) >=jpjglo-2) then
            IF( mig(ji) <= 15   .or. mjg(jj) <=15  .or.  mjg(jj) >=jpjglo-15) then
               IF( bathy(ji,jj) > 0.0)   then
                  bathy(ji,jj) = max(10.0,bathy(ji,jj)) !
               ENDIF
            ENDIF
         END DO
      END DO

Then it adds to the raw bathymetry the offset (say 10m) https://github.com/endaodea/DOMAINCFG_BASED_ON_36_NEMO/blob/eb765e0019ba3f76fff14300ef71dc50765de0ea/NEMOGCM/NEMO/OPA_SRC/DOM/domzgr.F90#L1876

      bathy(:,:) = bathy(:,:) + rn_wd_ref_depth !  Arbitrary reference level, This needs

Other out of date CEOD comments

Comments about zenv avoidance can be ignored as we have fixed that in package branch The mesh mask comment could be relevant for weights creation when interpolating. We don't want to interpolate to the +10 m grid as in the domain cfg file. In reality we should be interpolating to the grid when the SSH is at rest. So I created a separate mesh_mask file that has the SSH reduced by 10 m for weights creation.

Code to write out data

domain.F90 has the extra output: https://github.com/endaodea/DOMAINCFG_BASED_ON_36_NEMO/blob/eb765e0019ba3f76fff14300ef71dc50765de0ea/NEMOGCM/NEMO/OPA_SRC/DOM/domain.F90#L551

      CALL iom_rstput( 0, 0, inum, 'rn_wd_ref_depth'   , rn_wd_ref_depth  ) ! replace this later with variable
      CALL iom_rstput( 0, 0, inum, 'ht_wd', z2d )        !    ht_wd

Sample outputs

The header file of the resultant domain_cfg file for AMM15 is here: https://github.com/endaodea/DOMAINCFG_BASED_ON_36_NEMO/blob/main/namelist/domain_cfg.nc.txt

Note the extra variable:

	double rn_wd_ref_depth ;