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 1218 for trunk/NEMO/OPA_SRC/SBC/sbcmod.F90 – NEMO

Ignore:
Timestamp:
2008-10-28T10:12:16+01:00 (16 years ago)
Author:
smasson
Message:

first implementation of the new coupling interface in the trunk, see ticket:155

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMO/OPA_SRC/SBC/sbcmod.F90

    r1172 r1218  
    44   !! Surface module :  provide to the ocean its surface boundary condition 
    55   !!====================================================================== 
    6    !! History :  3.0   !  2006-07  (G. Madec)  Original code 
     6   !! History :  3.0   !  07-2006  (G. Madec)  Original code 
     7   !!             -    !  08-2008  (S. Masson, E. .... ) coupled interface 
    78   !!---------------------------------------------------------------------- 
    89 
     
    4243   PUBLIC   sbc        ! routine called by step.F90 
    4344    
    44    !! * namsbc namelist (public variables) 
    45    LOGICAL , PUBLIC ::   ln_ana      = .FALSE.   !: analytical boundary condition flag 
    46    LOGICAL , PUBLIC ::   ln_flx      = .FALSE.   !: flux      formulation 
    47    LOGICAL , PUBLIC ::   ln_blk_clio = .FALSE.   !: CLIO bulk formulation 
    48    LOGICAL , PUBLIC ::   ln_blk_core = .FALSE.   !: CORE bulk formulation 
    49    LOGICAL , PUBLIC ::   ln_cpl      = .FALSE.   !: coupled   formulation (overwritten by key_sbc_coupled ) 
    50    LOGICAL , PUBLIC ::   ln_dm2dc    = .FALSE.   !: Daily mean to Diurnal Cycle short wave (qsr) 
    51    LOGICAL , PUBLIC ::   ln_rnf      = .FALSE.   !: runoffs / runoff mouths 
    52    LOGICAL , PUBLIC ::   ln_ssr      = .FALSE.   !: Sea Surface restoring on SST and/or SSS       
    53    INTEGER , PUBLIC ::   nn_ice      = 0         !: flag on ice in the surface boundary condition (=0/1/2) 
    54    INTEGER , PUBLIC ::   nn_fwb      = 0         !: type of FreshWater Budget control (=0/1/2) 
    55    INTEGER          ::   nn_ico_cpl  = 0         !: ice-ocean coupling indicator 
    56    !                                             !  = 0   LIM-3 old case 
    57    !                                             !  = 1   stresses computed using now ocean velocity 
    58    !                                             !  = 2   combination of 0 and 1 cases 
    59  
    6045   INTEGER ::   nsbc   ! type of surface boundary condition (deduced from namsbc informations) 
    61    INTEGER ::   nice   ! type of ice in the surface boundary condition (deduced from namsbc informations) 
    6246       
    6347   !! * Substitutions 
     
    9478      ENDIF 
    9579 
    96       REWIND ( numnam )                   ! Read Namelist namsbc 
    97       READ   ( numnam, namsbc ) 
     80      REWIND( numnam )                   ! Read Namelist namsbc 
     81      READ  ( numnam, namsbc ) 
    9882 
    9983      ! overwrite namelist parameter using CPP key information 
    100 !!gmhere no overwrite, test all option via namelist change: require more incore memory 
     84!!gm here no overwrite, test all option via namelist change: require more incore memory 
    10185!!gm  IF( lk_sbc_cpl       ) THEN   ;   ln_cpl      = .TRUE.   ;   ELSE   ;   ln_cpl      = .FALSE.   ;   ENDIF 
    10286      IF( lk_lim2 )            nn_ice      = 2 
     
    10993      ! Control print 
    11094      IF(lwp) THEN 
    111          WRITE(numout,*) '        Namelist namsbc (overwritten using CPP key defined)' 
     95         WRITE(numout,*) '        Namelist namsbc (partly overwritten with CPP key setting)' 
    11296         WRITE(numout,*) '           frequency update of sbc (and ice)             nn_fsbc     = ', nn_fsbc 
    11397         WRITE(numout,*) '           Type of sbc : ' 
     
    11599         WRITE(numout,*) '              flux       formulation                     ln_flx      = ', ln_flx 
    116100         WRITE(numout,*) '              CLIO bulk  formulation                     ln_blk_clio = ', ln_blk_clio 
    117          WRITE(numout,*) '              CORE bulk  formulation                     ln_blk_core = ', ln_blk_core 
     101         WRITE(numout,*) '              CLIO bulk  formulation                     ln_blk_core = ', ln_blk_core 
    118102         WRITE(numout,*) '              coupled    formulation (T if key_sbc_cpl)  ln_cpl      = ', ln_cpl 
    119103         WRITE(numout,*) '           Misc. options of sbc : ' 
     
    127111      ENDIF 
    128112 
    129       IF( .NOT. ln_rnf )   THEN                      ! no specific treatment in rivers mouths vicinity 
    130          ln_rnf_mouth = .false.                       
    131          nkrnf = 0 
    132          rnfmsk(:,:) = 0.e0 
    133          rnfmsk_z(:) = 0.e0 
    134       ENDIF 
    135       IF( nn_ice == 0  )   fr_i(:,:) = 0.e0          ! no ice in the domain, ice fraction is always zero 
    136  
    137       ! Check consistancy   !!gm mixture of real and integer : coding to be changed.... 
    138  
    139       IF( nn_ice == 2 )   THEN 
    140          IF( MOD( nitend - nit000 + 1, nn_fsbc) /= 0 ) THEN  
    141             WRITE(ctmp1,*) 'experiment length (', nitend - nit000 + 1, ') is NOT a multiple of nn_fsbc (', nn_fsbc, ')' 
    142             CALL ctl_stop( ctmp1, 'Impossible to do proper restart files' ) 
    143          ENDIF 
    144          IF( MOD( nstock, nn_fsbc) /= 0 ) THEN  
    145             WRITE(ctmp1,*) 'nstock ('           , nstock             , ') is NOT a multiple of nn_fsbc (', nn_fsbc, ')' 
    146             CALL ctl_stop( ctmp1, 'Impossible to do proper restart files' ) 
    147          ENDIF 
    148       ENDIF 
    149  
    150       IF( MOD( rday, nn_fsbc*rdt ) /= 0 )   CALL ctl_warn( 'nn_fsbc is NOT a multiple of the number of time steps in a day' ) 
    151  
     113      IF( .NOT. ln_rnf ) THEN                      ! no specific treatment in vicinity of river mouths  
     114         ln_rnf_mouth  = .false.                       
     115         nkrnf         = 0 
     116         rnfmsk  (:,:) = 0.e0 
     117         rnfmsk_z(:)   = 0.e0 
     118      ENDIF 
     119      IF( nn_ice == 0  )   fr_i(:,:) = 0.e0        ! no ice in the domain, ice fraction is always zero 
     120 
     121      !                                            ! restartability    
     122      IF( MOD( nitend - nit000 + 1, nn_fsbc) /= 0 .OR.   & 
     123          MOD( nstock             , nn_fsbc) /= 0 ) THEN  
     124         WRITE(ctmp1,*) 'experiment length (', nitend - nit000 + 1, ') or nstock (', nstock,   & 
     125            &           ' is NOT a multiple of nn_fsbc (', nn_fsbc, ')' 
     126         CALL ctl_stop( ctmp1, 'Impossible to properly do model restart' ) 
     127      ENDIF 
     128      ! 
     129      IF( MOD( rday, REAL(nn_fsbc, wp) * rdt ) /= 0 )   & 
     130         &  CALL ctl_warn( 'nn_fsbc is NOT a multiple of the number of time steps in a day' ) 
     131      ! 
    152132      IF( nn_ice == 2 .AND. .NOT.( ln_blk_clio .OR. ln_blk_core ) )   & 
    153          &   CALL ctl_stop( 'sbc_init: sea-ice model requires a bulk formulation' ) 
     133         &   CALL ctl_stop( 'sea-ice model requires a bulk formulation' ) 
    154134       
    155135      ! Choice of the Surface Boudary Condition (set nsbc) 
     
    214194      SELECT CASE( nsbc )                        ! Compute ocean surface boundary condition 
    215195      !                                          ! (i.e. utau,vtau, qns, qsr, emp, emps) 
    216       CASE(  0 )   ;   CALL sbc_gyre    ( kt )      ! analytical formulation : GYRE configuration 
    217       CASE(  1 )   ;   CALL sbc_ana     ( kt )      ! analytical formulation : uniform sbc 
    218       CASE(  2 )   ;   CALL sbc_flx     ( kt )      ! flux formulation 
    219       CASE(  3 )   ;   CALL sbc_blk_clio( kt )      ! bulk formulation : CLIO for the ocean 
    220       CASE(  4 )   ;   CALL sbc_blk_core( kt )      ! bulk formulation : CORE for the ocean 
    221       CASE(  5 )   ;   CALL sbc_cpl     ( kt )      ! coupled formulation 
     196      CASE(  0 )   ;   CALL sbc_gyre    ( kt )                    ! analytical formulation : GYRE configuration 
     197      CASE(  1 )   ;   CALL sbc_ana     ( kt )                    ! analytical formulation : uniform sbc 
     198      CASE(  2 )   ;   CALL sbc_flx     ( kt )                    ! flux formulation 
     199      CASE(  3 )   ;   CALL sbc_blk_clio( kt )                    ! bulk formulation : CLIO for the ocean 
     200      CASE(  4 )   ;   CALL sbc_blk_core( kt )                    ! bulk formulation : CORE for the ocean 
     201      CASE(  5 )   ;   CALL sbc_cpl_rcv ( kt, nn_fsbc, nn_ice )   ! coupled formulation 
    222202      CASE( -1 )                                 
    223                        CALL sbc_ana     ( kt )      ! ESOPA, test ALL the formulations 
    224                        CALL sbc_gyre    ( kt ) 
    225                        CALL sbc_flx     ( kt ) 
    226                        CALL sbc_blk_clio( kt ) 
    227                        CALL sbc_blk_core( kt ) 
    228                        CALL sbc_cpl     ( kt ) 
     203                       CALL sbc_ana     ( kt )                     ! ESOPA, test ALL the formulations 
     204                       CALL sbc_gyre    ( kt )                     ! 
     205                       CALL sbc_flx     ( kt )                     ! 
     206                       CALL sbc_blk_clio( kt )                     ! 
     207                       CALL sbc_blk_core( kt )                     ! 
     208                       CALL sbc_cpl_rcv ( kt,  nn_fsbc, nn_ice )   ! 
    229209      END SELECT 
    230210 
     
    234214!!gm  IF( ln_dm2dc       )   CALL sbc_dcy( kt )                 ! Daily mean qsr distributed over the Diurnal Cycle 
    235215       
    236       SELECT CASE( nn_ice )                                     ! Update heat and freshwater fluxes over ice-covered areas 
    237       CASE(  1 )   ;       CALL sbc_ice_if ( kt )                     ! Ice-cover climatology ("Ice-if" model) 
     216      SELECT CASE( nn_ice )                                     ! Update heat and freshwater fluxes over sea-ice areas 
     217      CASE(  1 )   ;       CALL sbc_ice_if   ( kt )                   ! Ice-cover climatology ("Ice-if" model) 
    238218         !                                                       
    239219      CASE(  2 )   ;       CALL sbc_ice_lim_2( kt, nsbc )             ! LIM 2.0 ice model 
Note: See TracChangeset for help on using the changeset viewer.