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

Ignore:
Timestamp:
2019-09-10T11:49:13+02:00 (5 years ago)
Author:
mathiot
Message:

ENHANCE-02_ISF: fix issue with ice sheet coupling and conservation + other minor changes (ticket #2142)

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

Legend:

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

    r11395 r11521  
    4848   REAL(wp), DIMENSION(:,:)  , ALLOCATABLE ::   ssh_hc_loc_ini, ssh_sc_loc_ini   ! 
    4949   REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::   hc_loc_ini, sc_loc_ini, e3t_ini  ! 
     50   REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::   tmask_ini 
    5051 
    5152   !! * Substitutions 
     
    156157      ! 
    157158      DO jk = 1, jpkm1           ! volume variation (calculated with scale factors) 
    158          zwrk(:,:,jk) = ( surf(:,:)*e3t_n(:,:,jk) - surf_ini(:,:)*e3t_ini(:,:,jk) ) * tmask(:,:,jk) 
     159         zwrk(:,:,jk) = surf(:,:)*e3t_n(:,:,jk)*tmask(:,:,jk) - surf_ini(:,:)*e3t_ini(:,:,jk)*tmask_ini(:,:,jk) 
    159160      END DO 
    160       zdiff_v2 = glob_sum_full( 'diahsb', zwrk(:,:,:) ) 
     161      zdiff_v2 = glob_sum_full( 'diahsb', zwrk(:,:,:) )     ! glob_sum_full needed as tmask and tmask_ini could be different 
    161162      DO jk = 1, jpkm1           ! heat content variation 
    162          zwrk(:,:,jk) = ( surf(:,:)*e3t_n(:,:,jk)*tsn(:,:,jk,jp_tem) - surf_ini(:,:)*hc_loc_ini(:,:,jk) ) * tmask(:,:,jk) 
     163         zwrk(:,:,jk) = ( surf(:,:)*e3t_n(:,:,jk)*tsn(:,:,jk,jp_tem) - surf_ini(:,:)*hc_loc_ini(:,:,jk) ) 
    163164      END DO 
    164165      zdiff_hc = glob_sum_full( 'diahsb', zwrk(:,:,:) ) 
    165166      DO jk = 1, jpkm1           ! salt content variation 
    166          zwrk(:,:,jk) = ( surf(:,:)*e3t_n(:,:,jk)*tsn(:,:,jk,jp_sal) - surf_ini(:,:)*sc_loc_ini(:,:,jk) ) * tmask(:,:,jk) 
     167         zwrk(:,:,jk) = ( surf(:,:)*e3t_n(:,:,jk)*tsn(:,:,jk,jp_sal) - surf_ini(:,:)*sc_loc_ini(:,:,jk) ) 
    167168      END DO 
    168169      zdiff_sc = glob_sum_full( 'diahsb', zwrk(:,:,:) ) 
     
    188189         zwrk(:,:,jk) = surf(:,:) * e3t_n(:,:,jk) * tmask(:,:,jk) 
    189190      END DO 
    190       zvol_tot = glob_sum_full( 'diahsb', zwrk(:,:,:) ) 
     191      zvol_tot = glob_sum( 'diahsb', zwrk(:,:,:) ) 
    191192 
    192193!!gm to be added ? 
     
    271272            CALL iom_get( numror, jpdom_autoglo, 'ssh_ini'   , ssh_ini   , ldxios = lrxios ) 
    272273            CALL iom_get( numror, jpdom_autoglo, 'e3t_ini'   , e3t_ini   , ldxios = lrxios ) 
     274            CALL iom_get( numror, jpdom_autoglo, 'tmask_ini' , tmask_ini , ldxios = lrxios ) 
    273275            CALL iom_get( numror, jpdom_autoglo, 'hc_loc_ini', hc_loc_ini, ldxios = lrxios ) 
    274276            CALL iom_get( numror, jpdom_autoglo, 'sc_loc_ini', sc_loc_ini, ldxios = lrxios ) 
     
    326328         CALL iom_rstput( kt, nitrst, numrow, 'ssh_ini'   , ssh_ini   , ldxios = lwxios ) 
    327329         CALL iom_rstput( kt, nitrst, numrow, 'e3t_ini'   , e3t_ini   , ldxios = lwxios ) 
     330         CALL iom_rstput( kt, nitrst, numrow, 'tmask_ini' , tmask_ini , ldxios = lwxios ) 
    328331         CALL iom_rstput( kt, nitrst, numrow, 'hc_loc_ini', hc_loc_ini, ldxios = lwxios ) 
    329332         CALL iom_rstput( kt, nitrst, numrow, 'sc_loc_ini', sc_loc_ini, ldxios = lwxios ) 
     
    397400      ! ------------------- ! 
    398401      ALLOCATE( hc_loc_ini(jpi,jpj,jpk), sc_loc_ini(jpi,jpj,jpk), surf_ini(jpi,jpj), & 
    399          &      e3t_ini(jpi,jpj,jpk), surf(jpi,jpj),  ssh_ini(jpi,jpj), STAT=ierror  ) 
     402         &      e3t_ini(jpi,jpj,jpk), surf(jpi,jpj),  ssh_ini(jpi,jpj), tmask_ini(jpi,jpj,jpk),STAT=ierror  ) 
    400403      IF( ierror > 0 ) THEN 
    401404         CALL ctl_stop( 'dia_hsb_init: unable to allocate hc_loc_ini' )   ;   RETURN 
  • NEMO/branches/2019/ENHANCE-02_ISF_nemo/src/OCE/DIA/diawri.F90

    r11494 r11521  
    2727   USE oce            ! ocean dynamics and tracers  
    2828   USE isf 
     29   USE isfcpl 
    2930   USE dom_oce        ! ocean space and time domain 
    3031   USE phycst         ! physical constants 
     
    884885      !!---------------------------------------------------------------------- 
    885886      CHARACTER (len=* ), INTENT( in ) ::   cdfile_name      ! name of the file created 
     887      REAL(wp), DIMENSION(jpi,jpj,jpk) :: zisfdebug 
    886888      !! 
    887       INTEGER :: inum 
     889      INTEGER :: inum, jk 
    888890      !!---------------------------------------------------------------------- 
    889891      !  
     
    923925         END IF 
    924926      END IF 
     927      DO jk = 1,jpk 
     928         zisfdebug(:,:,jk) = risfcpl_cons_vol(:,:,jk) * rdt_iscpl / e1e2t(:,:) 
     929      END DO 
     930      CALL iom_rstput( 0, 0, inum, 'isfdebug', zisfdebug) 
    925931      IF( ALLOCATED(ahtu) ) THEN 
    926932         CALL iom_rstput( 0, 0, inum,  'ahtu', ahtu              )    ! aht at u-point 
  • NEMO/branches/2019/ENHANCE-02_ISF_nemo/src/OCE/DOM/dom_oce.F90

    r11403 r11521  
    3535   REAL(wp), PUBLIC ::   rn_atfp        !: asselin time filter parameter 
    3636   INTEGER , PUBLIC ::   nn_euler       !: =0 start with forward time step or not (=1) 
    37    LOGICAL , PUBLIC ::   ln_iscpl       !: coupling with ice sheet 
    3837   LOGICAL , PUBLIC ::   ln_crs         !: Apply grid coarsening to dynamical model output or online passive tracers 
    3938 
  • NEMO/branches/2019/ENHANCE-02_ISF_nemo/src/OCE/DOM/domain.F90

    r11395 r11521  
    185185      IF( lk_c1d         )   CALL cor_c1d       ! 1D configuration: Coriolis set at T-point 
    186186      ! 
    187       IF( ln_meshmask .AND. .NOT.ln_iscpl )                        CALL dom_wri     ! Create a domain file 
    188       IF( ln_meshmask .AND.      ln_iscpl .AND. .NOT.ln_rstart )   CALL dom_wri     ! Create a domain file 
    189       IF(                                       .NOT.ln_rstart )   CALL dom_ctl     ! Domain control 
    190       ! 
    191       IF( ln_write_cfg )   CALL cfg_write         ! create the configuration file 
     187      IF( ln_meshmask    )   CALL dom_wri       ! Create a domain file 
     188      IF( .NOT.ln_rstart )   CALL dom_ctl       ! Domain control 
     189      ! 
     190      IF( ln_write_cfg   )   CALL cfg_write     ! create the configuration file 
    192191      ! 
    193192      IF(lwp) THEN 
     
    285284         &             nn_it000, nn_itend , nn_date0    , nn_time0     , nn_leapy  , nn_istate ,     & 
    286285         &             nn_stock, nn_write , ln_mskland  , ln_clobber   , nn_chunksz, nn_euler  ,     & 
    287          &             ln_cfmeta, ln_iscpl, ln_xios_read, nn_wxios 
     286         &             ln_cfmeta, ln_xios_read, nn_wxios 
    288287      NAMELIST/namdom/ ln_linssh, rn_rdt, rn_atfp, ln_crs, ln_meshmask 
    289288#if defined key_netcdf4 
     
    334333         WRITE(numout,*) '      overwrite an existing file      ln_clobber      = ', ln_clobber 
    335334         WRITE(numout,*) '      NetCDF chunksize (bytes)        nn_chunksz      = ', nn_chunksz 
    336          WRITE(numout,*) '      IS coupling at the restart step ln_iscpl        = ', ln_iscpl 
    337335         IF( TRIM(Agrif_CFixed()) == '0' ) THEN 
    338336            WRITE(numout,*) '      READ restart for a single file using XIOS ln_xios_read =', ln_xios_read 
  • NEMO/branches/2019/ENHANCE-02_ISF_nemo/src/OCE/DOM/domvvl.F90

    r11423 r11521  
    2020   USE oce             ! ocean dynamics and tracers 
    2121   USE isfcpl 
     22   USE isf 
    2223   USE phycst          ! physical constant 
    2324   USE dom_oce         ! ocean space and time domain 
     
    816817            ! 
    817818            ! coupling with an ice sheet model (grounding/calving line migration) 
    818             IF ( ln_iscpl ) THEN 
     819            IF ( ln_isfcpl ) THEN 
    819820               ! 
    820821               ! extrapolate ssh over new water column if needed 
  • NEMO/branches/2019/ENHANCE-02_ISF_nemo/src/OCE/DYN/divhor.F90

    r11423 r11521  
    1919   !!---------------------------------------------------------------------- 
    2020   USE oce             ! ocean dynamics and tracers 
     21   USE isf 
     22   USE isfutils 
    2123   USE dom_oce         ! ocean space and time domain 
    22    USE sbc_oce, ONLY : ln_rnf, ln_isf ! surface boundary condition: ocean 
     24   USE sbc_oce, ONLY : ln_rnf ! surface boundary condition: ocean 
    2325   USE sbcrnf          ! river runoff  
    2426   USE isfhdiv         ! ice shelf 
     
    98100      !  
    99101#endif 
    100       IF( ln_isf )   CALL isf_hdiv( kt, hdivn )      !==  ice shelf  ==!   (update hdivn field) 
     102      CALL debug('isfdivdebug 0',hdivn) 
     103      IF( ln_isf .OR. ll_isfcpl_cons )   CALL isf_hdiv( kt, hdivn )      !==  ice shelf  ==!   (update hdivn field) 
     104      CALL debug('isfdivdebug 3',hdivn) 
    101105      ! 
    102106      CALL lbc_lnk( 'divhor', hdivn, 'T', 1. )   !   (no sign change) 
  • NEMO/branches/2019/ENHANCE-02_ISF_nemo/src/OCE/DYN/dynnxt.F90

    r11395 r11521  
    2626   !!------------------------------------------------------------------------- 
    2727   USE oce            ! ocean dynamics and tracers 
     28   USE isf 
    2829   USE dom_oce        ! ocean space and time domain 
    2930   USE sbc_oce        ! Surface boundary condition: ocean fields 
  • NEMO/branches/2019/ENHANCE-02_ISF_nemo/src/OCE/DYN/dynspg_ts.F90

    r11395 r11521  
    3434   USE zdfdrg          ! vertical physics: top/bottom drag coef. 
    3535   USE isf             ! ice shelf variable (fwfisf) 
     36   USE isfutils 
    3637   USE sbcapr          ! surface boundary condition: atmospheric pressure 
    3738   USE dynadv    , ONLY: ln_dynadv_vec 
     
    643644         zssh_frc(:,:) = zssh_frc(:,:) + div_sd(:,:) 
    644645      ENDIF 
     646      ! 
     647      IF( ll_isfcpl_cons ) THEN 
     648         zssh_frc(:,:) = zssh_frc(:,:) + risfcpl_cons_ssh(:,:) 
     649      END IF 
    645650      ! 
    646651#if defined key_asminc 
  • NEMO/branches/2019/ENHANCE-02_ISF_nemo/src/OCE/DYN/sshwzv.F90

    r11395 r11521  
    1818   USE oce            ! ocean dynamics and tracers variables 
    1919   USE isf            ! ice shelf 
     20   USE isfutils 
    2021   USE dom_oce        ! ocean space and time domain variables  
    2122   USE sbc_oce        ! surface boundary condition: ocean 
     
    255256         IF( .NOT.ln_linssh ) THEN                          ! before <-- with forcing removed 
    256257            zcoef = atfp * rdt * r1_rau0 
    257             sshb(:,:) = sshb(:,:) - zcoef * (     emp_b(:,:) - emp   (:,:)   & 
    258                &                             -    rnf_b(:,:) + rnf   (:,:)   & 
     258            sshb(:,:) = sshb(:,:) - zcoef * (  emp_b(:,:)        - emp   (:,:)       & 
     259               &                             - rnf_b(:,:)        + rnf   (:,:)       & 
    259260               &                             + fwfisf_cav_b(:,:) - fwfisf_cav(:,:)   & 
    260261               &                             + fwfisf_par_b(:,:) - fwfisf_par(:,:)   ) * ssmask(:,:) 
  • NEMO/branches/2019/ENHANCE-02_ISF_nemo/src/OCE/IOM/iom.F90

    r10817 r11521  
    378378        CALL iom_set_rstw_var_active('sshn') 
    379379        CALL iom_set_rstw_var_active('rhop') 
    380      ! extra variable needed for the ice sheet coupling 
    381         IF ( ln_iscpl ) THEN 
    382              CALL iom_set_rstw_var_active('tmask') 
    383              CALL iom_set_rstw_var_active('umask') 
    384              CALL iom_set_rstw_var_active('vmask') 
    385              CALL iom_set_rstw_var_active('smask') 
    386              CALL iom_set_rstw_var_active('e3t_n') 
    387              CALL iom_set_rstw_var_active('e3u_n') 
    388              CALL iom_set_rstw_var_active('e3v_n') 
    389              CALL iom_set_rstw_var_active('gdepw_n') 
    390         END IF 
    391380      ENDIF 
    392381      IF(ln_diurnal) CALL iom_set_rstw_var_active('Dsst') 
  • NEMO/branches/2019/ENHANCE-02_ISF_nemo/src/OCE/ISF/isf.F90

    r11489 r11521  
    3030   ! 0.1 -------- ice shelf cavity parameter -------------- 
    3131   CHARACTER(LEN=256), PUBLIC :: cn_isfdir 
     32   LOGICAL           , PUBLIC :: ln_isf 
    3233   ! 
    3334   ! 0.2 -------- ice shelf cavity opened namelist parameter ------------- 
     
    100101   INTEGER , PUBLIC                                        ::   nstp_iscpl   !: 
    101102   REAL(wp), PUBLIC                                        ::   rdt_iscpl    !:  
    102    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::   risfcpl_vol, risfcpl_cons_vol  !: 
    103    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) ::   risfcpl_tsc, risfcpl_cons_tsc  !: 
     103   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::   risfcpl_cons_ssh, risfcpl_cons_ssh_b               !: 
     104   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::   risfcpl_vol, risfcpl_cons_vol, risfcpl_cons_vol_b  !: 
     105   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) ::   risfcpl_tsc, risfcpl_cons_tsc, risfcpl_cons_tsc_b  !: 
    104106   ! 
    105107   !!---------------------------------------------------------------------- 
     
    184186      ! 
    185187      ALLOCATE( risfcpl_tsc(jpi,jpj,jpk,jpts)      , risfcpl_vol(jpi,jpj,jpk)      ,             & 
    186          &      risfcpl_cons_tsc(jpi,jpj,jpk,jpts) , risfcpl_cons_vol(jpi,jpj,jpk) , STAT=ialloc ) 
     188         &      risfcpl_cons_tsc(jpi,jpj,jpk,jpts) , risfcpl_cons_vol(jpi,jpj,jpk) ,             & 
     189         &      risfcpl_cons_tsc_b(jpi,jpj,jpk,jpts) , risfcpl_cons_vol_b(jpi,jpj,jpk),          & 
     190                risfcpl_cons_ssh_b(jpi,jpj), risfcpl_cons_ssh(jpi,jpj), STAT=ialloc ) 
    187191      ierr = ierr + ialloc 
    188192      ! 
  • NEMO/branches/2019/ENHANCE-02_ISF_nemo/src/OCE/ISF/isfcav.F90

    r11495 r11521  
    7878      !  
    7979      ! output T/S/U/V for the top boundary layer 
    80       CALL iom_put('ttbl_cav',zttbl(:,:)) 
    81       CALL iom_put('stbl'    ,zstbl(:,:)) 
     80      CALL iom_put('ttbl_cav',zttbl(:,:) * mskisf_cav(:,:)) 
     81      CALL iom_put('stbl'    ,zstbl(:,:) * mskisf_cav(:,:)) 
    8282      ! 
    8383      ! initialisation 
  • NEMO/branches/2019/ENHANCE-02_ISF_nemo/src/OCE/ISF/isfcavgam.F90

    r11495 r11521  
    6464         ! 
    6565         ! mask velocity in tbl with ice shelf mask 
    66          !zutbl(:,:) = zutbl(:,:) * mskisf_cav(:,:) 
    67          !zvtbl(:,:) = zvtbl(:,:) * mskisf_cav(:,:) 
     66         zutbl(:,:) = zutbl(:,:) * mskisf_cav(:,:) 
     67         zvtbl(:,:) = zvtbl(:,:) * mskisf_cav(:,:) 
    6868         ! 
    6969         ! output 
  • NEMO/branches/2019/ENHANCE-02_ISF_nemo/src/OCE/ISF/isfdiags.F90

    r11395 r11521  
    1717   USE dom_oce 
    1818   USE isf            ! ice shelf variable 
     19   USE isfutils 
    1920   USE iom            !  
    2021 
     
    9394      ! compute 3d output 
    9495      zvar2d(:,:) = pvar2d(:,:) / phtbl(:,:) 
     96      zvar3d(:,:,:) = 0._wp 
     97      ! 
    9598      DO jj = 1,jpj 
    9699         DO ji = 1,jpi 
     
    98101            ikb = kbot(ji,jj) 
    99102            DO jk = ikt, ikb - 1 
    100                zvar3d(ji,jj,jk) = zvar3d(ji,jj,jk) + zvar2d(ji,jj) * e3t_n(ji,jj,jk) 
     103               zvar3d(ji,jj,jk) = zvar2d(ji,jj) * e3t_n(ji,jj,jk) 
    101104            END DO 
    102             ! phtbl(ji,jj) * pfrac(ji,jj) = thickness of bottom affected by tbl 
    103             zvar3d(ji,jj,ikb) = zvar3d(ji,jj,ikb) + zvar2d(ji,jj) * e3t_n(ji,jj,ikb) * pfrac(ji,jj) 
     105            zvar3d(ji,jj,ikb) = zvar2d(ji,jj) * e3t_n(ji,jj,ikb) * pfrac(ji,jj) 
    104106         END DO 
    105107      END DO 
    106108      ! 
    107       ! output data 
    108109      CALL iom_put( TRIM(cdvar) , zvar3d(:,:,:)) 
    109110      ! 
  • NEMO/branches/2019/ENHANCE-02_ISF_nemo/src/OCE/ISF/isfhdiv.F90

    r11423 r11521  
    22 
    33   USE dom_oce 
     4   USE iom 
    45   USE isf 
     6   USE isfutils 
    57   USE phycst 
    68   USE in_out_manager 
     
    2830      INTEGER, INTENT(in) :: kt 
    2931      ! 
    30       ! ice shelf cavity contribution 
    31       IF ( ln_isfcav_mlt ) CALL isf_hdiv_mlt(misfkt_cav, misfkb_cav, rhisf_tbl_cav, rfrac_tbl_cav, fwfisf_cav, fwfisf_cav_b, phdiv) 
     32      IF (lwp) WRITE(numout,*) ' isfdiv start' 
     33      FLUSH(numout) 
    3234      ! 
    33       ! ice shelf parametrisation contribution 
    34       IF ( ln_isfpar_mlt ) CALL isf_hdiv_mlt(misfkt_par, misfkb_par, rhisf_tbl_par, rfrac_tbl_par, fwfisf_par, fwfisf_par_b, phdiv) 
     35      IF ( ln_isf ) THEN 
     36         ! 
     37         ! ice shelf cavity contribution 
     38         IF ( ln_isfcav_mlt ) CALL isf_hdiv_mlt(misfkt_cav, misfkb_cav, rhisf_tbl_cav, rfrac_tbl_cav, fwfisf_cav, fwfisf_cav_b, phdiv) 
     39         ! 
     40         ! ice shelf parametrisation contribution 
     41         IF ( ln_isfpar_mlt ) CALL isf_hdiv_mlt(misfkt_par, misfkb_par, rhisf_tbl_par, rfrac_tbl_par, fwfisf_par, fwfisf_par_b, phdiv) 
     42         ! 
     43      END IF 
    3544      ! 
    3645      ! ice sheet coupling contribution (if conservation needed) 
     
    3847         ! 
    3948         ! correct divergence only for the first time step 
    40          IF ( kt == nit000 ) CALL isf_hdiv_cpl(risfcpl_vol, phdiv) 
     49         !IF ( kt == nit000 ) CALL isf_hdiv_cpl(risfcpl_vol, phdiv) 
    4150         ! 
    4251         ! correct divergence every time step to remove any trend due to coupling 
    43          IF ( ll_isfcpl_cons ) CALL isf_hdiv_cpl(risfcpl_cons_vol, phdiv) 
     52         IF ( ll_isfcpl_cons ) CALL isf_hdiv_cpl(risfcpl_cons_vol, risfcpl_cons_vol_b, phdiv) 
    4453         ! 
    4554      END IF 
     55      IF (lwp) WRITE(numout,*) ' isfdiv end' 
     56      FLUSH(numout) 
    4657      ! 
    4758   END SUBROUTINE isf_hdiv 
     
    7889      DO jj = 1,jpj 
    7990         DO ji = 1,jpi 
    80                ikt = ktop(ji,jj) 
    81                ikb = kbot(ji,jj) 
    82                ! level fully include in the ice shelf boundary layer 
    83                DO jk = ikt, ikb - 1 
    84                   phdiv(ji,jj,jk) = phdiv(ji,jj,jk) + zqvol(ji,jj) 
    85                END DO 
    86                ! level partially include in ice shelf boundary layer  
    87                phdiv(ji,jj,ikb) = phdiv(ji,jj,ikb) + zqvol(ji,jj) * pfrac(ji,jj) 
     91            ikt = ktop(ji,jj) 
     92            ikb = kbot(ji,jj) 
     93            ! level fully include in the ice shelf boundary layer 
     94            DO jk = ikt, ikb - 1 
     95               phdiv(ji,jj,jk) = phdiv(ji,jj,jk) + zqvol(ji,jj) 
     96            END DO 
     97            ! level partially include in ice shelf boundary layer  
     98            phdiv(ji,jj,ikb) = phdiv(ji,jj,ikb) + zqvol(ji,jj) * pfrac(ji,jj) 
    8899         END DO 
    89100      END DO 
     
    91102   END SUBROUTINE isf_hdiv_mlt 
    92103 
    93    SUBROUTINE isf_hdiv_cpl(pqvol, phdiv) 
     104   SUBROUTINE isf_hdiv_cpl(pqvol, pqvol_b, phdiv) 
     105      !!---------------------------------------------------------------------- 
     106      !!                  ***  SUBROUTINE isf_hdiv_cpl  *** 
     107      !!        
     108      !! ** Purpose :    
     109      !! 
     110      !! ** Method  :    
     111      !! 
     112      !! ** Action  :   
     113      !!---------------------------------------------------------------------- 
    94114      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) :: phdiv 
    95       REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in   ) :: pqvol 
    96     
    97    INTEGER :: jk 
    98        
     115      !!---------------------------------------------------------------------- 
     116      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in   ) :: pqvol, pqvol_b 
     117      !!---------------------------------------------------------------------- 
     118      INTEGER :: jk 
     119      !!---------------------------------------------------------------------- 
     120      ! 
    99121      DO jk=1,jpk  
    100122         phdiv(:,:,jk) =  phdiv(:,:,jk) + pqvol(:,:,jk) * r1_e1e2t(:,:) / e3t_n(:,:,jk) 
    101123      END DO 
    102  
    103    END SUBROUTINE 
     124      ! 
     125   END SUBROUTINE isf_hdiv_cpl 
    104126 
    105127END MODULE isfhdiv 
  • NEMO/branches/2019/ENHANCE-02_ISF_nemo/src/OCE/ISF/isfnxt.F90

    r11403 r11521  
    4242      IF ( ln_isfpar_mlt ) CALL isf_dynnxt_mlt(misfkt_par, misfkb_par, rhisf_tbl_par, rfrac_tbl_par, fwfisf_par, fwfisf_par_b, pcoef) 
    4343      ! 
    44       ! ice sheet coupling 
    45       !IF ( ln_iscpl_hsb  ) CALL isf_dynnxt_cpl(...zcoef) 
    46       ! 
    4744   END SUBROUTINE isf_dynnxt 
    4845 
  • NEMO/branches/2019/ENHANCE-02_ISF_nemo/src/OCE/ISF/isfparmlt.F90

    r11495 r11521  
    148148      ! 3. ------------BG03 output 
    149149      ! output ttbl 
    150       CALL iom_put('ttbl_par', ztavg(:,:) ) 
     150      CALL iom_put('ttbl_par', ztavg(:,:) * mskisf_par(:,:) ) 
    151151      ! 
    152152      ! output thermal driving 
    153       CALL iom_put('isfthermald_par',( ztfrz(:,:) - ztavg(:,:) )) 
     153      CALL iom_put('isfthermald_par',( ztfrz(:,:) - ztavg(:,:) ) * mskisf_par(:,:)) 
    154154      ! 
    155155      ! 
  • NEMO/branches/2019/ENHANCE-02_ISF_nemo/src/OCE/ISF/isfstp.F90

    r11489 r11521  
    3333   USE isfcpl         ! isf variables 
    3434   USE isf            ! isf variables 
     35   USE isfutils 
    3536 
    3637   IMPLICIT NONE 
     
    103104      END IF 
    104105 
    105       IF ( ln_isfcpl ) THEN 
     106      IF ( ll_isfcpl ) THEN 
     107 
    106108         IF (lrst_oce) CALL isfcpl_rst_write(kt) 
     109 
    107110      END IF 
    108111      ! 
     
    181184            WRITE(numout,*) '' 
    182185            ! 
    183             WRITE(numout,*) '      Coupling to an ice sheet model          ln_isfcpl         = ', ln_isfcpl 
    184             IF ( ln_isfcpl ) THEN 
    185                WRITE(numout,*) '         conservation activated ln_isfcpl_cons           = ', ln_isfcpl_cons 
    186                WRITE(numout,*) '            number of call of the extrapolation loop = ', nn_drown 
    187             ENDIF 
    188             ! 
    189             WRITE(numout,*) '      Ice shelf load method                   cn_isfload        = ', TRIM(cn_isfload) 
    190186         ELSE 
    191187            IF ( ln_isfcav ) THEN 
     
    196192         END IF 
    197193 
     194         WRITE(numout,*) '      Coupling to an ice sheet model          ln_isfcpl         = ', ln_isfcpl 
     195         IF ( ln_isfcpl ) THEN 
     196            WRITE(numout,*) '         conservation activated ln_isfcpl_cons           = ', ln_isfcpl_cons 
     197            WRITE(numout,*) '            number of call of the extrapolation loop = ', nn_drown 
     198         ENDIF 
     199         ! 
     200         IF (ln_isfcav) WRITE(numout,*) '      Ice shelf load method                   cn_isfload        = ', TRIM(cn_isfload) 
     201         WRITE(numout,*) '' 
     202 
    198203      END IF 
    199204      ! 
     
    244249      ! 
    245250      ! terminate routine now if no ice shelf melt formulation specify 
    246       IF ( .NOT. ln_isf ) RETURN 
    247       ! 
    248       ! initialisation useful variable 
    249       r1_Lfusisf =  1._wp / rLfusisf 
     251      IF ( ln_isf ) THEN 
     252         ! 
     253         ! initialisation useful variable 
     254         r1_Lfusisf =  1._wp / rLfusisf 
     255         ! 
     256         ! initialisation melt in the cavity 
     257         IF ( ln_isfcav_mlt ) THEN 
     258            ! 
     259            ! initialisation  of cav variable 
     260            CALL isf_cav_init() 
     261            ! 
     262            ! read cav variable from restart 
     263            IF ( ln_rstart ) CALL isfrst_read('cav', risf_cav_tsc, fwfisf_cav, risf_cav_tsc_b, fwfisf_cav_b) 
     264            ! 
     265         END IF 
     266         ! 
     267         !--------------------------------------------------------------------------------------------------------------------- 
     268         ! initialisation parametrised melt 
     269         IF ( ln_isfpar_mlt ) THEN 
     270            ! 
     271            ! initialisation  of par variable 
     272            CALL isf_par_init() 
     273            ! 
     274            ! read par variable from restart 
     275            IF ( ln_rstart ) CALL isfrst_read('par', risf_par_tsc, fwfisf_par, risf_par_tsc_b, fwfisf_par_b) 
     276            ! 
     277         END IF 
     278      END IF 
     279      ! 
     280      !--------------------------------------------------------------------------------------------------------------------- 
     281      ! initialisation ice sheet coupling 
    250282      ! 
    251283      ll_isfcpl     = .FALSE. 
    252284      ll_isfcpl_cons= .FALSE. 
    253285      ! 
    254       ! initialisation melt in the cavity 
    255       IF ( ln_isfcav_mlt ) THEN 
    256          ! 
    257          ! initialisation  of cav variable 
    258          CALL isf_cav_init() 
    259          ! 
    260          ! read cav variable from restart 
    261          IF ( ln_rstart ) CALL isfrst_read('cav', risf_cav_tsc, fwfisf_cav, risf_cav_tsc_b, fwfisf_cav_b) 
    262          ! 
    263       END IF 
    264       ! 
    265       !--------------------------------------------------------------------------------------------------------------------- 
    266       ! initialisation parametrised melt 
    267       IF ( ln_isfpar_mlt ) THEN 
    268          ! 
    269          ! initialisation  of par variable 
    270          CALL isf_par_init() 
    271          ! 
    272          ! read par variable from restart 
    273          IF ( ln_rstart ) CALL isfrst_read('par', risf_par_tsc, fwfisf_par, risf_par_tsc_b, fwfisf_par_b) 
    274          ! 
    275       END IF 
    276       ! 
    277       !--------------------------------------------------------------------------------------------------------------------- 
    278       ! initialisation ice sheet coupling 
    279286      IF( ln_isfcpl ) THEN 
    280287 
  • NEMO/branches/2019/ENHANCE-02_ISF_nemo/src/OCE/ISF/isftbl.F90

    r11495 r11521  
    9898         ! 
    9999      END SELECT 
    100       ! 
    101       ! mask mean tbl value 
    102       pvarout(:,:) = pvarout(:,:) * ssmask(:,:) 
    103100      ! 
    104101   END SUBROUTINE isf_tbl 
  • NEMO/branches/2019/ENHANCE-02_ISF_nemo/src/OCE/ISF/isfutils.F90

    r11494 r11521  
    6565      !!-------------------------------------------------------------------- 
    6666      ! 
    67       zsum = glob_sum( 'debug', pvar(:,:) ) 
     67      zsum = glob_sum_full( 'debug', pvar(:,:) ) 
    6868      zmin = MINVAL( pvar(:,:) ) ; CALL mpp_min( 'debug', zmin ) ! min over the global domain 
    6969      zmax = MAXVAL( pvar(:,:) ) ; CALL mpp_max( 'debug', zmax ) ! max over the global domain 
     
    8989      !!-------------------------------------------------------------------- 
    9090      ! 
    91       zsum = glob_sum( 'debug', pvar(:,:) ) 
    92       zmin = MINVAL( pvar(:,:) ) ; CALL mpp_min( 'debug', zmin ) ! min over the global domain 
    93       zmax = MAXVAL( pvar(:,:) ) ; CALL mpp_max( 'debug', zmax ) ! max over the global domain 
     91      zsum = glob_sum_full( 'debug', pvar(:,:,:) ) 
     92      zmin = MINVAL( pvar(:,:,:) ) ; CALL mpp_min( 'debug', zmin ) ! min over the global domain 
     93      zmax = MAXVAL( pvar(:,:,:) ) ; CALL mpp_max( 'debug', zmax ) ! max over the global domain 
    9494      ! 
    9595      WRITE(numout,*) TRIM(cdtxt),' (min, max, sum) : ',zmin, zmax, zsum 
  • NEMO/branches/2019/ENHANCE-02_ISF_nemo/src/OCE/SBC/sbc_oce.F90

    r11403 r11521  
    4343   LOGICAL , PUBLIC ::   ln_dm2dc       !: Daily mean to Diurnal Cycle short wave (qsr) 
    4444   LOGICAL , PUBLIC ::   ln_rnf         !: runoffs / runoff mouths 
    45    LOGICAL , PUBLIC ::   ln_isf         !: ice shelf melting 
    4645   LOGICAL , PUBLIC ::   ln_ssr         !: Sea Surface restoring on SST and/or SSS       
    4746   LOGICAL , PUBLIC ::   ln_apr_dyn     !: Atmospheric pressure forcing used on dynamics (ocean & ice) 
  • NEMO/branches/2019/ENHANCE-02_ISF_nemo/src/OCE/SBC/sbccpl.F90

    r11423 r11521  
    3636   USE eosbn2         !  
    3737   USE sbcrnf  , ONLY : l_rnfcpl 
    38    USE isf     , ONLY : l_isfoasis, fwfisf_oasis 
     38   USE isf     , ONLY : ln_isf, l_isfoasis, fwfisf_oasis 
    3939#if defined key_cice 
    4040   USE ice_domain_size, only: ncat 
  • NEMO/branches/2019/ENHANCE-02_ISF_nemo/src/OCE/TRA/traisf.F90

    r11423 r11521  
    4848      IF( ln_timing )   CALL timing_start('tra_sbc') 
    4949      ! 
    50       ! cavity case 
    51       IF ( ln_isfcav_mlt ) CALL tra_isf_mlt(misfkt_cav, misfkb_cav, rhisf_tbl_cav, rfrac_tbl_cav, risf_cav_tsc, risf_cav_tsc_b, tsa) 
    52       ! 
    53       ! parametrisation case 
    54       IF ( ln_isfpar_mlt ) CALL tra_isf_mlt(misfkt_par, misfkb_par, rhisf_tbl_par, rfrac_tbl_par, risf_par_tsc, risf_par_tsc_b, tsa) 
     50      IF (ln_isf) THEN 
     51         ! 
     52         ! cavity case 
     53         IF ( ln_isfcav_mlt ) CALL tra_isf_mlt(misfkt_cav, misfkb_cav, rhisf_tbl_cav, rfrac_tbl_cav, risf_cav_tsc, risf_cav_tsc_b, tsa) 
     54         ! 
     55         ! parametrisation case 
     56         IF ( ln_isfpar_mlt ) CALL tra_isf_mlt(misfkt_par, misfkb_par, rhisf_tbl_par, rfrac_tbl_par, risf_par_tsc, risf_par_tsc_b, tsa) 
     57         ! 
     58      END IF 
    5559      ! 
    5660      ! ice sheet coupling case 
    57       IF ( ll_isfcpl .AND. kt == nit000 ) CALL tra_isf_cpl(risfcpl_tsc, tsa) 
    58       ! 
    59       ! ice sheet coupling case ( 
    60       IF ( ll_isfcpl_cons ) CALL tra_isf_cpl(risfcpl_cons_tsc, tsa) 
     61      IF ( ll_isfcpl ) THEN 
     62         ! 
     63         IF ( kt == nit000 ) CALL tra_isf_cpl(risfcpl_tsc, tsa) 
     64         ! 
     65         ! ensure 0 trend due to unconservation of the ice shelf coupling 
     66         IF ( ll_isfcpl_cons ) CALL tra_isf_cpl(risfcpl_cons_tsc, tsa) 
     67         ! 
     68      END IF 
    6169      ! 
    6270      IF( ln_timing )   CALL timing_stop('tra_isf') 
     
    95103            ! 
    96104            ! level fully include in the ice shelf boundary layer 
    97             ! sign - because fwf sign of evapo (rnf sign of precip) 
    98105            DO jk = ikt, ikb - 1 
    99106               pts(ji,jj,jk,jp_tem) = pts(ji,jj,jk,jp_tem) + ztc(ji,jj) 
     
    117124      REAL(wp), DIMENSION(jpi,jpj,jpk,jpts), INTENT(inout) :: ptsa 
    118125      !!---------------------------------------------------------------------- 
    119       REAL(wp), DIMENSION(jpi,jpj,jpk,jpts), INTENT(in   ) :: ptsc  !( >0 out ) 
     126      REAL(wp), DIMENSION(jpi,jpj,jpk,jpts), INTENT(in   ) :: ptsc 
    120127      !!---------------------------------------------------------------------- 
    121128      INTEGER :: jk 
  • NEMO/branches/2019/ENHANCE-02_ISF_nemo/src/OCE/step.F90

    r11403 r11521  
    3939   ! 
    4040   USE iom              ! xIOs server 
     41   USE isf 
    4142 
    4243   IMPLICIT NONE 
     
    113114      IF( ln_apr_dyn )   CALL sbc_apr ( kstp )                   ! atmospheric pressure (NB: call before bdy_dta which needs ssh_ib)  
    114115      IF( ln_bdy     )   CALL bdy_dta ( kstp, time_offset=+1 )   ! update dynamic & tracer data at open boundaries 
    115       IF( ln_isf     )   CALL isf_stp ( kstp ) 
     116      IF( ln_isf     .OR. ll_isfcpl )   CALL isf_stp ( kstp ) 
    116117                         CALL sbc     ( kstp )                   ! Sea Boundary Condition (including sea-ice) 
    117118 
     
    241242                         CALL tra_sbc       ( kstp )  ! surface boundary condition 
    242243      IF( ln_traqsr  )   CALL tra_qsr       ( kstp )  ! penetrative solar radiation qsr 
    243       IF( ln_isf     )  CALL tra_isf       ( kstp )  ! ice shelf heat flux 
     244      IF( ln_isf .OR. ll_isfcpl ) CALL tra_isf       ( kstp )  ! ice shelf heat flux 
    244245      IF( ln_trabbc  )   CALL tra_bbc       ( kstp )  ! bottom heat flux 
    245246      IF( ln_trabbl  )   CALL tra_bbl       ( kstp )  ! advective (and/or diffusive) bottom boundary layer scheme 
Note: See TracChangeset for help on using the changeset viewer.