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.
Changeset 12778 for NEMO – NEMO

Changeset 12778 for NEMO


Ignore:
Timestamp:
2020-04-20T16:35:39+02:00 (4 years ago)
Author:
jcastill
Message:

Implement user-defined sbc: tides only

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/UKMO/r12083_India_uncoupled/src/OCE/USR/usrdef_sbc.F90

    r12453 r12778  
    11MODULE usrdef_sbc 
    22   !!====================================================================== 
    3    !!                     ***  MODULE usrdef_sbc  *** 
    4    !! 
    5    !!                  ===  WAD_TEST_CASES configuration  === 
     3   !!                       ***  MODULE usrdef_sbc  *** 
     4   !!  
     5   !!                  ===  AMM7_SURGE configuration  === 
    66   !! 
    77   !! User defined :   surface forcing of a user configuration 
    88   !!====================================================================== 
    99   !! 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 
    1012   !!---------------------------------------------------------------------- 
    1113 
    1214   !!---------------------------------------------------------------------- 
    13    !!   usrdef_sbc    : user defined surface bounday conditions in WAD_TEST_CASES case 
     15   !!   usrdef_sbc    : user defined surface bounday conditions in LOCK_EXCHANGE case 
    1416   !!---------------------------------------------------------------------- 
    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 phycst         ! physical constants 
     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)  
    1924   ! 
    20    USE in_out_manager ! I/O manager 
    21    USE lib_mpp        ! distribued memory computing library 
    22    USE lbclnk         ! ocean lateral boundary conditions (or mpp link) 
    23    USE lib_fortran    ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) 
     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 
    2432 
    2533   IMPLICIT NONE 
    2634   PRIVATE 
    2735 
    28    PUBLIC   usrdef_sbc_oce       ! routine called in sbcmod module 
    29    PUBLIC   usrdef_sbc_ice_tau   ! routine called by icestp.F90 for ice dynamics 
    30    PUBLIC   usrdef_sbc_ice_flx   ! routine called by icestp.F90 for ice thermo 
     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 
    3144 
    3245   !! * Substitutions 
     
    4659      !!              condition, i.e. the momentum, heat and freshwater fluxes. 
    4760      !! 
    48       !! ** Method  :   all 0 fields, for WAD_TEST_CASES case 
     61      !! ** Method  :   all 0 fields, for AMM7_SURGE case 
    4962      !!                CAUTION : never mask the surface stress field ! 
    5063      !! 
    51       !! ** Action  : - set to ZERO all the ocean surface boundary condition, i.e. 
     64      !! ** Action  : - if tide-only case - set to ZERO all the ocean surface boundary condition, i.e.    
    5265      !!                   utau, vtau, taum, wndm, qns, qsr, emp, sfx 
    53       !! 
     66      !!              - if tide+surge case - read in wind and air pressure      !! 
    5467      !!---------------------------------------------------------------------- 
    5568      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 
    5677      !!--------------------------------------------------------------------- 
    57       !  
    58       IF( kt == nit000 ) THEN  
    59          !  
    60          IF(lwp) WRITE(numout,*)' usr_sbc : WAD_TEST_CASES case: NO surface forcing'  
    61          IF(lwp) WRITE(numout,*)' ~~~~~~~~~~~   utau = vtau = taum = wndm = qns = qsr = emp = sfx = 0'  
    62          !  
    63          utau(:,:) = 0._wp  
    64          vtau(:,:) = 0._wp  
    65          taum(:,:) = 0._wp  
    66          wndm(:,:) = 0._wp  
    67          !  
    68          emp (:,:) = 0._wp  
    69          sfx (:,:) = 0._wp  
    70          qns (:,:) = 0._wp  
    71          qsr (:,:) = 0._wp  
     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 
    7295         ! 
     96         emp (:,:) = 0._wp 
     97         sfx (:,:) = 0._wp 
     98         qns (:,:) = 0._wp 
     99         qsr (:,:) = 0._wp 
     100         !          
    73101      ENDIF 
    74102      ! 
     
    80108   END SUBROUTINE usrdef_sbc_ice_tau 
    81109 
    82  
    83    SUBROUTINE usrdef_sbc_ice_flx( kt, phs, phi ) 
     110   SUBROUTINE usrdef_sbc_ice_flx( kt ) 
    84111      INTEGER, INTENT(in) ::   kt   ! ocean time step 
    85       REAL(wp), DIMENSION(:,:,:), INTENT(in)  ::   phs    ! snow thickness 
    86       REAL(wp), DIMENSION(:,:,:), INTENT(in)  ::   phi    ! ice thickness 
    87112   END SUBROUTINE usrdef_sbc_ice_flx 
    88113 
Note: See TracChangeset for help on using the changeset viewer.