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 11949 for NEMO/branches/2019/dev_r11943_MERGE_2019/src/OCE/SBC/sbcmod.F90 – NEMO

Ignore:
Timestamp:
2019-11-22T15:29:17+01:00 (4 years ago)
Author:
acc
Message:

Merge in changes from 2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps. This just creates a fresh copy of this branch to use as the merge base. See ticket #2341

Location:
NEMO/branches/2019/dev_r11943_MERGE_2019/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2019/dev_r11943_MERGE_2019/src

    • Property svn:mergeinfo deleted
  • NEMO/branches/2019/dev_r11943_MERGE_2019/src/OCE/SBC/sbcmod.F90

    r11536 r11949  
    5959   USE timing         ! Timing 
    6060   USE wet_dry 
    61    USE diurnal_bulk, ONLY:   ln_diurnal_only   ! diurnal SST diagnostic 
     61   USE diu_bulk, ONLY:   ln_diurnal_only   ! diurnal SST diagnostic 
    6262 
    6363   IMPLICIT NONE 
     
    7676CONTAINS 
    7777 
    78    SUBROUTINE sbc_init 
     78   SUBROUTINE sbc_init( Kbb, Kmm, Kaa ) 
    7979      !!--------------------------------------------------------------------- 
    8080      !!                    ***  ROUTINE sbc_init *** 
     
    8888      !!              - nsbc: type of sbc 
    8989      !!---------------------------------------------------------------------- 
     90      INTEGER, INTENT(in) ::   Kbb, Kmm, Kaa         ! ocean time level indices 
    9091      INTEGER ::   ios, icpt                         ! local integer 
    9192      LOGICAL ::   ll_purecpl, ll_opa, ll_not_nemo   ! local logical 
     
    230231      CASE DEFAULT                     !- not supported 
    231232      END SELECT 
     233      IF( ln_diurnal .AND. .NOT. ln_blk  )   CALL ctl_stop( "sbc_init: diurnal flux processing only implemented for bulk forcing" ) 
    232234      ! 
    233235      !                       !**  allocate and set required variables 
     
    327329      !                       !**  associated modules : initialization 
    328330      ! 
    329                           CALL sbc_ssm_init           ! Sea-surface mean fields initialization 
    330       ! 
    331       IF( ln_blk      )   CALL sbc_blk_init            ! bulk formulae initialization 
    332  
    333       IF( ln_ssr      )   CALL sbc_ssr_init            ! Sea-Surface Restoring initialization 
    334       ! 
    335       IF( ln_isf      )   CALL sbc_isf_init            ! Compute iceshelves 
    336       ! 
    337                           CALL sbc_rnf_init            ! Runof initialization 
    338       ! 
    339       IF( ln_apr_dyn )    CALL sbc_apr_init            ! Atmo Pressure Forcing initialization 
     331                          CALL sbc_ssm_init ( Kbb, Kmm ) ! Sea-surface mean fields initialization 
     332      ! 
     333      IF( ln_blk      )   CALL sbc_blk_init              ! bulk formulae initialization 
     334 
     335      IF( ln_ssr      )   CALL sbc_ssr_init              ! Sea-Surface Restoring initialization 
     336      ! 
     337      IF( ln_isf      )   CALL sbc_isf_init( Kmm )       ! Compute iceshelves 
     338      ! 
     339                          CALL sbc_rnf_init( Kmm )       ! Runof initialization 
     340      ! 
     341      IF( ln_apr_dyn )    CALL sbc_apr_init              ! Atmo Pressure Forcing initialization 
    340342      ! 
    341343#if defined key_si3 
     
    343345                          IF( sbc_ice_alloc() /= 0 )   CALL ctl_stop('STOP', 'sbc_ice_alloc : unable to allocate arrays' ) 
    344346      ELSEIF( nn_ice == 2 ) THEN 
    345                           CALL ice_init                ! ICE initialization 
     347                          CALL ice_init( Kbb, Kmm, Kaa )         ! ICE initialization 
    346348      ENDIF 
    347349#endif 
    348       IF( nn_ice == 3 )   CALL cice_sbc_init( nsbc )   ! CICE initialization 
    349       ! 
    350       IF( ln_wave     )   CALL sbc_wave_init           ! surface wave initialisation 
     350      IF( nn_ice == 3 )   CALL cice_sbc_init( nsbc, Kbb, Kmm )   ! CICE initialization 
     351      ! 
     352      IF( ln_wave     )   CALL sbc_wave_init                     ! surface wave initialisation 
    351353      ! 
    352354      IF( lwxios ) THEN 
     
    363365 
    364366 
    365    SUBROUTINE sbc( kt ) 
     367   SUBROUTINE sbc( kt, Kbb, Kmm ) 
    366368      !!--------------------------------------------------------------------- 
    367369      !!                    ***  ROUTINE sbc  *** 
     
    380382      !!---------------------------------------------------------------------- 
    381383      INTEGER, INTENT(in) ::   kt   ! ocean time step 
     384      INTEGER, INTENT(in) ::   Kbb, Kmm   ! ocean time level indices 
    382385      ! 
    383386      LOGICAL ::   ll_sas, ll_opa   ! local logical 
     
    415418      ll_opa = nn_components == jp_iam_opa 
    416419      ! 
    417       IF( .NOT.ll_sas )   CALL sbc_ssm ( kt )            ! mean ocean sea surface variables (sst_m, sss_m, ssu_m, ssv_m) 
    418       IF( ln_wave     )   CALL sbc_wave( kt )            ! surface waves 
     420      IF( .NOT.ll_sas )   CALL sbc_ssm ( kt, Kbb, Kmm )  ! mean ocean sea surface variables (sst_m, sss_m, ssu_m, ssv_m) 
     421      IF( ln_wave     )   CALL sbc_wave( kt, Kmm )       ! surface waves 
    419422 
    420423      ! 
     
    423426      SELECT CASE( nsbc )                                ! Compute ocean surface boundary condition 
    424427      !                                                  ! (i.e. utau,vtau, qns, qsr, emp, sfx) 
    425       CASE( jp_usr   )     ;   CALL usrdef_sbc_oce( kt )                    ! user defined formulation  
    426       CASE( jp_flx     )   ;   CALL sbc_flx       ( kt )                    ! flux formulation 
     428      CASE( jp_usr   )     ;   CALL usrdef_sbc_oce( kt, Kbb )                        ! user defined formulation  
     429      CASE( jp_flx     )   ;   CALL sbc_flx       ( kt )                             ! flux formulation 
    427430      CASE( jp_blk     ) 
    428          IF( ll_sas    )       CALL sbc_cpl_rcv   ( kt, nn_fsbc, nn_ice )   ! OPA-SAS coupling: SAS receiving fields from OPA 
    429                                CALL sbc_blk       ( kt )                    ! bulk formulation for the ocean 
     431         IF( ll_sas    )       CALL sbc_cpl_rcv   ( kt, nn_fsbc, nn_ice, Kbb, Kmm )  ! OPA-SAS coupling: SAS receiving fields from OPA 
     432                               CALL sbc_blk       ( kt )                             ! bulk formulation for the ocean 
    430433                               ! 
    431       CASE( jp_purecpl )   ;   CALL sbc_cpl_rcv   ( kt, nn_fsbc, nn_ice )   ! pure coupled formulation 
     434      CASE( jp_purecpl )   ;   CALL sbc_cpl_rcv   ( kt, nn_fsbc, nn_ice, Kbb, Kmm )  ! pure coupled formulation 
    432435      CASE( jp_none    ) 
    433          IF( ll_opa    )       CALL sbc_cpl_rcv   ( kt, nn_fsbc, nn_ice )   ! OPA-SAS coupling: OPA receiving fields from SAS 
     436         IF( ll_opa    )       CALL sbc_cpl_rcv   ( kt, nn_fsbc, nn_ice, Kbb, Kmm )  ! OPA-SAS coupling: OPA receiving fields from SAS 
    434437      END SELECT 
    435438      ! 
    436       IF( ln_mixcpl )          CALL sbc_cpl_rcv   ( kt, nn_fsbc, nn_ice )   ! forced-coupled mixed formulation after forcing 
    437       ! 
    438       IF ( ln_wave .AND. (ln_tauwoc .OR. ln_tauw) ) CALL sbc_wstress( )      ! Wind stress provided by waves  
     439      IF( ln_mixcpl )          CALL sbc_cpl_rcv   ( kt, nn_fsbc, nn_ice, Kbb, Kmm )  ! forced-coupled mixed formulation after forcing 
     440      ! 
     441      IF ( ln_wave .AND. (ln_tauwoc .OR. ln_tauw) ) CALL sbc_wstress( )              ! Wind stress provided by waves  
    439442      ! 
    440443      !                                            !==  Misc. Options  ==! 
    441444      ! 
    442445      SELECT CASE( nn_ice )                                       ! Update heat and freshwater fluxes over sea-ice areas 
    443       CASE(  1 )   ;         CALL sbc_ice_if   ( kt )             ! Ice-cover climatology ("Ice-if" model) 
     446      CASE(  1 )   ;         CALL sbc_ice_if   ( kt, Kbb, Kmm )   ! Ice-cover climatology ("Ice-if" model) 
    444447#if defined key_si3 
    445       CASE(  2 )   ;         CALL ice_stp  ( kt, nsbc )          ! SI3 ice model 
     448      CASE(  2 )   ;         CALL ice_stp  ( kt, Kbb, Kmm, nsbc ) ! SI3 ice model 
    446449#endif 
    447450      CASE(  3 )   ;         CALL sbc_ice_cice ( kt, nsbc )       ! CICE ice model 
     
    455458      ENDIF 
    456459 
    457       IF( ln_isf         )   CALL sbc_isf( kt )                   ! compute iceshelves 
    458  
    459       IF( ln_rnf         )   CALL sbc_rnf( kt )                   ! add runoffs to fresh water fluxes 
    460  
    461       IF( ln_ssr         )   CALL sbc_ssr( kt )                   ! add SST/SSS damping term 
    462  
    463       IF( nn_fwb    /= 0 )   CALL sbc_fwb( kt, nn_fwb, nn_fsbc )  ! control the freshwater budget 
     460      IF( ln_isf         )   CALL sbc_isf( kt, Kmm )                   ! compute iceshelves 
     461 
     462      IF( ln_rnf         )   CALL sbc_rnf( kt )                        ! add runoffs to fresh water fluxes 
     463 
     464      IF( ln_ssr         )   CALL sbc_ssr( kt )                        ! add SST/SSS damping term 
     465 
     466      IF( nn_fwb    /= 0 )   CALL sbc_fwb( kt, nn_fwb, nn_fsbc, Kmm )  ! control the freshwater budget 
    464467 
    465468      ! Special treatment of freshwater fluxes over closed seas in the model domain 
     
    472475      IF ( ll_wd ) THEN     ! If near WAD point limit the flux for now 
    473476         zthscl = atanh(rn_wd_sbcfra)                     ! taper frac default is .999  
    474          zwdht(:,:) = sshn(:,:) + ht_0(:,:) - rn_wdmin1   ! do this calc of water 
     477         zwdht(:,:) = ssh(:,:,Kmm) + ht_0(:,:) - rn_wdmin1   ! do this calc of water 
    475478                                                     ! depth above wd limit once 
    476479         WHERE( zwdht(:,:) <= 0.0 ) 
     
    558561      ! 
    559562      IF(ln_ctl) THEN         ! print mean trends (used for debugging) 
    560          CALL prt_ctl(tab2d_1=fr_i              , clinfo1=' fr_i    - : ', mask1=tmask ) 
    561          CALL prt_ctl(tab2d_1=(emp-rnf + fwfisf), clinfo1=' emp-rnf - : ', mask1=tmask ) 
    562          CALL prt_ctl(tab2d_1=(sfx-rnf + fwfisf), clinfo1=' sfx-rnf - : ', mask1=tmask ) 
    563          CALL prt_ctl(tab2d_1=qns              , clinfo1=' qns      - : ', mask1=tmask ) 
    564          CALL prt_ctl(tab2d_1=qsr              , clinfo1=' qsr      - : ', mask1=tmask ) 
    565          CALL prt_ctl(tab3d_1=tmask            , clinfo1=' tmask    - : ', mask1=tmask, kdim=jpk ) 
    566          CALL prt_ctl(tab3d_1=tsn(:,:,:,jp_tem), clinfo1=' sst      - : ', mask1=tmask, kdim=1   ) 
    567          CALL prt_ctl(tab3d_1=tsn(:,:,:,jp_sal), clinfo1=' sss      - : ', mask1=tmask, kdim=1   ) 
    568          CALL prt_ctl(tab2d_1=utau             , clinfo1=' utau     - : ', mask1=umask,                      & 
    569             &         tab2d_2=vtau             , clinfo2=' vtau     - : ', mask2=vmask ) 
     563         CALL prt_ctl(tab2d_1=fr_i                , clinfo1=' fr_i    - : ' , mask1=tmask ) 
     564         CALL prt_ctl(tab2d_1=(emp-rnf + fwfisf)  , clinfo1=' emp-rnf - : ' , mask1=tmask ) 
     565         CALL prt_ctl(tab2d_1=(sfx-rnf + fwfisf)  , clinfo1=' sfx-rnf - : ' , mask1=tmask ) 
     566         CALL prt_ctl(tab2d_1=qns                 , clinfo1=' qns      - : ', mask1=tmask ) 
     567         CALL prt_ctl(tab2d_1=qsr                 , clinfo1=' qsr      - : ', mask1=tmask ) 
     568         CALL prt_ctl(tab3d_1=tmask               , clinfo1=' tmask    - : ', mask1=tmask, kdim=jpk ) 
     569         CALL prt_ctl(tab3d_1=ts(:,:,:,jp_tem,Kmm), clinfo1=' sst      - : ', mask1=tmask, kdim=1   ) 
     570         CALL prt_ctl(tab3d_1=ts(:,:,:,jp_sal,Kmm), clinfo1=' sss      - : ', mask1=tmask, kdim=1   ) 
     571         CALL prt_ctl(tab2d_1=utau                , clinfo1=' utau     - : ', mask1=umask,                      & 
     572            &         tab2d_2=vtau                , clinfo2=' vtau     - : ', mask2=vmask ) 
    570573      ENDIF 
    571574 
Note: See TracChangeset for help on using the changeset viewer.