source: NEMO/trunk/tests/CANAL/MY_SRC/usrdef_sbc.F90 @ 12377

Last change on this file since 12377 was 12377, checked in by acc, 7 months ago

The big one. Merging all 2019 developments from the option 1 branch back onto the trunk.

This changeset reproduces 2019/dev_r11943_MERGE_2019 on the trunk using a 2-URL merge
onto a working copy of the trunk. I.e.:

svn merge —ignore-ancestry \

svn+ssh://acc@forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/NEMO/trunk \
svn+ssh://acc@forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/NEMO/branches/2019/dev_r11943_MERGE_2019 ./

The —ignore-ancestry flag avoids problems that may otherwise arise from the fact that
the merge history been trunk and branch may have been applied in a different order but
care has been taken before this step to ensure that all applicable fixes and updates
are present in the merge branch.

The trunk state just before this step has been branched to releases/release-4.0-HEAD
and that branch has been immediately tagged as releases/release-4.0.2. Any fixes
or additions in response to tickets on 4.0, 4.0.1 or 4.0.2 should be done on
releases/release-4.0-HEAD. From now on future 'point' releases (e.g. 4.0.2) will
remain unchanged with periodic releases as needs demand. Note release-4.0-HEAD is a
transitional naming convention. Future full releases, say 4.2, will have a release-4.2
branch which fulfills this role and the first point release (e.g. 4.2.0) will be made
immediately following the release branch creation.

2020 developments can be started from any trunk revision later than this one.

  • Property svn:keywords set to Id
File size: 4.6 KB
Line 
1MODULE usrdef_sbc
2   !!======================================================================
3   !!                       ***  MODULE  usrdef_sbc  ***
4   !!
5   !!                      ===  CANAL configuration  ===
6   !!
7   !! User defined :   surface forcing of a user configuration
8   !!======================================================================
9   !! History :  4.0   ! 2017-11  (J.Chanut)  user defined interface
10   !!----------------------------------------------------------------------
11
12   !!----------------------------------------------------------------------
13   !!   usr_def_sbc    : user defined surface bounday conditions in OVERFLOW case
14   !!----------------------------------------------------------------------
15   USE oce             ! ocean dynamics and tracers
16   USE dom_oce         ! ocean space and time domain
17   USE sbc_oce         ! Surface boundary condition: ocean fields
18   USE phycst          ! physical constants
19   USE usrdef_nam, ONLY : rn_u10, rn_uofac, rn_windszy 
20   !
21   USE in_out_manager  ! I/O manager
22   USE lib_mpp         ! distribued memory computing library
23   USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
24   USE lib_fortran     ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined)
25
26   IMPLICIT NONE
27   PRIVATE
28
29   PUBLIC   usrdef_sbc_oce      ! routine called in sbcmod module
30   PUBLIC   usrdef_sbc_ice_tau  ! routine called by icestp.F90 for ice dynamics
31   PUBLIC   usrdef_sbc_ice_flx  ! routine called by icestp.F90 for ice thermo
32
33   !!----------------------------------------------------------------------
34   !! NEMO/OCE 4.0 , NEMO Consortium (2018)
35   !! $Id$
36   !! Software governed by the CeCILL license (see ./LICENSE)
37   !!----------------------------------------------------------------------
38CONTAINS
39
40   SUBROUTINE usrdef_sbc_oce( kt, Kmm, Kbb )
41      !!---------------------------------------------------------------------
42      !!                    ***  ROUTINE usr_def_sbc  ***
43      !!             
44      !! ** Purpose :   provide at each time-step the surface boundary
45      !!              condition, i.e. the momentum, heat and freshwater fluxes.
46      !!
47      !! ** Method  :   all 0 fields, for CANAL case
48      !!                CAUTION : never mask the surface stress field !
49      !!
50      !! ** Action  : - set to ZERO all the ocean surface boundary condition, i.e.   
51      !!                   utau, vtau, taum, wndm, qns, qsr, emp, sfx
52      !!
53      !!----------------------------------------------------------------------
54      INTEGER, INTENT(in) ::   kt        ! ocean time step
55      INTEGER, INTENT(in) ::   Kbb, Kmm  ! ocean time index
56      INTEGER  ::   ji, jj               ! dummy loop indices
57      REAL(wp) :: zrhoair = 1.22     ! approximate air density [Kg/m3]
58      REAL(wp) :: zcd = 1.13e-3      ! approximate drag coefficient
59      REAL(wp) :: zrhocd             ! Rho * Cd
60      REAL(wp), DIMENSION(jpi,jpj) :: zwndrel   ! relative wind
61      !!---------------------------------------------------------------------
62      !
63      zrhocd = zrhoair * zcd
64     
65      IF( kt == nit000 ) THEN
66         !
67         IF(lwp) WRITE(numout,*)' usr_sbc : EW_CANAL case: surface forcing'
68         IF(lwp) WRITE(numout,*)' ~~~~~~~~~~~   vtau = taum = wndm = qns = qsr = emp = sfx = 0'
69         !
70         utau(:,:) = 0._wp
71         IF( rn_u10 /= 0. .AND. rn_windszy > 0. ) THEN
72            WHERE( ABS(gphit) <= rn_windszy/2. ) utau(:,:) = zrhocd * rn_u10 * rn_u10
73         ENDIF
74         vtau(:,:) = 0._wp
75         taum(:,:) = 0._wp
76         wndm(:,:) = 0._wp
77         !
78         emp (:,:) = 0._wp
79         sfx (:,:) = 0._wp
80         qns (:,:) = 0._wp
81         qsr (:,:) = 0._wp
82         !         
83      ENDIF
84
85      IF( rn_uofac /= 0. ) THEN
86         
87         WHERE( ABS(gphit) <= rn_windszy/2. )
88            zwndrel(:,:) = rn_u10 - rn_uofac * uu(:,:,1,Kmm)
89         ELSEWHERE
90            zwndrel(:,:) =        - rn_uofac * uu(:,:,1,Kmm)
91         END WHERE
92         utau(:,:) = zrhocd * zwndrel(:,:) * zwndrel(:,:)
93
94         zwndrel(:,:) = - rn_uofac * vv(:,:,1,Kmm)
95         vtau(:,:) = zrhocd * zwndrel(:,:) * zwndrel(:,:)
96
97      ENDIF
98      !
99   END SUBROUTINE usrdef_sbc_oce
100
101   SUBROUTINE usrdef_sbc_ice_tau( kt )
102      INTEGER, INTENT(in) ::   kt   ! ocean time step
103   END SUBROUTINE usrdef_sbc_ice_tau
104
105
106   SUBROUTINE usrdef_sbc_ice_flx( kt, phs, phi )
107      INTEGER, INTENT(in) ::   kt   ! ocean time step
108      REAL(wp), DIMENSION(:,:,:), INTENT(in)  ::   phs    ! snow thickness
109      REAL(wp), DIMENSION(:,:,:), INTENT(in)  ::   phi    ! ice thickness
110   END SUBROUTINE usrdef_sbc_ice_flx
111
112   !!======================================================================
113END MODULE usrdef_sbc
Note: See TracBrowser for help on using the repository browser.