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/2020/dev_r13383_HPC-02_Daley_Tiling/src/OCE/TRA – NEMO

source: NEMO/branches/2020/dev_r13383_HPC-02_Daley_Tiling/src/OCE/TRA/traisf.F90 @ 13518

Last change on this file since 13518 was 13518, checked in by hadcv, 4 years ago

Tiling for modules before tra_adv

File size: 7.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 isf_oce                                     ! Ice shelf variables
13   USE par_oce , ONLY : nijtile, ntile, ntsi, ntei, ntsj, ntej
14   USE dom_oce                                     ! ocean space domain variables
15   USE isfutils, ONLY : debug                      ! debug option
16   USE timing  , ONLY : timing_start, timing_stop  ! Timing
17   USE in_out_manager                              ! I/O manager
18
19   IMPLICIT NONE
20   PRIVATE
21
22   PUBLIC   tra_isf   ! routine called by step.F90
23
24   !! * Substitutions
25#  include "do_loop_substitute.h90"
26#  include "domzgr_substitute.h90"
27   !!----------------------------------------------------------------------
28   !! NEMO/OCE 4.0 , NEMO Consortium (2018)
29   !! $Id: trasbc.F90 10499 2019-01-10 15:12:24Z deazer $
30   !! Software governed by the CeCILL license (see ./LICENSE)
31   !!----------------------------------------------------------------------
32CONTAINS
33
34   ! TODO: NOT TESTED- requires isf
35   SUBROUTINE tra_isf ( kt, Kmm, pts, Krhs )
36      !!----------------------------------------------------------------------
37      !!                  ***  ROUTINE tra_isf  ***
38      !!                   
39      !! ** Purpose :  Compute the temperature trend due to the ice shelf melting (qhoce + qhc)
40      !!
41      !! ** Action  : - update pts(:,:,:,:,Krhs) for cav, par and cpl case
42      !!----------------------------------------------------------------------
43      INTEGER                                  , INTENT(in   ) :: kt        ! ocean time step
44      INTEGER                                  , INTENT(in   ) :: Kmm, Krhs ! ocean time level indices
45      REAL(wp), DIMENSION(jpi,jpj,jpk,jpts,jpt), INTENT(inout) :: pts       ! active tracers and RHS of tracer equation
46      !!----------------------------------------------------------------------
47      !
48      IF( ln_timing )   CALL timing_start('tra_isf')
49      !
50      IF( ntile == 0 .OR. ntile == 1 )  THEN                       ! Do only on the first tile
51         IF( kt == nit000 ) THEN
52            IF(lwp) WRITE(numout,*)
53            IF(lwp) WRITE(numout,*) 'tra_isf : Ice shelf heat fluxes'
54            IF(lwp) WRITE(numout,*) '~~~~~~~ '
55         ENDIF
56      ENDIF
57      !
58      ! cavity case
59      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, pts(:,:,:,:,Krhs))
60      !
61      ! parametrisation case
62      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, pts(:,:,:,:,Krhs))
63      !
64      ! ice sheet coupling case
65      IF ( ln_isfcpl ) THEN
66         !
67         ! Dynamical stability at start up after change in under ice shelf cavity geometry is achieve by correcting the divergence.
68         ! This is achieved by applying a volume flux in order to keep the horizontal divergence after remapping
69         ! the same as at the end of the latest time step. So correction need to be apply at nit000 (euler time step) and
70         ! half of it at nit000+1 (leap frog time step).
71         ! in accordance to this, the heat content flux due to injected water need to be added in the temperature and salt trend
72         ! at time step nit000 and nit000+1
73         IF ( kt == nit000  ) CALL tra_isf_cpl(Kmm, risfcpl_tsc       , pts(:,:,:,:,Krhs))
74         IF ( kt == nit000+1) CALL tra_isf_cpl(Kmm, risfcpl_tsc*0.5_wp, pts(:,:,:,:,Krhs))
75         !
76         ! ensure 0 trend due to unconservation of the ice shelf coupling
77         IF ( ln_isfcpl_cons ) CALL tra_isf_cpl(Kmm, risfcpl_cons_tsc, pts(:,:,:,:,Krhs))
78         !
79      END IF
80      !
81      IF ( ln_isfdebug ) THEN
82         IF( ntile == 0 .OR. ntile == nijtile ) THEN                       ! Do only for the full domain
83            CALL debug('tra_isf: pts(:,:,:,:,Krhs) T', pts(:,:,:,1,Krhs))
84            CALL debug('tra_isf: pts(:,:,:,:,Krhs) S', pts(:,:,:,2,Krhs))
85         ENDIF
86      END IF
87      !
88      IF( ln_timing )   CALL timing_stop('tra_isf')
89      !
90   END SUBROUTINE tra_isf
91   !
92   ! TODO: NOT TESTED- requires isf
93   SUBROUTINE tra_isf_mlt(ktop, kbot, phtbl, pfrac, ptsc, ptsc_b, pts)
94      !!----------------------------------------------------------------------
95      !!                  ***  ROUTINE tra_isf_mlt  ***
96      !!
97      !! *** Purpose :  Compute the temperature trend due to the ice shelf melting (qhoce + qhc) for cav or par case
98      !!
99      !! *** Action :: Update pts(:,:,:,:,Krhs) with the surface boundary condition trend
100      !!
101      !!----------------------------------------------------------------------
102      REAL(wp), DIMENSION(jpi,jpj,jpk,jpts), INTENT(inout) :: pts
103      !!----------------------------------------------------------------------
104      INTEGER , DIMENSION(jpi,jpj)     , INTENT(in   ) :: ktop , kbot
105      REAL(wp), DIMENSION(jpi,jpj)     , INTENT(in   ) :: phtbl, pfrac
106      REAL(wp), DIMENSION(jpi,jpj,jpts), INTENT(in   ) :: ptsc , ptsc_b
107      !!----------------------------------------------------------------------
108      INTEGER                      :: ji,jj,jk  ! loop index   
109      INTEGER                      :: ikt, ikb  ! top and bottom level of the tbl
110      REAL(wp), DIMENSION(ST_2D(nn_hls))     :: ztc       ! total ice shelf tracer trend
111      !!----------------------------------------------------------------------
112      !
113      ! compute 2d total trend due to isf
114      DO_2D( 1, 1, 1, 1 )
115         ztc(ji,jj) = 0.5_wp * ( ptsc(ji,jj,jp_tem) + ptsc_b(ji,jj,jp_tem) ) / phtbl(ji,jj)
116      END_2D
117      !
118      ! update pts(:,:,:,:,Krhs)
119      DO_2D( 1, 1, 1, 1 )
120         !
121         ikt = ktop(ji,jj)
122         ikb = kbot(ji,jj)
123         !
124         ! level fully include in the ice shelf boundary layer
125         DO jk = ikt, ikb - 1
126            pts(ji,jj,jk,jp_tem) = pts(ji,jj,jk,jp_tem) + ztc(ji,jj)
127         END DO
128         !
129         ! level partially include in ice shelf boundary layer
130         pts(ji,jj,ikb,jp_tem) = pts(ji,jj,ikb,jp_tem) + ztc(ji,jj) * pfrac(ji,jj)
131         !
132      END_2D
133      !
134   END SUBROUTINE tra_isf_mlt
135   !
136   ! TODO: NOT TESTED- requires isf
137   SUBROUTINE tra_isf_cpl( Kmm, ptsc, ptsa )
138      !!----------------------------------------------------------------------
139      !!                  ***  ROUTINE tra_isf_cpl  ***
140      !!
141      !! *** Action :: Update pts(:,:,:,:,Krhs) with the ice shelf coupling trend
142      !!
143      !!----------------------------------------------------------------------
144      REAL(wp), DIMENSION(jpi,jpj,jpk,jpts), INTENT(inout) :: ptsa
145      !!----------------------------------------------------------------------
146      INTEGER                              , INTENT(in   ) :: Kmm   ! ocean time level index
147      REAL(wp), DIMENSION(jpi,jpj,jpk,jpts), INTENT(in   ) :: ptsc
148      !!----------------------------------------------------------------------
149      INTEGER :: ji, jj, jk
150      !!----------------------------------------------------------------------
151      !
152      DO_3D( 0, 0, 0, 0, 1, jpk )
153         ptsa(ji,jj,jk,jp_tem) = ptsa(ji,jj,jk,jp_tem) + ptsc(ji,jj,jk,jp_tem) * r1_e1e2t(ji,jj) / e3t(ji,jj,jk,Kmm)
154         ptsa(ji,jj,jk,jp_sal) = ptsa(ji,jj,jk,jp_sal) + ptsc(ji,jj,jk,jp_sal) * r1_e1e2t(ji,jj) / e3t(ji,jj,jk,Kmm)
155      END_3D
156      !
157   END SUBROUTINE tra_isf_cpl
158   !
159END MODULE traisf
Note: See TracBrowser for help on using the repository browser.