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

Ignore:
Timestamp:
2019-07-17T15:29:15+02:00 (5 years ago)
Author:
kingr
Message:

Merged Juan's changes for running AMM15 woth wave coupling.
Corrected minor logic error to allow AMM7-uncoupled to reproduce earlier results.
Few line spacing changes to allow merging with OBS br and trunk rvn 5518.

File:
1 edited

Legend:

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

    r8058 r11277  
    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          &             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 
     134         WRITE(numout,*) '              wave physics                               ln_wave     = ', ln_wave   
    134135         WRITE(numout,*) '              OASIS coupling (with atm or sas)           lk_oasis    = ', lk_oasis 
    135136         WRITE(numout,*) '              components of your executable              nn_components = ', nn_components 
    136137         WRITE(numout,*) '              Multicategory heat flux formulation (LIM3) nn_limflx   = ', nn_limflx 
     138         WRITE(numout,*) '              momentum formulation                       nn_drag     = ', nn_drag 
    137139         WRITE(numout,*) '           Misc. options of sbc : ' 
    138140         WRITE(numout,*) '              Patm gradient added in ocean & ice Eqs.    ln_apr_dyn  = ', ln_apr_dyn 
     
    164166      IF ( nn_components == jp_iam_opa .AND. ln_cpl )   & 
    165167         &      CALL ctl_stop( 'STOP', 'sbc_init : OPA-SAS coupled via OASIS, but ln_cpl = T in OPA' ) 
    166       IF ( nn_components == jp_iam_opa .AND. ln_mixcpl )   & 
    167          &      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' ) 
    168170      IF ( ln_cpl .AND. .NOT. lk_oasis )    & 
    169171         &      CALL ctl_stop( 'STOP', 'sbc_init : OASIS-coupled atmosphere model, but key_oasis3 disabled' ) 
    170       IF( ln_mixcpl .AND. .NOT. lk_oasis )    & 
    171          &      CALL ctl_stop( 'the forced-coupled mixed mode (ln_mixcpl) requires the cpp key key_oasis3' ) 
    172       IF( ln_mixcpl .AND. .NOT. ln_cpl )    & 
    173          &      CALL ctl_stop( 'the forced-coupled mixed mode (ln_mixcpl) requires ln_cpl = T' ) 
    174       IF( ln_mixcpl .AND. nn_components /= jp_iam_nemo )    & 
    175          &      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' ) 
    176178 
    177179      !                              ! allocate sbc arrays 
     
    214216      IF( ln_dm2dc .AND. .NOT.( ln_flx .OR. ln_blk_core ) .AND. nn_components /= jp_iam_opa )   & 
    215217         &   CALL ctl_stop( 'diurnal cycle into qsr field from daily values requires a flux or core-bulk formulation' ) 
    216        
    217       IF ( ln_wave ) THEN 
    218       !Activated wave module but neither drag nor stokes drift activated 
    219          IF ( .NOT.(ln_cdgw .OR. ln_sdw) )   THEN 
    220             CALL ctl_warn( 'Ask for wave coupling but nor drag coefficient (ln_cdgw=F) neither stokes drift activated (ln_sdw=F)' ) 
    221       !drag coefficient read from wave model definable only with mfs bulk formulae and core  
    222          ELSEIF (ln_cdgw .AND. .NOT.(ln_blk_mfs .OR. ln_blk_core) )       THEN        
    223              CALL ctl_stop( 'drag coefficient read from wave model definable only with mfs bulk formulae and core') 
    224          ENDIF 
    225       ELSE 
    226       IF ( ln_cdgw .OR. ln_sdw  )                                         &  
    227          &   CALL ctl_stop('Not Activated Wave Module (ln_wave=F) but     & 
    228          & asked coupling with drag coefficient (ln_cdgw =T) or Stokes drift (ln_sdw=T) ') 
    229       ENDIF  
    230218      !                          ! Choice of the Surface Boudary Condition (set nsbc) 
    231       ll_purecpl = ln_cpl .AND. .NOT. ln_mixcpl 
     219      ll_purecpl = ln_cpl .AND. .NOT. ln_mixcpl .AND. .NOT. ln_wavcpl 
    232220      ! 
    233221      icpt = 0 
     
    261249         IF( nsbc == jp_mfs     )   WRITE(numout,*) '              MFS Bulk formulation' 
    262250         IF( nsbc == jp_none    )   WRITE(numout,*) '              OPA coupled to SAS via oasis' 
    263          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' 
    264253         IF( nn_components/= jp_iam_nemo )  & 
    265254            &                       WRITE(numout,*) '              + OASIS coupled SAS' 
    266255      ENDIF 
    267256      ! 
    268       IF( lk_oasis )   CALL sbc_cpl_init (nn_ice)   ! OASIS initialisation. must be done before: (1) first time step 
    269       !                                                     !                                            (2) the use of nn_fsbc 
    270  
     257      IF( lk_oasis ) THEN    
     258         IF( sbc_cpl_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'sbc_cpl_alloc : unable to allocate arrays' )             
     259         CALL sbc_cpl_init (nn_ice)   ! OASIS initialisation. must be done before: (1) first time step    
     260                                      ! (2) the use of nn_fsbc    
     261      ENDIF    
    271262!     nn_fsbc initialization if OPA-SAS coupling via OASIS 
    272263!     sas model time step has to be declared in OASIS (mandatory) -> nn_fsbc has to be modified accordingly 
     
    305296 
    306297      IF( nn_ice == 4      )   CALL cice_sbc_init( nsbc )      ! CICE initialisation 
     298      !   
     299      IF( ln_wave          )   CALL sbc_wave_init              ! surface wave initialisation   
     300      ! 
    307301       
    308302   END SUBROUTINE sbc_init 
     
    325319      !!              - updte the ice fraction : fr_i 
    326320      !!---------------------------------------------------------------------- 
     321      USE bdydta, ONLY: bdy_dta   
     322      ! 
    327323      INTEGER, INTENT(in) ::   kt       ! ocean time step 
    328324      !!--------------------------------------------------------------------- 
     
    345341      !                                            ! ---------------------------------------- ! 
    346342      ! 
    347       IF ( .NOT. lk_bdy ) then 
    348          IF( ln_apr_dyn ) CALL sbc_apr( kt )                ! atmospheric pressure provided at kt+0.5*nn_fsbc 
    349       ENDIF 
     343 
     344      IF( ln_apr_dyn ) CALL sbc_apr( kt )                ! atmospheric pressure provided at kt+0.5*nn_fsbc 
    350345                                                         ! (caution called before sbc_ssm) 
    351346      ! 
     
    382377      END SELECT 
    383378 
    384       IF( ln_mixcpl )        CALL sbc_cpl_rcv ( kt, nn_fsbc, nn_ice )   ! forced-coupled mixed formulation after forcing 
    385  
     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) 
    386384 
    387385      !                                            !==  Misc. Options  ==! 
Note: See TracChangeset for help on using the changeset viewer.