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 11876 for NEMO/branches – NEMO

Changeset 11876 for NEMO/branches


Ignore:
Timestamp:
2019-11-08T12:26:42+01:00 (4 years ago)
Author:
mathiot
Message:

ENHANCE-02_ISF_nemo: add timing in the main isf routine + various bug fixes + cosmetic changes

Location:
NEMO/branches/2019/ENHANCE-02_ISF_nemo
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2019/ENHANCE-02_ISF_nemo/cfgs/SHARED/namelist_ref

    r11844 r11876  
    441441   ! 
    442442   ln_isf = .false.           ! activate ice shelf module 
    443       cn_isfdir = './'           ! directory for all ice shelf input file 
     443      ln_isfdebug = .false.      ! add debug print in ISF code (global min/max/sum of specific variable) 
     444      cn_isfdir   = './'         ! directory for all ice shelf input file 
    444445      ! 
    445446      ! ---------------- cavities opened ------------------------------- 
  • NEMO/branches/2019/ENHANCE-02_ISF_nemo/src/OCE/DIA/diawri.F90

    r11529 r11876  
    907907      CALL iom_rstput( 0, 0, inum, 'vomecrty', vn                )    ! now j-velocity 
    908908      CALL iom_rstput( 0, 0, inum, 'vovecrtz', wn                )    ! now k-velocity 
    909       CALL iom_rstput( 0, 0, inum, 'risfdep', risfdep          )    ! now k-velocity 
     909      CALL iom_rstput( 0, 0, inum, 'risfdep', risfdep            )    ! now k-velocity 
     910      CALL iom_rstput( 0, 0, inum, 'ht_n'   , ht_n               )    ! now k-velocity 
    910911      IF ( ln_isf ) THEN 
    911912         IF (ln_isfcav_mlt) THEN 
     
    925926         END IF 
    926927      END IF 
     928 
     929      IF ( ln_isf ) THEN 
     930         IF (ln_isfcav_mlt) CALL iom_rstput( 0, 0, inum, 'mskisf_cav', REAL(mskisf_cav,8), ktype = jp_i1 ) 
     931         IF (ln_isfpar_mlt) CALL iom_rstput( 0, 0, inum, 'mskisf_par', REAL(mskisf_par,8), ktype = jp_i1 ) 
     932      END IF 
     933       
    927934      IF( ALLOCATED(ahtu) ) THEN 
    928935         CALL iom_rstput( 0, 0, inum,  'ahtu', ahtu              )    ! aht at u-point 
  • NEMO/branches/2019/ENHANCE-02_ISF_nemo/src/OCE/DYN/dynzdf.F90

    r11844 r11876  
    149149                  ze3va =  ( 1._wp - r_vvl ) * e3v_n(ji,jj,ikv) + r_vvl * e3v_a(ji,jj,ikv) 
    150150                  ua(ji,jj,iku) = ua(ji,jj,iku) + r2dt * 0.5*( rCdU_top(ji+1,jj)+rCdU_top(ji,jj) ) * ua_b(ji,jj) / ze3ua 
    151                   va(ji,jj,ikv) = va(ji,jj,ikv) + r2dt * 0.5*( rCdU_top(ji+1,jj)+rCdU_top(ji,jj) ) * va_b(ji,jj) / ze3va 
     151                  va(ji,jj,ikv) = va(ji,jj,ikv) + r2dt * 0.5*( rCdU_top(ji,jj+1)+rCdU_top(ji,jj) ) * va_b(ji,jj) / ze3va 
    152152               END DO 
    153153            END DO 
     
    428428                  ikv = mikv(ji,jj)       ! (first wet ocean u- and v-points) 
    429429                  ze3va =  ( 1._wp - r_vvl ) * e3v_n(ji,jj,ikv) + r_vvl * e3v_a(ji,jj,ikv)   ! after scale factor at T-point 
    430                   zwd(ji,jj,ikv) = zwd(ji,jj,ikv) - r2dt * 0.5*( rCdU_top(ji+1,jj)+rCdU_top(ji,jj) ) / ze3va 
     430                  zwd(ji,jj,ikv) = zwd(ji,jj,ikv) - r2dt * 0.5*( rCdU_top(ji,jj+1)+rCdU_top(ji,jj) ) / ze3va 
    431431               END DO 
    432432            END DO 
  • NEMO/branches/2019/ENHANCE-02_ISF_nemo/src/OCE/ISF/isf.F90

    r11852 r11876  
    3131   CHARACTER(LEN=256), PUBLIC :: cn_isfdir 
    3232   LOGICAL           , PUBLIC :: ln_isf 
    33    LOGICAL           , PUBLIC :: ln_isfdebug=.TRUE. 
     33   LOGICAL           , PUBLIC :: ln_isfdebug 
    3434   ! 
    3535   ! 0.2 -------- ice shelf cavity opened namelist parameter ------------- 
  • NEMO/branches/2019/ENHANCE-02_ISF_nemo/src/OCE/ISF/isfcavmlt.F90

    r11852 r11876  
    122122      pqhc (:,:) =   pqfwf(:,:) * ztfrz(:,:) * rcp     ! heat content flux  ( >0 out) 
    123123      ! 
     124      ! output freezing point at the interface 
     125      CALL iom_put('isftfrz_cav', ztfrz ) 
     126      ! 
    124127   END SUBROUTINE isfcav_mlt_spe 
    125128 
     
    163166      pqhc (:,:) =   pqfwf(:,:) * ztfrz(:,:) * rcp                 ! heat content flux ( > 0 out ) 
    164167      ! 
    165       ! output thermal driving 
     168      ! output thermal driving and freezinpoint at the ice shelf interface 
    166169      CALL iom_put('isfthermald_cav', zthd ) 
     170      CALL iom_put('isftfrz_cav'    , ztfrz ) 
    167171      ! 
    168172   END SUBROUTINE isfcav_mlt_2eq 
     
    248252      CALL iom_put('qconisf', zqcon(:,:) * mskisf_cav(:,:) ) 
    249253      ! 
    250       ! output thermal driving 
    251       CALL iom_put('isfthermald_cav', zthd(:,:) * mskisf_cav(:,:) ) 
     254      ! output thermal driving and freezing point at the interface 
     255      CALL iom_put('isfthermald_cav', zthd (:,:) * mskisf_cav(:,:) ) 
     256      CALL iom_put('isftfrz_cav'    , ztfrz(:,:) * mskisf_cav(:,:) ) 
    252257      ! 
    253258   END SUBROUTINE isfcav_mlt_3eq 
     
    302307      pqhc (:,:) =   pqfwf(:,:) * ztfrz(:,:) * rcp     ! heat content flux  ( >0 out) 
    303308      ! 
     309      CALL iom_put('isftfrz_cav', ztfrz * mskisf_cav(:,:) ) 
    304310   END SUBROUTINE isfcav_mlt_oasis 
    305311 
  • NEMO/branches/2019/ENHANCE-02_ISF_nemo/src/OCE/ISF/isfpar.F90

    r11852 r11876  
    2323   USE isfdiags , ONLY: isf_diags_flx  ! ice shelf diags subroutine 
    2424   ! 
    25    USE dom_oce  , ONLY: jpi,jpj        ! ocean space and time domain 
     25   USE dom_oce  , ONLY: jpi,jpj, bathy ! ocean space and time domain 
    2626   USE phycst   , ONLY: r1_rau0_rcp    ! physical constants 
    2727   ! 
     
    124124      END WHERE 
    125125      ! 
    126       ! compute ktop 
    127       CALL isf_tbl_ktop(ztblmin, misfkt_par) 
     126      ! ensure ztblmax <= bathy 
     127      WHERE ( ztblmax(:,:) > bathy(:,:) ) 
     128         ztblmax(:,:) = bathy(:,:) 
     129      END WHERE 
     130      ! 
     131      ! compute ktop and update ztblmin to gdepw_0(misfkt_par)  
     132      CALL isf_tbl_ktop(ztblmin, misfkt_par) !   out: misfkt_par 
     133      !                                      ! inout: ztblmin 
    128134      ! 
    129135      ! initial tbl thickness 
     
    132138      ! define iceshelf parametrisation mask 
    133139      mskisf_par = 0 
    134       WHERE ( ztblmax > 0._wp ) 
     140      WHERE ( rhisf0_tbl_par(:,:) > 0._wp ) 
    135141         mskisf_par(:,:) = 1._wp 
    136142      END WHERE 
  • NEMO/branches/2019/ENHANCE-02_ISF_nemo/src/OCE/ISF/isfparmlt.F90

    r11852 r11876  
    105105      pqoce(:,:) =   pqfwf(:,:) * rLfusisf             ! ocean/ice shelf flux assume to be equal to latent heat flux 
    106106      pqhc (:,:) =   pqfwf(:,:) * ztfrz(:,:) * rcp     ! heat content flux  
     107      CALL iom_put('isftfrz_par', ztfrz ) 
    107108      ! 
    108109   END SUBROUTINE isfpar_mlt_spe 
     
    154155      ! output thermal driving 
    155156      CALL iom_put('isfthermald_par',( ztfrz(:,:) - ztavg(:,:) ) * mskisf_par(:,:)) 
     157      CALL iom_put('isftfrz_par', ztfrz ) 
    156158      ! 
    157159   END SUBROUTINE isfpar_mlt_bg03 
     
    210212      pqhc (:,:) =   pqfwf(:,:) * ztfrz(:,:) * rcp     ! heat content flux  ( >0 out ) 
    211213      ! 
     214      CALL iom_put('isftfrz_par', ztfrz ) 
     215      ! 
    212216   END SUBROUTINE isfpar_mlt_oasis 
    213217 
  • NEMO/branches/2019/ENHANCE-02_ISF_nemo/src/OCE/ISF/isfstp.F90

    r11852 r11876  
    2727   USE lib_mpp, ONLY: ctl_stop, ctl_nam 
    2828   USE in_out_manager ! I/O manager 
     29   USE timing 
    2930 
    3031   IMPLICIT NONE 
     
    5960      !!--------------------------------------------------------------------- 
    6061      ! 
     62      IF( ln_timing )   CALL timing_start('isf') 
     63      ! 
    6164      IF ( ln_isfcav_mlt ) THEN 
    6265         ! 
     
    6770         END IF 
    6871         ! 
    69          ! compute tbl lvl/h 
     72         ! compute misfkb, rhisf_tbl, rfrac (deepest level, thickness, fraction of deepest cell affected by tbl) 
    7073         rhisf_tbl_cav(:,:) = rn_htbl * mskisf_cav(:,:) 
    7174         CALL isf_tbl_lvl(ht_n, e3t_n, misfkt_cav, misfkb_cav, rhisf_tbl_cav, rfrac_tbl_cav) 
     
    8588         ! 
    8689         ! compute misfkb, rhisf_tbl, rfrac (deepest level, thickness, fraction of deepest cell affected by tbl) 
     90         ! by simplicity, we assume the top level where param applied do not change with time 
    8791         rhisf_tbl_par(:,:) = rhisf0_tbl_par(:,:) 
    8892         CALL isf_tbl_lvl(ht_n, e3t_n, misfkt_par, misfkb_par, rhisf_tbl_par, rfrac_tbl_par) 
     
    9498      ! 
    9599      IF ( ln_isfcpl .AND. lrst_oce ) CALL isfcpl_rst_write(kt) 
     100      ! 
     101      IF( ln_timing )   CALL timing_stop('isf') 
    96102      ! 
    97103   END SUBROUTINE isf_stp 
     
    162168         ! 
    163169         IF ( ln_isf ) THEN 
     170            WRITE(numout,*) '      Add debug print in isf module           ln_isfdebug     = ', ln_isfdebug 
     171            WRITE(numout,*) 
    164172            WRITE(numout,*) '      melt inside the cavity                  ln_isfcav_mlt   = ', ln_isfcav_mlt 
    165173            IF ( ln_isfcav_mlt) THEN 
     
    168176               WRITE(numout,*) '         gamma formulation                       cn_gammablk = ', TRIM(cn_gammablk)  
    169177               IF ( TRIM(cn_gammablk) .NE. 'spe' ) THEN  
    170                   WRITE(numout,*) '            gammat coefficient                       rn_gammat0  = ', rn_gammat0   
    171                   WRITE(numout,*) '            gammas coefficient                       rn_gammas0  = ', rn_gammas0   
    172                   WRITE(numout,*) '            top drag coef.    used (from namdrg_top) rn_Cd0      = ', r_Cdmin_top 
    173                   WRITE(numout,*) '            top background ke used (from namdrg_top) rn_ke0      = ', r_ke0_top 
     178                  WRITE(numout,*) '         gammat coefficient                       rn_gammat0  = ', rn_gammat0   
     179                  WRITE(numout,*) '         gammas coefficient                       rn_gammas0  = ', rn_gammas0   
     180                  WRITE(numout,*) '         top drag coef.    used (from namdrg_top) rn_Cd0      = ', r_Cdmin_top 
     181                  WRITE(numout,*) '         top background ke used (from namdrg_top) rn_ke0      = ', r_ke0_top 
    174182               END IF 
    175183            END IF 
     
    190198            ! 
    191199         ELSE 
    192  
     200            ! 
    193201            IF ( ln_isfcav ) THEN 
    194202               WRITE(numout,*) '' 
     
    196204               WRITE(numout,*) '' 
    197205            END IF 
     206            ! 
    198207         END IF 
    199208 
     
    207216      ! sanity check  ! issue ln_isfcav not yet known as well as l_isfoasis  => move this call in isf_stp ? 
    208217      ! melt in the cavity without cavity 
    209        IF ( ln_isfcav_mlt .AND. (.NOT. ln_isfcav) ) & 
     218      IF ( ln_isfcav_mlt .AND. (.NOT. ln_isfcav) ) & 
    210219          &   CALL ctl_stop('ice shelf melt in the cavity activated (ln_isfcav_mlt) but no cavity detected in domcfg (ln_isfcav), STOP' ) 
    211220      ! 
     
    256265         &             ln_isfcav_mlt, cn_isfcav_mlt, cn_gammablk, rn_gammat0, rn_gammas0, rn_htbl, sn_isfcav_fwf,   & 
    257266         &             ln_isfpar_mlt, cn_isfpar_mlt, sn_isfpar_fwf, sn_isfpar_zmin, sn_isfpar_zmax, sn_isfpar_Leff, & 
    258          &             ln_isfcpl    , nn_drown, ln_isfcpl_cons,                                                     & 
     267         &             ln_isfcpl    , nn_drown, ln_isfcpl_cons, ln_isfdebug,                                        & 
    259268         &             cn_isfload   , cn_isfdir 
    260269      !!---------------------------------------------------------------------- 
  • NEMO/branches/2019/ENHANCE-02_ISF_nemo/src/OCE/ISF/isftbl.F90

    r11852 r11876  
    1616   USE isf     ! ice shelf variables 
    1717 
    18    USE dom_oce ! vertical scale factor 
     18   USE dom_oce ! vertical scale factor and depth 
    1919 
    2020   IMPLICIT NONE 
     
    250250      INTEGER,  DIMENSION(jpi,jpj), INTENT(  out) :: ktop        ! top level affected by the ice shelf parametrisation 
    251251      !!-------------------------- IN  ------------------------------------- 
    252       REAL(wp), DIMENSION(jpi,jpj), INTENT(in   ) :: pdep        ! top depth of the parametrisation influence 
     252      REAL(wp), DIMENSION(jpi,jpj), INTENT(inout) :: pdep        ! top depth of the parametrisation influence 
    253253      !!-------------------------------------------------------------------- 
    254254      INTEGER :: ji,jj 
     
    256256      !!-------------------------------------------------------------------- 
    257257      ! 
    258       ! compute top level (need to be recomputed each time (z*, z~)  
     258      ! if we need to recompute the top level at every time stepcompute top level (z*, z~)  
     259      ! in case of weak ht_n variation we can assume the top level of htbl to be constant 
     260      ! => only done using gdepw_0 
    259261      ! be sure pdep is already correctly bounded 
    260262      ! test: this routine run on isfdraft should return mikt 
     
    263265      DO ji = 1, jpi 
    264266         DO jj = 1, jpj 
     267            ! comput ktop 
    265268            ikt = 2 
    266             DO WHILE ( gdepw_n(ji,jj,ikt) <= pdep(ji,jj ) ) ;  ikt = ikt + 1 ;  END DO 
     269            DO WHILE ( gdepw_0(ji,jj,ikt) <= pdep(ji,jj ) ) ;  ikt = ikt + 1 ;  END DO 
    267270            ktop(ji,jj) = ikt - 1 
     271            ! 
     272            ! update pdep 
     273            pdep(ji,jj) = gdepw_0(ji,jj,ktop(ji,jj)) 
    268274         END DO 
    269275      END DO 
Note: See TracChangeset for help on using the changeset viewer.