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 12287 – NEMO

Changeset 12287


Ignore:
Timestamp:
2019-12-23T13:01:19+01:00 (4 years ago)
Author:
jcastill
Message:

Fist attempt at adding wave momentum coupling (not tested)

Location:
branches/UKMO/r8395_cpl_tauwav/NEMOGCM
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/UKMO/r8395_cpl_tauwav/NEMOGCM/CONFIG/SHARED/namelist_ref

    r12286 r12287  
    217217   ln_sdw      = .false.   !  Read 2D Surf Stokes Drift & Computation of 3D stokes drift (T => ln_wave=.true. & fill namsbc_wave)  
    218218   ln_tauoc    = .false.   !  Activate ocean stress modified by external wave induced stress (T => ln_wave=.true. & fill namsbc_wave) 
     219   ln_tauw     = .false.   !  Activate ocean stress components from wave model 
    219220   ln_stcor    = .false.   !  Activate Stokes Coriolis term (T => ln_wave=.true. & ln_sdw=.true. & fill namsbc_wave) 
    220221   nn_lsm      = 0         !  =0 land/sea mask for input fields is not applied (keep empty land/sea mask filename field) , 
     
    300301   sn_rcv_wnum   =       'none'                 ,    'no'    ,     ''      ,         ''          ,   '' 
    301302   sn_rcv_wstrf  =       'none'                 ,    'no'    ,     ''      ,         ''          ,   '' 
     303   sn_rcv_tauw   =       'none'                 ,    'no'    ,     ''      ,         ''          ,   '' 
    302304   sn_rcv_wdrag  =       'none'                 ,    'no'    ,     ''      ,         ''          ,   '' 
    303305! 
     
    458460   sn_wnum     =  'sdw_wave' ,        1          , 'wave_num'   ,     .true.   , .false. , 'daily'   ,  ''      , ''       , '' 
    459461   sn_tauoc    =  'sdw_wave' ,        1          , 'wave_stress',     .true.   , .false. , 'daily'   ,  ''      , ''       , '' 
     462   sn_tauwx    =  'sdw_wave' ,        1          , 'wave_stress',     .true.   , .false. , 'daily'   ,  ''      , ''       , ''   
     463   sn_tauwy    =  'sdw_wave' ,        1          , 'wave_stress',     .true.   , .false. , 'daily'   ,  ''      , ''       , '' 
    460464! 
    461465   cn_dir  = './'  !  root directory for the location of drag coefficient files 
  • branches/UKMO/r8395_cpl_tauwav/NEMOGCM/NEMO/OPA_SRC/SBC/sbc_oce.F90

    r12286 r12287  
    6565   LOGICAL , PUBLIC ::   ln_sdw         !: true if 3d stokes drift from wave model 
    6666   LOGICAL , PUBLIC ::   ln_tauoc       !: true if normalized stress from wave is used 
     67   LOGICAL , PUBLIC ::   ln_tauw        !: true if ocean stress components from wave is used 
    6768   LOGICAL , PUBLIC ::   ln_stcor       !: true if Stokes-Coriolis term is used 
    6869   ! 
  • branches/UKMO/r8395_cpl_tauwav/NEMOGCM/NEMO/OPA_SRC/SBC/sbccpl.F90

    r12286 r12287  
    117117   INTEGER, PARAMETER ::   jpr_isf    = 52 
    118118   INTEGER, PARAMETER ::   jpr_icb    = 53 
    119  
    120    INTEGER, PARAMETER ::   jprcv      = 53   ! total number of fields received   
     119   INTEGER, PARAMETER ::   jpr_tauwx  = 54   ! x component of the ocean stress from waves  
     120   INTEGER, PARAMETER ::   jpr_tauwy  = 55   ! y component of the ocean stress from waves 
     121 
     122   INTEGER, PARAMETER ::   jprcv      = 55   ! total number of fields received   
    121123 
    122124   INTEGER, PARAMETER ::   jps_fice   =  1   ! ice fraction sent to the atmosphere 
     
    170172   TYPE(FLD_C) ::   sn_snd_ifrac, sn_snd_crtw, sn_snd_wlev  
    171173   ! Received from waves  
    172    TYPE(FLD_C) ::   sn_rcv_hsig,sn_rcv_phioc,sn_rcv_sdrfx,sn_rcv_sdrfy,sn_rcv_wper,sn_rcv_wnum,sn_rcv_wstrf,sn_rcv_wdrag 
     174   TYPE(FLD_C) ::   sn_rcv_hsig,sn_rcv_phioc,sn_rcv_sdrfx,sn_rcv_sdrfy,sn_rcv_wper,sn_rcv_wnum,sn_rcv_wstrf,sn_rcv_tauw, & 
     175                    sn_rcv_wdrag 
    173176   !                                   ! Other namelist parameters 
    174177   INTEGER     ::   nn_cplmodel           ! Maximum number of models to/from which NEMO is potentialy sending/receiving data 
     
    245248         &                  sn_rcv_wdrag, sn_rcv_qns  , sn_rcv_emp   , sn_rcv_rnf   , sn_rcv_cal   ,   & 
    246249         &                  sn_rcv_iceflx,sn_rcv_co2  , nn_cplmodel  , ln_usecplmask, sn_rcv_mslp  ,   & 
    247          &                  sn_rcv_icb , sn_rcv_isf 
     250         &                  sn_rcv_icb , sn_rcv_isf   , sn_rcv_tauw 
    248251 
    249252      !!--------------------------------------------------------------------- 
     
    296299         WRITE(numout,*)'      Mean wave number                = ', TRIM(sn_rcv_wnum%cldes  ), ' (', TRIM(sn_rcv_wnum%clcat  ), ')'  
    297300         WRITE(numout,*)'      Stress frac adsorbed by waves   = ', TRIM(sn_rcv_wstrf%cldes ), ' (', TRIM(sn_rcv_wstrf%clcat ), ')'  
     301         WRITE(numout,*)'      Stress components by waves      = ', TRIM(sn_rcv_tauw%cldes  ), ' (', TRIM(sn_rcv_tauw%clcat  ), ')' 
    298302         WRITE(numout,*)'      Neutral surf drag coefficient   = ', TRIM(sn_rcv_wdrag%cldes ), ' (', TRIM(sn_rcv_wdrag%clcat ), ')'  
    299303         WRITE(numout,*)'  sent fields (multiple ice categories)' 
     
    588592         cpl_wstrf = .TRUE. 
    589593      ENDIF 
     594      srcv(jpr_tauwx)%clname = 'O_Tauwx'      ! ocean stress from wave in the x direction  
     595      srcv(jpr_tauwy)%clname = 'O_Tauwy'      ! ocean stress from wave in the y direction  
     596      IF( TRIM(sn_rcv_tauw%cldes ) == 'coupled' )  THEN   
     597         srcv(jpr_tauwx)%laction = .TRUE.   
     598         srcv(jpr_tauwy)%laction = .TRUE.   
     599         cpl_tauw = .TRUE.   
     600      ENDIF 
    590601      srcv(jpr_wdrag)%clname = 'O_WDrag'     ! neutral surface drag coefficient 
    591602      IF( TRIM(sn_rcv_wdrag%cldes ) == 'coupled' )  THEN 
     
    593604         cpl_wdrag = .TRUE. 
    594605      ENDIF 
     606      !  
     607      IF( srcv(jpr_tauoc)%laction .AND. srcv(jpr_tauwx)%laction .AND. srcv(jpr_tauwy)%laction ) &  
     608            CALL ctl_stop( 'More than one method for modifying the ocean stress has been selected ', &  
     609                                     '(sn_rcv_tauoc=coupled and sn_rcv_tauw=coupled)' )  
     610      ! 
    595611      !  
    596612      !                                                      ! ------------------------------- ! 
     
    11811197      !                                                      ! ========================= !  
    11821198      IF( srcv(jpr_wstrf)%laction .AND. ln_tauoc ) tauoc_wave(:,:) = frcv(jpr_wstrf)%z3(:,:,1) 
     1199 
     1200      !                                                      ! ========================= !  
     1201      !                                                      ! Stress component by waves ! 
     1202      !                                                      ! ========================= !  
     1203      IF( srcv(jpr_tauwx)%laction .AND. srcv(jpr_tauwy)%laction .AND. ln_tauw ) THEN 
     1204         tauw_x(:,:) = frcv(jpr_tauwx)%z3(:,:,1) 
     1205         tauw_y(:,:) = frcv(jpr_tauwy)%z3(:,:,1) 
     1206      ENDIF 
    11831207 
    11841208      !                                                      ! ========================= !  
  • branches/UKMO/r8395_cpl_tauwav/NEMOGCM/NEMO/OPA_SRC/SBC/sbcmod.F90

    r12286 r12287  
    407407         IF( ll_opa    )       CALL sbc_cpl_rcv   ( kt, nn_fsbc, nn_ice )   ! OPA-SAS coupling: OPA receiving fields from SAS 
    408408      END SELECT 
    409       IF ( ln_wave .AND. ln_tauoc) THEN                                 ! Wave stress subctracted 
    410             utau(:,:) = utau(:,:)*tauoc_wave(:,:) 
    411             vtau(:,:) = vtau(:,:)*tauoc_wave(:,:) 
    412             taum(:,:) = taum(:,:)*tauoc_wave(:,:) 
    413       ! 
    414             SELECT CASE( nsbc ) 
    415             CASE(  0,1,2,3,5,-1 )  ; 
    416                 IF(lwp .AND. kt == nit000 ) WRITE(numout,*) 'WARNING: You are subtracting the wave stress to the ocean. & 
    417                         & If not requested select ln_tauoc=.false' 
    418             END SELECT 
    419       ! 
    420       END IF 
    421409      IF( ln_mixcpl )          CALL sbc_cpl_rcv   ( kt, nn_fsbc, nn_ice )   ! forced-coupled mixed formulation after forcing 
     410 
     411      IF ( ln_wave .AND. (ln_tauoc .OR. ln_tauw) ) CALL sbc_stress( )       ! Wave stress update 
    422412 
    423413      ! 
  • branches/UKMO/r8395_cpl_tauwav/NEMOGCM/NEMO/OPA_SRC/SBC/sbcwave.F90

    r12286 r12287  
    3333 
    3434   PUBLIC   sbc_stokes      ! routine called in sbccpl 
     35   PUBLIC   sbc_stress      ! routine called in sbcmod 
    3536   PUBLIC   sbc_wave        ! routine called in sbcmod 
    3637   PUBLIC   sbc_wave_init   ! routine called in sbcmod 
     
    4445   LOGICAL, PUBLIC ::   cpl_wnum   = .FALSE. 
    4546   LOGICAL, PUBLIC ::   cpl_wstrf  = .FALSE. 
     47   LOGICAL, PUBLIC ::   cpl_tauw   = .FALSE. 
    4648   LOGICAL, PUBLIC ::   cpl_wdrag  = .FALSE. 
    4749 
     
    5658   TYPE(FLD), ALLOCATABLE, DIMENSION(:) ::   sf_wn      ! structure of input fields (file informations, fields read) wave number for Qiao 
    5759   TYPE(FLD), ALLOCATABLE, DIMENSION(:) ::   sf_tauoc   ! structure of input fields (file informations, fields read) normalized wave stress into the ocean 
     60   TYPE(FLD), ALLOCATABLE, DIMENSION(:) ::   sf_tauw    ! structure of input fields (file informations, fields read) ocean stress components from wave model 
    5861   REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:)   ::   cdn_wave            !: 
    5962   REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:)   ::   hsw, wmp, wnum      !:  
    6063   REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:)   ::   tauoc_wave          !:   
     64   REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:)   ::   tauw_x              !: 
     65   REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:)   ::   tauw_y              !: 
    6166   REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:)   ::   tsd2d               !:  
    6267   REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:)   ::   div_sd              !: barotropic stokes drift divergence 
     
    188193   END SUBROUTINE sbc_stokes 
    189194 
     195   SUBROUTINE sbc_stress( )  
     196      !!---------------------------------------------------------------------  
     197      !!                     ***  ROUTINE sbc_stress  ***  
     198      !!  
     199      !! ** Purpose :   Updates the ocean momentum modified by waves  
     200      !!  
     201      !! ** Method  : - Calculate u,v components of stress depending on stress  
     202      !!                model   
     203      !!              - Calculate the stress module  
     204      !!              - The wind module is not modified by waves   
     205      !! ** action    
     206      !!---------------------------------------------------------------------  
     207      INTEGER  ::   jj, ji   ! dummy loop argument  
     208      !  
     209      IF( ln_tauoc ) THEN  
     210         utau(:,:) = utau(:,:)*tauoc_wave(:,:)  
     211         vtau(:,:) = vtau(:,:)*tauoc_wave(:,:)  
     212         taum(:,:) = taum(:,:)*tauoc_wave(:,:)  
     213      ENDIF  
     214      !  
     215      IF( ln_tauw ) THEN  
     216         DO jj = 1, jpjm1  
     217            DO ji = 1, jpim1  
     218               ! Stress components at u- & v-points  
     219               utau(ji,jj) = 0.5_wp * ( tauw_x(ji,jj) + tauw_x(ji+1,jj) )  
     220               vtau(ji,jj) = 0.5_wp * ( tauw_y(ji,jj) + tauw_y(ji,jj+1) )  
     221               !  
     222               ! Stress module at t points  
     223               taum(ji,jj) = SQRT( tauw_x(ji,jj)*tauw_x(ji,jj) + tauw_y(ji,jj)*tauw_y(ji,jj) )  
     224            END DO  
     225         END DO  
     226         CALL lbc_lnk_multi( utau(:,:), 'U', -1. , vtau(:,:), 'V', -1. , taum(:,: ), 'T', -1. )  
     227      ENDIF  
     228      !  
     229   END SUBROUTINE sbc_stress  
    190230 
    191231   SUBROUTINE sbc_wave( kt ) 
     
    214254         CALL fld_read( kt, nn_fsbc, sf_tauoc )          ! read wave norm stress from external forcing 
    215255         tauoc_wave(:,:) = sf_tauoc(1)%fnow(:,:,1) 
     256      ENDIF 
     257 
     258      IF( ln_tauw .AND. .NOT. cpl_tauw ) THEN      !==  Wave induced stress  ==!  
     259         CALL fld_read( kt, nn_fsbc, sf_tauw )           ! read ocean stress components from external forcing (T grid)  
     260         tauw_x(:,:) = sf_tauw(1)%fnow(:,:,1)  
     261         tauw_y(:,:) = sf_tauw(2)%fnow(:,:,1)  
    216262      ENDIF 
    217263 
     
    260306      !! 
    261307      CHARACTER(len=100)     ::  cn_dir                          ! Root directory for location of drag coefficient files 
    262       TYPE(FLD_N), ALLOCATABLE, DIMENSION(:) ::   slf_i     ! array of namelist informations on the fields to read 
     308      TYPE(FLD_N), ALLOCATABLE, DIMENSION(:) ::   slf_i, slf_j   ! array of namelist informations on the fields to read 
    263309      TYPE(FLD_N)            ::  sn_cdg, sn_usd, sn_vsd,  & 
    264310                             &   sn_hsw, sn_wmp, sn_wnum, sn_tauoc      ! informations about the fields to be read 
    265311      ! 
    266       NAMELIST/namsbc_wave/  sn_cdg, cn_dir, sn_usd, sn_vsd, sn_hsw, sn_wmp, sn_wnum, sn_tauoc 
     312      NAMELIST/namsbc_wave/  sn_cdg, cn_dir, sn_usd, sn_vsd, sn_hsw, sn_wmp, sn_wnum, sn_tauoc, sn_tauwx, sn_tauwy 
    267313      !!--------------------------------------------------------------------- 
    268314      ! 
     
    276322      IF(lwm) WRITE ( numond, namsbc_wave ) 
    277323      ! 
     324      IF( ln_tauoc .AND. ln_tauw ) &   
     325         CALL ctl_stop( 'More than one method for modifying the ocean stress has been selected ', &  
     326                                  '(ln_tauoc=.true. and ln_tauw=.true.)' )  
     327      IF( ln_tauoc ) &  
     328          CALL ctl_warn( 'You are subtracting the wave stress to the ocean (ln_tauoc=.true.)' )  
     329      IF( ln_tauw ) &  
     330          CALL ctl_warn( 'The wave modified ocean stress components are used (ln_tauw=.true.) ', &  
     331                               'This will override any other specification of the ocean stress' )   
     332 
    278333      IF( ln_cdgw ) THEN 
    279334         IF( .NOT. cpl_wdrag ) THEN 
     
    298353         ENDIF 
    299354         ALLOCATE( tauoc_wave(jpi,jpj) ) 
     355      ENDIF 
     356 
     357      IF( ln_tauw ) THEN  
     358         IF( .NOT. cpl_tauw ) THEN  
     359            ALLOCATE( sf_tauw(2), STAT=ierror )           !* allocate and fill sf_wave with sn_tauwx/y  
     360            IF( ierror > 0 )   CALL ctl_stop( 'STOP', 'sbc_wave_init: unable to allocate sf_tauw structure' )  
     361            !  
     362            ALLOCATE( slf_j(2) )  
     363            slf_j(1) = sn_tauwx  
     364            slf_j(2) = sn_tauwy  
     365                                    ALLOCATE( sf_tauw(1)%fnow(jpi,jpj,1)   )  
     366                                    ALLOCATE( sf_tauw(2)%fnow(jpi,jpj,1)   )  
     367            IF( slf_j(1)%ln_tint )  ALLOCATE( sf_tauw(1)%fdta(jpi,jpj,1,2) )  
     368            IF( slf_j(2)%ln_tint )  ALLOCATE( sf_tauw(2)%fdta(jpi,jpj,1,2) )  
     369            CALL fld_fill( sf_tauw, (/ slf_j /), cn_dir, 'sbc_wave_init', 'read wave input', 'namsbc_wave' )  
     370         ENDIF  
     371         ALLOCATE( tauw_x(jpi,jpj) )  
     372         ALLOCATE( tauw_y(jpi,jpj) )  
    300373      ENDIF 
    301374 
Note: See TracChangeset for help on using the changeset viewer.