Opened 5 years ago
Closed 3 years ago
#2177 closed Defect (fixed)
Deriving scale factors if ln_isfcav = true
Reported by: | jamesharle | Owned by: | systeam |
---|---|---|---|
Priority: | low | Milestone: | |
Component: | tools | Version: | trunk |
Severity: | minor | Keywords: | DOMAINcfg, TOOLS, domzgr, ISF |
Cc: |
Description
Context
When employing ln_isfcav = true and generating a domain_cfg.nc file using the DOMAINcfg tool the vertical scale factors are altered in the shallowest wet cell as follows:
in domzgr.f90 (ln1828):
e3w_0 (ji,jj,ik ) = e3t_0 (ji,jj,ik)
this is to accommodate the use of partial cells under ice sheets. The consequence of this is that an incorrect gdept_0 is generated using e3_to_depth (in zgr_read) in the active (wet) cells wherever the ice sheet is present.
Dynamically this is not an issue as far as I can tell as gdept_n is corrected for this fact in dom_vvl_init, whilst still perpetuating the e3w_n based on e3t_0(ji,jj,ik) - (also in iscplrst.F90).
The consequence of this approach is that the thickness factors e3w_0 and e3w_n, and depth coordinate gdept_0 are incorrect in domain_cfg.nc, meshmask.nc and any output files. The only way the user can back out the true depth at t-points is to update diawri.F90 to output gdept_n or use the ice draft depth with 0.5*e3w_0 at the first wet cell. I thought it would be cleaner and clearer if the treatment of the scale thickness of the first wet cell under the ice sheet was treated locally within the dynamics code rather than globally (corrupting the vertical coordinates).
As the alteration to e3w at the first wet cell under the ice sheet was not immediately apparent, this proved interesting when deriving domain_cfg.nc files for both sh94 and hybrid z-s coordinates. Below are my changes to domzgr.f90 (in tools/DOMAINcfg) to remove this adaption and to the other code in src/OCE that has to be updated accordingly.
I have tested both the old code and the changes below on an ISOMIP-like set up. Both yielding identical run.stat files.
I’ve raised this ticket on the suggestion of Pierre, who says he’ll be revisiting the ice cavity coordinates in his 2019WP.
Proposal
Firstly to retain the full e3w thicknesses in tools/DOMAINcfg/src
-
domzgr.f90
1825 1825 e3w_0 (ji,jj,ik+1) = gdept_0(ji,jj,ik+1) - gdept_0(ji,jj,ik) 1826 1826 ENDIF 1827 1827 ! ... on ik / ik-1 1828 e3w_0 (ji,jj,ik ) = e3t_0 (ji,jj,ik) !2._wp * (gdept_0(ji,jj,ik) - gdepw_0(ji,jj,ik))1829 1828 e3t_0 (ji,jj,ik-1) = gdepw_0(ji,jj,ik) - gdepw_1d(ik-1) 1830 ! The next line isn't required and doesn't affect results - included for consistency with bathymetry code 1831 gdept_0(ji,jj,ik-1) = gdept_1d(ik-1) 1829 e3w_0 (ji,jj,ik) = e3w_0 (ji,jj,ik) + ( gdept_0(ji,jj,ik) - gdept_1d(ik) ) 1832 1830 ENDIF 1833 1831 END DO 1834 1832 END DO
In domvvl we therefore have to retain the conventional way of defining gdept_n without an adjustment for the uppermost wet cell under the ice sheet (this will be handled locally in dyn_hpg_isf).
-
domvvl.F90
116 116 !!---------------------------------------------------------------------- 117 117 INTEGER :: ji, jj, jk 118 118 INTEGER :: ii0, ii1, ij0, ij1 119 REAL(wp):: zcoef120 119 !!---------------------------------------------------------------------- 121 120 ! 122 121 IF(lwp) WRITE(numout,*) … … 161 160 DO jk = 2, jpk ! vertical sum 162 161 DO jj = 1,jpj 163 162 DO ji = 1,jpi 164 ! zcoef = tmask - wmask ! 0 everywhere tmask = wmask, ie everywhere expect at jk = mikt165 ! ! 1 everywhere from mbkt to mikt + 1 or 1 (if no isf)166 ! ! 0.5 where jk = mikt167 !!gm ??????? BUG ? gdept_n as well as gde3w_n does not include the thickness of ISF ??168 zcoef = ( tmask(ji,jj,jk) - wmask(ji,jj,jk) )169 163 gdepw_n(ji,jj,jk) = gdepw_n(ji,jj,jk-1) + e3t_n(ji,jj,jk-1) 170 gdept_n(ji,jj,jk) = zcoef * ( gdepw_n(ji,jj,jk ) + 0.5 * e3w_n(ji,jj,jk)) & 171 & + (1-zcoef) * ( gdept_n(ji,jj,jk-1) + e3w_n(ji,jj,jk)) 164 gdept_n(ji,jj,jk) = gdept_n(ji,jj,jk-1) + e3w_n(ji,jj,jk) 172 165 gde3w_n(ji,jj,jk) = gdept_n(ji,jj,jk) - sshn(ji,jj) 173 166 gdepw_b(ji,jj,jk) = gdepw_b(ji,jj,jk-1) + e3t_b(ji,jj,jk-1) 174 gdept_b(ji,jj,jk) = zcoef * ( gdepw_b(ji,jj,jk ) + 0.5 * e3w_b(ji,jj,jk)) & 175 & + (1-zcoef) * ( gdept_b(ji,jj,jk-1) + e3w_b(ji,jj,jk)) 167 gdept_b(ji,jj,jk) = gdept_b(ji,jj,jk-1) + e3w_b(ji,jj,jk) 176 168 END DO 177 169 END DO 178 170 END DO … … 589 581 INTEGER, INTENT( in ) :: kt ! time step 590 582 ! 591 583 INTEGER :: ji, jj, jk ! dummy loop indices 592 REAL(wp) :: zcoef ! local scalar593 584 !!---------------------------------------------------------------------- 594 585 ! 595 586 IF( ln_linssh ) RETURN ! No calculation in linear free surface … … 645 636 DO jk = 2, jpk 646 637 DO jj = 1,jpj 647 638 DO ji = 1,jpi 648 ! zcoef = (tmask(ji,jj,jk) - wmask(ji,jj,jk)) ! 0 everywhere tmask = wmask, ie everywhere expect at jk = mikt649 ! 1 for jk = mikt650 zcoef = (tmask(ji,jj,jk) - wmask(ji,jj,jk))651 639 gdepw_n(ji,jj,jk) = gdepw_n(ji,jj,jk-1) + e3t_n(ji,jj,jk-1) 652 gdept_n(ji,jj,jk) = zcoef * ( gdepw_n(ji,jj,jk ) + 0.5 * e3w_n(ji,jj,jk) ) & 653 & + (1-zcoef) * ( gdept_n(ji,jj,jk-1) + e3w_n(ji,jj,jk) ) 640 gdept_n(ji,jj,jk) = gdept_n(ji,jj,jk-1) + e3w_n(ji,jj,jk) 654 641 gde3w_n(ji,jj,jk) = gdept_n(ji,jj,jk) - sshn(ji,jj) 655 642 END DO 656 643 END DO
The correction term is also updated in iscplrst.F90:
-
iscplrst.F90
222 222 END DO 223 223 IF (mikt(ji,jj) > 1) THEN 224 224 jk = mikt(ji,jj) 225 gdept_n(ji,jj,jk) = gdep w_0(ji,jj,jk) + 0.5_wp *e3w_n(ji,jj,jk)225 gdept_n(ji,jj,jk) = gdept_0(ji,jj,jk-1) + e3w_n(ji,jj,jk) 226 226 gdepw_n(ji,jj,jk) = gdepw_0(ji,jj,jk) 227 227 gde3w_n(ji,jj,jk) = gdept_n(ji,jj,jk ) - sshn (ji,jj) 228 228 END IF
In dyn_hpg_isf the definition of e3w in the first wet cell under the ice sheet is added:
-
dynhpg.F90
581 581 REAL(wp), DIMENSION(jpi,jpj,jpk ) :: zhpi, zhpj 582 582 REAL(wp), DIMENSION(jpi,jpj,jpts) :: zts_top 583 583 REAL(wp), DIMENSION(jpi,jpj) :: zrhdtop_oce 584 REAL(wp), DIMENSION(jpi,jpj) :: ze3w_top 584 585 !!---------------------------------------------------------------------- 585 586 ! 586 587 zcoef0 = - grav * 0.5_wp ! Local constant initialization … … 592 593 593 594 ! compute rhd at the ice/oce interface (ocean side) 594 595 ! usefull to reduce residual current in the test case ISOMIP with no melting 596 ! compute the half wet cell thickness just under the ice sheet. NB this is not 597 ! 0.5 * e3w_n(:,:,ikt) due to the partial step in the ice sheet 595 598 DO ji = 1, jpi 596 599 DO jj = 1, jpj 597 600 ikt = mikt(ji,jj) 598 zts_top(ji,jj,1) = tsn(ji,jj,ikt,1) 599 zts_top(ji,jj,2) = tsn(ji,jj,ikt,2) 601 zts_top (ji,jj,1) = tsn(ji,jj,ikt,1) 602 zts_top (ji,jj,2) = tsn(ji,jj,ikt,2) 603 ze3w_top(ji,jj ) = gdept_n(ji,jj,ikt) - gdepw_n(ji,jj,ikt) 600 604 END DO 601 605 END DO 602 606 CALL eos( zts_top, risfdep, zrhdtop_oce ) 603 607 604 !==================================================================================605 608 !===== Compute surface value ===================================================== 606 609 !================================================================================== 607 610 DO jj = 2, jpjm1 … … 611 614 iktp1j = mikt(ji,jj+1) 612 615 ! hydrostatic pressure gradient along s-surfaces and ice shelf pressure 613 616 ! we assume ISF is in isostatic equilibrium 614 zhpi(ji,jj,1) = zcoef0 / e1u(ji,jj) * ( 0.5_wp * e3w_n(ji+1,jj,iktp1i)&617 zhpi(ji,jj,1) = zcoef0 / e1u(ji,jj) * ( ze3w_top(ji+1,jj) & 615 618 & * ( 2._wp * znad + rhd(ji+1,jj,iktp1i) + zrhdtop_oce(ji+1,jj) ) & 616 & - 0.5_wp * e3w_n(ji,jj,ikt)&619 & - ze3w_top(ji,jj) & 617 620 & * ( 2._wp * znad + rhd(ji,jj,ikt) + zrhdtop_oce(ji,jj) ) & 618 621 & + ( riceload(ji+1,jj) - riceload(ji,jj)) ) 619 zhpj(ji,jj,1) = zcoef0 / e2v(ji,jj) * ( 0.5_wp * e3w_n(ji,jj+1,iktp1j)&622 zhpj(ji,jj,1) = zcoef0 / e2v(ji,jj) * ( ze3w_top(ji,jj+1) & 620 623 & * ( 2._wp * znad + rhd(ji,jj+1,iktp1j) + zrhdtop_oce(ji,jj+1) ) & 621 & - 0.5_wp * e3w_n(ji,jj,ikt) &624 & - ze3w_top(ji,jj) & 622 625 & * ( 2._wp * znad + rhd(ji,jj,ikt) + zrhdtop_oce(ji,jj) ) & 623 626 & + ( riceload(ji,jj+1) - riceload(ji,jj)) ) 624 627 ! s-coordinate pressure gradient correction (=0 if z coordinate)
Commit History (0)
(No commits)
Change History (3)
comment:1 Changed 5 years ago by mathiot
comment:2 Changed 4 years ago by clevy
- Type changed from Enhancement to Defect
comment:3 Changed 3 years ago by mathiot
- Resolution set to fixed
- Status changed from new to closed
Fixed in WP2019
For the time being, the computation of the deepest e3w_0 has been changed in the ice shelf in r10490. According to this change a modification in the computation of the isf load was required (r10491).
Now the e3_to_depth give correct answer and e3 and depth in the ice shelf point ('land point') in domain_cfg and mesh_mask are correct. ISOMIP run using user_def or domain_cfg give the same answer and after 30 years results are as expected.
With James, we will revisit this in the WP2019 as part of his action on sigma under the iceshelf and my action on ice shelf coupling, geometry and cleaning/simplification.