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.
isfhdiv.F90 in NEMO/branches/2019/UKMO_MERGE_2019/src/OCE/ISF – NEMO

source: NEMO/branches/2019/UKMO_MERGE_2019/src/OCE/ISF/isfhdiv.F90 @ 12242

Last change on this file since 12242 was 12077, checked in by mathiot, 5 years ago

include ENHANCE-02_ISF_nemo in UKMO merge branch

File size: 6.4 KB
RevLine 
[11395]1MODULE isfhdiv
[12077]2   !!======================================================================
3   !!                       ***  MODULE  isfhdiv  ***
4   !! ice shelf horizontal divergence module :  update the horizontal divergence
5   !!                   with the ice shelf melt and coupling correction
6   !!======================================================================
7   !! History :  4.0  !  2019-09  (P. Mathiot) Original code
8   !!----------------------------------------------------------------------
[11395]9
[12077]10   !!----------------------------------------------------------------------
11   !!   isf_hdiv    : update the horizontal divergence with the ice shelf
12   !!                 melt and coupling correction
13   !!----------------------------------------------------------------------
14
15   USE isf_oce                ! ice shelf
16
[11852]17   USE dom_oce                ! time and space domain
18   USE phycst , ONLY: r1_rau0 ! physical constant
19   USE in_out_manager         !
[11395]20
[11403]21   IMPLICIT NONE
[11395]22
[11403]23   PRIVATE
[11395]24
[11403]25   PUBLIC isf_hdiv
[11395]26
27CONTAINS
28
[12068]29   SUBROUTINE isf_hdiv( kt, Kmm, phdiv )
[11395]30      !!----------------------------------------------------------------------
31      !!                  ***  SUBROUTINE isf_hdiv  ***
32      !!       
[11541]33      !! ** Purpose :   update the horizontal divergence with the ice shelf contribution
34      !!                (parametrisation, explicit, ice sheet coupling conservation
35      !!                 increment)
[11395]36      !!
37      !!----------------------------------------------------------------------
38      REAL(wp), DIMENSION(:,:,:), INTENT( inout ) ::   phdiv   ! horizontal divergence
39      !!----------------------------------------------------------------------
[11423]40      INTEGER, INTENT(in) :: kt
[12068]41      INTEGER, INTENT(in) :: Kmm      !  ocean time level index
[11395]42      !
[11521]43      IF ( ln_isf ) THEN
44         !
45         ! ice shelf cavity contribution
46         IF ( ln_isfcav_mlt ) CALL isf_hdiv_mlt(misfkt_cav, misfkb_cav, rhisf_tbl_cav, rfrac_tbl_cav, fwfisf_cav, fwfisf_cav_b, phdiv)
47         !
48         ! ice shelf parametrisation contribution
49         IF ( ln_isfpar_mlt ) CALL isf_hdiv_mlt(misfkt_par, misfkb_par, rhisf_tbl_par, rfrac_tbl_par, fwfisf_par, fwfisf_par_b, phdiv)
50         !
[11541]51         ! ice sheet coupling contribution
[11852]52         IF ( ln_isfcpl .AND. kt /= 0 ) THEN
[11541]53            !
[12077]54            ! Dynamical stability at start up after change in under ice shelf cavity geometry is achieve by correcting the divergence.
55            ! This is achieved by applying a volume flux in order to keep the horizontal divergence after remapping
56            ! the same as at the end of the latest time step. So correction need to be apply at nit000 (euler time step) and
57            ! half of it at nit000+1 (leap frog time step).
[12068]58            IF ( kt == nit000   ) CALL isf_hdiv_cpl(Kmm, risfcpl_vol       , phdiv)
59            IF ( kt == nit000+1 ) CALL isf_hdiv_cpl(Kmm, risfcpl_vol*0.5_wp, phdiv)
[11541]60            !
61            ! correct divergence every time step to remove any trend due to coupling
62            ! conservation option
[12068]63            IF ( ln_isfcpl_cons ) CALL isf_hdiv_cpl(Kmm, risfcpl_cons_vol, phdiv)
[11541]64            !
65         END IF
[11423]66         !
67      END IF
[11395]68      !
69   END SUBROUTINE isf_hdiv
70
71   SUBROUTINE isf_hdiv_mlt(ktop, kbot, phtbl, pfrac, pfwf, pfwf_b, phdiv)
72      !!----------------------------------------------------------------------
73      !!                  ***  SUBROUTINE sbc_isf_div  ***
74      !!       
[11541]75      !! ** Purpose :   update the horizontal divergence with the ice shelf inflow
[11395]76      !!
[11541]77      !! ** Method  :   pfwf is positive (outflow) and expressed as kg/m2/s
78      !!                increase the divergence
[11395]79      !!
[11541]80      !! ** Action  :   phdivn   increased by the ice shelf outflow
[11395]81      !!----------------------------------------------------------------------
82      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) :: phdiv
83      !!----------------------------------------------------------------------
84      INTEGER , DIMENSION(jpi,jpj), INTENT(in   ) :: ktop , kbot
85      REAL(wp), DIMENSION(jpi,jpj), INTENT(in   ) :: pfrac, phtbl
86      REAL(wp), DIMENSION(jpi,jpj), INTENT(in   ) :: pfwf , pfwf_b
87      !!----------------------------------------------------------------------
88      INTEGER  ::   ji, jj, jk   ! dummy loop indices
89      INTEGER  ::   ikt, ikb 
[11541]90      REAL(wp), DIMENSION(jpi,jpj) :: zhdiv
[11395]91      !!----------------------------------------------------------------------
92      !
93      !==   fwf distributed over several levels   ==!
94      !
95      ! compute integrated divergence correction
[11541]96      zhdiv(:,:) = 0.5_wp * ( pfwf(:,:) + pfwf_b(:,:) ) * r1_rau0 / phtbl(:,:)
[11395]97      !
98      ! update divergence at each level affected by ice shelf top boundary layer
99      DO jj = 1,jpj
100         DO ji = 1,jpi
[11521]101            ikt = ktop(ji,jj)
102            ikb = kbot(ji,jj)
103            ! level fully include in the ice shelf boundary layer
104            DO jk = ikt, ikb - 1
[11541]105               phdiv(ji,jj,jk) = phdiv(ji,jj,jk) + zhdiv(ji,jj)
[11521]106            END DO
107            ! level partially include in ice shelf boundary layer
[11541]108            phdiv(ji,jj,ikb) = phdiv(ji,jj,ikb) + zhdiv(ji,jj) * pfrac(ji,jj)
[11395]109         END DO
110      END DO
111      !
112   END SUBROUTINE isf_hdiv_mlt
113
[12068]114   SUBROUTINE isf_hdiv_cpl(Kmm, pqvol, phdiv)
[11521]115      !!----------------------------------------------------------------------
116      !!                  ***  SUBROUTINE isf_hdiv_cpl  ***
117      !!       
[11541]118      !! ** Purpose :   update the horizontal divergence with the ice shelf
119      !!                coupling conservation increment
[11521]120      !!
[11541]121      !! ** Method  :   pqvol is positive (outflow) and expressed as m3/s
122      !!                increase the divergence
[11521]123      !!
[11541]124      !! ** Action  :   phdivn   increased by the ice shelf outflow
125      !!
[11521]126      !!----------------------------------------------------------------------
[11423]127      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) :: phdiv
[11521]128      !!----------------------------------------------------------------------
[12068]129      INTEGER,                          INTENT(in)    :: Kmm     ! ocean time level index
[11529]130      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in   ) :: pqvol
[11521]131      !!----------------------------------------------------------------------
132      INTEGER :: jk
133      !!----------------------------------------------------------------------
134      !
[11423]135      DO jk=1,jpk 
[12068]136         phdiv(:,:,jk) =  phdiv(:,:,jk) + pqvol(:,:,jk) * r1_e1e2t(:,:) / e3t(:,:,jk,Kmm)
[11423]137      END DO
[11521]138      !
139   END SUBROUTINE isf_hdiv_cpl
[11423]140
[11395]141END MODULE isfhdiv
Note: See TracBrowser for help on using the repository browser.