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 5111 for branches/2015/dev_r5094_UKMO_ISFCLEAN/NEMOGCM/NEMO/OPA_SRC/DOM/domzgr.F90 – NEMO

Ignore:
Timestamp:
2015-03-02T16:30:57+01:00 (9 years ago)
Author:
mathiot
Message:

add some missing if ln_isfcav, test of option compatibility with ln_isfcav + small documentation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2015/dev_r5094_UKMO_ISFCLEAN/NEMOGCM/NEMO/OPA_SRC/DOM/domzgr.F90

    r5098 r5111  
    298298      ENDIF 
    299299 
     300!      IF ( ln_isfcav ) THEN 
    300301! need to be like this to compute the pressure gradient with ISF. If not, level beneath the ISF are not aligned (sum(e3t) /= depth) 
    301302! define e3t_0 and e3w_0 as the differences between gdept and gdepw respectively 
    302       DO jk = 1, jpkm1 
    303          e3t_1d(jk) = gdepw_1d(jk+1)-gdepw_1d(jk)  
    304       END DO 
    305       e3t_1d(jpk) = e3t_1d(jpk-1)   ! we don't care because this level is masked in NEMO 
    306  
    307       DO jk = 2, jpk 
    308          e3w_1d(jk) = gdept_1d(jk) - gdept_1d(jk-1)  
    309       END DO 
    310       e3w_1d(1  ) = 2._wp * (gdept_1d(1) - gdepw_1d(1))  
     303         DO jk = 1, jpkm1 
     304            e3t_1d(jk) = gdepw_1d(jk+1)-gdepw_1d(jk)  
     305         END DO 
     306         e3t_1d(jpk) = e3t_1d(jpk-1)   ! we don't care because this level is masked in NEMO 
     307 
     308         DO jk = 2, jpk 
     309            e3w_1d(jk) = gdept_1d(jk) - gdept_1d(jk-1)  
     310         END DO 
     311         e3w_1d(1  ) = 2._wp * (gdept_1d(1) - gdepw_1d(1))  
     312!      END IF 
    311313 
    312314!!gm BUG in s-coordinate this does not work! 
     
    473475         ! (ISF) TODO build ice draft netcdf file for isomip and build the corresponding part of code 
    474476         IF( cp_cfg == "isomip" .AND. ln_isfcav ) THEN  
    475            !  
    476            risfdep(:,:)=200.e0  
    477            misfdep(:,:)=1  
    478            ij0 = 1 ; ij1 = 40  
    479            DO jj = mj0(ij0), mj1(ij1)  
    480               risfdep(:,jj)=700.0_wp-(gphit(:,jj)+80.0_wp)*125.0_wp  
    481                 END DO  
     477            risfdep(:,:)=200.e0  
     478            misfdep(:,:)=1  
     479            ij0 = 1 ; ij1 = 40  
     480            DO jj = mj0(ij0), mj1(ij1)  
     481               risfdep(:,jj)=700.0_wp-(gphit(:,jj)+80.0_wp)*125.0_wp  
     482            END DO  
    482483            WHERE( bathy(:,:) <= 0._wp )  risfdep(:,:) = 0._wp  
    483            !  
     484         !  
    484485         ELSEIF ( cp_cfg == "isomip2" .AND. ln_isfcav ) THEN 
    485486         !  
     
    536537            CALL iom_get  ( inum, jpdom_data, 'Bathymetry', bathy ) 
    537538            CALL iom_close( inum ) 
    538             !   
     539            !                                                 
    539540            risfdep(:,:)=0._wp          
    540541            misfdep(:,:)=1              
     
    963964      !!---------------------------------------------------------------------- 
    964965      !! 
    965       INTEGER  ::   ji, jj, jk, jl   ! dummy loop indices 
     966      INTEGER  ::   ji, jj, jk       ! dummy loop indices 
    966967      INTEGER  ::   ik, it           ! temporary integers 
    967       INTEGER  ::   id, jd, nprocd 
    968968      LOGICAL  ::   ll_print         ! Allow  control print for debugging 
    969969      REAL(wp) ::   ze3tp , ze3wp    ! Last ocean level thickness at T- and W-points 
    970970      REAL(wp) ::   zdepwp, zdepth   ! Ajusted ocean depth to avoid too small e3t 
    971       REAL(wp) ::   zmax, zmin       ! Maximum and minimum depth 
     971      REAL(wp) ::   zmax             ! Maximum depth 
    972972      REAL(wp) ::   zdiff            ! temporary scalar 
    973973      REAL(wp) ::   zrefdep          ! temporary scalar 
     
    10461046                     &                             * ((gdept_1d(     ik  ) - gdepw_1d(ik) )   & 
    10471047                     &                             / ( gdepw_1d(     ik+1) - gdepw_1d(ik) )) 
    1048                   e3t_0(ji,jj,ik) = e3t_1d (ik) * ( gdepw_0 (ji,jj,ik+1) - gdepw_1d(ik) )   &  
    1049                      &                          / ( gdepw_1d(      ik+1) - gdepw_1d(ik) )  
     1048                  e3t_0  (ji,jj,ik) = e3t_1d (ik) * ( gdepw_0 (ji,jj,ik+1) - gdepw_1d(ik) )   &  
     1049                     &                             / ( gdepw_1d(      ik+1) - gdepw_1d(ik) )  
    10501050                  e3w_0(ji,jj,ik) = 0.5_wp * ( gdepw_0(ji,jj,ik+1) + gdepw_1d(ik+1) - 2._wp * gdepw_1d(ik) )   & 
    10511051                     &                     * ( e3w_1d(ik) / ( gdepw_1d(ik+1) - gdepw_1d(ik) ) ) 
     
    12021202      
    12031203      ! Compute gdep3w_0 (vertical sum of e3w) 
    1204       IF ( ln_isfcav ) THEN 
     1204      IF ( ln_isfcav ) THEN ! if cavity 
    12051205         WHERE (misfdep == 0) misfdep = 1 
    12061206         DO jj = 1,jpj 
     
    13351335            misfdep(jpi,:) = misfdep(  2  ,:)  
    13361336         ENDIF 
    1337   
     1337 
    13381338         IF( nperio == 1 .OR. nperio  ==  4 .OR. nperio  ==  6 ) THEN 
    13391339            mbathy( 1 ,:) = mbathy(jpim1,:)             ! local domain is cyclic east-west 
    13401340            mbathy(jpi,:) = mbathy(  2  ,:) 
    13411341         ENDIF 
    1342   
     1342 
    13431343         ! split last cell if possible (only where water column is 2 cell or less) 
    13441344         DO jk = jpkm1, 1, -1 
     
    13581358            END WHERE 
    13591359         END DO 
    1360   
     1360 
    13611361  
    13621362 ! Case where bathy and risfdep compatible but not the level variable mbathy/misfdep because of partial cell condition 
     
    16391639               IF( zmbathy(ji,jj) .LT. misfdep(ji  ,jj+1) ) ibtestjp1 = 0 
    16401640               ibtest=MAX(ibtestim1, ibtestip1, ibtestjm1, ibtestjp1) 
    1641                IF( ibtest == 0 ) THEN 
     1641               IF( ibtest == 0 .AND. misfdep(ji,jj) .GE. 2) THEN 
    16421642                  mbathy(ji,jj) = 0 ; bathy(ji,jj) = 0.0_wp ; misfdep(ji,jj) = 0 ; risfdep(ji,jj) = 0.0_wp ; 
    16431643               END IF 
Note: See TracChangeset for help on using the changeset viewer.