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 @ 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: 5.8 KB
Line 
1MODULE traisf
2   !!==============================================================================
3   !!                       ***  MODULE  traisf  ***
4   !! Ocean active tracers:  ice shelf boundary condition
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      !!----------------------------------------------------------------------
39      !!                  ***  ROUTINE tra_isf  ***
40      !!                   
41      !! ** Purpose :  Compute the temperature trend due to the ice shelf melting (qhoce + qhc)
42      !!
43      !! ** Action  : - update tsa for cav, par and cpl case
44      !!----------------------------------------------------------------------
45      INTEGER, INTENT(in) ::   kt   ! ocean time-step index
46      !!----------------------------------------------------------------------
47      !
48      IF( ln_timing )   CALL timing_start('tra_isf')
49      !
50      ! cavity case
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)
52      !
53      ! parametrisation case
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      !
56      ! ice sheet coupling case
57      IF ( ln_isfcpl ) THEN
58         !
59         IF ( kt == nit000  ) CALL tra_isf_cpl(risfcpl_tsc       , tsa)
60         IF ( kt == nit000+1) CALL tra_isf_cpl(risfcpl_tsc*0.5_wp, tsa)
61         !
62         ! ensure 0 trend due to unconservation of the ice shelf coupling
63         IF ( ln_isfcpl_cons ) CALL tra_isf_cpl(risfcpl_cons_tsc, tsa)
64         !
65      END IF
66      !
67      IF( ln_timing )   CALL timing_stop('tra_isf')
68      !
69   END SUBROUTINE tra_isf
70   !
71   SUBROUTINE tra_isf_mlt(ktop, kbot, phtbl, pfrac, ptsc, ptsc_b, pts)
72      !!----------------------------------------------------------------------
73      !!                  ***  ROUTINE tra_isf_mlt  ***
74      !!
75      !! *** Purpose :  Compute the temperature trend due to the ice shelf melting (qhoce + qhc) for cav or par case
76      !!
77      !! *** Action :: Update tsa with the surface boundary condition trend
78      !!
79      !!----------------------------------------------------------------------
80      REAL(wp), DIMENSION(jpi,jpj,jpk,jpts), INTENT(inout) :: pts
81      !!----------------------------------------------------------------------
82      INTEGER , DIMENSION(jpi,jpj)     , INTENT(in   ) :: ktop , kbot
83      REAL(wp), DIMENSION(jpi,jpj)     , INTENT(in   ) :: phtbl, pfrac
84      REAL(wp), DIMENSION(jpi,jpj,jpts), INTENT(in   ) :: ptsc , ptsc_b
85      !!----------------------------------------------------------------------
86      INTEGER                      :: ji,jj,jk  ! loop index   
87      INTEGER                      :: ikt, ikb  ! top and bottom level of the tbl
88      REAL(wp), DIMENSION(jpi,jpj) :: ztc       ! total ice shelf tracer trend
89      !!----------------------------------------------------------------------
90      !
91      ! compute 2d total trend due to isf
92      ztc(:,:) = 0.5_wp * ( ptsc(:,:,jp_tem) + ptsc_b(:,:,jp_tem) ) / phtbl(:,:)
93      !
94      ! update tsa
95      DO jj = 1,jpj
96         DO ji = 1,jpi
97            !
98            ikt = ktop(ji,jj)
99            ikb = kbot(ji,jj)
100            !
101            ! level fully include in the ice shelf boundary layer
102            DO jk = ikt, ikb - 1
103               pts(ji,jj,jk,jp_tem) = pts(ji,jj,jk,jp_tem) + ztc(ji,jj)
104            END DO
105            !
106            ! level partially include in ice shelf boundary layer
107            pts(ji,jj,ikb,jp_tem) = pts(ji,jj,ikb,jp_tem) + ztc(ji,jj) * pfrac(ji,jj)
108            !
109         END DO
110      END DO
111      !
112   END SUBROUTINE tra_isf_mlt
113   !
114   SUBROUTINE tra_isf_cpl( ptsc, ptsa )
115      !!----------------------------------------------------------------------
116      !!                  ***  ROUTINE tra_isf_cpl  ***
117      !!
118      !! *** Action :: Update tsa with the ice shelf coupling trend
119      !!
120      !!----------------------------------------------------------------------
121      REAL(wp), DIMENSION(jpi,jpj,jpk,jpts), INTENT(inout) :: ptsa
122      !!----------------------------------------------------------------------
123      REAL(wp), DIMENSION(jpi,jpj,jpk,jpts), INTENT(in   ) :: ptsc
124      !!----------------------------------------------------------------------
125      INTEGER :: jk
126      !!----------------------------------------------------------------------
127      !
128      DO jk = 1,jpk
129         ptsa(:,:,jk,jp_tem) = ptsa(:,:,jk,jp_tem) + ptsc(:,:,jk,jp_tem) * r1_e1e2t(:,:) / e3t_n(:,:,jk)
130         ptsa(:,:,jk,jp_sal) = ptsa(:,:,jk,jp_sal) + ptsc(:,:,jk,jp_sal) * r1_e1e2t(:,:) / e3t_n(:,:,jk)
131      END DO
132      !
133   END SUBROUTINE tra_isf_cpl
134   !
135END MODULE traisf
Note: See TracBrowser for help on using the repository browser.