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 10478 for branches/UKMO/AMM15_v3_6_STABLE_package_collate_coupling/NEMOGCM/NEMO/OPA_SRC/SBC/sbcmod.F90 – NEMO

Ignore:
Timestamp:
2019-01-09T12:11:55+01:00 (5 years ago)
Author:
jcastill
Message:

Merged branch UKMO/r6232_HZG_WAVE-coupling@9868

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/UKMO/AMM15_v3_6_STABLE_package_collate_coupling/NEMOGCM/NEMO/OPA_SRC/SBC/sbcmod.F90

    r10473 r10478  
    8888      NAMELIST/namsbc/ nn_fsbc   , ln_ana    , ln_flx, ln_blk_clio, ln_blk_core, ln_mixcpl,   & 
    8989         &             ln_blk_mfs, ln_apr_dyn, nn_ice, nn_ice_embd, ln_dm2dc   , ln_rnf   ,   & 
    90          &             ln_ssr    , nn_isf    , nn_fwb, ln_cdgw    , ln_wave    , ln_sdw   ,   & 
    91          &             ln_tauoc  , ln_stcor  , nn_lsm, nn_limflx , nn_components, ln_cpl 
     90         &             ln_ssr    , nn_isf    , nn_fwb, ln_wave, nn_lsm     , nn_limflx,   &  
     91                       nn_components, ln_cpl , ln_wavcpl, nn_drag 
    9292      INTEGER  ::   ios 
    9393      INTEGER  ::   ierr, ierr0, ierr1, ierr2, ierr3, jpm 
    94       LOGICAL  ::   ll_purecpl 
    9594      !!---------------------------------------------------------------------- 
    9695 
     
    131130         WRITE(numout,*) '              MFS  bulk  formulation                     ln_blk_mfs  = ', ln_blk_mfs 
    132131         WRITE(numout,*) '              ocean-atmosphere coupled formulation       ln_cpl      = ', ln_cpl 
    133          WRITE(numout,*) '              forced-coupled mixed formulation           ln_mixcpl   = ', ln_mixcpl 
     132         WRITE(numout,*) '              forced-coupled atm mixed formulation       ln_mixcpl   = ', ln_mixcpl  
     133         WRITE(numout,*) '              forced-coupled wav mixed formulation       ln_wavcpl   = ', ln_wavcpl 
    134134         WRITE(numout,*) '              wave physics                               ln_wave     = ', ln_wave   
    135          WRITE(numout,*) '                 Stokes drift corr. to vert. velocity    ln_sdw      = ', ln_sdw   
    136          WRITE(numout,*) '                 wave modified ocean stress              ln_tauoc    = ', ln_tauoc   
    137          WRITE(numout,*) '                 Stokes coriolis term                    ln_stcor    = ', ln_stcor   
    138          WRITE(numout,*) '                 neutral drag coefficient (CORE, MFS)    ln_cdgw     = ', ln_cdgw 
    139135         WRITE(numout,*) '              OASIS coupling (with atm or sas)           lk_oasis    = ', lk_oasis 
    140136         WRITE(numout,*) '              components of your executable              nn_components = ', nn_components 
    141137         WRITE(numout,*) '              Multicategory heat flux formulation (LIM3) nn_limflx   = ', nn_limflx 
     138         WRITE(numout,*) '              momentum formulation                       nn_drag     = ', nn_drag 
    142139         WRITE(numout,*) '           Misc. options of sbc : ' 
    143140         WRITE(numout,*) '              Patm gradient added in ocean & ice Eqs.    ln_apr_dyn  = ', ln_apr_dyn 
     
    169166      IF ( nn_components == jp_iam_opa .AND. ln_cpl )   & 
    170167         &      CALL ctl_stop( 'STOP', 'sbc_init : OPA-SAS coupled via OASIS, but ln_cpl = T in OPA' ) 
    171       IF ( nn_components == jp_iam_opa .AND. ln_mixcpl )   & 
    172          &      CALL ctl_stop( 'STOP', 'sbc_init : OPA-SAS coupled via OASIS, but ln_mixcpl = T in OPA' ) 
     168      IF ( nn_components == jp_iam_opa .AND. ( ln_mixcpl .OR. ln_wavcpl) )   &  
     169         &      CALL ctl_stop( 'STOP', 'sbc_init : OPA-SAS coupled via OASIS, but ln_mixcpl or ln_wavcpl = T in OPA' ) 
    173170      IF ( ln_cpl .AND. .NOT. lk_oasis )    & 
    174171         &      CALL ctl_stop( 'STOP', 'sbc_init : OASIS-coupled atmosphere model, but key_oasis3 disabled' ) 
    175       IF( ln_mixcpl .AND. .NOT. lk_oasis )    & 
    176          &      CALL ctl_stop( 'the forced-coupled mixed mode (ln_mixcpl) requires the cpp key key_oasis3' ) 
    177       IF( ln_mixcpl .AND. .NOT. ln_cpl )    & 
    178          &      CALL ctl_stop( 'the forced-coupled mixed mode (ln_mixcpl) requires ln_cpl = T' ) 
    179       IF( ln_mixcpl .AND. nn_components /= jp_iam_nemo )    & 
    180          &      CALL ctl_stop( 'the forced-coupled mixed mode (ln_mixcpl) is not yet working with sas-opa coupling via oasis' ) 
     172      IF( ( ln_mixcpl .OR. ln_wavcpl ) .AND. .NOT. lk_oasis )    &  
     173         &      CALL ctl_stop( 'the forced-coupled mixed mode (ln_mixcpl or ln_wavcpl) requires the cpp key key_oasis3' )  
     174      IF( ( ln_mixcpl .OR. ln_wavcpl ) .AND. .NOT. ln_cpl )    &  
     175         &      CALL ctl_stop( 'the forced-coupled mixed mode (ln_mixcpl or ln_wavcpl) requires ln_cpl = T' )  
     176      IF( ( ln_mixcpl .OR. ln_wavcpl ) .AND. nn_components /= jp_iam_nemo )    &  
     177         &      CALL ctl_stop( 'the forced-coupled mixed mode (ln_mixcpl or ln_wavcpl) is not yet working with sas-opa coupling via oasis' ) 
    181178 
    182179      !                              ! allocate sbc arrays 
     
    219216      IF( ln_dm2dc .AND. .NOT.( ln_flx .OR. ln_blk_core ) .AND. nn_components /= jp_iam_opa )   & 
    220217         &   CALL ctl_stop( 'diurnal cycle into qsr field from daily values requires a flux or core-bulk formulation' ) 
    221        
    222       IF ( ln_wave ) THEN 
    223          !Activated wave module but neither drag nor stokes drift activated   
    224          IF ( .NOT.(ln_cdgw .OR. ln_sdw .OR. ln_tauoc .OR. ln_stcor ) )   THEN    
    225              CALL ctl_warn( 'Ask for wave coupling but ln_cdgw=F, ln_sdw=F, ln_tauoc=F, ln_stcor=F')   
    226          !drag coefficient read from wave model definable only with mfs bulk formulae and core 
    227          ELSEIF (ln_cdgw .AND. .NOT.(ln_blk_mfs .OR. ln_blk_core) )       THEN        
    228              CALL ctl_stop( 'drag coefficient read from wave model definable only with mfs bulk formulae and core') 
    229          ELSEIF (ln_stcor .AND. .NOT. ln_sdw) THEN    
    230              CALL ctl_stop( 'Stokes-Coriolis term calculated only if activated Stokes Drift ln_sdw=T') 
    231          ENDIF 
    232       ELSE 
    233          IF ( ln_cdgw .OR. ln_sdw .OR. ln_tauoc .OR. ln_stcor ) &    
    234             &   CALL ctl_stop( 'Not Activated Wave Module (ln_wave=F) but asked coupling ',    &   
    235             &                  'with drag coefficient (ln_cdgw =T) '  ,                        &   
    236             &                  'or Stokes Drift (ln_sdw=T) ' ,                                 &   
    237             &                  'or ocean stress modification due to waves (ln_tauoc=T) ',      &   
    238             &                  'or Stokes-Coriolis term (ln_stcori=T)'  ) 
    239       ENDIF  
    240218      !                          ! Choice of the Surface Boudary Condition (set nsbc) 
    241       ll_purecpl = ln_cpl .AND. .NOT. ln_mixcpl 
     219      ll_purecpl = ln_cpl .AND. .NOT. ln_mixcpl .AND. .NOT. ln_wavcpl 
    242220      ! 
    243221      icpt = 0 
     
    271249         IF( nsbc == jp_mfs     )   WRITE(numout,*) '              MFS Bulk formulation' 
    272250         IF( nsbc == jp_none    )   WRITE(numout,*) '              OPA coupled to SAS via oasis' 
    273          IF( ln_mixcpl          )   WRITE(numout,*) '              + forced-coupled mixed formulation' 
     251         IF( ln_mixcpl          )   WRITE(numout,*) '              + forced-coupled mixed atm formulation'  
     252         IF( ln_wavcpl          )   WRITE(numout,*) '              + forced-coupled mixed wav formulation' 
    274253         IF( nn_components/= jp_iam_nemo )  & 
    275254            &                       WRITE(numout,*) '              + OASIS coupled SAS' 
     
    340319      !!              - updte the ice fraction : fr_i 
    341320      !!---------------------------------------------------------------------- 
     321      USE bdydta, ONLY: bdy_dta   
     322      ! 
    342323      INTEGER, INTENT(in) ::   kt       ! ocean time step 
    343324      !!--------------------------------------------------------------------- 
     
    360341      !                                            ! ---------------------------------------- ! 
    361342      ! 
    362       IF ( .NOT. lk_bdy ) then 
    363          IF( ln_apr_dyn ) CALL sbc_apr( kt )                ! atmospheric pressure provided at kt+0.5*nn_fsbc 
    364       ENDIF 
     343 
     344      IF( ln_apr_dyn ) CALL sbc_apr( kt )                ! atmospheric pressure provided at kt+0.5*nn_fsbc 
    365345                                                         ! (caution called before sbc_ssm) 
    366346      ! 
     
    397377      END SELECT 
    398378 
    399       IF( ln_mixcpl )        CALL sbc_cpl_rcv ( kt, nn_fsbc, nn_ice )   ! forced-coupled mixed formulation after forcing 
    400  
    401       IF ( ln_wave .AND. ln_tauoc) THEN                 ! Wave stress subctracted   
    402             utau(:,:) = utau(:,:)*tauoc_wave(:,:)   
    403             vtau(:,:) = vtau(:,:)*tauoc_wave(:,:)   
    404             taum(:,:) = taum(:,:)*tauoc_wave(:,:)   
    405       !   
    406             SELECT CASE( nsbc )   
    407             CASE(  0,1,2,3,5,-1 )  ;   
    408                 IF(lwp .AND. kt == nit000 ) WRITE(numout,*) 'WARNING: You are subtracting the wave stress to the ocean. &   
    409                         & If not requested select ln_tauoc=.false'   
    410             END SELECT   
    411       !   
    412       END IF 
     379      IF( ln_mixcpl .OR. ln_wavcpl )  CALL sbc_cpl_rcv ( kt, nn_fsbc, nn_ice )   ! forced-coupled mixed formulation after forcing  
     380       
     381      IF( ln_wave .AND. (ln_tauoc .OR. ln_tauw) ) CALL sbc_stress( )    ! Wave stress update   
     382      IF( lk_bdy )           CALL bdy_dta ( kt, time_offset=+1 )        ! update dynamic & tracer data at open boundaries  
     383                                                                        ! (caution called after sbc_ssm[_cpl] and before ice) 
    413384 
    414385      !                                            !==  Misc. Options  ==! 
Note: See TracChangeset for help on using the changeset viewer.