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 6808 for branches/NERC/dev_r5549_BDY_ZEROGRAD/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_cice.F90 – NEMO

Ignore:
Timestamp:
2016-07-19T10:38:35+02:00 (8 years ago)
Author:
jamesharle
Message:

merge with trunk@6232 for consistency with SSB code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/NERC/dev_r5549_BDY_ZEROGRAD/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_cice.F90

    r5516 r6808  
    99   !!---------------------------------------------------------------------- 
    1010   !!   sbc_ice_cice  : sea-ice model time-stepping and update ocean sbc over ice-covered area 
    11    !!    
    12    !!    
    1311   !!---------------------------------------------------------------------- 
    1412   USE oce             ! ocean dynamics and tracers 
     
    6765   PRIVATE 
    6866 
    69    !! * Routine accessibility 
    7067   PUBLIC cice_sbc_init   ! routine called by sbc_init 
    7168   PUBLIC cice_sbc_final  ! routine called by sbc_final 
     
    9390   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:), PRIVATE ::   png     ! local array used in sbc_cice_ice 
    9491 
    95    !! * Substitutions 
    96 #  include "domzgr_substitute.h90" 
    97  
     92   !!---------------------------------------------------------------------- 
     93   !! NEMO/OPA 3.7 , NEMO-consortium (2015)  
    9894   !! $Id$ 
     95   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt) 
     96   !!---------------------------------------------------------------------- 
    9997CONTAINS 
    10098 
     
    154152   END SUBROUTINE sbc_ice_cice 
    155153 
    156    SUBROUTINE cice_sbc_init (ksbc) 
     154 
     155   SUBROUTINE cice_sbc_init( ksbc ) 
    157156      !!--------------------------------------------------------------------- 
    158157      !!                    ***  ROUTINE cice_sbc_init  *** 
    159158      !! ** Purpose: Initialise ice related fields for NEMO and coupling 
    160159      !! 
     160      !!--------------------------------------------------------------------- 
    161161      INTEGER, INTENT( in  ) ::   ksbc                ! surface forcing type 
    162162      REAL(wp), DIMENSION(:,:), POINTER :: ztmp1, ztmp2 
     
    240240         snwice_mass_b(:,:) = 0.0_wp         ! no mass exchanges 
    241241      ENDIF 
    242       IF( .NOT. ln_rstart ) THEN 
     242      IF( .NOT.ln_rstart ) THEN 
    243243         IF( nn_ice_embd == 2 ) THEN            ! full embedment (case 2) deplete the initial ssh below sea-ice area 
    244244            sshn(:,:) = sshn(:,:) - snwice_mass(:,:) * r1_rau0 
    245245            sshb(:,:) = sshb(:,:) - snwice_mass(:,:) * r1_rau0 
    246 #if defined key_vvl             
    247            ! key_vvl necessary? clem: yes for compilation purpose 
    248             DO jk = 1,jpkm1                     ! adjust initial vertical scale factors 
    249                fse3t_n(:,:,jk) = e3t_0(:,:,jk)*( 1._wp + sshn(:,:)*tmask(:,:,1)/(ht_0(:,:) + 1.0 - tmask(:,:,1)) ) 
    250                fse3t_b(:,:,jk) = e3t_0(:,:,jk)*( 1._wp + sshb(:,:)*tmask(:,:,1)/(ht_0(:,:) + 1.0 - tmask(:,:,1)) ) 
    251             ENDDO 
    252             fse3t_a(:,:,:) = fse3t_b(:,:,:) 
    253             ! Reconstruction of all vertical scale factors at now and before time 
    254             ! steps 
    255             ! ============================================================================= 
    256             ! Horizontal scale factor interpolations 
    257             ! -------------------------------------- 
    258             CALL dom_vvl_interpol( fse3t_b(:,:,:), fse3u_b(:,:,:), 'U' ) 
    259             CALL dom_vvl_interpol( fse3t_b(:,:,:), fse3v_b(:,:,:), 'V' ) 
    260             CALL dom_vvl_interpol( fse3t_n(:,:,:), fse3u_n(:,:,:), 'U' ) 
    261             CALL dom_vvl_interpol( fse3t_n(:,:,:), fse3v_n(:,:,:), 'V' ) 
    262             CALL dom_vvl_interpol( fse3u_n(:,:,:), fse3f_n(:,:,:), 'F' ) 
    263             ! Vertical scale factor interpolations 
    264             ! ------------------------------------ 
    265             CALL dom_vvl_interpol( fse3t_n(:,:,:), fse3w_n (:,:,:), 'W'  ) 
    266             CALL dom_vvl_interpol( fse3u_n(:,:,:), fse3uw_n(:,:,:), 'UW' ) 
    267             CALL dom_vvl_interpol( fse3v_n(:,:,:), fse3vw_n(:,:,:), 'VW' ) 
    268             CALL dom_vvl_interpol( fse3u_b(:,:,:), fse3uw_b(:,:,:), 'UW' ) 
    269             CALL dom_vvl_interpol( fse3v_b(:,:,:), fse3vw_b(:,:,:), 'VW' ) 
    270             ! t- and w- points depth 
    271             ! ---------------------- 
    272             fsdept_n(:,:,1) = 0.5_wp * fse3w_n(:,:,1) 
    273             fsdepw_n(:,:,1) = 0.0_wp 
    274             fsde3w_n(:,:,1) = fsdept_n(:,:,1) - sshn(:,:) 
    275             DO jk = 2, jpk 
    276                fsdept_n(:,:,jk) = fsdept_n(:,:,jk-1) + fse3w_n(:,:,jk) 
    277                fsdepw_n(:,:,jk) = fsdepw_n(:,:,jk-1) + fse3t_n(:,:,jk-1) 
    278                fsde3w_n(:,:,jk) = fsdept_n(:,:,jk  ) - sshn   (:,:) 
    279             END DO 
    280 #endif 
     246 
     247!!gm This should be put elsewhere....   (same remark for limsbc) 
     248!!gm especially here it is assumed zstar coordinate, but it can be ztilde.... 
     249            IF( .NOT.ln_linssh ) THEN 
     250               ! 
     251               DO jk = 1,jpkm1                     ! adjust initial vertical scale factors 
     252                  e3t_n(:,:,jk) = e3t_0(:,:,jk)*( 1._wp + sshn(:,:)*tmask(:,:,1)/(ht_0(:,:) + 1.0 - tmask(:,:,1)) ) 
     253                  e3t_b(:,:,jk) = e3t_0(:,:,jk)*( 1._wp + sshb(:,:)*tmask(:,:,1)/(ht_0(:,:) + 1.0 - tmask(:,:,1)) ) 
     254               ENDDO 
     255               e3t_a(:,:,:) = e3t_b(:,:,:) 
     256               ! Reconstruction of all vertical scale factors at now and before time-steps 
     257               ! ============================================================================= 
     258               ! Horizontal scale factor interpolations 
     259               ! -------------------------------------- 
     260               CALL dom_vvl_interpol( e3t_b(:,:,:), e3u_b(:,:,:), 'U' ) 
     261               CALL dom_vvl_interpol( e3t_b(:,:,:), e3v_b(:,:,:), 'V' ) 
     262               CALL dom_vvl_interpol( e3t_n(:,:,:), e3u_n(:,:,:), 'U' ) 
     263               CALL dom_vvl_interpol( e3t_n(:,:,:), e3v_n(:,:,:), 'V' ) 
     264               CALL dom_vvl_interpol( e3u_n(:,:,:), e3f_n(:,:,:), 'F' ) 
     265               ! Vertical scale factor interpolations 
     266               ! ------------------------------------ 
     267               CALL dom_vvl_interpol( e3t_n(:,:,:), e3w_n (:,:,:), 'W'  ) 
     268               CALL dom_vvl_interpol( e3u_n(:,:,:), e3uw_n(:,:,:), 'UW' ) 
     269               CALL dom_vvl_interpol( e3v_n(:,:,:), e3vw_n(:,:,:), 'VW' ) 
     270               CALL dom_vvl_interpol( e3u_b(:,:,:), e3uw_b(:,:,:), 'UW' ) 
     271               CALL dom_vvl_interpol( e3v_b(:,:,:), e3vw_b(:,:,:), 'VW' ) 
     272               ! t- and w- points depth 
     273               ! ---------------------- 
     274               gdept_n(:,:,1) = 0.5_wp * e3w_n(:,:,1) 
     275               gdepw_n(:,:,1) = 0.0_wp 
     276               gde3w_n(:,:,1) = gdept_n(:,:,1) - sshn(:,:) 
     277               DO jk = 2, jpk 
     278                  gdept_n(:,:,jk) = gdept_n(:,:,jk-1) + e3w_n(:,:,jk) 
     279                  gdepw_n(:,:,jk) = gdepw_n(:,:,jk-1) + e3t_n(:,:,jk-1) 
     280                  gde3w_n(:,:,jk) = gdept_n(:,:,jk  ) - sshn   (:,:) 
     281               END DO 
     282            ENDIF 
    281283         ENDIF 
    282284      ENDIF 
    283   
     285      ! 
    284286      CALL wrk_dealloc( jpi,jpj, ztmp1, ztmp2 ) 
    285287      ! 
     
    289291 
    290292    
    291    SUBROUTINE cice_sbc_in (kt, ksbc) 
     293   SUBROUTINE cice_sbc_in( kt, ksbc ) 
    292294      !!--------------------------------------------------------------------- 
    293295      !!                    ***  ROUTINE cice_sbc_in  *** 
     
    296298      INTEGER, INTENT(in   ) ::   kt   ! ocean time step 
    297299      INTEGER, INTENT(in   ) ::   ksbc ! surface forcing type 
    298  
     300      ! 
    299301      INTEGER  ::   ji, jj, jl                   ! dummy loop indices       
    300302      REAL(wp), DIMENSION(:,:), POINTER :: ztmp, zpice 
     
    444446! Freezing/melting potential 
    445447! Calculated over NEMO leapfrog timestep (hence 2*dt) 
    446       nfrzmlt(:,:)=rau0*rcp*fse3t_m(:,:)*(Tocnfrz-sst_m(:,:))/(2.0*dt) 
     448      nfrzmlt(:,:) = rau0 * rcp * e3t_m(:,:) * ( Tocnfrz-sst_m(:,:) ) / ( 2.0*dt ) 
    447449 
    448450      ztmp(:,:) = nfrzmlt(:,:) 
     
    490492! x comp and y comp of sea surface slope (on F points) 
    491493! T point to F point 
    492       DO jj=1,jpjm1 
    493          DO ji=1,jpim1 
    494             ztmp(ji,jj)=0.5 * (  (zpice(ji+1,jj  )-zpice(ji,jj  ))/e1u(ji,jj  )   & 
    495                                + (zpice(ji+1,jj+1)-zpice(ji,jj+1))/e1u(ji,jj+1) ) &  
    496                             *  fmask(ji,jj,1) 
    497          ENDDO 
    498       ENDDO 
    499       CALL nemo2cice(ztmp,ss_tltx,'F', -1. ) 
     494      DO jj = 1, jpjm1 
     495         DO ji = 1, jpim1 
     496            ztmp(ji,jj)=0.5 * (  (zpice(ji+1,jj  )-zpice(ji,jj  )) * r1_e1u(ji,jj  )    & 
     497               &               + (zpice(ji+1,jj+1)-zpice(ji,jj+1)) * r1_e1u(ji,jj+1)  ) * fmask(ji,jj,1) 
     498         END DO 
     499      END DO 
     500      CALL nemo2cice( ztmp,ss_tltx,'F', -1. ) 
    500501 
    501502! T point to F point 
    502       DO jj=1,jpjm1 
    503          DO ji=1,jpim1 
    504             ztmp(ji,jj)=0.5 * (  (zpice(ji  ,jj+1)-zpice(ji  ,jj))/e2v(ji  ,jj)   & 
    505                                + (zpice(ji+1,jj+1)-zpice(ji+1,jj))/e2v(ji+1,jj) ) & 
    506                             *  fmask(ji,jj,1) 
    507          ENDDO 
    508       ENDDO 
     503      DO jj = 1, jpjm1 
     504         DO ji = 1, jpim1 
     505            ztmp(ji,jj)=0.5 * (  (zpice(ji  ,jj+1)-zpice(ji  ,jj)) * r1_e2v(ji  ,jj)    & 
     506               &               + (zpice(ji+1,jj+1)-zpice(ji+1,jj)) * r1_e2v(ji+1,jj)  ) *  fmask(ji,jj,1) 
     507         END DO 
     508      END DO 
    509509      CALL nemo2cice(ztmp,ss_tlty,'F', -1. ) 
    510510 
     
    517517 
    518518 
    519    SUBROUTINE cice_sbc_out (kt,ksbc) 
     519   SUBROUTINE cice_sbc_out( kt, ksbc ) 
    520520      !!--------------------------------------------------------------------- 
    521521      !!                    ***  ROUTINE cice_sbc_out  *** 
     
    575575! Update taum with modulus of ice-ocean stress  
    576576! strocnxT and strocnyT are not weighted by ice fraction in CICE so must be done here  
    577 taum(:,:)=(1.0-fr_i(:,:))*taum(:,:)+fr_i(:,:)*SQRT(ztmp1**2. + ztmp2**2.)  
     577taum(:,:)=(1.0-fr_i(:,:))*taum(:,:)+fr_i(:,:)*SQRT(ztmp1*ztmp1 + ztmp2*ztmp2)  
    578578 
    579579! Freshwater fluxes  
     
    888888#endif 
    889889      !!--------------------------------------------------------------------- 
    890  
    891890      CHARACTER(len=1), INTENT( in ) ::   & 
    892891          cd_type       ! nature of pn grid-point 
     
    908907 
    909908      INTEGER  ::   ji, jj, jn                      ! dummy loop indices 
     909      !!--------------------------------------------------------------------- 
    910910 
    911911!     A. Ensure all haloes are filled in NEMO field (pn) 
     
    10961096   !!   Default option           Dummy module         NO CICE sea-ice model 
    10971097   !!---------------------------------------------------------------------- 
    1098    !! $Id$ 
    10991098CONTAINS 
    11001099 
Note: See TracChangeset for help on using the changeset viewer.