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

source: NEMO/branches/2019/ENHANCE-02_ISF_nemo/src/OCE/TRA/traisf.F90 @ 11423

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

ENHANCE-02_ISF_nemo : add UKESM ice sheet coupling method (ticket #2142)

File size: 5.7 KB
RevLine 
[11395]1MODULE traisf
2   !!==============================================================================
[11403]3   !!                       ***  MODULE  traisf  ***
4   !! Ocean active tracers:  ice shelf boundary condition
[11395]5   !!==============================================================================
6   !! History :    4.0  !  2019-09  (P. Mathiot) original file
7   !!----------------------------------------------------------------------
8
9   !!----------------------------------------------------------------------
10   !!   tra_isf       : update the tracer trend at ocean surface
11   !!----------------------------------------------------------------------
12   USE oce            ! ocean dynamics and active tracers
13   USE dom_oce        ! ocean space domain variables
14   USE phycst         ! physical constant
15   USE eosbn2         ! Equation Of State
16   USE isf            ! Ice shelf variable
17   USE isfutils       !
18   !
19   USE in_out_manager ! I/O manager
20   USE iom            ! xIOS server
21   USE timing         ! Timing
22
23   IMPLICIT NONE
24   PRIVATE
25
26   PUBLIC   tra_isf   ! routine called by step.F90
27
28   !! * Substitutions
29#  include "vectopt_loop_substitute.h90"
30   !!----------------------------------------------------------------------
31   !! NEMO/OCE 4.0 , NEMO Consortium (2018)
32   !! $Id: trasbc.F90 10499 2019-01-10 15:12:24Z deazer $
33   !! Software governed by the CeCILL license (see ./LICENSE)
34   !!----------------------------------------------------------------------
35CONTAINS
36
37   SUBROUTINE tra_isf ( kt )
38      !!----------------------------------------------------------------------
[11403]39      !!                  ***  ROUTINE tra_isf  ***
[11395]40      !!                   
[11403]41      !! ** Purpose :  Compute the temperature trend due to the ice shelf melting (qhoce + qhc)
[11395]42      !!
[11403]43      !! ** Action  : - update tsa for cav, par and cpl case
[11395]44      !!----------------------------------------------------------------------
45      INTEGER, INTENT(in) ::   kt   ! ocean time-step index
46      !!----------------------------------------------------------------------
47      !
48      IF( ln_timing )   CALL timing_start('tra_sbc')
49      !
[11403]50      ! cavity case
[11395]51      IF ( ln_isfcav_mlt ) CALL tra_isf_mlt(misfkt_cav, misfkb_cav, rhisf_tbl_cav, rfrac_tbl_cav, risf_cav_tsc, risf_cav_tsc_b, tsa)
[11403]52      !
53      ! parametrisation case
[11395]54      IF ( ln_isfpar_mlt ) CALL tra_isf_mlt(misfkt_par, misfkb_par, rhisf_tbl_par, rfrac_tbl_par, risf_par_tsc, risf_par_tsc_b, tsa)
55      !
[11403]56      ! ice sheet coupling case
[11423]57      IF ( ll_isfcpl .AND. kt == nit000 ) CALL tra_isf_cpl(risfcpl_tsc, tsa)
[11395]58      !
[11423]59      ! ice sheet coupling case (
60      IF ( ll_isfcpl_cons ) CALL tra_isf_cpl(risfcpl_cons_tsc, tsa)
61      !
[11395]62      IF( ln_timing )   CALL timing_stop('tra_isf')
63      !
64   END SUBROUTINE tra_isf
65   !
66   SUBROUTINE tra_isf_mlt(ktop, kbot, phtbl, pfrac, ptsc, ptsc_b, pts)
67      !!----------------------------------------------------------------------
[11403]68      !!                  ***  ROUTINE tra_isf_mlt  ***
69      !!
70      !! *** Purpose :  Compute the temperature trend due to the ice shelf melting (qhoce + qhc) for cav or par case
71      !!
72      !! *** Action :: Update tsa with the surface boundary condition trend
73      !!
74      !!----------------------------------------------------------------------
[11395]75      REAL(wp), DIMENSION(jpi,jpj,jpk,jpts), INTENT(inout) :: pts
76      !!----------------------------------------------------------------------
77      INTEGER , DIMENSION(jpi,jpj)     , INTENT(in   ) :: ktop , kbot
78      REAL(wp), DIMENSION(jpi,jpj)     , INTENT(in   ) :: phtbl, pfrac
79      REAL(wp), DIMENSION(jpi,jpj,jpts), INTENT(in   ) :: ptsc , ptsc_b
80      !!----------------------------------------------------------------------
[11403]81      INTEGER                      :: ji,jj,jk  ! loop index   
82      INTEGER                      :: ikt, ikb  ! top and bottom level of the tbl
83      REAL(wp), DIMENSION(jpi,jpj) :: ztc       ! total ice shelf tracer trend
84      !!----------------------------------------------------------------------
[11395]85      !
86      ! compute 2d total trend due to isf
87      ztc(:,:) = 0.5_wp * ( ptsc(:,:,jp_tem) + ptsc_b(:,:,jp_tem) ) / phtbl(:,:)
88      !
89      ! update tsa
90      DO jj = 1,jpj
91         DO ji = 1,jpi
92            !
93            ikt = ktop(ji,jj)
94            ikb = kbot(ji,jj)
95            !
96            ! level fully include in the ice shelf boundary layer
97            ! sign - because fwf sign of evapo (rnf sign of precip)
98            DO jk = ikt, ikb - 1
99               pts(ji,jj,jk,jp_tem) = pts(ji,jj,jk,jp_tem) + ztc(ji,jj)
100            END DO
101            !
102            ! level partially include in ice shelf boundary layer
103            pts(ji,jj,ikb,jp_tem) = pts(ji,jj,ikb,jp_tem) + ztc(ji,jj) * pfrac(ji,jj)
104            !
105         END DO
106      END DO
107      !
108   END SUBROUTINE tra_isf_mlt
109   !
[11423]110   SUBROUTINE tra_isf_cpl( ptsc, ptsa )
111      !!----------------------------------------------------------------------
112      !!                  ***  ROUTINE tra_isf_cpl  ***
113      !!
114      !! *** Action :: Update tsa with the ice shelf coupling trend
115      !!
116      !!----------------------------------------------------------------------
117      REAL(wp), DIMENSION(jpi,jpj,jpk,jpts), INTENT(inout) :: ptsa
118      !!----------------------------------------------------------------------
119      REAL(wp), DIMENSION(jpi,jpj,jpk,jpts), INTENT(in   ) :: ptsc  !( >0 out )
120      !!----------------------------------------------------------------------
121      INTEGER :: jk
122      !!----------------------------------------------------------------------
123      !
124      DO jk = 1,jpk
125         ptsa(:,:,jk,jp_tem) = ptsa(:,:,jk,jp_tem) - ptsc(:,:,jk,jp_tem) * r1_e1e2t(:,:) / e3t_n(:,:,jk)
126         ptsa(:,:,jk,jp_sal) = ptsa(:,:,jk,jp_sal) - ptsc(:,:,jk,jp_sal) * r1_e1e2t(:,:) / e3t_n(:,:,jk)
127      END DO
128      !
129   END SUBROUTINE tra_isf_cpl
[11395]130   !
131END MODULE traisf
Note: See TracBrowser for help on using the repository browser.