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/ICE_ADV1D/MY_SRC – NEMO

source: NEMO/trunk/tests/ICE_ADV1D/MY_SRC/usrdef_sbc.F90 @ 14072

Last change on this file since 14072 was 14072, checked in by laurent, 3 years ago

Merging branch "2020/dev_r13648_ASINTER-04_laurent_bulk_ice", ticket #2369

File size: 7.6 KB
Line 
1MODULE usrdef_sbc
2   !!======================================================================
3   !!                       ***  MODULE  usrdef_sbc  ***
4   !!
5   !!                      ===  ICE_ADV1D 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 ICE_ADV1D 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   USE sbc_phy, ONLY : pp_cldf
23   !
24   USE in_out_manager  ! I/O manager
25   USE lib_mpp         ! distribued memory computing library
26   USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
27   USE lib_fortran     ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined)
28
29   
30   IMPLICIT NONE
31   PRIVATE
32
33   PUBLIC   usrdef_sbc_oce      ! routine called by sbcmod.F90 for sbc ocean
34   PUBLIC   usrdef_sbc_ice_tau  ! routine called by icestp.F90 for ice dynamics
35   PUBLIC   usrdef_sbc_ice_flx  ! routine called by icestp.F90 for ice thermo
36
37   !!----------------------------------------------------------------------
38   !! NEMO/OCE 4.0 , NEMO Consortium (2018)
39   !! $Id: usrdef_sbc.F90 10074 2018-08-28 16:15:49Z nicolasmartin $
40   !! Software governed by the CeCILL license (see ./LICENSE)
41   !!----------------------------------------------------------------------
42CONTAINS
43
44   SUBROUTINE usrdef_sbc_oce( kt, Kbb )
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 ICE_ADV1D 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      INTEGER, INTENT(in) ::   Kbb  ! ocean time index
60      !!---------------------------------------------------------------------
61      !
62      IF( kt == nit000 ) THEN
63         !
64         IF(lwp)   WRITE(numout,*)' usrdef_sbc_oce : ICE_ADV1D case: NO surface forcing'
65         ! --- oce variables --- !
66         utau(:,:) = 0._wp 
67         vtau(:,:) = 0._wp
68         taum(:,:) = 0._wp
69         wndm(:,:) = 0._wp
70         !
71         emp (:,:) = 0._wp
72         sfx (:,:) = 0._wp
73         qns (:,:) = 0._wp
74         qsr (:,:) = 0._wp
75         !
76         utau_b(:,:) = 0._wp 
77         vtau_b(:,:) = 0._wp
78         emp_b (:,:) = 0._wp
79         sfx_b (:,:) = 0._wp
80         qns_b (:,:) = 0._wp
81         !
82      ENDIF
83      !
84   END SUBROUTINE usrdef_sbc_oce
85
86   SUBROUTINE usrdef_sbc_ice_tau( kt )
87      !!---------------------------------------------------------------------
88      !!                     ***  ROUTINE usrdef_sbc_ice_tau  ***
89      !!
90      !! ** Purpose :   provide the surface boundary (momentum) condition over sea-ice
91      !!---------------------------------------------------------------------
92      INTEGER, INTENT(in) ::   kt   ! ocean time step
93      !!---------------------------------------------------------------------
94      IF( kt==nit000 .AND. lwp)   WRITE(numout,*)' usrdef_sbc_ice : ICE_ADV1D case: no stress forcing'
95      !
96      utau_ice(:,:) = 0._wp
97      vtau_ice(:,:) = 0._wp
98      !
99   END SUBROUTINE usrdef_sbc_ice_tau
100
101   SUBROUTINE usrdef_sbc_ice_flx( kt, phs, phi )
102      !!---------------------------------------------------------------------
103      !!                     ***  ROUTINE usrdef_sbc_ice_flx  ***
104      !!
105      !! ** Purpose :   provide the surface boundary (flux) condition over sea-ice
106      !!---------------------------------------------------------------------
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      !!
111      INTEGER  ::   jl
112      REAL(wp) ::   zfr1, zfr2                 ! local variables
113      REAL(wp), DIMENSION(jpi,jpj) ::   zsnw   ! snw distribution after wind blowing
114      REAL(wp), DIMENSION(jpi,jpj) ::   ztri
115      !!---------------------------------------------------------------------
116      !
117      IF( kt==nit000 .AND. lwp)   WRITE(numout,*)' usrdef_sbc_ice : ICE_ADV1D case: NO flux forcing'
118      !
119      ! ocean variables (renaming)
120      emp_oce (:,:)   = 0._wp   ! uniform value for freshwater budget (E-P)
121      qsr_oce (:,:)   = 0._wp   ! uniform value for     solar radiation
122      qns_oce (:,:)   = 0._wp   ! uniform value for non-solar radiation
123
124      ! ice variables
125      alb_ice (:,:,:) = 0.7_wp  ! useless
126      qsr_ice (:,:,:) = 0._wp   ! uniform value for     solar radiation
127      qns_ice (:,:,:) = 0._wp   ! uniform value for non-solar radiation
128      sprecip (:,:)   = 0._wp   ! uniform value for snow precip
129      evap_ice(:,:,:) = 0._wp   ! uniform value for sublimation
130
131      ! ice fields deduced from above
132      zsnw(:,:) = 1._wp
133      !!CALL lim_thd_snwblow( at_i_b, zsnw )  ! snow distribution over ice after wind blowing
134      emp_ice  (:,:)   = SUM( a_i_b(:,:,:) * evap_ice(:,:,:), dim=3 ) - sprecip(:,:) * zsnw(:,:)
135      emp_oce  (:,:)   = emp_oce(:,:) - sprecip(:,:) * (1._wp - zsnw(:,:) )
136      qevap_ice(:,:,:) =   0._wp
137      qprec_ice(:,:)   =   rhos * ( sst_m(:,:) * rcpi - rLfus ) * tmask(:,:,1) !  in J/m3
138      qemp_oce (:,:)   = - emp_oce(:,:) * sst_m(:,:) * rcp
139      qemp_ice (:,:)   =   sprecip(:,:) * zsnw * ( sst_m(:,:) * rcpi - rLfus ) * tmask(:,:,1) ! solid precip (only)
140
141      ! total fluxes
142      emp_tot (:,:) = emp_ice  + emp_oce
143      qns_tot (:,:) = at_i_b(:,:) * qns_oce(:,:) + SUM( a_i_b(:,:,:) * qns_ice(:,:,:), dim=3 ) + qemp_ice(:,:) + qemp_oce(:,:)
144      qsr_tot (:,:) = at_i_b(:,:) * qsr_oce(:,:) + SUM( a_i_b(:,:,:) * qsr_ice(:,:,:), dim=3 )
145
146      ! --- shortwave radiation transmitted below the surface (W/m2, see Grenfell Maykut 77) --- !
147      cloud_fra(:,:) = pp_cldf
148      ztri(:,:) = 0.18 * ( 1.0 - cloud_fra(:,:) ) + 0.35 * cloud_fra(:,:)  ! surface transmission when hi>10cm
149      !
150      DO jl = 1, jpl
151         WHERE    ( phs(:,:,jl) <= 0._wp .AND. phi(:,:,jl) <  0.1_wp )     ! linear decrease from hi=0 to 10cm 
152            qtr_ice_top(:,:,jl) = qsr_ice(:,:,jl) * ( ztri(:,:) + ( 1._wp - ztri(:,:) ) * ( 1._wp - phi(:,:,jl) * 10._wp ) )
153         ELSEWHERE( phs(:,:,jl) <= 0._wp .AND. phi(:,:,jl) >= 0.1_wp )     ! constant (ztri) when hi>10cm
154            qtr_ice_top(:,:,jl) = qsr_ice(:,:,jl) * ztri(:,:)
155         ELSEWHERE                                                         ! zero when hs>0
156            qtr_ice_top(:,:,jl) = 0._wp
157         END WHERE
158      ENDDO
159         
160 
161   END SUBROUTINE usrdef_sbc_ice_flx
162
163
164   !!======================================================================
165END MODULE usrdef_sbc
Note: See TracBrowser for help on using the repository browser.