Index: NEMO/branches/UKMO/r12083_India_uncoupled/src/OCE/USR/usrdef_sbc.F90
===================================================================
--- NEMO/branches/UKMO/r12083_India_uncoupled/src/OCE/USR/usrdef_sbc.F90	(revision 12755)
+++ NEMO/branches/UKMO/r12083_India_uncoupled/src/OCE/USR/usrdef_sbc.F90	(revision 12778)
@@ -1,32 +1,45 @@
 MODULE usrdef_sbc
    !!======================================================================
-   !!                     ***  MODULE  usrdef_sbc  ***
-   !!
-   !!                  ===  WAD_TEST_CASES configuration  ===
+   !!                       ***  MODULE usrdef_sbc  ***
+   !! 
+   !!                  ===  AMM7_SURGE configuration  ===
    !!
    !! User defined :   surface forcing of a user configuration
    !!======================================================================
    !! History :  4.0   ! 2016-03  (S. Flavoni, G. Madec)  user defined interface
+   !!            4.0   ! 2017-12  (C. O'Neill)  add necessary options for surge work - either no fluxes 
+   !!                                           (for tide-only run) or wind and pressure only
    !!----------------------------------------------------------------------
 
    !!----------------------------------------------------------------------
-   !!   usrdef_sbc    : user defined surface bounday conditions in WAD_TEST_CASES case
+   !!   usrdef_sbc    : user defined surface bounday conditions in LOCK_EXCHANGE case
    !!----------------------------------------------------------------------
-   USE oce            ! ocean dynamics and tracers
-   USE dom_oce        ! ocean space and time domain
-   USE sbc_oce        ! Surface boundary condition: ocean fields
-   USE phycst         ! physical constants
+   USE oce             ! ocean dynamics and tracers
+   USE dom_oce         ! ocean space and time domain
+   USE sbc_oce         ! Surface boundary condition: ocean fields
+   USE sbc_ice         ! Surface boundary condition: ocean fields
+   USE fldread         ! read input fields
+   USE phycst          ! physical constants
+   USE lib_fortran     ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) 
    !
-   USE in_out_manager ! I/O manager
-   USE lib_mpp        ! distribued memory computing library
-   USE lbclnk         ! ocean lateral boundary conditions (or mpp link)
-   USE lib_fortran    ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined)
+   USE in_out_manager  ! I/O manager
+   USE iom
+   USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
+   USE lib_mpp         ! distribued memory computing library
+   !USE wrk_nemo       ! work arrays
+   USE timing         ! Timing
+   USE prtctl         ! Print control
 
    IMPLICIT NONE
    PRIVATE
 
-   PUBLIC   usrdef_sbc_oce       ! routine called in sbcmod module
-   PUBLIC   usrdef_sbc_ice_tau   ! routine called by icestp.F90 for ice dynamics
-   PUBLIC   usrdef_sbc_ice_flx   ! routine called by icestp.F90 for ice thermo
+   PUBLIC   usrdef_sbc_oce    ! routine called in sbcmod module
+   PUBLIC   usrdef_sbc_ice_tau  ! routine called by sbcice_lim.F90 for ice dynamics
+   PUBLIC   usrdef_sbc_ice_flx  ! routine called by sbcice_lim.F90 for ice thermo
+   !                                  !!* Namelist namsbc_usr
+   REAL(wp) ::   rn_vfac     ! multiplication factor for ice/ocean velocity in the calculation of wind stress (clem)
+   REAL(wp) ::   rn_charn_const 
+   LOGICAL  ::   ln_use_sbc  ! Surface fluxes on or not 
+
 
    !! * Substitutions
@@ -46,29 +59,44 @@
       !!              condition, i.e. the momentum, heat and freshwater fluxes.
       !!
-      !! ** Method  :   all 0 fields, for WAD_TEST_CASES case
+      !! ** Method  :   all 0 fields, for AMM7_SURGE case
       !!                CAUTION : never mask the surface stress field !
       !!
-      !! ** Action  : - set to ZERO all the ocean surface boundary condition, i.e.
+      !! ** Action  : - if tide-only case - set to ZERO all the ocean surface boundary condition, i.e.   
       !!                   utau, vtau, taum, wndm, qns, qsr, emp, sfx
-      !!
+      !!              - if tide+surge case - read in wind and air pressure      !!
       !!----------------------------------------------------------------------
       INTEGER, INTENT(in) ::   kt   ! ocean time step
+
+      INTEGER  ::   ios      ! Local integer output status for namelist read
+      !
+      CHARACTER(len=100) ::  cn_dir   !   Root directory for location of flux files
+      TYPE(FLD_N) ::   sn_wndi, sn_wndj                        ! informations about the fields to be read
+
+      NAMELIST/namsbc_usr/ ln_use_sbc, cn_dir , rn_vfac,  &
+         &                   sn_wndi, sn_wndj, rn_charn_const
       !!---------------------------------------------------------------------
-      ! 
-      IF( kt == nit000 ) THEN 
-         ! 
-         IF(lwp) WRITE(numout,*)' usr_sbc : WAD_TEST_CASES case: NO surface forcing' 
-         IF(lwp) WRITE(numout,*)' ~~~~~~~~~~~   utau = vtau = taum = wndm = qns = qsr = emp = sfx = 0' 
-         ! 
-         utau(:,:) = 0._wp 
-         vtau(:,:) = 0._wp 
-         taum(:,:) = 0._wp 
-         wndm(:,:) = 0._wp 
-         ! 
-         emp (:,:) = 0._wp 
-         sfx (:,:) = 0._wp 
-         qns (:,:) = 0._wp 
-         qsr (:,:) = 0._wp 
+      !
+      IF( kt == nit000 ) THEN
+         
+         
+         REWIND( numnam_cfg )              ! Namelist namsbc_usr in configuration namelist
+         READ  ( numnam_cfg, namsbc_usr, IOSTAT = ios, ERR = 902 )
+902      IF( ios /= 0 ) CALL ctl_nam ( ios , 'namsbc_surge in configuration namelist' )
+
+         IF(lwm) WRITE( numond, namsbc_usr )
+
+         IF(lwp) WRITE(numout,*)' usr_sbc : AMM7_SURGE tide only case: NO surface forcing'
+         IF(lwp) WRITE(numout,*)' ~~~~~~~~~~~   utau = vtau = taum = wndm = qns = qsr = emp = sfx = 0'
+
+         utau(:,:) = 0._wp
+         vtau(:,:) = 0._wp
+         taum(:,:) = 0._wp
+         wndm(:,:) = 0._wp
          !
+         emp (:,:) = 0._wp
+         sfx (:,:) = 0._wp
+         qns (:,:) = 0._wp
+         qsr (:,:) = 0._wp
+         !         
       ENDIF
       !
@@ -80,9 +108,6 @@
    END SUBROUTINE usrdef_sbc_ice_tau
 
-
-   SUBROUTINE usrdef_sbc_ice_flx( kt, phs, phi )
+   SUBROUTINE usrdef_sbc_ice_flx( kt )
       INTEGER, INTENT(in) ::   kt   ! ocean time step
-      REAL(wp), DIMENSION(:,:,:), INTENT(in)  ::   phs    ! snow thickness
-      REAL(wp), DIMENSION(:,:,:), INTENT(in)  ::   phi    ! ice thickness
    END SUBROUTINE usrdef_sbc_ice_flx
 
