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.
usrdef_sbc.F90 in NEMO/trunk/tests/ICEDYN/MY_SRC – NEMO

source: NEMO/trunk/tests/ICEDYN/MY_SRC/usrdef_sbc.F90 @ 9789

Last change on this file since 9789 was 9789, checked in by clem, 6 years ago

change the name of SAS_BIPER configuration to a more explicit one: ICEDYN

File size: 7.4 KB
Line 
1MODULE usrdef_sbc
2   !!======================================================================
3   !!                       ***  MODULE  usrdef_sbc  ***
4   !!
5   !!                      ===  ICEDYN configuration  ===
6   !!
7   !! User defined :   surface forcing of a user configuration
8   !!======================================================================
9   !! History :  4.0   ! 2016-03  (S. Flavoni, G. Madec)  user defined interface
10   !!----------------------------------------------------------------------
11
12   !!----------------------------------------------------------------------
13   !!   usr_def_sbc    : user defined surface bounday conditions in ICEDYN 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 sbc_ice         ! Surface boundary condition: ice fields
19   USE phycst          ! physical constants
20   USE ice, ONLY       : at_i_b, a_i_b
21   USE icethd_dh       ! for CALL ice_thd_snwblow
22   !
23   USE in_out_manager  ! I/O manager
24   USE lib_mpp         ! distribued memory computing library
25   USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
26   USE lib_fortran     ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined)
27
28   IMPLICIT NONE
29   PRIVATE
30
31   PUBLIC   usrdef_sbc_oce      ! routine called by sbcmod.F90 for sbc ocean
32   PUBLIC   usrdef_sbc_ice_tau  ! routine called by icestp.F90 for ice dynamics
33   PUBLIC   usrdef_sbc_ice_flx  ! routine called by icestp.F90 for ice thermo
34
35   !! * Substitutions
36#  include "vectopt_loop_substitute.h90"
37   !!----------------------------------------------------------------------
38   !! NEMO/OPA 4.0 , NEMO Consortium (2016)
39   !! $Id$
40   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
41   !!----------------------------------------------------------------------
42CONTAINS
43
44   SUBROUTINE usrdef_sbc_oce( kt )
45      !!---------------------------------------------------------------------
46      !!                    ***  ROUTINE usr_def_sbc  ***
47      !!             
48      !! ** Purpose :   provide at each time-step the surface boundary
49      !!              condition, i.e. the momentum, heat and freshwater fluxes.
50      !!
51      !! ** Method  :   all 0 fields, for ICEDYN case
52      !!                CAUTION : never mask the surface stress field !
53      !!
54      !! ** Action  : - set to ZERO all the ocean surface boundary condition, i.e.   
55      !!                   utau, vtau, taum, wndm, qns, qsr, emp, sfx
56      !!
57      !!----------------------------------------------------------------------
58      INTEGER, INTENT(in) ::   kt   ! ocean time step
59      !!---------------------------------------------------------------------
60      !
61      IF( kt == nit000 ) THEN
62         !
63         IF(lwp)   WRITE(numout,*)' usrdef_sbc_oce : ICEDYN case: NO surface forcing'
64         ! --- oce variables --- !
65         utau(:,:) = 0._wp 
66         vtau(:,:) = 0._wp
67         taum(:,:) = 0._wp
68         wndm(:,:) = 0._wp
69         !
70         emp (:,:) = 0._wp
71         sfx (:,:) = 0._wp
72         qns (:,:) = 0._wp
73         qsr (:,:) = 0._wp
74         !
75         utau_b(:,:) = 0._wp 
76         vtau_b(:,:) = 0._wp
77         emp_b (:,:) = 0._wp
78         sfx_b (:,:) = 0._wp
79         qns_b (:,:) = 0._wp
80         !
81      ENDIF
82      !
83   END SUBROUTINE usrdef_sbc_oce
84
85   SUBROUTINE usrdef_sbc_ice_tau( kt )
86      !!---------------------------------------------------------------------
87      !!                     ***  ROUTINE usrdef_sbc_ice_tau  ***
88      !!
89      !! ** Purpose :   provide the surface boundary (momentum) condition over sea-ice
90      !!---------------------------------------------------------------------
91      INTEGER, INTENT(in) ::   kt   ! ocean time step
92      !!---------------------------------------------------------------------
93      IF( kt==nit000 .AND. lwp)   WRITE(numout,*)' usrdef_sbc_ice : ICEDYN case: constant stress forcing'
94      !
95      utau_ice(:,:) = 1.3_wp   ! <=> 0.5 m/s
96      vtau_ice(:,:) = 0._wp
97      !
98   END SUBROUTINE usrdef_sbc_ice_tau
99
100   SUBROUTINE usrdef_sbc_ice_flx( kt, phs, phi )
101      !!---------------------------------------------------------------------
102      !!                     ***  ROUTINE usrdef_sbc_ice_flx  ***
103      !!
104      !! ** Purpose :   provide the surface boundary (flux) condition over sea-ice
105      !!---------------------------------------------------------------------
106      INTEGER, INTENT(in) ::   kt   ! ocean time step
107      REAL(wp), DIMENSION(:,:,:), INTENT(in)  ::   phs    ! snow thickness
108      REAL(wp), DIMENSION(:,:,:), INTENT(in)  ::   phi    ! ice thickness
109      !!
110      REAL(wp) ::   zfr1, zfr2                 ! local variables
111      REAL(wp), DIMENSION(jpi,jpj) ::   zsnw   ! snw distribution after wind blowing
112      !!---------------------------------------------------------------------
113      !
114      IF( kt==nit000 .AND. lwp)   WRITE(numout,*)' usrdef_sbc_ice : ICEDYN case: NO flux forcing'
115      !
116      ! ocean variables (renaming)
117      emp_oce (:,:)   = 0._wp   ! uniform value for freshwater budget (E-P)
118      qsr_oce (:,:)   = 0._wp   ! uniform value for     solar radiation
119      qns_oce (:,:)   = 0._wp   ! uniform value for non-solar radiation
120
121      ! ice variables
122      alb_ice (:,:,:) = 0.7_wp  ! useless
123      qsr_ice (:,:,:) = 0._wp   ! uniform value for     solar radiation
124      qns_ice (:,:,:) = 0._wp   ! uniform value for non-solar radiation
125      sprecip (:,:)   = 0._wp   ! uniform value for snow precip
126      evap_ice(:,:,:) = 0._wp   ! uniform value for sublimation
127
128      ! ice fields deduced from above
129      zsnw(:,:) = 1._wp
130      !!CALL lim_thd_snwblow( at_i_b, zsnw )  ! snow distribution over ice after wind blowing
131      emp_ice  (:,:)   = SUM( a_i_b(:,:,:) * evap_ice(:,:,:), dim=3 ) - sprecip(:,:) * zsnw(:,:)
132      emp_oce  (:,:)   = emp_oce(:,:) - sprecip(:,:) * (1._wp - zsnw(:,:) )
133      qevap_ice(:,:,:) =   0._wp
134      qprec_ice(:,:)   =   rhosn * ( sst_m(:,:) * cpic - lfus ) * tmask(:,:,1) !  in J/m3
135      qemp_oce (:,:)   = - emp_oce(:,:) * sst_m(:,:) * rcp
136      qemp_ice (:,:)   =   sprecip(:,:) * zsnw * ( sst_m(:,:) * cpic - lfus ) * tmask(:,:,1) ! solid precip (only)
137
138      ! total fluxes
139      emp_tot (:,:) = emp_ice  + emp_oce
140      qns_tot (:,:) = at_i_b(:,:) * qns_oce(:,:) + SUM( a_i_b(:,:,:) * qns_ice(:,:,:), dim=3 ) + qemp_ice(:,:) + qemp_oce(:,:)
141      qsr_tot (:,:) = at_i_b(:,:) * qsr_oce(:,:) + SUM( a_i_b(:,:,:) * qsr_ice(:,:,:), dim=3 )
142
143      ! --- shortwave radiation transmitted below the surface (W/m2, see Grenfell Maykut 77) --- !
144      zfr1 = ( 0.18 * ( 1.0 - cldf_ice ) + 0.35 * cldf_ice )            ! transmission when hi>10cm
145      zfr2 = ( 0.82 * ( 1.0 - cldf_ice ) + 0.65 * cldf_ice )            ! zfr2 such that zfr1 + zfr2 to equal 1
146      !
147      WHERE    ( phs(:,:,:) <= 0._wp .AND. phi(:,:,:) <  0.1_wp )       ! linear decrease from hi=0 to 10cm 
148         qsr_ice_tr(:,:,:) = qsr_ice(:,:,:) * ( zfr1 + zfr2 * ( 1._wp - phi(:,:,:) * 10._wp ) )
149      ELSEWHERE( phs(:,:,:) <= 0._wp .AND. phi(:,:,:) >= 0.1_wp )       ! constant (zfr1) when hi>10cm
150         qsr_ice_tr(:,:,:) = qsr_ice(:,:,:) * zfr1
151      ELSEWHERE                                                         ! zero when hs>0
152         qsr_ice_tr(:,:,:) = 0._wp 
153      END WHERE
154         
155   END SUBROUTINE usrdef_sbc_ice_flx
156
157
158   !!======================================================================
159END MODULE usrdef_sbc
Note: See TracBrowser for help on using the repository browser.