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 11494 for NEMO/branches/2019/ENHANCE-02_ISF_nemo/src – NEMO

Ignore:
Timestamp:
2019-09-03T12:46:35+02:00 (5 years ago)
Author:
mathiot
Message:

ENHANCE-02_ISF: switch on isf param in WED025 and fix bugs in isf param code + cosmetic changes (ticket #2142)

Location:
NEMO/branches/2019/ENHANCE-02_ISF_nemo/src/OCE
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2019/ENHANCE-02_ISF_nemo/src/OCE/DIA/diawri.F90

    r11423 r11494  
    915915         END IF 
    916916         IF (ln_isfpar_mlt) THEN 
     917            CALL iom_rstput( 0, 0, inum, 'isfmsk_par', REAL(mskisf_par,8)  )    ! now k-velocity 
    917918            CALL iom_rstput( 0, 0, inum, 'fwfisf_par', fwfisf_par          )    ! now k-velocity 
    918919            CALL iom_rstput( 0, 0, inum, 'rhisf_par_tbl', rhisf_tbl_par    )    ! now k-velocity 
  • NEMO/branches/2019/ENHANCE-02_ISF_nemo/src/OCE/ISF/isfcavmlt.F90

    r11488 r11494  
    4242      !!---------------------------------------------------------------------- 
    4343      !! 
    44       !! ** Purpose    : compute ice shelf fwf/heqt fluxes  
     44      !! ** Purpose    : compute or read ice shelf fwf/heat fluxes in the ice shelf cavity 
    4545      !! 
    4646      !!--------------------------------------------------------------------- 
     
    189189            ! 
    190190            ! compute coeficient to solve the 2nd order equation 
    191             zeps1 = rau0_rcp*pgt(ji,jj) 
    192             zeps2 = rLfusisf*rau0*pgs(ji,jj) 
    193             zeps3 = rhoisf*rcpisf*rkappa/MAX(risfdep(ji,jj),zeps) 
    194             zeps4 = risf_lamb2+risf_lamb3*risfdep(ji,jj) 
    195             zeps6 = zeps4-pttbl(ji,jj) 
    196             zeps7 = zeps4-rtsurf 
     191            zeps1 = rau0_rcp * pgt(ji,jj) 
     192            zeps2 = rLfusisf * rau0 * pgs(ji,jj) 
     193            zeps3 = rhoisf * rcpisf * rkappa / MAX(risfdep(ji,jj),zeps) 
     194            zeps4 = risf_lamb2 + risf_lamb3 * risfdep(ji,jj) 
     195            zeps6 = zeps4 - pttbl(ji,jj) 
     196            zeps7 = zeps4 - rtsurf 
    197197            ! 
    198198            ! solve the 2nd order equation to find zsfrz 
    199199            zaqe  = risf_lamb1 * (zeps1 + zeps3) 
    200             zaqer = 0.5_wp/MIN(zaqe,-zeps) 
    201             zbqe  = zeps1*zeps6+zeps3*zeps7-zeps2 
    202             zcqe  = zeps2*pstbl(ji,jj) 
    203             zdis  = zbqe*zbqe-4.0_wp*zaqe*zcqe                
     200            zaqer = 0.5_wp / MIN(zaqe,-zeps) 
     201            zbqe  = zeps1 * zeps6 + zeps3 * zeps7 - zeps2 
     202            zcqe  = zeps2 * pstbl(ji,jj) 
     203            zdis  = zbqe * zbqe - 4.0_wp * zaqe * zcqe                
    204204            ! 
    205205            ! Presumably zdis can never be negative because gammas is very small compared to gammat 
    206             zsfrz=(-zbqe-SQRT(zdis))*zaqer 
    207             IF ( zsfrz < 0.0_wp ) zsfrz=(-zbqe+SQRT(zdis))*zaqer  ! check this if this if is needed 
     206            zsfrz=(-zbqe - SQRT(zdis)) * zaqer 
     207            IF ( zsfrz < 0.0_wp ) zsfrz=(-zbqe + SQRT(zdis)) * zaqer  ! check this if this if is needed 
    208208            ! 
    209209            ! compute t freeze (eq. 25) 
  • NEMO/branches/2019/ENHANCE-02_ISF_nemo/src/OCE/ISF/isfpar.F90

    r11423 r11494  
    4343   SUBROUTINE isf_par( kt, ptsc, pqfwf ) 
    4444      !!--------------------------------------------------------------------- 
    45       !!                     ***  ROUTINE sbc_isf_cav  *** 
     45      !!                     ***  ROUTINE isf_par ***       
    4646      !! 
    4747      !! ** Purpose :    
     
    7979      zqh(:,:) = ( zqhc (:,:) + zqoce(:,:) ) 
    8080      ! 
    81       ! lbclnk on melt 
     81      ! lbclnk on melt and heat fluxes 
    8282      CALL lbc_lnk_multi( 'isfmlt', zqh, 'T', 1., pqfwf, 'T', 1.) 
    8383      ! 
     
    120120      ! 
    121121      ! if param used under an ice shelf overwrite ztblmax by the ice shelf draft 
    122       WHERE ( risfdep > 0._wp ) 
     122      WHERE ( risfdep > 0._wp .AND. ztblmin > 0._wp ) 
    123123         ztblmin(:,:) = risfdep(:,:) 
    124124      END WHERE 
     
    130130      rhisf0_tbl_par(:,:) = ztblmax(:,:) - ztblmin(:,:) 
    131131      ! 
    132       ! compute misfkb_par, rhisf_tbl 
    133       rhisf_tbl_par(:,:) = rhisf0_tbl_par(:,:) 
    134       CALL isf_tbl_lvl( ht_n, e3t_n, misfkt_par, misfkb_par, rhisf_tbl_par, rfrac_tbl_par ) 
    135       ! 
    136132      ! define iceshelf parametrisation mask 
    137133      mskisf_par = 0 
     
    140136      END WHERE 
    141137      ! 
     138      ! compute misfkb_par, rhisf_tbl 
     139      rhisf_tbl_par(:,:) = rhisf0_tbl_par(:,:) 
     140      CALL isf_tbl_lvl( ht_n * mskisf_par, e3t_n, misfkt_par, misfkb_par, rhisf_tbl_par, rfrac_tbl_par ) 
     141      ! 
    142142      SELECT CASE ( TRIM(cn_isfpar_mlt) ) 
    143143         ! 
    144144      CASE ( 'spe' ) 
    145  
     145         ! 
    146146         ALLOCATE( sf_isfpar_fwf(1), STAT=ierr ) 
    147147         ALLOCATE( sf_isfpar_fwf(1)%fnow(jpi,jpj,1), sf_isfpar_fwf(1)%fdta(jpi,jpj,1,2) ) 
    148148         CALL fld_fill( sf_isfpar_fwf, (/ sn_isfpar_fwf /), cn_isfdir, 'isf_par_init', 'read fresh water flux isf data', 'namisf' ) 
    149  
     149         ! 
    150150         IF(lwp) WRITE(numout,*) 
    151151         IF(lwp) WRITE(numout,*) '      ==>>>   ice melt read from forcing field (cn_isfmlt_par = spe)' 
    152  
     152         ! 
    153153      CASE ( 'bg03' ) 
    154154         ! 
     
    161161         ! 
    162162      CASE ( 'oasis' ) 
    163  
     163         ! 
    164164         IF(lwp) WRITE(numout,*) 
    165165         IF(lwp) WRITE(numout,*) '      ==>>>    isf melt provided by OASIS (cn_isfmlt_par = oasis)' 
    166  
     166         ! 
    167167      CASE DEFAULT 
    168168         CALL ctl_stop( 'sbc_isf_init: wrong value of nn_isf' ) 
     
    171171   END SUBROUTINE isf_par_init 
    172172 
    173    END MODULE isfpar 
     173END MODULE isfpar 
  • NEMO/branches/2019/ENHANCE-02_ISF_nemo/src/OCE/ISF/isfparmlt.F90

    r11425 r11494  
    3737! ------------------------------------------------------------------------------------------------------- 
    3838 
    39   SUBROUTINE isfpar_mlt( kt, pqfwf, pqoce, pqhc ) 
    40       !!--------------------------------------------------------------------- 
    41       !!                  ***  ROUTINE sbc_isf  *** 
     39  SUBROUTINE isfpar_mlt( kt, pqhc, pqoce, pqfwf ) 
     40      !!--------------------------------------------------------------------- 
     41      !!                  ***  ROUTINE isfpar_mlt  *** 
    4242      !! 
    4343      !! ** Purpose : Compute Salt and Heat fluxes related to ice_shelf  
     
    4949      !!---------------------------------------------------------------------- 
    5050      !!-------------------------- OUT ------------------------------------- 
    51       REAL(wp), DIMENSION(jpi,jpj), INTENT(inout) :: pqfwf,pqoce, pqhc  ! fresh water, ice-ocean heat and heat content fluxes 
     51      REAL(wp), DIMENSION(jpi,jpj), INTENT(inout) :: pqfwf, pqoce, pqhc  ! fresh water, ice-ocean heat and heat content fluxes 
    5252      !!-------------------------- IN  ------------------------------------- 
    5353      INTEGER, INTENT(in) ::   kt   ! ocean time step 
     
    7272! ------------------------------------------------------------------------------------------------------- 
    7373 
    74    SUBROUTINE isfpar_mlt_spe(kt, pqhc, pqfwf, pqoce) 
     74   SUBROUTINE isfpar_mlt_spe(kt, pqhc, pqoce, pqfwf) 
    7575      !!--------------------------------------------------------------------- 
    7676      !!                  ***  ROUTINE isfpar_mlt_spe  *** 
     
    8181      !!---------------------------------------------------------------------- 
    8282      !!-------------------------- OUT ------------------------------------- 
    83       REAL(wp), DIMENSION(jpi,jpj), INTENT(inout) :: pqhc, pqfwf,pqoce  ! fresh water and ice-ocean heat fluxes 
     83      REAL(wp), DIMENSION(jpi,jpj), INTENT(inout) :: pqhc, pqfwf, pqoce  ! fresh water and ice-ocean heat fluxes 
    8484      !!-------------------------- IN  ------------------------------------- 
    8585      INTEGER,  INTENT(in) :: kt 
     
    122122      !!---------------------------------------------------------------------- 
    123123      !!-------------------------- OUT ------------------------------------- 
    124       REAL(wp), DIMENSION(jpi,jpj), INTENT(inout) :: pqhc, pqfwf,pqoce  ! fresh water and ice-ocean heat fluxes 
     124      REAL(wp), DIMENSION(jpi,jpj), INTENT(inout) :: pqhc, pqfwf, pqoce  ! fresh water and ice-ocean heat fluxes 
    125125      !!-------------------------- IN  ------------------------------------- 
    126126      INTEGER,  INTENT(in) :: kt 
     
    158158   SUBROUTINE isfpar_mlt_oasis(kt, pqhc , pqoce, pqfwf ) 
    159159      !!---------------------------------------------------------------------- 
     160      !!                  ***  ROUTINE isfpar_oasis  *** 
    160161      !! 
    161162      !! ** Purpose    : scale the fwf read from input file by the total amount received by the sbccpl interface 
    162163      !! 
    163       !! ** Purpose    : - read ice shelf melt from forcing file => pattern 
    164       !!                 - total amount of fwf is given by sbccpl (fwfisf_oasis) 
     164      !! ** Purpose    : - read ice shelf melt from forcing file and scale it by the input file total amount => pattern 
     165      !!                 - compute total amount of fwf given by sbccpl (fwfisf_oasis) 
    165166      !!                 - scale fwf and compute heat fluxes 
    166167      !! 
  • NEMO/branches/2019/ENHANCE-02_ISF_nemo/src/OCE/ISF/isftbl.F90

    r11403 r11494  
    210210      ! 
    211211      ! phtbl need to be bounded by water column thickness before 
    212       ! test: if phtbl = water column thickness, should return mbathy 
    213       ! test: if phtbl = 0 should return ktop 
     212      ! test: if htbl = water column thickness, should return mbathy 
     213      ! test: if htbl = 0 should return ktop (phtbl cap to e3t(ji,jj,1)) 
    214214      ! 
    215215      ! get ktbl 
  • NEMO/branches/2019/ENHANCE-02_ISF_nemo/src/OCE/ISF/isfutils.F90

    r11403 r11494  
    3838      REAL(wp), DIMENSION(jpi,jpj), INTENT(  out) :: pvar          ! output variable 
    3939      !!-------------------------- IN  ------------------------------------- 
    40       CHARACTER(len=256)          , INTENT(in   ) :: cdfile, cdvar ! input file name and variable name 
     40      CHARACTER(len=256)          , INTENT(in   ) :: cdfile   ! input file name 
     41      CHARACTER(len=34)           , INTENT(in   ) :: cdvar    ! variable name 
    4142      !!-------------------------------------------------------------------- 
    4243      INTEGER :: inum 
    4344      !!-------------------------------------------------------------------- 
    4445 
    45       CALL iom_open( cdfile, inum ) 
    46       CALL iom_get( inum, jpdom_data, cdvar, pvar, 1) 
     46      CALL iom_open( TRIM(cdfile), inum ) 
     47      CALL iom_get( inum, jpdom_data, TRIM(cdvar), pvar) 
    4748      CALL iom_close(inum) 
    4849 
Note: See TracChangeset for help on using the changeset viewer.