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

Ignore:
Timestamp:
2018-10-29T15:20:26+01:00 (5 years ago)
Author:
kingr
Message:

Rolled back to r10247 - i.e., undid merge of pkg br and 3.6_stable br

File:
1 edited

Legend:

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

    r10248 r10251  
    5353   REAL(wp)   , PUBLIC, ALLOCATABLE, SAVE, DIMENSION (:,:)     ::  risfLeff               !:effective length (Leff) BG03 nn_isf==2 
    5454   REAL(wp)   , PUBLIC, ALLOCATABLE, SAVE, DIMENSION (:,:)     ::  ttbl, stbl, utbl, vtbl !:top boundary layer variable at T point 
     55#if defined key_agrif 
     56   ! AGRIF can not handle these arrays as integers. The reason is a mystery but problems avoided by declaring them as reals 
     57   REAL(wp),    PUBLIC, ALLOCATABLE, SAVE, DIMENSION (:,:)     ::  misfkt, misfkb         !:Level of ice shelf base 
     58                                                                                          !: (first wet level and last level include in the tbl) 
     59#else 
    5560   INTEGER,    PUBLIC, ALLOCATABLE, SAVE, DIMENSION (:,:)     ::  misfkt, misfkb         !:Level of ice shelf base 
     61#endif 
    5662 
    5763 
     
    8692    REAL(wp)                     ::   rmin 
    8793    REAL(wp)                     ::   zhk 
    88     REAL(wp)                     ::   zt_frz, zpress 
    89     CHARACTER(len=256)           ::   cfisf , cvarzisf, cvarhisf   ! name for isf file 
     94    CHARACTER(len=256)           ::   cfisf, cvarzisf, cvarhisf   ! name for isf file 
    9095    CHARACTER(LEN=256)           :: cnameis                     ! name of iceshelf file 
    9196    CHARACTER (LEN=32)           :: cvarLeff                    ! variable name for efficient Length scale 
     
    171176              DO jj = 1, jpj 
    172177                  jk = 2 
    173                   DO WHILE ( jk .LE. mbkt(ji,jj) .AND. gdepw_0(ji,jj,jk) < rzisf_tbl(ji,jj) ) ;  jk = jk + 1 ;  END DO 
     178                  DO WHILE ( jk .LE. mbkt(ji,jj) .AND. fsdepw(ji,jj,jk) < rzisf_tbl(ji,jj) ) ;  jk = jk + 1 ;  END DO 
    174179                  misfkt(ji,jj) = jk-1 
    175180               END DO 
     
    189194         END IF 
    190195          
    191          ! save initial top boundary layer thickness          
    192196         rhisf_tbl_0(:,:) = rhisf_tbl(:,:) 
    193197 
     198         ! compute bottom level of isf tbl and thickness of tbl below the ice shelf 
     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          
    194220      END IF 
    195221 
     
    204230      IF( MOD( kt-1, nn_fsbc) == 0 ) THEN 
    205231 
    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 
    226232 
    227233         ! compute salf and heat flux 
     
    264270         END IF 
    265271         ! compute tsc due to isf 
    266          ! WARNING water add at temp = 0C, correction term is added, maybe better here but need a 3D variable). 
    267 !         zpress = grav*rau0*fsdept(ji,jj,jk)*1.e-04 
    268          zt_frz = -1.9 !eos_fzp( tsn(ji,jj,jk,jp_sal), zpress ) 
    269          risf_tsc(:,:,jp_tem) = qisf(:,:) * r1_rau0_rcp - rdivisf * fwfisf(:,:) * zt_frz * r1_rau0 ! 
     272         ! WARNING water add at temp = 0C, correction term is added in trasbc, maybe better here but need a 3D variable). 
     273         risf_tsc(:,:,jp_tem) = qisf(:,:) * r1_rau0_rcp ! 
    270274          
    271275         ! salt effect already take into account in vertical advection 
    272276         risf_tsc(:,:,jp_sal) = (1.0_wp-rdivisf) * fwfisf(:,:) * stbl(:,:) * r1_rau0 
    273  
    274          ! output 
    275          IF( iom_use('qisf'  ) )   CALL iom_put('qisf'  , qisf) 
    276          IF( iom_use('fwfisf') )   CALL iom_put('fwfisf', fwfisf * stbl(:,:) / soce ) 
    277  
    278          ! if apply only on the trend and not as a volume flux (rdivisf = 0), fwfisf have to be set to 0 now 
    279          fwfisf(:,:) = rdivisf * fwfisf(:,:)          
    280   
     277           
    281278         ! lbclnk 
    282279         CALL lbc_lnk(risf_tsc(:,:,jp_tem),'T',1.) 
     
    298295         ENDIF 
    299296         !  
     297         ! output 
     298         CALL iom_put('qisf'  , qisf) 
     299         IF( iom_use('fwfisf') )   CALL iom_put('fwfisf', fwfisf * stbl(:,:) / soce ) 
    300300      END IF 
    301301   
     
    370370             ! Calculate freezing temperature 
    371371                zpress = grav*rau0*fsdept(ji,jj,ik)*1.e-04  
    372                 CALL eos_fzp(tsb(ji,jj,ik,jp_sal), zt_frz, zpress)  
     372                zt_frz = eos_fzp(tsb(ji,jj,ik,jp_sal), zpress)  
    373373                zt_sum = zt_sum + (tsn(ji,jj,ik,jp_tem)-zt_frz) * fse3t(ji,jj,ik) * tmask(ji,jj,ik)  ! sum temp 
    374374             ENDDO 
     
    452452      zti(:,:)=tinsitu( ttbl, stbl, zpress ) 
    453453! Calculate freezing temperature 
    454       CALL eos_fzp( sss_m(:,:), zfrz(:,:), zpress ) 
     454      zfrz(:,:)=eos_fzp( sss_m(:,:), zpress ) 
    455455 
    456456       
     
    472472 
    473473                     nit = nit + 1 
    474                      IF (nit .GE. 100) CALL ctl_stop( 'STOP', 'sbc_isf_hol99 : too many iteration ...' ) 
    475  
     474                     IF (nit .GE. 100) THEN 
     475                        !WRITE(numout,*) "sbcisf : too many iteration ... ", zhtflx, zhtflx_b,zgammat, rn_gammat0, rn_tfri2, nn_gammablk, ji,jj 
     476                        !WRITE(numout,*) "sbcisf : too many iteration ... ", (zhtflx - zhtflx_b)/zhtflx 
     477                        CALL ctl_stop( 'STOP', 'sbc_isf_hol99 : too many iteration ...' ) 
     478                     END IF 
    476479! save gammat and compute zhtflx_b 
    477480                     zgammat2d(ji,jj)=zgammat 
     
    791794               ! test on tmask useless ????? 
    792795               DO jk = ikt, mbkt(ji,jj) 
    793                   IF ( (SUM(fse3t(ji,jj,ikt:jk-1)) .LT. rhisf_tbl(ji,jj)) .AND. (tmask(ji,jj,jk) == 1) ) ikb = jk 
     796!                  IF ( (SUM(fse3t(ji,jj,ikt:jk-1)) .LT. rhisf_tbl(ji,jj)) .AND. (tmask(ji,jj,jk) == 1) ) ikb = jk 
    794797               END DO 
    795798               rhisf_tbl(ji,jj) = MIN(rhisf_tbl(ji,jj), SUM(fse3t(ji,jj,ikt:ikb)))  ! limit the tbl to water thickness. 
Note: See TracChangeset for help on using the changeset viewer.