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.
isfcav.F90 in NEMO/branches/2019/ENHANCE-02_ISF_nemo/src/OCE/ISF – NEMO

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

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

ENHANCE-02_ISF: fix coupling issue (ticket #2142)

File size: 8.5 KB
Line 
1MODULE isfcav
2   !!======================================================================
3   !!                       ***  MODULE  isfcav  ***
4   !! Ice shelf cavity module :  update ice shelf melting under ice
5   !!                            shelf
6   !!======================================================================
7   !! History :  3.2  !  2011-02  (C.Harris  ) Original code isf cav
8   !!            3.4  !  2013-03  (P. Mathiot) Merging + parametrization
9   !!            4.1  !  2019-09  (P. Mathiot) Split ice shelf cavity and ice shelf parametrisation
10   !!----------------------------------------------------------------------
11
12   !!----------------------------------------------------------------------
13   !!   isf_cav       : update ice shelf melting under ice shelf
14   !!----------------------------------------------------------------------
15   USE oce            ! ocean dynamics and tracers
16   USE isf            ! ice shelf public variables
17   USE isftbl         ! ice shelf top boundary layer properties
18   USE isfcavmlt      ! ice shelf melt formulation
19   USE isfcavgam      ! ice shelf melt exchange coeficient
20   USE isfdiags       ! ice shelf diags
21   USE dom_oce        ! ocean space and time domain
22   USE phycst         ! physical constants
23   USE eosbn2         ! l_useCT
24   !
25   USE in_out_manager ! I/O manager
26   USE iom            ! I/O library
27   USE fldread        ! read input field at current time step
28   USE lbclnk         ! lbclnk
29
30   IMPLICIT NONE
31
32   PRIVATE
33
34   PUBLIC   isf_cav, isf_cav_init ! routine called in isfmlt
35
36   !!----------------------------------------------------------------------
37   !! NEMO/OCE 4.0 , NEMO Consortium (2018)
38   !! $Id: sbcisf.F90 10536 2019-01-16 19:21:09Z mathiot $
39   !! Software governed by the CeCILL license (see ./LICENSE)
40   !!----------------------------------------------------------------------
41CONTAINS
42
43   SUBROUTINE isf_cav( kt, ptsc, pqfwf )
44      !!---------------------------------------------------------------------
45      !!                     ***  ROUTINE isf_cav  ***
46      !!
47      !! ** Purpose :   handle surface boundary condition under ice shelf
48      !!
49      !! ** Method  :   based on Mathiot et al. (2017)
50      !!
51      !! ** Action  :   - compute geometry of the Losch top bournary layer (see Losch et al. 2008)
52      !!                - depending on the chooses option
53      !!                   - compute temperature/salt in the tbl
54      !!                   - compute exchange coeficient
55      !!                   - compute heat and fwf fluxes
56      !!                   - output
57      !!---------------------------------------------------------------------
58      !!-------------------------- OUT --------------------------------------
59      REAL(wp), DIMENSION(jpi,jpj)     , INTENT(inout) :: pqfwf
60      REAL(wp), DIMENSION(jpi,jpj,jpts), INTENT(inout) :: ptsc
61      !!-------------------------- IN  --------------------------------------
62      INTEGER, INTENT(in) ::   kt   ! ocean time step
63      !!---------------------------------------------------------------------
64      LOGICAL :: lit
65      INTEGER :: nit
66      REAL(wp) :: zerr
67      REAL(wp), DIMENSION(jpi,jpj) :: zqlat, zqoce, zqhc, zqh
68      REAL(wp), DIMENSION(jpi,jpj) :: zqoce_b
69      REAL(wp), DIMENSION(jpi,jpj) :: zgammat, zgammas
70      REAL(wp), DIMENSION(jpi,jpj) :: zttbl, zstbl
71      !!---------------------------------------------------------------------
72      !
73      ! compute T/S/U/V for the top boundary layer
74      CALL isf_tbl(tsn(:,:,:,jp_tem), zttbl(:,:),'T', misfkt_cav, rhisf_tbl_cav, misfkb_cav, rfrac_tbl_cav )
75      CALL isf_tbl(tsn(:,:,:,jp_sal), zstbl(:,:),'T', misfkt_cav, rhisf_tbl_cav, misfkb_cav, rfrac_tbl_cav )
76      !
77      ! output T/S/U/V for the top boundary layer
78      CALL iom_put('ttbl_cav',zttbl(:,:) * mskisf_cav(:,:))
79      CALL iom_put('stbl'    ,zstbl(:,:) * mskisf_cav(:,:))
80      !
81      ! initialisation
82      IF (TRIM(cn_gammablk) == 'HJ99' ) zqoce_b (:,:) = ptsc(:,:,jp_tem) * rau0_rcp ! last time step total heat fluxes (to speed up convergence)
83      !
84      ! compute ice shelf melting
85      nit = 1 ; lit = .TRUE.
86      DO WHILE ( lit )    ! maybe just a constant number of iteration as in blk_core is fine
87         !
88         ! compute gammat every where (2d)
89         ! useless if melt specified
90         IF ( TRIM(cn_isfcav_mlt) .NE. 'spe' ) THEN
91            CALL isfcav_gammats( zttbl, zstbl, zqoce  , pqfwf,  &
92               &                               zgammat, zgammas )
93         END IF
94         !   
95         ! compute tfrz, latent heat and melt (2d)
96         CALL isfcav_mlt(kt, zgammat, zgammas, zttbl, zstbl, &
97            &                         zqhc   , zqoce, pqfwf  )
98         !
99         ! define if we need to iterate (nn_gammablk 0/1 do not need iteration)
100         SELECT CASE ( cn_gammablk )
101         CASE ( 'spe','ad15' )
102            ! no convergence needed
103            lit = .FALSE.
104         CASE ( 'hj99' )
105            ! compute error between 2 iterations
106            zerr = MAXVAL(ABS(zqoce(:,:) - zqoce_b(:,:)))
107            !
108            ! define if iteration needed
109            IF (nit >= 100) THEN              ! too much iteration
110               CALL ctl_stop( 'STOP', 'isf_cav: HJ99 gamma formulation had too many iterations ...' )
111            ELSE IF ( zerr <= 0.01_wp ) THEN  ! convergence is achieve
112               lit = .FALSE.
113            ELSE                              ! converge is not yet achieve
114               nit = nit + 1
115               zqoce_b(:,:) = zqoce(:,:)
116            END IF
117         END SELECT
118         !
119      END DO
120      !
121      ! compute heat and water flux  (change signe directly in the melt subroutine)
122      pqfwf(:,:) = pqfwf(:,:) * mskisf_cav(:,:)
123      zqoce(:,:) = zqoce(:,:) * mskisf_cav(:,:)
124      zqhc (:,:) = zqhc(:,:)  * mskisf_cav(:,:)
125      !
126      ! compute heat content flux
127      zqlat(:,:) = - pqfwf(:,:) * rLfusisf    ! 2d latent heat flux (W/m2) ( > 0 out )
128      !
129      ! total heat flux ( >0 out )
130      zqh(:,:) = ( zqhc (:,:) + zqoce(:,:) )
131      !
132      ! lbclnk on melt
133      CALL lbc_lnk_multi( 'isfmlt', zqh, 'T', 1., pqfwf, 'T', 1.)
134      !
135      ! output fluxes
136      CALL isf_diags_flx( misfkt_cav, misfkb_cav, rhisf_tbl_cav, rfrac_tbl_cav, 'cav', pqfwf, zqoce, zqlat, zqhc)
137      !
138      ! set temperature content
139      ptsc(:,:,jp_tem) = - zqh(:,:) * r1_rau0_rcp
140      !
141   END SUBROUTINE isf_cav
142
143   SUBROUTINE isf_cav_init
144      !!---------------------------------------------------------------------
145      !!                  ***  ROUTINE isf_cav_init ***
146      !!
147      !! ** Purpose : initialisation of variable needed to compute melt under an ice shelf
148      !!
149      !!----------------------------------------------------------------------
150      INTEGER :: ierr
151      !!---------------------------------------------------------------------
152
153      ! allocation isfcav gamtisf, gamsisf,
154      CALL isf_alloc_cav()
155      !
156      ! cav
157      misfkt_cav(:,:)    = mikt(:,:) ; misfkb_cav(:,:)    = 1
158      rhisf_tbl_cav(:,:) = 0.0_wp    ; rfrac_tbl_cav(:,:) = 0.0_wp
159      !
160      SELECT CASE ( TRIM(cn_isfcav_mlt) )
161      CASE( 'spe' )
162
163         ALLOCATE( sf_isfcav_fwf(1), STAT=ierr )
164         ALLOCATE( sf_isfcav_fwf(1)%fnow(jpi,jpj,1), sf_isfcav_fwf(1)%fdta(jpi,jpj,1,2) )
165         CALL fld_fill( sf_isfcav_fwf, (/ sn_isfcav_fwf /), cn_isfdir, 'isf_cav_init', 'read fresh water flux isf data', 'namisf' )
166
167         IF(lwp) WRITE(numout,*)
168         IF(lwp) WRITE(numout,*) '  ==>> The ice shelf melt inside the cavity is read from forcing files'
169
170      CASE( '2eq' )
171         IF(lwp) WRITE(numout,*)
172         IF(lwp) WRITE(numout,*) '  ==>> The original ISOMIP melt formulation is used to compute melt under the ice shelves'
173
174      CASE( '3eq' )
175         ! coeficient for linearisation of potential tfreez
176         ! Crude approximation for pressure (but commonly used)
177         IF ( l_useCT ) THEN   ! linearisation from Jourdain et al. (2017)
178            risf_lamb1 =-0.0564_wp
179            risf_lamb2 = 0.0773_wp
180            risf_lamb3 =-7.8633e-8 * grav * rau0
181         ELSE                  ! linearisation from table 4 (Asay-Davis et al., 2015)
182            risf_lamb1 =-0.0573_wp
183            risf_lamb2 = 0.0832_wp
184            risf_lamb3 =-7.5300e-8 * grav * rau0
185         ENDIF
186
187         IF(lwp) WRITE(numout,*)
188         IF(lwp) WRITE(numout,*) '  ==>> The 3 equations melt formulation is used to compute melt under the ice shelves'
189
190      CASE DEFAULT
191         CALL ctl_stop(' cn_isfcav_mlt method unknown (spe, 2eq, 3eq), check namelist')
192      END SELECT
193      !
194      ! compute mask
195      mskisf_cav(:,:) = (1._wp - tmask(:,:,1)) * ssmask(:,:)
196      !
197   END SUBROUTINE isf_cav_init
198
199END MODULE isfcav
Note: See TracBrowser for help on using the repository browser.