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/ENHANCE-02_ISF_nemo/src/OCE/ISF – NEMO

source: NEMO/branches/2019/ENHANCE-02_ISF_nemo/src/OCE/ISF/isfhdiv.F90 @ 11529

Last change on this file since 11529 was 11529, checked in by mathiot, 3 years ago

ENHANCE-02_ISF: fixes for ice sheet coupling (ticket #2142)

File size: 4.6 KB
Line 
1MODULE isfhdiv
2
3   USE dom_oce
4   USE iom
5   USE isf
6   USE isfutils
7   USE phycst
8   USE in_out_manager
9
10   IMPLICIT NONE
11
12   PRIVATE
13
14   PUBLIC isf_hdiv
15
16CONTAINS
17
18   SUBROUTINE isf_hdiv( kt, phdiv )
19      !!----------------------------------------------------------------------
20      !!                  ***  SUBROUTINE isf_hdiv  ***
21      !!       
22      !! ** Purpose :   
23      !!
24      !! ** Method  :   
25      !!
26      !! ** Action  :   phdiv   decreased by the fwf inflow (isf melt in this case)
27      !!----------------------------------------------------------------------
28      REAL(wp), DIMENSION(:,:,:), INTENT( inout ) ::   phdiv   ! horizontal divergence
29      !!----------------------------------------------------------------------
30      INTEGER, INTENT(in) :: kt
31      !
32      IF ( ln_isf ) THEN
33         !
34         ! ice shelf cavity contribution
35         IF ( ln_isfcav_mlt ) CALL isf_hdiv_mlt(misfkt_cav, misfkb_cav, rhisf_tbl_cav, rfrac_tbl_cav, fwfisf_cav, fwfisf_cav_b, phdiv)
36         !
37         ! ice shelf parametrisation contribution
38         IF ( ln_isfpar_mlt ) CALL isf_hdiv_mlt(misfkt_par, misfkb_par, rhisf_tbl_par, rfrac_tbl_par, fwfisf_par, fwfisf_par_b, phdiv)
39         !
40      END IF
41      !
42      ! ice sheet coupling contribution (if conservation needed)
43      IF ( ll_isfcpl ) THEN
44         !
45         ! correct divergence only for the first time step
46         IF ( kt == nit000 ) CALL isf_hdiv_cpl(risfcpl_vol, phdiv)
47         !
48         ! correct divergence every time step to remove any trend due to coupling
49         IF ( ll_isfcpl_cons ) CALL isf_hdiv_cpl(risfcpl_cons_vol, phdiv)
50         !
51      END IF
52      !
53   END SUBROUTINE isf_hdiv
54
55   SUBROUTINE isf_hdiv_mlt(ktop, kbot, phtbl, pfrac, pfwf, pfwf_b, phdiv)
56      !!----------------------------------------------------------------------
57      !!                  ***  SUBROUTINE sbc_isf_div  ***
58      !!       
59      !! ** Purpose :   update the horizontal divergence with the runoff inflow
60      !!
61      !! ** Method  :   
62      !!                CAUTION : risf_tsc(:,:,jp_sal) is negative (outflow) increase the
63      !!                          divergence and expressed in m/s
64      !!
65      !! ** Action  :   phdivn   decreased by the runoff inflow
66      !!----------------------------------------------------------------------
67      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) :: phdiv
68      !!----------------------------------------------------------------------
69      INTEGER , DIMENSION(jpi,jpj), INTENT(in   ) :: ktop , kbot
70      REAL(wp), DIMENSION(jpi,jpj), INTENT(in   ) :: pfrac, phtbl
71      REAL(wp), DIMENSION(jpi,jpj), INTENT(in   ) :: pfwf , pfwf_b
72      !!----------------------------------------------------------------------
73      INTEGER  ::   ji, jj, jk   ! dummy loop indices
74      INTEGER  ::   ikt, ikb 
75      REAL(wp), DIMENSION(jpi,jpj) :: zqvol,ztmp
76      !!----------------------------------------------------------------------
77      !
78      !==   fwf distributed over several levels   ==!
79      !
80      ! compute integrated divergence correction
81      zqvol(:,:) = 0.5_wp * ( pfwf(:,:) + pfwf_b(:,:) ) * r1_rau0 / phtbl(:,:)
82      !
83      ! update divergence at each level affected by ice shelf top boundary layer
84      DO jj = 1,jpj
85         DO ji = 1,jpi
86            ikt = ktop(ji,jj)
87            ikb = kbot(ji,jj)
88            ! level fully include in the ice shelf boundary layer
89            DO jk = ikt, ikb - 1
90               phdiv(ji,jj,jk) = phdiv(ji,jj,jk) + zqvol(ji,jj)
91            END DO
92            ! level partially include in ice shelf boundary layer
93            phdiv(ji,jj,ikb) = phdiv(ji,jj,ikb) + zqvol(ji,jj) * pfrac(ji,jj)
94         END DO
95      END DO
96      !
97   END SUBROUTINE isf_hdiv_mlt
98
99   SUBROUTINE isf_hdiv_cpl(pqvol, phdiv)
100      !!----------------------------------------------------------------------
101      !!                  ***  SUBROUTINE isf_hdiv_cpl  ***
102      !!       
103      !! ** Purpose :   
104      !!
105      !! ** Method  :   
106      !!
107      !! ** Action  : 
108      !!----------------------------------------------------------------------
109      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) :: phdiv
110      !!----------------------------------------------------------------------
111      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in   ) :: pqvol
112      !!----------------------------------------------------------------------
113      INTEGER :: jk
114      !!----------------------------------------------------------------------
115      !
116      DO jk=1,jpk 
117         phdiv(:,:,jk) =  phdiv(:,:,jk) + pqvol(:,:,jk) * r1_e1e2t(:,:) / e3t_n(:,:,jk)
118      END DO
119      !
120   END SUBROUTINE isf_hdiv_cpl
121
122END MODULE isfhdiv
Note: See TracBrowser for help on using the repository browser.