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 6371 for branches/UKMO/dev_r5518_debug_isf_restart/NEMOGCM/NEMO/OPA_SRC/SBC/sbcisf.F90 – NEMO

Ignore:
Timestamp:
2016-03-08T10:25:55+01:00 (8 years ago)
Author:
frrh
Message:

Now merge r 5783:6333 of nemo_v3_6_STABLE_copy

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/UKMO/dev_r5518_debug_isf_restart/NEMOGCM/NEMO/OPA_SRC/SBC/sbcisf.F90

    r6369 r6371  
    5252   REAL(wp)   , PUBLIC, ALLOCATABLE, SAVE, DIMENSION (:,:)     ::  risfLeff               !:effective length (Leff) BG03 nn_isf==2 
    5353   REAL(wp)   , PUBLIC, ALLOCATABLE, SAVE, DIMENSION (:,:)     ::  ttbl, stbl, utbl, vtbl !:top boundary layer variable at T point 
    54 #if defined key_agrif 
    55    ! AGRIF can not handle these arrays as integers. The reason is a mystery but problems avoided by declaring them as reals 
    56    REAL(wp),    PUBLIC, ALLOCATABLE, SAVE, DIMENSION (:,:)     ::  misfkt, misfkb         !:Level of ice shelf base 
    57                                                                                           !: (first wet level and last level include in the tbl) 
    58 #else 
    5954   INTEGER,    PUBLIC, ALLOCATABLE, SAVE, DIMENSION (:,:)     ::  misfkt, misfkb         !:Level of ice shelf base 
    60 #endif 
    6155 
    6256 
     
    177171              DO jj = 1, jpj 
    178172                  jk = 2 
    179                   DO WHILE ( jk .LE. mbkt(ji,jj) .AND. fsdepw(ji,jj,jk) < rzisf_tbl(ji,jj) ) ;  jk = jk + 1 ;  END DO 
     173                  DO WHILE ( jk .LE. mbkt(ji,jj) .AND. gdepw_0(ji,jj,jk) < rzisf_tbl(ji,jj) ) ;  jk = jk + 1 ;  END DO 
    180174                  misfkt(ji,jj) = jk-1 
    181175               END DO 
     
    195189         END IF 
    196190          
    197          ! compute bottom level of isf tbl and thickness of tbl below the ice shelf 
     191         ! save initial top boundary layer thickness          
    198192         rhisf_tbl_0(:,:) = rhisf_tbl(:,:) 
    199          DO jj = 1,jpj 
    200             DO ji = 1,jpi 
    201                ikt = misfkt(ji,jj) 
    202                ikb = misfkt(ji,jj) 
    203                ! thickness of boundary layer at least the top level thickness 
    204                rhisf_tbl(ji,jj) = MAX(rhisf_tbl_0(ji,jj), fse3t_n(ji,jj,ikt)) 
    205  
    206                ! determine the deepest level influenced by the boundary layer 
    207                ! test on tmask useless ????? 
    208                DO jk = ikt, mbkt(ji,jj) 
    209                   IF ( (SUM(fse3t_n(ji,jj,ikt:jk-1)) .LT. rhisf_tbl(ji,jj)) .AND. (tmask(ji,jj,jk) == 1) ) ikb = jk 
    210                END DO 
    211                rhisf_tbl(ji,jj) = MIN(rhisf_tbl(ji,jj), SUM(fse3t_n(ji,jj,ikt:ikb)))  ! limit the tbl to water thickness. 
    212                misfkb(ji,jj) = ikb                                                  ! last wet level of the tbl 
    213                r1_hisf_tbl(ji,jj) = 1._wp / rhisf_tbl(ji,jj) 
    214  
    215                zhk           = SUM( fse3t(ji, jj, ikt:ikb - 1)) * r1_hisf_tbl(ji,jj)  ! proportion of tbl cover by cell from ikt to ikb - 1 
    216                ralpha(ji,jj) = rhisf_tbl(ji,jj) * (1._wp - zhk ) / fse3t(ji,jj,ikb)  ! proportion of bottom cell influenced by boundary layer 
    217             END DO 
    218          END DO 
    219           
     193 
    220194      END IF 
    221195 
     
    230204      IF( MOD( kt-1, nn_fsbc) == 0 ) THEN 
    231205 
     206         ! compute bottom level of isf tbl and thickness of tbl below the ice shelf 
     207         DO jj = 1,jpj 
     208            DO ji = 1,jpi 
     209               ikt = misfkt(ji,jj) 
     210               ikb = misfkt(ji,jj) 
     211               ! thickness of boundary layer at least the top level thickness 
     212               rhisf_tbl(ji,jj) = MAX(rhisf_tbl_0(ji,jj), fse3t_n(ji,jj,ikt)) 
     213 
     214               ! determine the deepest level influenced by the boundary layer 
     215               DO jk = ikt, mbkt(ji,jj) 
     216                  IF ( (SUM(fse3t_n(ji,jj,ikt:jk-1)) .LT. rhisf_tbl(ji,jj)) .AND. (tmask(ji,jj,jk) == 1) ) ikb = jk 
     217               END DO 
     218               rhisf_tbl(ji,jj) = MIN(rhisf_tbl(ji,jj), SUM(fse3t_n(ji,jj,ikt:ikb)))  ! limit the tbl to water thickness. 
     219               misfkb(ji,jj) = ikb                                                  ! last wet level of the tbl 
     220               r1_hisf_tbl(ji,jj) = 1._wp / rhisf_tbl(ji,jj) 
     221 
     222               zhk           = SUM( fse3t(ji, jj, ikt:ikb - 1)) * r1_hisf_tbl(ji,jj)  ! proportion of tbl cover by cell from ikt to ikb - 1 
     223               ralpha(ji,jj) = rhisf_tbl(ji,jj) * (1._wp - zhk ) / fse3t(ji,jj,ikb)  ! proportion of bottom cell influenced by boundary layer 
     224            END DO 
     225         END DO 
    232226 
    233227         ! compute salf and heat flux 
     
    458452             ! Calculate freezing temperature 
    459453                zpress = grav*rau0*fsdept(ji,jj,ik)*1.e-04  
    460                 zt_frz = eos_fzp(tsb(ji,jj,ik,jp_sal), zpress)  
     454                CALL eos_fzp(tsb(ji,jj,ik,jp_sal), zt_frz, zpress)  
    461455                zt_sum = zt_sum + (tsn(ji,jj,ik,jp_tem)-zt_frz) * fse3t(ji,jj,ik) * tmask(ji,jj,ik)  ! sum temp 
    462456             ENDDO 
     
    540534      zti(:,:)=tinsitu( ttbl, stbl, zpress ) 
    541535! Calculate freezing temperature 
    542       zfrz(:,:)=eos_fzp( sss_m(:,:), zpress ) 
     536      CALL eos_fzp( sss_m(:,:), zfrz(:,:), zpress ) 
    543537 
    544538       
Note: See TracChangeset for help on using the changeset viewer.