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

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

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

ENHANCE-02_ISF_nemo: add timing in the main isf routine + various bug fixes + cosmetic changes

File size: 11.3 KB
RevLine 
[11395]1MODULE isfparmlt
2   !!======================================================================
[11403]3   !!                       ***  MODULE  isfparmlt  ***
[11541]4   !! Ice shelf parametrisation module :  update surface ocean boundary condition under ice
5   !!                   shelf using an ice shelf melt parametrisation
[11395]6   !!======================================================================
7   !! History :  4.0  ! original code
8   !!----------------------------------------------------------------------
9
[11541]10   USE isf            ! ice shelf
[11852]11   USE isftbl , ONLY: isf_tbl   ! ice shelf depth average
[11395]12
[11852]13   USE dom_oce                  ! ocean space and time domain
14   USE oce    , ONLY: tsn       ! ocean dynamics and tracers
15   USE phycst , ONLY: rcp, rau0 ! physical constants
16   USE eosbn2 , ONLY: eos_fzp   ! equation of state
[11395]17
[11852]18   USE in_out_manager              ! I/O manager
19   USE iom        , ONLY: iom_put  ! I/O library
20   USE fldread    , ONLY: fld_read !
21   USE lib_fortran, ONLY: glob_sum !
22   USE lib_mpp    , ONLY: ctl_stop !
23
[11395]24   IMPLICIT NONE
25
26   PRIVATE
27
28   PUBLIC  isfpar_mlt 
29   
30   !!----------------------------------------------------------------------
31   !! NEMO/OCE 4.0 , NEMO Consortium (2018)
32   !! $Id: sbcisf.F90 10536 2019-01-16 19:21:09Z mathiot $
33   !! Software governed by the CeCILL license (see ./LICENSE)
34   !!----------------------------------------------------------------------
35CONTAINS
36
37! -------------------------------------------------------------------------------------------------------
38! -------------------------------- PUBLIC SUBROUTINE ----------------------------------------------------
39! -------------------------------------------------------------------------------------------------------
40
[11494]41  SUBROUTINE isfpar_mlt( kt, pqhc, pqoce, pqfwf )
[11395]42      !!---------------------------------------------------------------------
[11494]43      !!                  ***  ROUTINE isfpar_mlt  ***
[11395]44      !!
45      !! ** Purpose : Compute Salt and Heat fluxes related to ice_shelf
46      !!              melting and freezing
47      !!
[11403]48      !! ** Method  :  2 parameterizations are available according
49      !!                        1 : Specified melt flux
[11395]50      !!                        2 : Beckmann & Goose parameterization
51      !!----------------------------------------------------------------------
52      !!-------------------------- OUT -------------------------------------
[11494]53      REAL(wp), DIMENSION(jpi,jpj), INTENT(inout) :: pqfwf, pqoce, pqhc  ! fresh water, ice-ocean heat and heat content fluxes
[11395]54      !!-------------------------- IN  -------------------------------------
55      INTEGER, INTENT(in) ::   kt   ! ocean time step
56      !!---------------------------------------------------------------------
57      !
58      ! Choose among the available ice shelf parametrisation
59      SELECT CASE ( cn_isfpar_mlt )
60      CASE ( 'spe' )    ! specified runoff in depth (Mathiot et al., 2017 in preparation)
61         CALL isfpar_mlt_spe(kt, pqhc, pqoce, pqfwf)
62      CASE ( 'bg03' )    ! Beckmann and Goosse parametrisation
63         CALL isfpar_mlt_bg03(kt, pqhc, pqoce, pqfwf)
64      CASE ( 'oasis' )
[11403]65         CALL isfpar_mlt_oasis( kt, pqhc, pqoce, pqfwf)
[11395]66      CASE DEFAULT
67         CALL ctl_stop('STOP', 'unknown isf melt formulation : cn_isfpar (should not see this)')
68      END SELECT
69      !
70   END SUBROUTINE isfpar_mlt
71
72! -------------------------------------------------------------------------------------------------------
73! -------------------------------- PRIVATE SUBROUTINE ---------------------------------------------------
74! -------------------------------------------------------------------------------------------------------
75
[11494]76   SUBROUTINE isfpar_mlt_spe(kt, pqhc, pqoce, pqfwf)
[11395]77      !!---------------------------------------------------------------------
[11403]78      !!                  ***  ROUTINE isfpar_mlt_spe  ***
[11395]79      !!
80      !! ** Purpose : prescribed ice shelf melting in case ice shelf cavities are closed.
81      !!              data read into a forcing files.
82      !!
83      !!----------------------------------------------------------------------
84      !!-------------------------- OUT -------------------------------------
[11494]85      REAL(wp), DIMENSION(jpi,jpj), INTENT(inout) :: pqhc, pqfwf, pqoce  ! fresh water and ice-ocean heat fluxes
[11395]86      !!-------------------------- IN  -------------------------------------
87      INTEGER,  INTENT(in) :: kt
88      !!--------------------------------------------------------------------
89      INTEGER :: jk
90      REAL(wp), DIMENSION(jpi,jpj,jpk)  :: ztfrz3d
91      REAL(wp), DIMENSION(jpi,jpj)      :: ztfrz
92      !!--------------------------------------------------------------------
93      !
[11403]94      ! 0. ------------Read specified runoff
[11852]95      CALL fld_read ( kt, 1, sf_isfpar_fwf   )
[11395]96      !
97      ! compute ptfrz
[11403]98      ! 1. ------------Mean freezing point
[11395]99      DO jk = 1,jpk
100         CALL eos_fzp(tsn(:,:,jk,jp_sal), ztfrz3d(:,:,jk), gdept_n(:,:,jk))
101      END DO
[11495]102      CALL isf_tbl(ztfrz3d, ztfrz, 'T', misfkt_par, rhisf_tbl_par, misfkb_par, rfrac_tbl_par )
[11395]103      !
104      pqfwf(:,:) = - sf_isfpar_fwf(1)%fnow(:,:,1)      ! fresh water flux from the isf (fwfisf <0 mean melting)
105      pqoce(:,:) =   pqfwf(:,:) * rLfusisf             ! ocean/ice shelf flux assume to be equal to latent heat flux
106      pqhc (:,:) =   pqfwf(:,:) * ztfrz(:,:) * rcp     ! heat content flux
[11876]107      CALL iom_put('isftfrz_par', ztfrz )
[11395]108      !
109   END SUBROUTINE isfpar_mlt_spe
110
111   SUBROUTINE isfpar_mlt_bg03(kt, pqhc, pqoce, pqfwf)
112      !!---------------------------------------------------------------------
[11403]113      !!                  ***  ROUTINE isfpar_mlt_bg03  ***
[11395]114      !!
[11403]115      !! ** Purpose : compute an estimate of ice shelf melting and
116      !!              latent, ocean-ice and heat content heat fluxes
117      !!              in case cavities are closed based on the far fields T and S properties.
[11395]118      !!
[11403]119      !! ** Method  : The ice shelf melt is computed as proportional to the differences between the
120      !!              mean temperature and mean freezing point in front of the ice shelf averaged
121      !!              over the ice shelf min ice shelf draft and max ice shelf draft and the freezing point
[11395]122      !!
123      !! ** Reference : Beckmann and Goosse (2003), "A parameterization of ice shelf-ocean
[11403]124      !!                interaction for climate models", Ocean Modelling 5(2003) 157-170.
[11395]125      !!----------------------------------------------------------------------
126      !!-------------------------- OUT -------------------------------------
[11494]127      REAL(wp), DIMENSION(jpi,jpj), INTENT(inout) :: pqhc, pqfwf, pqoce  ! fresh water and ice-ocean heat fluxes
[11395]128      !!-------------------------- IN  -------------------------------------
129      INTEGER,  INTENT(in) :: kt
130      !!--------------------------------------------------------------------
131      INTEGER :: jk
132      REAL(wp), DIMENSION(jpi,jpj,jpk) :: ztfrz3d        ! freezing point
133      REAL(wp), DIMENSION(jpi,jpj)     :: ztfrz          ! freezing point
134      REAL(wp), DIMENSION(jpi,jpj)     :: ztavg          ! temperature avg
135      !!----------------------------------------------------------------------
136      !
137      ! 0. ------------Mean freezing point
138      DO jk = 1,jpk
139         CALL eos_fzp(tsn(:,:,jk,jp_sal), ztfrz3d(:,:,jk), gdept_n(:,:,jk))
140      END DO
[11495]141      CALL isf_tbl(ztfrz3d, ztfrz, 'T', misfkt_par, rhisf_tbl_par, misfkb_par, rfrac_tbl_par )
[11395]142      !
143      ! 1. ------------Mean temperature
[11495]144      CALL isf_tbl(tsn(:,:,jk,jp_tem), ztavg, 'T', misfkt_par, rhisf_tbl_par, misfkb_par, rfrac_tbl_par )
[11395]145      !
146      ! 2. ------------Net heat flux and fresh water flux due to the ice shelf
[11403]147      pqoce(:,:) =   rau0 * rcp * rn_gammat0 * risfLeff(:,:) * e1t(:,:) * ( ztavg(:,:) - ztfrz(:,:) ) * r1_e1e2t(:,:)
[11541]148      pqfwf(:,:) = - pqoce(:,:) / rLfusisf             ! derived from the latent heat flux
[11395]149      pqhc (:,:) =   pqfwf(:,:) * ztfrz(:,:) * rcp     ! heat content flux
150      !
[11403]151      ! 3. ------------BG03 output
[11395]152      ! output ttbl
[11521]153      CALL iom_put('ttbl_par', ztavg(:,:) * mskisf_par(:,:) )
[11395]154      !
155      ! output thermal driving
[11521]156      CALL iom_put('isfthermald_par',( ztfrz(:,:) - ztavg(:,:) ) * mskisf_par(:,:))
[11876]157      CALL iom_put('isftfrz_par', ztfrz )
[11395]158      !
159   END SUBROUTINE isfpar_mlt_bg03
160
[11403]161   SUBROUTINE isfpar_mlt_oasis(kt, pqhc , pqoce, pqfwf )
162      !!----------------------------------------------------------------------
[11541]163      !!                  ***  ROUTINE isfpar_mlt_oasis  ***
[11403]164      !!
165      !! ** Purpose    : scale the fwf read from input file by the total amount received by the sbccpl interface
166      !!
[11494]167      !! ** Purpose    : - read ice shelf melt from forcing file and scale it by the input file total amount => pattern
168      !!                 - compute total amount of fwf given by sbccpl (fwfisf_oasis)
[11403]169      !!                 - scale fwf and compute heat fluxes
170      !!
171      !!---------------------------------------------------------------------
172      !!-------------------------- OUT -------------------------------------
173      REAL(wp), DIMENSION(jpi,jpj), INTENT(  out) :: pqhc, pqoce, pqfwf  ! heat content, latent heat and fwf fluxes
174      !!-------------------------- IN  -------------------------------------
175      INTEGER                     , INTENT(in   ) :: kt                  ! current time step
176      !!--------------------------------------------------------------------
177      INTEGER                           :: jk                            ! loop index
[11541]178      REAL(wp)                          :: zfwf_fld, zfwf_oasis          ! total fwf in the forcing fields (pattern) and from the cpl interface (amount)
[11403]179      REAL(wp), DIMENSION(jpi,jpj)      :: ztfrz                         ! tbl freezing temperature
180      REAL(wp), DIMENSION(jpi,jpj)      :: zfwf                          ! 2d fwf map after scaling
181      REAL(wp), DIMENSION(jpi,jpj,jpk)  :: ztfrz3d
182      !!--------------------------------------------------------------------
183      !
184      ! 0. ------------Read specified runoff
[11852]185      CALL fld_read ( kt, 1, sf_isfpar_fwf   )
[11403]186      !
[11541]187      ! 1. ------------Mean freezing point (needed for heat content flux)
[11403]188      DO jk = 1,jpk
189         CALL eos_fzp(tsn(:,:,jk,jp_sal), ztfrz3d(:,:,jk), gdept_n(:,:,jk))
190      END DO
[11495]191      CALL isf_tbl(ztfrz3d, ztfrz, 'T', misfkt_par, rhisf_tbl_par, misfkb_par, rfrac_tbl_par )
[11403]192      !
[11541]193      ! 2. ------------Scale isf melt pattern with total amount from oasis
[11403]194      ! ice shelf 2d map
195      zfwf(:,:) = - sf_isfpar_fwf(1)%fnow(:,:,1)
196      !
197      ! compute glob sum from input file
[11425]198      ! (PM) should we consider delay sum as in fwb ? (it will offset by 1 time step if I understood well)
199      zfwf_fld = glob_sum('isfcav_mlt', e1e2t(:,:) * zfwf(:,:))
[11403]200      !
201      ! compute glob sum from atm->oce ice shelf fwf
[11425]202      ! (PM) should we consider delay sum as in fwb ?
203      zfwf_oasis = glob_sum('isfcav_mlt', e1e2t(:,:) * fwfisf_oasis(:,:))
[11403]204      !
205      ! scale fwf
[11423]206      zfwf(:,:) = zfwf(:,:) * zfwf_oasis / zfwf_fld
[11403]207      !
[11541]208      ! i3. -----------Define fwf and qoce
[11403]209      ! ocean heat flux is assume to be equal to the latent heat
210      pqfwf(:,:) =   zfwf(:,:)                         ! fwf                ( >0 out )
211      pqoce(:,:) = - pqfwf(:,:) * rLfusisf             ! ocean heat flux    ( >0 out ) (assumed to be the latent heat flux)
212      pqhc (:,:) =   pqfwf(:,:) * ztfrz(:,:) * rcp     ! heat content flux  ( >0 out )
213      !
[11876]214      CALL iom_put('isftfrz_par', ztfrz )
215      !
[11395]216   END SUBROUTINE isfpar_mlt_oasis
217
218END MODULE isfparmlt
Note: See TracBrowser for help on using the repository browser.