source: NEMO/branches/UKMO/r12083_India_uncoupled/src/OCE/USR/usrdef_sbc.F90 @ 12778

Last change on this file since 12778 was 12778, checked in by jcastill, 8 months ago

Implement user-defined sbc: tides only

File size: 5.0 KB
Line 
1MODULE usrdef_sbc
2   !!======================================================================
3   !!                       ***  MODULE usrdef_sbc  ***
4   !!
5   !!                  ===  AMM7_SURGE 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   !!            4.0   ! 2017-12  (C. O'Neill)  add necessary options for surge work - either no fluxes
11   !!                                           (for tide-only run) or wind and pressure only
12   !!----------------------------------------------------------------------
13
14   !!----------------------------------------------------------------------
15   !!   usrdef_sbc    : user defined surface bounday conditions in LOCK_EXCHANGE case
16   !!----------------------------------------------------------------------
17   USE oce             ! ocean dynamics and tracers
18   USE dom_oce         ! ocean space and time domain
19   USE sbc_oce         ! Surface boundary condition: ocean fields
20   USE sbc_ice         ! Surface boundary condition: ocean fields
21   USE fldread         ! read input fields
22   USE phycst          ! physical constants
23   USE lib_fortran     ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined)
24   !
25   USE in_out_manager  ! I/O manager
26   USE iom
27   USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
28   USE lib_mpp         ! distribued memory computing library
29   !USE wrk_nemo       ! work arrays
30   USE timing         ! Timing
31   USE prtctl         ! Print control
32
33   IMPLICIT NONE
34   PRIVATE
35
36   PUBLIC   usrdef_sbc_oce    ! routine called in sbcmod module
37   PUBLIC   usrdef_sbc_ice_tau  ! routine called by sbcice_lim.F90 for ice dynamics
38   PUBLIC   usrdef_sbc_ice_flx  ! routine called by sbcice_lim.F90 for ice thermo
39   !                                  !!* Namelist namsbc_usr
40   REAL(wp) ::   rn_vfac     ! multiplication factor for ice/ocean velocity in the calculation of wind stress (clem)
41   REAL(wp) ::   rn_charn_const 
42   LOGICAL  ::   ln_use_sbc  ! Surface fluxes on or not
43
44
45   !! * Substitutions
46#  include "vectopt_loop_substitute.h90"
47   !!----------------------------------------------------------------------
48   !! NEMO/OCE 4.0 , NEMO Consortium (2018)
49   !! $Id$
50   !! Software governed by the CeCILL license (see ./LICENSE)
51   !!----------------------------------------------------------------------
52CONTAINS
53
54   SUBROUTINE usrdef_sbc_oce( kt )
55      !!---------------------------------------------------------------------
56      !!                    ***  ROUTINE usrdef_sbc  ***
57      !!             
58      !! ** Purpose :   provide at each time-step the surface boundary
59      !!              condition, i.e. the momentum, heat and freshwater fluxes.
60      !!
61      !! ** Method  :   all 0 fields, for AMM7_SURGE case
62      !!                CAUTION : never mask the surface stress field !
63      !!
64      !! ** Action  : - if tide-only case - set to ZERO all the ocean surface boundary condition, i.e.   
65      !!                   utau, vtau, taum, wndm, qns, qsr, emp, sfx
66      !!              - if tide+surge case - read in wind and air pressure      !!
67      !!----------------------------------------------------------------------
68      INTEGER, INTENT(in) ::   kt   ! ocean time step
69
70      INTEGER  ::   ios      ! Local integer output status for namelist read
71      !
72      CHARACTER(len=100) ::  cn_dir   !   Root directory for location of flux files
73      TYPE(FLD_N) ::   sn_wndi, sn_wndj                        ! informations about the fields to be read
74
75      NAMELIST/namsbc_usr/ ln_use_sbc, cn_dir , rn_vfac,  &
76         &                   sn_wndi, sn_wndj, rn_charn_const
77      !!---------------------------------------------------------------------
78      !
79      IF( kt == nit000 ) THEN
80         
81         
82         REWIND( numnam_cfg )              ! Namelist namsbc_usr in configuration namelist
83         READ  ( numnam_cfg, namsbc_usr, IOSTAT = ios, ERR = 902 )
84902      IF( ios /= 0 ) CALL ctl_nam ( ios , 'namsbc_surge in configuration namelist' )
85
86         IF(lwm) WRITE( numond, namsbc_usr )
87
88         IF(lwp) WRITE(numout,*)' usr_sbc : AMM7_SURGE tide only case: NO surface forcing'
89         IF(lwp) WRITE(numout,*)' ~~~~~~~~~~~   utau = vtau = taum = wndm = qns = qsr = emp = sfx = 0'
90
91         utau(:,:) = 0._wp
92         vtau(:,:) = 0._wp
93         taum(:,:) = 0._wp
94         wndm(:,:) = 0._wp
95         !
96         emp (:,:) = 0._wp
97         sfx (:,:) = 0._wp
98         qns (:,:) = 0._wp
99         qsr (:,:) = 0._wp
100         !         
101      ENDIF
102      !
103   END SUBROUTINE usrdef_sbc_oce
104
105
106   SUBROUTINE usrdef_sbc_ice_tau( kt )
107      INTEGER, INTENT(in) ::   kt   ! ocean time step
108   END SUBROUTINE usrdef_sbc_ice_tau
109
110   SUBROUTINE usrdef_sbc_ice_flx( kt )
111      INTEGER, INTENT(in) ::   kt   ! ocean time step
112   END SUBROUTINE usrdef_sbc_ice_flx
113
114   !!======================================================================
115END MODULE usrdef_sbc
Note: See TracBrowser for help on using the repository browser.