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 @ 11541

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

ENHANCE-02_ISF: simplify use of ln_isf, add extra comments + minor changes (ticket #2142)

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