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 3625 for branches/2012/dev_NOC_2012_rev3555/NEMOGCM/NEMO/OPA_SRC/SBC/sbcmod.F90 – NEMO

Ignore:
Timestamp:
2012-11-21T14:19:18+01:00 (11 years ago)
Author:
acc
Message:

Branch dev_NOC_2012_r3555. #1006. Step 7. Check in code now merged with dev_r3385_NOCS04_HAMF

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2012/dev_NOC_2012_rev3555/NEMOGCM/NEMO/OPA_SRC/SBC/sbcmod.F90

    r3609 r3625  
    1212   !!             -   ! 2010-10  (J. Chanut, C. Bricaud, G. Madec)  add the surface pressure forcing 
    1313   !!            3.4  ! 2011-11  (C. Harris) CICE added as an option 
     14   !!            3.5  ! 2012-11  (A. Coward, G. Madec) Rethink of heat, mass and salt surface fluxes 
    1415   !!---------------------------------------------------------------------- 
    1516 
     
    8485      INTEGER ::   icpt   ! local integer 
    8586      !! 
    86       NAMELIST/namsbc/ nn_fsbc   , ln_ana , ln_flx  , ln_blk_clio, ln_blk_core, ln_cpl,   & 
    87          &             ln_blk_mfs, ln_apr_dyn, nn_ice , ln_dm2dc, ln_rnf, ln_ssr     , nn_fwb, ln_cdgw 
     87      NAMELIST/namsbc/ nn_fsbc   , ln_ana    , ln_flx,  ln_blk_clio, ln_blk_core, ln_cpl,   & 
     88         &             ln_blk_mfs, ln_apr_dyn, nn_ice,  nn_ice_embd, ln_dm2dc   , ln_rnf,   & 
     89         &             ln_ssr    , nn_fwb    , ln_cdgw 
    8890      !!---------------------------------------------------------------------- 
    8991 
     
    121123         WRITE(numout,*) '              Patm gradient added in ocean & ice Eqs.    ln_apr_dyn  = ', ln_apr_dyn 
    122124         WRITE(numout,*) '              ice management in the sbc (=0/1/2/3)       nn_ice      = ', nn_ice  
     125         WRITE(numout,*) '              ice-ocean embedded/levitating (=0/1/2)     nn_ice_embd = ', nn_ice_embd 
    123126         WRITE(numout,*) '              daily mean to diurnal cycle qsr            ln_dm2dc    = ', ln_dm2dc  
    124127         WRITE(numout,*) '              runoff / runoff mouths                     ln_rnf      = ', ln_rnf 
     
    136139         IF( sbc_rnf_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'sbc_init : unable to allocate sbc_rnf arrays' ) 
    137140         nkrnf         = 0 
    138          rnf     (:,:) = 0.e0 
    139          rnfmsk  (:,:) = 0.e0 
    140          rnfmsk_z(:)   = 0.e0 
     141         rnf     (:,:) = 0.0_wp 
     142         rnfmsk  (:,:) = 0.0_wp 
     143         rnfmsk_z(:)   = 0.0_wp 
    141144      ENDIF 
    142145      IF( nn_ice == 0  )   fr_i(:,:) = 0.e0        ! no ice in the domain, ice fraction is always zero 
     146 
     147      sfx(:,:) = 0.0_wp                            ! the salt flux due to freezing/melting will be computed (i.e. will be non-zero)  
     148                                                   ! only if sea-ice is present 
    143149 
    144150      !                                            ! restartability    
     
    157163      IF( nn_ice == 4 .AND. .NOT.( ln_blk_core .OR. lk_cpl ) )   & 
    158164         &   CALL ctl_stop( 'CICE sea-ice model requires ln_blk_core or lk_cpl' ) 
    159       IF( nn_ice == 4 .AND. ( .NOT. ( cp_cfg == 'orca' ) .OR. lk_agrif ) )   & 
    160          &   CALL ctl_stop( 'CICE sea-ice model currently only available in a global ORCA configuration without AGRIF' ) 
     165      IF( nn_ice == 4 .AND. lk_agrif )   & 
     166         &   CALL ctl_stop( 'CICE sea-ice model not currently available with AGRIF' ) 
     167      IF( ( nn_ice == 3 .OR. nn_ice == 4 ) .AND. nn_ice_embd == 0 )   & 
     168         &   CALL ctl_stop( 'LIM3 and CICE sea-ice models require nn_ice_embd = 2 or 3' ) 
    161169       
    162170      IF( ln_dm2dc )   nday_qsr = -1   ! initialisation flag 
     
    226234      !! ** Action  : - set the ocean surface boundary condition at before and now  
    227235      !!                time step, i.e.   
    228       !!                utau_b, vtau_b, qns_b, qsr_b, emp_n, emps_b, qrp_b, erp_b 
    229       !!                utau  , vtau  , qns  , qsr  , emp  , emps  , qrp  , erp 
     236      !!                utau_b, vtau_b, qns_b, qsr_b, emp_n, sfx_b, qrp_b, erp_b 
     237      !!                utau  , vtau  , qns  , qsr  , emp  , sfx  , qrp  , erp 
    230238      !!              - updte the ice fraction : fr_i 
    231239      !!---------------------------------------------------------------------- 
     
    243251         ! The 3D heat content due to qsr forcing is treated in traqsr 
    244252         ! qsr_b (:,:) = qsr (:,:) 
    245          emp_b (:,:) = emp (:,:) 
    246          emps_b(:,:) = emps(:,:) 
     253         emp_b(:,:) = emp(:,:) 
     254         sfx_b(:,:) = sfx(:,:) 
    247255      ENDIF 
    248256      !                                            ! ---------------------------------------- ! 
     
    262270                                                             
    263271      SELECT CASE( nsbc )                                ! Compute ocean surface boundary condition 
    264       !                                                  ! (i.e. utau,vtau, qns, qsr, emp, emps) 
     272      !                                                  ! (i.e. utau,vtau, qns, qsr, emp, sfx) 
    265273      CASE(  0 )   ;   CALL sbc_gyre    ( kt )                    ! analytical formulation : GYRE configuration 
    266274      CASE(  1 )   ;   CALL sbc_ana     ( kt )                    ! analytical formulation : uniform sbc 
     
    314322            CALL iom_get( numror, jpdom_autoglo, 'qns_b' , qns_b  )   ! before non solar heat flux (T-point) 
    315323            ! The 3D heat content due to qsr forcing is treated in traqsr 
    316             ! CALL iom_get( numror, jpdom_autoglo, 'qsr_b' , qsr_b  )   ! before     solar heat flux (T-point) 
    317             CALL iom_get( numror, jpdom_autoglo, 'emp_b' , emp_b  )   ! before     freshwater flux (T-point) 
    318             CALL iom_get( numror, jpdom_autoglo, 'emps_b', emps_b )   ! before C/D freshwater flux (T-point) 
     324            ! CALL iom_get( numror, jpdom_autoglo, 'qsr_b' , qsr_b  ) ! before     solar heat flux (T-point) 
     325            CALL iom_get( numror, jpdom_autoglo, 'emp_b', emp_b  )    ! before     freshwater flux (T-point) 
     326            ! To ensure restart capability with 3.3x/3.4 restart files    !! to be removed in v3.6 
     327            IF( iom_varid( numror, 'sfx_b', ldstop = .FALSE. ) > 0 ) THEN 
     328               CALL iom_get( numror, jpdom_autoglo, 'sfx_b', sfx_b )  ! before salt flux (T-point) 
     329            ELSE 
     330               sfx_b (:,:) = sfx(:,:) 
     331            ENDIF 
    319332         ELSE                                                   !* no restart: set from nit000 values 
    320333            IF(lwp) WRITE(numout,*) '          nit000-1 surface forcing fields set to nit000' 
     
    322335            vtau_b(:,:) = vtau(:,:) 
    323336            qns_b (:,:) = qns (:,:) 
    324             ! qsr_b (:,:) = qsr (:,:) 
    325             emp_b (:,:) = emp (:,:) 
    326             emps_b(:,:) = emps(:,:) 
     337            emp_b (:,:) = emp(:,:) 
     338            sfx_b (:,:) = sfx(:,:) 
    327339         ENDIF 
    328340      ENDIF 
     
    340352         ! CALL iom_rstput( kt, nitrst, numrow, 'qsr_b'  , qsr  ) 
    341353         CALL iom_rstput( kt, nitrst, numrow, 'emp_b'  , emp  ) 
    342          CALL iom_rstput( kt, nitrst, numrow, 'emps_b' , emps ) 
     354         CALL iom_rstput( kt, nitrst, numrow, 'sfx_b' , sfx ) 
    343355      ENDIF 
    344356 
     
    348360      IF( MOD( kt-1, nn_fsbc ) == 0 ) THEN 
    349361         CALL iom_put( "empmr" , emp  - rnf )                   ! upward water flux 
    350          CALL iom_put( "empsmr", emps - rnf )                   ! c/d water flux 
     362         CALL iom_put( "saltflx", sfx  )                        ! downward salt flux   
     363                                                                ! (includes virtual salt flux beneath ice  
     364                                                                ! in linear free surface case) 
    351365         CALL iom_put( "qt"    , qns  + qsr )                   ! total heat flux  
    352366         CALL iom_put( "qns"   , qns        )                   ! solar heat flux 
     
    365379         CALL prt_ctl(tab2d_1=fr_i             , clinfo1=' fr_i     - : ', mask1=tmask, ovlap=1 ) 
    366380         CALL prt_ctl(tab2d_1=(emp-rnf)        , clinfo1=' emp-rnf  - : ', mask1=tmask, ovlap=1 ) 
    367          CALL prt_ctl(tab2d_1=(emps-rnf)       , clinfo1=' emps-rnf - : ', mask1=tmask, ovlap=1 ) 
     381         CALL prt_ctl(tab2d_1=(sfx-rnf)        , clinfo1=' sfx-rnf - : ', mask1=tmask, ovlap=1 ) 
    368382         CALL prt_ctl(tab2d_1=qns              , clinfo1=' qns      - : ', mask1=tmask, ovlap=1 ) 
    369383         CALL prt_ctl(tab2d_1=qsr              , clinfo1=' qsr      - : ', mask1=tmask, ovlap=1 ) 
Note: See TracChangeset for help on using the changeset viewer.