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

source: NEMO/trunk/tests/BENCH/MY_SRC/usrdef_sbc.F90 @ 15814

Last change on this file since 15814 was 14433, checked in by smasson, 3 years ago

trunk: merge dev_r14312_MPI_Interface into the trunk, #2598

File size: 7.1 KB
RevLine 
[9762]1MODULE usrdef_sbc
2   !!======================================================================
3   !!                       ***  MODULE  usrdef_sbc  ***
4   !!
5   !!                      ===  BENCH configuration  ===
6   !!
7   !! User defined :   surface forcing of a user configuration
8   !!======================================================================
9   !! History :  4.0   !
10   !!----------------------------------------------------------------------
11
12   !!----------------------------------------------------------------------
13   !!   usr_def_sbc    : user defined surface bounday conditions in BENCH case
14   !!----------------------------------------------------------------------
[10179]15   USE par_oce        ! ocean space and time domain
16   USE dom_oce       
17   USE oce             ! ocean dynamics and tracers
[9762]18   USE sbc_oce         ! Surface boundary condition: ocean fields
[10179]19   USE sbc_ice         ! Surface boundary condition: ocean fields
[9762]20   USE in_out_manager  ! I/O manager
[10179]21   USE phycst          ! physical constants
22   USE lib_mpp         ! MPP library
23   USE lbclnk          ! lateral boundary conditions - mpp exchanges
[9762]24
[10179]25#if defined key_si3
26   USE ice, ONLY       : at_i_b, a_i_b
27#endif
28
[9762]29   IMPLICIT NONE
30   PRIVATE
31
[14273]32   PUBLIC   usrdef_sbc_oce      ! routine called by sbcmod.F90 for sbc ocean
33   PUBLIC   usrdef_sbc_ice_tau  ! routine called by icestp.F90 for ice dynamics
34   PUBLIC   usrdef_sbc_ice_flx  ! routine called by icestp.F90 for ice thermo
[9762]35
[12740]36   !! * Substitutions
37#  include "do_loop_substitute.h90"
[9762]38   !!----------------------------------------------------------------------
39   !! NEMO/OPA 4.0 , NEMO Consortium (2016)
40   !! $Id$
41   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
42   !!----------------------------------------------------------------------
43CONTAINS
44
[12377]45   SUBROUTINE usrdef_sbc_oce( kt, Kbb )
[9762]46      !!---------------------------------------------------------------------
47      !!                    ***  ROUTINE usr_def_sbc  ***
48      !!             
49      !! ** Purpose :   provide at each time-step the surface boundary
50      !!              condition, i.e. the momentum, heat and freshwater fluxes.
51      !!
52      !! ** Method  :   all 0 fields, for BENCH case
53      !!                CAUTION : never mask the surface stress field !
54      !!
55      !! ** Action  : - set to ZERO all the ocean surface boundary condition, i.e.   
56      !!                   utau, vtau, taum, wndm, qns, qsr, emp, sfx
57      !!
58      !!----------------------------------------------------------------------
59      INTEGER, INTENT(in) ::   kt   ! ocean time step
[12377]60      INTEGER, INTENT(in) ::   Kbb  ! ocean time index
[9762]61      !!---------------------------------------------------------------------
62      !     
63      IF( kt == nit000 ) THEN
64         !
65         IF(lwp) WRITE(numout,*)' usr_sbc : BENCH case: surface forcing'
66         IF(lwp) WRITE(numout,*)' ~~~~~~~~~~~   vtau = taum = wndm = qns = qsr = emp = sfx = 0'
67         !
68         utau(:,:) = 0._wp
69         vtau(:,:) = 0._wp
70         taum(:,:) = 0._wp
71         wndm(:,:) = 0._wp
72         !
73         emp (:,:) = 0._wp
74         sfx (:,:) = 0._wp
75         qns (:,:) = 0._wp
76         qsr (:,:) = 0._wp
[10179]77         !
78         utau_b(:,:) = 0._wp 
79         vtau_b(:,:) = 0._wp
80         emp_b (:,:) = 0._wp
81         sfx_b (:,:) = 0._wp
82         qns_b (:,:) = 0._wp
83         !
[9762]84      ENDIF
85      !
86   END SUBROUTINE usrdef_sbc_oce
87
[10179]88   
[9762]89   SUBROUTINE usrdef_sbc_ice_tau( kt )
[10179]90      !!---------------------------------------------------------------------
91      !!                     ***  ROUTINE usrdef_sbc_ice_tau  ***
92      !!
93      !! ** Purpose :   provide the surface boundary (momentum) condition over
94      !sea-ice
95      !!---------------------------------------------------------------------
[9762]96      INTEGER, INTENT(in) ::   kt   ! ocean time step
[10179]97      !
[14273]98      REAL(wp) ::   zztmp
[10179]99      INTEGER  ::   ji, jj
100      !!---------------------------------------------------------------------
101#if defined key_si3
102      IF( kt==nit000 .AND. lwp)   WRITE(numout,*)' usrdef_sbc_ice : BENCH case: constant stress forcing'
103      !
104      ! define unique value on each point. z2d ranging from 0.05 to -0.05
[13286]105      !
[13295]106      DO_2D( 0, 0, 0, 0 )
[14273]107         zztmp = 0.1 * ( 0.5 - REAL( mig0(ji) + (mjg0(jj)-1) * Ni0glo, wp ) / REAL( Ni0glo * Nj0glo, wp ) )
108         utau_ice(ji,jj) = 0.1_wp + zztmp
109         vtau_ice(ji,jj) = 0.1_wp + zztmp
[12740]110      END_2D
[10179]111
[14433]112      CALL lbc_lnk( 'usrdef_sbc', utau_ice, 'U', -1., vtau_ice, 'V', -1. )
[10179]113#endif
114      !
[9762]115   END SUBROUTINE usrdef_sbc_ice_tau
116
[10179]117   
118   SUBROUTINE usrdef_sbc_ice_flx( kt, phs, phi )
119      !!---------------------------------------------------------------------
120      !!                     ***  ROUTINE usrdef_sbc_ice_flx  ***
121      !!
[14273]122      !! ** Purpose :   provide the surface boundary (flux) condition over sea-ice
[10179]123      !!---------------------------------------------------------------------
[9762]124      INTEGER, INTENT(in) ::   kt   ! ocean time step
[10179]125      REAL(wp), DIMENSION(:,:,:), INTENT(in)  ::   phs    ! snow thickness
126      REAL(wp), DIMENSION(:,:,:), INTENT(in)  ::   phi    ! ice thickness
127      !!
128      REAL(wp), DIMENSION(jpi,jpj) ::   zsnw   ! snw distribution after wind blowing
129      !!---------------------------------------------------------------------
[14273]130#if defined key_si3
[10179]131      !
132      IF( kt==nit000 .AND. lwp)   WRITE(numout,*)' usrdef_sbc_ice : BENCH case: NO flux forcing'
133      !
134      ! ocean variables (renaming)
135      emp_oce (:,:)   = 0._wp   ! uniform value for freshwater budget (E-P)
136      qsr_oce (:,:)   = 0._wp   ! uniform value for     solar radiation
[14273]137      qns_oce (:,:)   = 0._wp   ! uniform value for non-solar heat flux
[10179]138
139      ! ice variables
140      alb_ice (:,:,:) = 0.7_wp  ! useless
141      qsr_ice (:,:,:) = 0._wp   ! uniform value for     solar radiation
[14273]142      qns_ice (:,:,:) = 0._wp   ! uniform value for non-solar heat flux
143      dqns_ice(:,:,:) = 0._wp   ! uniform value for non solar heat flux sensitivity for ice
[10179]144      sprecip (:,:)   = 0._wp   ! uniform value for snow precip
145      evap_ice(:,:,:) = 0._wp   ! uniform value for sublimation
146
147      ! ice fields deduced from above
148      zsnw(:,:) = 1._wp
[14273]149      !!CALL lim_thd_snwblow( at_i_b, zsnw )  ! snow distribution over ice after wind blowing
[10179]150      emp_ice  (:,:)   = SUM( a_i_b(:,:,:) * evap_ice(:,:,:), dim=3 ) - sprecip(:,:) * zsnw(:,:)
151      emp_oce  (:,:)   = emp_oce(:,:) - sprecip(:,:) * (1._wp - zsnw(:,:) )
152      qevap_ice(:,:,:) =   0._wp
153      qprec_ice(:,:)   =   rhos * ( sst_m(:,:) * rcpi - rLfus ) * tmask(:,:,1) !  in J/m3
154      qemp_oce (:,:)   = - emp_oce(:,:) * sst_m(:,:) * rcp
155      qemp_ice (:,:)   =   sprecip(:,:) * zsnw * ( sst_m(:,:) * rcpi - rLfus ) * tmask(:,:,1) ! solid precip (only)
156
157      ! total fluxes
158      emp_tot (:,:) = emp_ice  + emp_oce
159      qns_tot (:,:) = at_i_b(:,:) * qns_oce(:,:) + SUM( a_i_b(:,:,:) * qns_ice(:,:,:), dim=3 ) + qemp_ice(:,:) + qemp_oce(:,:)
160      qsr_tot (:,:) = at_i_b(:,:) * qsr_oce(:,:) + SUM( a_i_b(:,:,:) * qsr_ice(:,:,:), dim=3 )
161
[13472]162      ! --- shortwave radiation transmitted thru the surface scattering layer (W/m2) --- !
163      qtr_ice_top(:,:,:) = 0._wp
[10179]164#endif
165
[9762]166   END SUBROUTINE usrdef_sbc_ice_flx
167
168   !!======================================================================
169END MODULE usrdef_sbc
Note: See TracBrowser for help on using the repository browser.