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

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

Last change on this file since 11931 was 11931, checked in by mathiot, 4 years ago

ENHANCE-02_ISF_nemo: add comments, improve memory usage of ln_isfcpl_cons option, fix issue in ISOMIP+ configuration

File size: 16.9 KB
Line 
1MODULE isfcavmlt
2   !!======================================================================
3   !!                       ***  MODULE  isfcavmlt  ***
4   !! ice shelf module :  update surface ocean boundary condition under ice
5   !!                   shelves
6   !!======================================================================
7   !! History :  4.0  !  2019-09  (P. Mathiot) Original code
8   !!----------------------------------------------------------------------
9
10   !!----------------------------------------------------------------------
11   !!   isfcav_mlt    : compute or read ice shelf fwf/heat fluxes in the ice shelf cavity
12   !!----------------------------------------------------------------------
13
14   USE isf                      ! ice shelf
15   USE isftbl , ONLY: isf_tbl   ! ice shelf depth average
16   USE isfutils,ONLY: debug     ! debug subroutine
17
18   USE dom_oce                            ! ocean space and time domain
19   USE oce    , ONLY: tsn                 ! ocean dynamics and tracers
20   USE phycst , ONLY: rcp, rau0, rau0_rcp ! physical constants
21   USE eosbn2 , ONLY: eos_fzp             ! equation of state
22
23   USE in_out_manager              ! I/O manager
24   USE iom        , ONLY: iom_put  ! I/O library
25   USE fldread    , ONLY: fld_read, FLD, FLD_N !
26   USE lib_fortran, ONLY: glob_sum !
27   USE lib_mpp    , ONLY: ctl_stop !
28
29   IMPLICIT NONE
30   PRIVATE
31
32   PUBLIC   isfcav_mlt
33
34   !!----------------------------------------------------------------------
35   !! NEMO/OCE 4.0 , NEMO Consortium (2018)
36   !! $Id: sbcisf.F90 10536 2019-01-16 19:21:09Z mathiot $
37   !! Software governed by the CeCILL license (see ./LICENSE)
38   !!----------------------------------------------------------------------
39CONTAINS
40
41! -------------------------------------------------------------------------------------------------------
42! -------------------------------- PUBLIC SUBROUTINE ----------------------------------------------------
43! -------------------------------------------------------------------------------------------------------
44
45   SUBROUTINE isfcav_mlt(kt, pgt, pgs , pttbl, pstbl, &
46      &                           pqhc, pqoce, pqfwf  )
47      !!----------------------------------------------------------------------
48      !!
49      !!                          ***  ROUTINE isfcav_mlt  ***
50      !!
51      !! ** Purpose    : compute or read ice shelf fwf/heat fluxes in the ice shelf cavity
52      !!
53      !!-------------------------- OUT -------------------------------------
54      REAL(wp), DIMENSION(jpi,jpj), INTENT(  out) :: pqhc, pqoce, pqfwf  ! heat and fwf fluxes
55      !!-------------------------- IN  -------------------------------------
56      INTEGER, INTENT(in) :: kt
57      REAL(wp), DIMENSION(jpi,jpj), INTENT(in   ) :: pgt  , pgs    ! gamma t and gamma s
58      REAL(wp), DIMENSION(jpi,jpj), INTENT(in   ) :: pttbl, pstbl  ! top boundary layer tracer
59      !!---------------------------------------------------------------------
60      !
61      ! compute latent heat and melt (2d)
62      SELECT CASE ( cn_isfcav_mlt )
63      CASE ( 'spe' )   ! ice shelf melt specified (read input file, and heat fluxes derived from
64         CALL isfcav_mlt_spe( kt, pstbl,               &
65            &                  pqhc, pqoce, pqfwf  )
66      CASE ( '2eq' )   !  ISOMIP  formulation (2 equations) for volume flux (Hunter et al., 2006)
67         CALL isfcav_mlt_2eq( pgt, pttbl, pstbl,       &
68            &                  pqhc , pqoce, pqfwf )
69      CASE ( '3eq' )   ! ISOMIP+ formulation (3 equations) for volume flux (Asay-Davis et al., 2015)
70         CALL isfcav_mlt_3eq( pgt, pgs , pttbl, pstbl, &
71            &                  pqhc, pqoce, pqfwf  )
72      CASE ( 'oasis' ) ! fwf pass trough oasis
73         CALL isfcav_mlt_oasis( kt, pstbl,              &
74            &                   pqhc, pqoce, pqfwf  )
75      CASE DEFAULT
76         CALL ctl_stop('STOP', 'unknown isf melt formulation : cn_isfcav (should not see this)')
77      END SELECT
78      !
79      IF (ln_isfdebug) THEN
80         CALL debug( 'isfcav_mlt:', pqhc (:,:) )
81         CALL debug( 'isfcav_mlt:', pqoce(:,:) )
82         CALL debug( 'isfcav_mlt:', pqfwf(:,:) )
83      END IF
84      !
85   END SUBROUTINE isfcav_mlt
86
87! -------------------------------------------------------------------------------------------------------
88! -------------------------------- PRIVATE SUBROUTINE ---------------------------------------------------
89! -------------------------------------------------------------------------------------------------------
90
91   SUBROUTINE isfcav_mlt_spe(kt, pstbl,          &  ! <<== in
92      &                      pqhc , pqoce, pqfwf )  ! ==>> out
93      !!----------------------------------------------------------------------
94      !!
95      !!                          ***  ROUTINE isfcav_mlt_spe  ***
96      !!
97      !! ** Purpose    : - read ice shelf melt from forcing file
98      !!                 - compute ocea-ice heat flux (assuming it is equal to latent heat)
99      !!                 - compute heat content flux
100      !!---------------------------------------------------------------------
101      !!-------------------------- OUT -------------------------------------
102      REAL(wp), DIMENSION(jpi,jpj), INTENT(  out) :: pqhc, pqoce, pqfwf  ! heat content, latent heat and fwf fluxes
103      !!-------------------------- IN  -------------------------------------
104      INTEGER                     , INTENT(in   ) :: kt                  ! current time step
105      REAL(wp), DIMENSION(jpi,jpj), INTENT(in   ) :: pstbl               ! salinity in tbl
106      !!--------------------------------------------------------------------
107      REAL(wp), DIMENSION(jpi,jpj) :: ztfrz                              ! tbl freezing temperature
108      !!--------------------------------------------------------------------
109      !
110      ! Compute freezing temperature
111      CALL eos_fzp( pstbl(:,:), ztfrz(:,:), risfdep(:,:) )
112      !
113      ! read input file
114      CALL fld_read ( kt, 1, sf_isfcav_fwf )
115      !
116      ! define fwf and qoce
117      ! ocean heat flux is assume to be equal to the latent heat
118      pqfwf(:,:) = - sf_isfcav_fwf(1)%fnow(:,:,1)      ! fwf                ( >0 out)
119      pqoce(:,:) = - pqfwf(:,:) * rLfusisf             ! ocean heat flux    ( >0 out)
120      pqhc (:,:) =   pqfwf(:,:) * ztfrz(:,:) * rcp     ! heat content flux  ( >0 out)
121      !
122      ! output freezing point at the interface
123      CALL iom_put('isftfrz_cav', ztfrz )
124      !
125   END SUBROUTINE isfcav_mlt_spe
126
127   SUBROUTINE isfcav_mlt_2eq(pgt , pttbl, pstbl, &  ! <<== in
128      &                      pqhc, pqoce, pqfwf  )  ! ==>> out
129      !!----------------------------------------------------------------------
130      !!
131      !!                          ***  ROUTINE isfcav_mlt_2eq  ***
132      !!
133      !! ** Purpose    : Compute ice shelf fwf/heqt fluxes using ISOMIP formulation (Hunter et al., 2006)
134      !!
135      !! ** Method     : The ice shelf melt latent heat is defined as being equal to the ocean/ice heat flux.
136      !!                 From this we can derived the fwf, ocean/ice heat flux and the heat content flux as being :
137      !!                   qfwf  = Gammat * Rau0 * Cp * ( Tw - Tfrz ) / Lf
138      !!                   qhoce = qlat
139      !!                   qhc   = qfwf * Cp * Tfrz
140      !!
141      !! ** Reference  : Hunter,  J.  R.:  Specification  for  test  models  of  ice  shelf  cavities, 
142      !!                 Tech.  Rep.  June,  Antarctic  Climate  &  Ecosystems  Cooperative  Research  Centre,  available  at: 
143      !!                 http://staff.acecrc.org.au/~bkgalton/ISOMIP/test_cavities.pdf (last access: 21 July 2016), 2006.
144      !!
145      !!-------------------------- OUT -------------------------------------
146      REAL(wp), DIMENSION(jpi,jpj), INTENT(  out) :: pqhc, pqoce, pqfwf  ! hean content, ocean-ice heat and fwf fluxes
147      !!-------------------------- IN  -------------------------------------
148      REAL(wp), DIMENSION(jpi,jpj), INTENT(in   ) :: pgt           ! temperature exchange coeficient
149      REAL(wp), DIMENSION(jpi,jpj), INTENT(in   ) :: pttbl, pstbl  ! temperature and salinity in top boundary layer
150      !!--------------------------------------------------------------------
151      REAL(wp), DIMENSION(jpi,jpj) :: ztfrz         ! freezing temperature
152      REAL(wp), DIMENSION(jpi,jpj) :: zthd          ! thermal driving
153      !!--------------------------------------------------------------------
154      !
155      ! Calculate freezing temperature
156      CALL eos_fzp( pstbl(:,:), ztfrz(:,:), risfdep(:,:) )
157      !
158      ! thermal driving
159      zthd (:,:) = ( pttbl(:,:) - ztfrz(:,:) ) * mskisf_cav(:,:)
160      !
161      ! compute ocean-ice heat flux and then derive fwf assuming that ocean heat flux equal latent heat
162      pqfwf(:,:) = - pgt(:,:) * rau0_rcp * zthd(:,:) / rLfusisf    ! fresh water flux  ( > 0 out )
163      pqoce(:,:) = - pqfwf(:,:) * rLfusisf                         ! ocea-ice flux     ( > 0 out )
164      pqhc (:,:) =   pqfwf(:,:) * ztfrz(:,:) * rcp                 ! heat content flux ( > 0 out )
165      !
166      ! output thermal driving and freezinpoint at the ice shelf interface
167      CALL iom_put('isfthermald_cav', zthd )
168      CALL iom_put('isftfrz_cav'    , ztfrz )
169      !
170   END SUBROUTINE isfcav_mlt_2eq
171
172   SUBROUTINE isfcav_mlt_3eq(pgt, pgs , pttbl, pstbl, &  ! <<== in
173      &                           pqhc, pqoce, pqfwf  )  ! ==>> out
174      !!----------------------------------------------------------------------
175      !!
176      !!                          ***  ROUTINE isfcav_mlt_3eq  ***
177      !!
178      !! ** Purpose    : Compute ice shelf fwf/heqt fluxes using the 3 equation formulation
179      !!
180      !! ** Method     : The melt rate is determined considering the heat balance, the salt balance
181      !!                 at the phase change interface and a linearisation of the equation of state.
182      !!
183      !! ** Reference  : - Holland, D. M. and Jenkins, A.,
184      !!                   Modeling Thermodynamic Ice-Ocean Interactions at the Base of an Ice Shelf,
185      !!                   J. Phys. Oceanogr., 29, 1999.
186      !!                 - Asay-Davis, X. S., Cornford, S. L., Durand, G., Galton-Fenzi, B. K., Gladstone,
187      !!                   R. M., Gudmundsson, G. H., Hattermann, T., Holland, D. M., Holland, D., Holland,
188      !!                   P. R., Martin, D. F., Mathiot, P., Pattyn, F., and Seroussi, H.:
189      !!                   Experimental design for three interrelated marine ice sheet and ocean model intercomparison projects:
190      !!                   MISMIP v. 3 (MISMIP +), ISOMIP v. 2 (ISOMIP +) and MISOMIP v. 1 (MISOMIP1),
191      !!                   Geosci. Model Dev., 9, 2471-2497, https://doi.org/10.5194/gmd-9-2471-2016, 2016.
192      !!
193      !!-------------------------- OUT -------------------------------------
194      REAL(wp), DIMENSION(jpi,jpj), INTENT(  out) :: pqhc, pqoce, pqfwf  ! latent heat and fwf fluxes
195      !!-------------------------- IN  -------------------------------------
196      REAL(wp), DIMENSION(jpi,jpj), INTENT(in   ) :: pgt  , pgs          ! heat/salt exchange coeficient
197      REAL(wp), DIMENSION(jpi,jpj), INTENT(in   ) :: pttbl, pstbl        ! mean temperature and salinity in top boundary layer
198      !!--------------------------------------------------------------------
199      REAL(wp) :: zeps1,zeps2,zeps3,zeps4,zeps6,zeps7       ! dummy local scalar for quadratic equation resolution
200      REAL(wp) :: zaqe,zbqe,zcqe,zaqer,zdis,zsfrz,zcfac     ! dummy local scalar for quadratic equation resolution
201      REAL(wp) :: zeps = 1.e-20
202      REAL(wp), DIMENSION(jpi,jpj) :: ztfrz         ! freezing point
203      REAL(wp), DIMENSION(jpi,jpj) :: zqcon         ! conductive flux through the ice shelf
204      REAL(wp), DIMENSION(jpi,jpj) :: zthd          ! thermal driving
205      !
206      INTEGER  ::   ji, jj     ! dummy loop indices
207      !!--------------------------------------------------------------------
208      !
209      ! compute upward heat flux zhtflx and upward water flux zwflx
210      ! Resolution of a 3d equation from equation 24, 25 and 26 (note conduction through the ice has been added to Eq 24)
211      DO jj = 1, jpj
212         DO ji = 1, jpi
213            !
214            ! compute coeficient to solve the 2nd order equation
215            zeps1 = rau0_rcp * pgt(ji,jj)
216            zeps2 = rLfusisf * rau0 * pgs(ji,jj)
217            zeps3 = rhoisf * rcpisf * rkappa / MAX(risfdep(ji,jj),zeps)
218            zeps4 = risf_lamb2 + risf_lamb3 * risfdep(ji,jj)
219            zeps6 = zeps4 - pttbl(ji,jj)
220            zeps7 = zeps4 - rtsurf
221            !
222            ! solve the 2nd order equation to find zsfrz
223            zaqe  = risf_lamb1 * (zeps1 + zeps3)
224            zaqer = 0.5_wp / MIN(zaqe,-zeps)
225            zbqe  = zeps1 * zeps6 + zeps3 * zeps7 - zeps2
226            zcqe  = zeps2 * pstbl(ji,jj)
227            zdis  = zbqe * zbqe - 4.0_wp * zaqe * zcqe               
228            !
229            ! Presumably zdis can never be negative because gammas is very small compared to gammat
230            zsfrz=(-zbqe - SQRT(zdis)) * zaqer
231            IF ( zsfrz < 0.0_wp ) zsfrz=(-zbqe + SQRT(zdis)) * zaqer  ! check this if this if is needed
232            !
233            ! compute t freeze (eq. 25)
234            ztfrz(ji,jj) = zeps4 + risf_lamb1 * zsfrz
235            !
236            ! thermal driving
237            zthd(ji,jj) = ( pttbl(ji,jj) - ztfrz(ji,jj) )
238            !
239            ! compute the upward water and heat flux (eq. 24 and eq. 26)
240            pqfwf(ji,jj) = rau0     * pgs(ji,jj) * ( zsfrz - pstbl(ji,jj) ) / MAX(zsfrz,zeps) ! fresh water flux    (> 0 out)
241            pqoce(ji,jj) = rau0_rcp * pgt(ji,jj) * zthd (ji,jj)                               ! ocean-ice heat flux (> 0 out)
242            pqhc (ji,jj) = rcp      * pqfwf(ji,jj) * ztfrz(ji,jj)                             ! heat content   flux (> 0 out)
243            !
244            zqcon(ji,jj) = zeps3 * ( ztfrz(ji,jj) - rtsurf )
245            !
246         END DO
247      END DO
248      !
249      ! output conductive heat flux through the ice
250      CALL iom_put('qconisf', zqcon(:,:) * mskisf_cav(:,:) )
251      !
252      ! output thermal driving and freezing point at the interface
253      CALL iom_put('isfthermald_cav', zthd (:,:) * mskisf_cav(:,:) )
254      CALL iom_put('isftfrz_cav'    , ztfrz(:,:) * mskisf_cav(:,:) )
255      !
256   END SUBROUTINE isfcav_mlt_3eq
257
258   SUBROUTINE isfcav_mlt_oasis(kt, pstbl,          &  ! <<== in
259      &                        pqhc , pqoce, pqfwf )  ! ==>> out
260      !!----------------------------------------------------------------------
261      !!                          ***  ROUTINE isfcav_mlt_oasis  ***
262      !!
263      !! ** Purpose    : scale the fwf read from input file by the total amount received by the sbccpl interface
264      !!
265      !! ** Purpose    : - read ice shelf melt from forcing file => pattern
266      !!                 - total amount of fwf is given by sbccpl (fwfisf_cpl)
267      !!                 - scale fwf and compute heat fluxes
268      !!
269      !!---------------------------------------------------------------------
270      !!-------------------------- OUT -------------------------------------
271      REAL(wp), DIMENSION(jpi,jpj), INTENT(  out) :: pqhc, pqoce, pqfwf  ! heat content, latent heat and fwf fluxes
272      !!-------------------------- IN  -------------------------------------
273      INTEGER                     , INTENT(in   ) :: kt                  ! current time step
274      REAL(wp), DIMENSION(jpi,jpj), INTENT(in   ) :: pstbl               ! salinity in tbl
275      !!--------------------------------------------------------------------
276      REAL(wp)                     :: zfwf_fld, zfwf_oasis               ! total fwf in the forcing fields (pattern) and from the oasis interface (amount)
277      REAL(wp), DIMENSION(jpi,jpj) :: ztfrz                              ! tbl freezing temperature
278      REAL(wp), DIMENSION(jpi,jpj) :: zfwf                               ! 2d fwf map after scaling
279      !!--------------------------------------------------------------------
280      !
281      ! Calculate freezing temperature
282      CALL eos_fzp( pstbl(:,:), ztfrz(:,:), risfdep(:,:) )
283      !
284      ! read input file
285      CALL fld_read ( kt, 1, sf_isfcav_fwf )
286      !
287      ! ice shelf 2d map
288      zfwf(:,:) = - sf_isfcav_fwf(1)%fnow(:,:,1)
289      !
290      ! compute glob sum from input file
291      ! (PM) should consider delay sum as in fwb (1 time step offset if I well understood)
292      zfwf_fld = glob_sum('isfcav_mlt', e1e2t(:,:) * zfwf(:,:))
293      !
294      ! compute glob sum from atm->oce ice shelf fwf
295      ! (PM) should consider delay sum as in fwb (1 time step offset if I well understood)
296      zfwf_oasis = glob_sum('isfcav_mlt', e1e2t(:,:) * fwfisf_oasis(:,:))
297      !
298      ! scale fwf
299      zfwf(:,:) = zfwf(:,:) * zfwf_oasis / zfwf_fld
300      !
301      ! define fwf and qoce
302      ! ocean heat flux is assume to be equal to the latent heat
303      pqfwf(:,:) =   zfwf(:,:)                         ! fwf                ( >0 out)
304      pqoce(:,:) = - pqfwf(:,:) * rLfusisf             ! ocean heat flux    ( >0 out)
305      pqhc (:,:) =   pqfwf(:,:) * ztfrz(:,:) * rcp     ! heat content flux  ( >0 out)
306      !
307      CALL iom_put('isftfrz_cav', ztfrz * mskisf_cav(:,:) )
308      !
309   END SUBROUTINE isfcav_mlt_oasis
310
311END MODULE isfcavmlt
Note: See TracBrowser for help on using the repository browser.