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 12252 for NEMO/branches/2019/dev_r11943_MERGE_2019/src – NEMO

Ignore:
Timestamp:
2019-12-14T14:57:23+01:00 (4 years ago)
Author:
smasson
Message:

rev12240_dev_r11943_MERGE_2019: same as [12251], merge trunk 12072:12248, all sette tests ok, GYRE_PISCES, AMM12, ISOMIP, VORTEX intentical to 12236

Location:
NEMO/branches/2019/dev_r11943_MERGE_2019/src
Files:
1 deleted
20 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2019/dev_r11943_MERGE_2019/src/ICE/icedyn_adv.F90

    r11960 r12252  
    8888      CASE( np_advPRA )                ! PRATHER scheme        ! 
    8989         !                             !-----------------------! 
    90          CALL ice_dyn_adv_pra(         kt, u_ice, v_ice, & 
     90         CALL ice_dyn_adv_pra(         kt, u_ice, v_ice, h_i, h_s, h_ip, & 
    9191            &                          ato_i, v_i, v_s, sv_i, oa_i, a_i, a_ip, v_ip, e_s, e_i ) 
    9292      END SELECT 
  • NEMO/branches/2019/dev_r11943_MERGE_2019/src/ICE/icedyn_adv_pra.F90

    r11812 r12252  
    5454CONTAINS 
    5555 
    56    SUBROUTINE ice_dyn_adv_pra( kt, pu_ice, pv_ice,  & 
     56   SUBROUTINE ice_dyn_adv_pra(         kt, pu_ice, pv_ice, ph_i, ph_s, ph_ip,  & 
    5757      &                        pato_i, pv_i, pv_s, psv_i, poa_i, pa_i, pa_ip, pv_ip, pe_s, pe_i ) 
    5858      !!---------------------------------------------------------------------- 
     
    7070      REAL(wp), DIMENSION(:,:)    , INTENT(in   ) ::   pu_ice     ! ice i-velocity 
    7171      REAL(wp), DIMENSION(:,:)    , INTENT(in   ) ::   pv_ice     ! ice j-velocity 
     72      REAL(wp), DIMENSION(:,:,:)  , INTENT(in   ) ::   ph_i       ! ice thickness 
     73      REAL(wp), DIMENSION(:,:,:)  , INTENT(in   ) ::   ph_s       ! snw thickness 
     74      REAL(wp), DIMENSION(:,:,:)  , INTENT(in   ) ::   ph_ip      ! ice pond thickness 
    7275      REAL(wp), DIMENSION(:,:)    , INTENT(inout) ::   pato_i     ! open water area 
    7376      REAL(wp), DIMENSION(:,:,:)  , INTENT(inout) ::   pv_i       ! ice volume 
     
    8790      REAL(wp), DIMENSION(jpi,jpj)            ::   zati1, zati2 
    8891      REAL(wp), DIMENSION(jpi,jpj)            ::   zudy, zvdx 
     92      REAL(wp), DIMENSION(jpi,jpj,jpl)        ::   zhi_max, zhs_max, zhip_max 
    8993      REAL(wp), DIMENSION(jpi,jpj,jpl)        ::   zarea 
    9094      REAL(wp), DIMENSION(jpi,jpj,jpl)        ::   z0ice, z0snw, z0ai, z0smi, z0oi 
     
    9599      ! 
    96100      IF( kt == nit000 .AND. lwp )   WRITE(numout,*) '-- ice_dyn_adv_pra: Prather advection scheme' 
     101      ! 
     102      ! --- Record max of the surrounding 9-pts ice thick. (for call Hbig) --- ! 
     103      DO jl = 1, jpl 
     104         DO jj = 2, jpjm1 
     105            DO ji = fs_2, fs_jpim1 
     106               zhip_max(ji,jj,jl) = MAX( epsi20, ph_ip(ji,jj,jl), ph_ip(ji+1,jj  ,jl), ph_ip(ji  ,jj+1,jl), & 
     107                  &                                               ph_ip(ji-1,jj  ,jl), ph_ip(ji  ,jj-1,jl), & 
     108                  &                                               ph_ip(ji+1,jj+1,jl), ph_ip(ji-1,jj-1,jl), & 
     109                  &                                               ph_ip(ji+1,jj-1,jl), ph_ip(ji-1,jj+1,jl) ) 
     110               zhi_max (ji,jj,jl) = MAX( epsi20, ph_i (ji,jj,jl), ph_i (ji+1,jj  ,jl), ph_i (ji  ,jj+1,jl), & 
     111                  &                                               ph_i (ji-1,jj  ,jl), ph_i (ji  ,jj-1,jl), & 
     112                  &                                               ph_i (ji+1,jj+1,jl), ph_i (ji-1,jj-1,jl), & 
     113                  &                                               ph_i (ji+1,jj-1,jl), ph_i (ji-1,jj+1,jl) ) 
     114               zhs_max (ji,jj,jl) = MAX( epsi20, ph_s (ji,jj,jl), ph_s (ji+1,jj  ,jl), ph_s (ji  ,jj+1,jl), & 
     115                  &                                               ph_s (ji-1,jj  ,jl), ph_s (ji  ,jj-1,jl), & 
     116                  &                                               ph_s (ji+1,jj+1,jl), ph_s (ji-1,jj-1,jl), & 
     117                  &                                               ph_s (ji+1,jj-1,jl), ph_s (ji-1,jj+1,jl) ) 
     118            END DO 
     119         END DO 
     120      END DO 
     121      CALL lbc_lnk_multi( 'icedyn_adv_pra', zhi_max, 'T', 1., zhs_max, 'T', 1., zhip_max, 'T', 1. ) 
    97122      ! 
    98123      ! --- If ice drift is too fast, use  subtime steps for advection (CFL test for stability) --- ! 
     
    239264         !     (because advected fields are not perfectly bounded and tiny negative values can occur, e.g. -1.e-20) 
    240265         CALL ice_var_zapneg( zdt, pato_i, pv_i, pv_s, psv_i, poa_i, pa_i, pa_ip, pv_ip, pe_s, pe_i ) 
     266         ! 
     267         ! --- Make sure ice thickness is not too big --- ! 
     268         !     (because ice thickness can be too large where ice concentration is very small) 
     269         CALL Hbig( zdt, zhi_max, zhs_max, zhip_max, pv_i, pv_s, pa_i, pa_ip, pv_ip, pe_s ) 
    241270         ! 
    242271         ! --- Ensure snow load is not too big --- ! 
     
    588617      ! 
    589618   END SUBROUTINE adv_y 
     619 
     620 
     621   SUBROUTINE Hbig( pdt, phi_max, phs_max, phip_max, pv_i, pv_s, pa_i, pa_ip, pv_ip, pe_s ) 
     622      !!------------------------------------------------------------------- 
     623      !!                  ***  ROUTINE Hbig  *** 
     624      !! 
     625      !! ** Purpose : Thickness correction in case advection scheme creates 
     626      !!              abnormally tick ice or snow 
     627      !! 
     628      !! ** Method  : 1- check whether ice thickness is larger than the surrounding 9-points 
     629      !!                 (before advection) and reduce it by adapting ice concentration 
     630      !!              2- check whether snow thickness is larger than the surrounding 9-points 
     631      !!                 (before advection) and reduce it by sending the excess in the ocean 
     632      !! 
     633      !! ** input   : Max thickness of the surrounding 9-points 
     634      !!------------------------------------------------------------------- 
     635      REAL(wp)                    , INTENT(in   ) ::   pdt                          ! tracer time-step 
     636      REAL(wp), DIMENSION(:,:,:)  , INTENT(in   ) ::   phi_max, phs_max, phip_max   ! max ice thick from surrounding 9-pts 
     637      REAL(wp), DIMENSION(:,:,:)  , INTENT(inout) ::   pv_i, pv_s, pa_i, pa_ip, pv_ip 
     638      REAL(wp), DIMENSION(:,:,:,:), INTENT(inout) ::   pe_s 
     639      ! 
     640      INTEGER  ::   ji, jj, jl         ! dummy loop indices 
     641      REAL(wp) ::   z1_dt, zhip, zhi, zhs, zfra 
     642      !!------------------------------------------------------------------- 
     643      ! 
     644      z1_dt = 1._wp / pdt 
     645      ! 
     646      DO jl = 1, jpl 
     647 
     648         DO jj = 1, jpj 
     649            DO ji = 1, jpi 
     650               IF ( pv_i(ji,jj,jl) > 0._wp ) THEN 
     651                  ! 
     652                  !                               ! -- check h_ip -- ! 
     653                  ! if h_ip is larger than the surrounding 9 pts => reduce h_ip and increase a_ip 
     654                  IF( ln_pnd_H12 .AND. pv_ip(ji,jj,jl) > 0._wp ) THEN 
     655                     zhip = pv_ip(ji,jj,jl) / MAX( epsi20, pa_ip(ji,jj,jl) ) 
     656                     IF( zhip > phip_max(ji,jj,jl) .AND. pa_ip(ji,jj,jl) < 0.15 ) THEN 
     657                        pa_ip(ji,jj,jl) = pv_ip(ji,jj,jl) / phip_max(ji,jj,jl) 
     658                     ENDIF 
     659                  ENDIF 
     660                  ! 
     661                  !                               ! -- check h_i -- ! 
     662                  ! if h_i is larger than the surrounding 9 pts => reduce h_i and increase a_i 
     663                  zhi = pv_i(ji,jj,jl) / pa_i(ji,jj,jl) 
     664                  IF( zhi > phi_max(ji,jj,jl) .AND. pa_i(ji,jj,jl) < 0.15 ) THEN 
     665                     pa_i(ji,jj,jl) = pv_i(ji,jj,jl) / MIN( phi_max(ji,jj,jl), hi_max(jpl) )   !-- bound h_i to hi_max (99 m) 
     666                  ENDIF 
     667                  ! 
     668                  !                               ! -- check h_s -- ! 
     669                  ! if h_s is larger than the surrounding 9 pts => put the snow excess in the ocean 
     670                  zhs = pv_s(ji,jj,jl) / pa_i(ji,jj,jl) 
     671                  IF( pv_s(ji,jj,jl) > 0._wp .AND. zhs > phs_max(ji,jj,jl) .AND. pa_i(ji,jj,jl) < 0.15 ) THEN 
     672                     zfra = phs_max(ji,jj,jl) / MAX( zhs, epsi20 ) 
     673                     ! 
     674                     wfx_res(ji,jj) = wfx_res(ji,jj) + ( pv_s(ji,jj,jl) - pa_i(ji,jj,jl) * phs_max(ji,jj,jl) ) * rhos * z1_dt 
     675                     hfx_res(ji,jj) = hfx_res(ji,jj) - SUM( pe_s(ji,jj,1:nlay_s,jl) ) * ( 1._wp - zfra ) * z1_dt ! W.m-2 <0 
     676                     ! 
     677                     pe_s(ji,jj,1:nlay_s,jl) = pe_s(ji,jj,1:nlay_s,jl) * zfra 
     678                     pv_s(ji,jj,jl)          = pa_i(ji,jj,jl) * phs_max(ji,jj,jl) 
     679                  ENDIF            
     680                  !                   
     681               ENDIF 
     682            END DO 
     683         END DO 
     684      END DO  
     685      ! 
     686   END SUBROUTINE Hbig 
    590687 
    591688 
  • NEMO/branches/2019/dev_r11943_MERGE_2019/src/ICE/icedyn_adv_umx.F90

    r11627 r12252  
    352352         CALL ice_var_zapneg( zdt, pato_i, pv_i, pv_s, psv_i, poa_i, pa_i, pa_ip, pv_ip, pe_s, pe_i ) 
    353353         ! 
    354          ! Make sure ice thickness is not too big 
    355          !    (because ice thickness can be too large where ice concentration is very small) 
    356          CALL Hbig( zdt, zhi_max, zhs_max, zhip_max, pv_i, pv_s, psv_i, poa_i, pa_i, pa_ip, pv_ip, pe_s, pe_i ) 
    357  
     354         ! --- Make sure ice thickness is not too big --- ! 
     355         !     (because ice thickness can be too large where ice concentration is very small) 
     356         CALL Hbig( zdt, zhi_max, zhs_max, zhip_max, pv_i, pv_s, pa_i, pa_ip, pv_ip, pe_s ) 
     357         ! 
     358         ! --- Ensure snow load is not too big --- ! 
     359         CALL Hsnow( zdt, pv_i, pv_s, pa_i, pa_ip, pe_s ) 
     360         ! 
    358361      END DO 
    359362      ! 
     
    15141517 
    15151518 
    1516    SUBROUTINE Hbig( pdt, phi_max, phs_max, phip_max, pv_i, pv_s, psv_i, poa_i, pa_i, pa_ip, pv_ip, pe_s, pe_i ) 
     1519   SUBROUTINE Hbig( pdt, phi_max, phs_max, phip_max, pv_i, pv_s, pa_i, pa_ip, pv_ip, pe_s ) 
    15171520      !!------------------------------------------------------------------- 
    15181521      !!                  ***  ROUTINE Hbig  *** 
     
    15251528      !!              2- check whether snow thickness is larger than the surrounding 9-points 
    15261529      !!                 (before advection) and reduce it by sending the excess in the ocean 
    1527       !!              3- check whether snow load deplets the snow-ice interface below sea level$ 
    1528       !!                 and reduce it by sending the excess in the ocean 
    1529       !!              4- correct pond concentration to avoid a_ip > a_i 
    15301530      !! 
    15311531      !! ** input   : Max thickness of the surrounding 9-points 
     
    15331533      REAL(wp)                    , INTENT(in   ) ::   pdt                          ! tracer time-step 
    15341534      REAL(wp), DIMENSION(:,:,:)  , INTENT(in   ) ::   phi_max, phs_max, phip_max   ! max ice thick from surrounding 9-pts 
    1535       REAL(wp), DIMENSION(:,:,:)  , INTENT(inout) ::   pv_i, pv_s, psv_i, poa_i, pa_i, pa_ip, pv_ip 
     1535      REAL(wp), DIMENSION(:,:,:)  , INTENT(inout) ::   pv_i, pv_s, pa_i, pa_ip, pv_ip 
    15361536      REAL(wp), DIMENSION(:,:,:,:), INTENT(inout) ::   pe_s 
    1537       REAL(wp), DIMENSION(:,:,:,:), INTENT(inout) ::   pe_i 
    1538       ! 
    1539       INTEGER  ::   ji, jj, jk, jl         ! dummy loop indices 
    1540       REAL(wp) ::   z1_dt, zhip, zhi, zhs, zvs_excess, zfra 
    1541       REAL(wp), DIMENSION(jpi,jpj) ::   zswitch 
     1537      ! 
     1538      INTEGER  ::   ji, jj, jl         ! dummy loop indices 
     1539      REAL(wp) ::   z1_dt, zhip, zhi, zhs, zfra 
    15421540      !!------------------------------------------------------------------- 
    15431541      ! 
     
    15781576                     pv_s(ji,jj,jl)          = pa_i(ji,jj,jl) * phs_max(ji,jj,jl) 
    15791577                  ENDIF            
     1578                  !                   
     1579               ENDIF 
     1580            END DO 
     1581         END DO 
     1582      END DO  
     1583      ! 
     1584   END SUBROUTINE Hbig 
     1585 
     1586 
     1587   SUBROUTINE Hsnow( pdt, pv_i, pv_s, pa_i, pa_ip, pe_s ) 
     1588      !!------------------------------------------------------------------- 
     1589      !!                  ***  ROUTINE Hsnow  *** 
     1590      !! 
     1591      !! ** Purpose : 1- Check snow load after advection 
     1592      !!              2- Correct pond concentration to avoid a_ip > a_i 
     1593      !! 
     1594      !! ** Method :  If snow load makes snow-ice interface to deplet below the ocean surface 
     1595      !!              then put the snow excess in the ocean 
     1596      !! 
     1597      !! ** Notes :   This correction is crucial because of the call to routine icecor afterwards 
     1598      !!              which imposes a mini of ice thick. (rn_himin). This imposed mini can artificially 
     1599      !!              make the snow very thick (if concentration decreases drastically) 
     1600      !!              This behavior has been seen in Ultimate-Macho and supposedly it can also be true for Prather 
     1601      !!------------------------------------------------------------------- 
     1602      REAL(wp)                    , INTENT(in   ) ::   pdt   ! tracer time-step 
     1603      REAL(wp), DIMENSION(:,:,:)  , INTENT(inout) ::   pv_i, pv_s, pa_i, pa_ip 
     1604      REAL(wp), DIMENSION(:,:,:,:), INTENT(inout) ::   pe_s 
     1605      ! 
     1606      INTEGER  ::   ji, jj, jl   ! dummy loop indices 
     1607      REAL(wp) ::   z1_dt, zvs_excess, zfra 
     1608      !!------------------------------------------------------------------- 
     1609      ! 
     1610      z1_dt = 1._wp / pdt 
     1611      ! 
     1612      ! -- check snow load -- ! 
     1613      DO jl = 1, jpl 
     1614         DO jj = 1, jpj 
     1615            DO ji = 1, jpi 
     1616               IF ( pv_i(ji,jj,jl) > 0._wp ) THEN 
    15801617                  ! 
    1581                   !                               ! -- check snow load -- ! 
    1582                   ! if snow load makes snow-ice interface to deplet below the ocean surface => put the snow excess in the ocean 
    1583                   !    this correction is crucial because of the call to routine icecor afterwards which imposes a mini of ice thick. (rn_himin) 
    1584                   !    this imposed mini can artificially make the snow very thick (if concentration decreases drastically) 
    15851618                  zvs_excess = MAX( 0._wp, pv_s(ji,jj,jl) - pv_i(ji,jj,jl) * (rau0-rhoi) * r1_rhos ) 
    1586                   IF( zvs_excess > 0._wp ) THEN 
     1619                  ! 
     1620                  IF( zvs_excess > 0._wp ) THEN   ! snow-ice interface deplets below the ocean surface 
     1621                     ! put snow excess in the ocean 
    15871622                     zfra = ( pv_s(ji,jj,jl) - zvs_excess ) / MAX( pv_s(ji,jj,jl), epsi20 ) 
    15881623                     wfx_res(ji,jj) = wfx_res(ji,jj) + zvs_excess * rhos * z1_dt 
    15891624                     hfx_res(ji,jj) = hfx_res(ji,jj) - SUM( pe_s(ji,jj,1:nlay_s,jl) ) * ( 1._wp - zfra ) * z1_dt ! W.m-2 <0 
    1590                      ! 
     1625                     ! correct snow volume and heat content 
    15911626                     pe_s(ji,jj,1:nlay_s,jl) = pe_s(ji,jj,1:nlay_s,jl) * zfra 
    15921627                     pv_s(ji,jj,jl)          = pv_s(ji,jj,jl) - zvs_excess 
    15931628                  ENDIF 
    1594                    
     1629                  ! 
    15951630               ENDIF 
    15961631            END DO 
    15971632         END DO 
    1598       END DO  
    1599       !                                           !-- correct pond concentration to avoid a_ip > a_i 
     1633      END DO 
     1634      ! 
     1635      !-- correct pond concentration to avoid a_ip > a_i -- ! 
    16001636      WHERE( pa_ip(:,:,:) > pa_i(:,:,:) )   pa_ip(:,:,:) = pa_i(:,:,:) 
    16011637      ! 
    1602       ! 
    1603    END SUBROUTINE Hbig 
    1604     
     1638   END SUBROUTINE Hsnow 
     1639 
     1640 
    16051641#else 
    16061642   !!---------------------------------------------------------------------- 
  • NEMO/branches/2019/dev_r11943_MERGE_2019/src/OCE/BDY/bdyini.F90

    r12205 r12252  
    395395      jpbdta = MAXVAL(nblendta(1:jpbgrd,1:nb_bdy)) 
    396396      ALLOCATE( nbidta(jpbdta, jpbgrd, nb_bdy), nbjdta(jpbdta, jpbgrd, nb_bdy), nbrdta(jpbdta, jpbgrd, nb_bdy) ) 
    397      
     397      nbrdta(:,:,:) = 0   ! initialize nbrdta as it may not be completely defined for each bdy 
     398       
    398399      ! Calculate global boundary index arrays or read in from file 
    399400      !------------------------------------------------------------                
  • NEMO/branches/2019/dev_r11943_MERGE_2019/src/OCE/BDY/bdyvol.F90

    r12150 r12252  
    143143      ! Check the cumulated transport through unstructured OBC once barotropic velocities corrected 
    144144      ! ------------------------------------------------------ 
    145       IF( MOD( kt, nn_write ) == 0 .AND. ( kc == 1 ) ) THEN 
     145      IF( MOD( kt, MAX(nn_write,1) ) == 0 .AND. ( kc == 1 ) ) THEN 
    146146         ! 
    147147         ! compute residual transport across boundary 
  • NEMO/branches/2019/dev_r11943_MERGE_2019/src/OCE/DIA/diawri.F90

    r12182 r12252  
    4949   USE lbclnk         ! ocean lateral boundary conditions (or mpp link) 
    5050   USE in_out_manager ! I/O manager 
    51    USE diatmb         ! Top,middle,bottom output 
    5251   USE dia25h         ! 25h Mean output 
    5352   USE iom            !  
     
    399398      CALL iom_put( "bn2", rn2 )                      ! Brunt-Vaisala buoyancy frequency (N^2) 
    400399      ! 
    401  
    402       IF (ln_diatmb)   CALL dia_tmb( Kmm )            ! tmb values  
    403            
     400       
    404401      IF (ln_dia25h)   CALL dia_25h( kt, Kmm )        ! 25h averaging 
    405402 
  • NEMO/branches/2019/dev_r11943_MERGE_2019/src/OCE/DYN/divhor.F90

    r12150 r12252  
    7373         IF(lwp) WRITE(numout,*) 'div_hor : horizontal velocity divergence ' 
    7474         IF(lwp) WRITE(numout,*) '~~~~~~~   ' 
     75         hdiv(:,:,:) = 0._wp    ! initialize hdiv for the halos at the first time step 
    7576      ENDIF 
    7677      ! 
  • NEMO/branches/2019/dev_r11943_MERGE_2019/src/OCE/DYN/dynspg_ts.F90

    r12250 r12252  
    4646   USE tide_mod        ! 
    4747   USE sbcwave         ! surface wave 
    48    USE diatmb          ! Top,middle,bottom output 
    4948#if defined key_agrif 
    5049   USE agrif_oce_interp ! agrif 
     
    6160   USE iom             ! IOM library 
    6261   USE restart         ! only for lrst_oce 
    63    USE diatmb          ! Top,middle,bottom output 
    6462 
    6563   USE iom   ! to remove 
     
    154152      REAL(wp) ::   r1_2dt_b, z1_hu, z1_hv          ! local scalars 
    155153      REAL(wp) ::   za0, za1, za2, za3              !   -      - 
    156       REAL(wp) ::   zmdi, zztmp, zldg               !   -      - 
     154      REAL(wp) ::   zztmp, zldg               !   -      - 
    157155      REAL(wp) ::   zhu_bck, zhv_bck, zhdiv         !   -      - 
    158156      REAL(wp) ::   zun_save, zvn_save              !   -      - 
     
    178176      !                                         !* Allocate temporary arrays 
    179177      IF( ln_wd_dl ) ALLOCATE( ztwdmask(jpi,jpj), zuwdmask(jpi,jpj), zvwdmask(jpi,jpj), zuwdav2(jpi,jpj), zvwdav2(jpi,jpj)) 
    180       ! 
    181       zmdi=1.e+20                               !  missing data indicator for masking 
    182178      ! 
    183179      zwdramp = r_rn_wdmin1               ! simplest ramp  
     
    835831      IF( ln_wd_dl )   DEALLOCATE( ztwdmask, zuwdmask, zvwdmask, zuwdav2, zvwdav2 ) 
    836832      ! 
    837       IF( ln_diatmb ) THEN 
    838          CALL iom_put( "baro_u" , puu_b(:,:,Kmm)*ssumask(:,:)+zmdi*(1.-ssumask(:,:) ) )  ! Barotropic  U Velocity 
    839          CALL iom_put( "baro_v" , pvv_b(:,:,Kmm)*ssvmask(:,:)+zmdi*(1.-ssvmask(:,:) ) )  ! Barotropic  V Velocity 
    840       ENDIF 
     833      CALL iom_put( "baro_u" , puu_b(:,:,Kmm) )  ! Barotropic  U Velocity 
     834      CALL iom_put( "baro_v" , pvv_b(:,:,Kmm) )  ! Barotropic  V Velocity 
    841835      ! 
    842836   END SUBROUTINE dyn_spg_ts 
  • NEMO/branches/2019/dev_r11943_MERGE_2019/src/OCE/IOM/iom.F90

    r12205 r12252  
    837837      CHARACTER(LEN=100)    ::   clinfo    ! info character 
    838838      !--------------------------------------------------------------------- 
     839      ! 
     840      IF( iom_open_init == 0 )   RETURN   ! avoid to use iom_file(jf)%nfid that us not yet initialized 
    839841      ! 
    840842      clinfo = '                    iom_close ~~~  ' 
  • NEMO/branches/2019/dev_r11943_MERGE_2019/src/OCE/LDF/ldfdyn.F90

    r11960 r12252  
    416416            ! 
    417417            zcmsmag   = (rn_csmc/rpi)**2                                            ! (C_smag/pi)^2 
    418             zstabf_lo = rn_minfac * rn_minfac / ( 2._wp * 4._wp * zcmsmag )        ! lower limit stability factor scaling 
     418            zstabf_lo = rn_minfac * rn_minfac / ( 2._wp * 12._wp * 12._wp * zcmsmag ) ! lower limit stability factor scaling 
    419419            zstabf_up = rn_maxfac / ( 4._wp * zcmsmag * 2._wp * rdt )               ! upper limit stability factor scaling 
    420420            IF( ln_dynldf_blp ) zstabf_lo = ( 16._wp / 9._wp ) * zstabf_lo          ! provide |U|L^3/12 lower limit instead  
  • NEMO/branches/2019/dev_r11943_MERGE_2019/src/OCE/LDF/ldfslp.F90

    r12236 r12252  
    209209               zbu = MIN(  zbu, - z1_slpmax * ABS( zau ) , -7.e+3_wp/e3u(ji,jj,jk,Kmm)* ABS( zau )  ) 
    210210               zbv = MIN(  zbv, - z1_slpmax * ABS( zav ) , -7.e+3_wp/e3v(ji,jj,jk,Kmm)* ABS( zav )  ) 
     211               !                                      ! Fred Dupont: add a correction for bottom partial steps: 
     212               !                                      !              max slope = 1/2 * e3 / e1 
     213               IF (ln_zps .AND. jk==mbku(ji,jj)) & 
     214                  zbu = MIN(  zbu, - z1_slpmax * ABS( zau ) , - 2._wp * e1u(ji,jj) / e3u(ji,jj,jk,Kmm)* ABS( zau )  ) 
     215               IF (ln_zps .AND. jk==mbkv(ji,jj)) & 
     216                  zbv = MIN(  zbv, - z1_slpmax * ABS( zav ) , - 2._wp * e2v(ji,jj) / e3v(ji,jj,jk,Kmm)* ABS( zav )  ) 
    211217               !                                      ! uslp and vslp output in zwz and zww, resp. 
    212218               zfi = MAX( omlmask(ji,jj,jk), omlmask(ji+1,jj,jk) ) 
     
    405411      REAL(wp) ::   zbeta0, ze3_e1, ze3_e2 
    406412      REAL(wp), DIMENSION(jpi,jpj)     ::   z1_mlbw 
    407       REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zalbet 
    408413      REAL(wp), DIMENSION(jpi,jpj,jpk,0:1) ::   zdxrho , zdyrho, zdzrho     ! Horizontal and vertical density gradients 
    409414      REAL(wp), DIMENSION(jpi,jpj,0:1,0:1) ::   zti_mlb, ztj_mlb            ! for Griffies operator only 
     
    461466                     zdks = 0._wp 
    462467                  ENDIF 
    463                   zdzrho_raw = ( - rab_b(ji,jj,jk+kp,jp_tem) * zdkt &  
    464                              &   + rab_b(ji,jj,jk+kp,jp_sal) * zdks & 
     468                  zdzrho_raw = ( - rab_b(ji,jj,jk   ,jp_tem) * zdkt &  
     469                             &   + rab_b(ji,jj,jk   ,jp_sal) * zdks & 
    465470                             & ) / e3w(ji,jj,jk+kp,Kmm)   
    466471                  zdzrho(ji,jj,jk,kp) = - MIN( - repsln , zdzrho_raw )    ! force zdzrho >= repsln 
  • NEMO/branches/2019/dev_r11943_MERGE_2019/src/OCE/SBC/cpl_oasis3.F90

    r12236 r12252  
    306306      ! End of definition phase 
    307307      !------------------------------------------------------------------ 
    308        
     308      !      
     309#if defined key_agrif 
     310      IF( agrif_fixed() == Agrif_Nb_Fine_Grids() ) THEN 
     311#endif 
    309312      CALL oasis_enddef(nerror) 
    310313      IF( nerror /= OASIS_Ok )   CALL oasis_abort ( ncomp_id, 'cpl_define', 'Failure in oasis_enddef') 
     314#if defined key_agrif 
     315      ENDIF 
     316#endif 
    311317      ! 
    312318      IF( ltmp_wapatch ) THEN 
     
    357363                     WRITE(numout,*) 'oasis_put:  kstep ', kstep 
    358364                     WRITE(numout,*) 'oasis_put:   info ', kinfo 
    359                      WRITE(numout,*) '     - Minimum value is ', MINVAL(pdata(:,:,jc)) 
    360                      WRITE(numout,*) '     - Maximum value is ', MAXVAL(pdata(:,:,jc)) 
    361                      WRITE(numout,*) '     -     Sum value is ', SUM(pdata(:,:,jc)) 
     365                     WRITE(numout,*) '     - Minimum value is ', MINVAL(pdata(nldi:nlei,nldj:nlej,jc)) 
     366                     WRITE(numout,*) '     - Maximum value is ', MAXVAL(pdata(nldi:nlei,nldj:nlej,jc)) 
     367                     WRITE(numout,*) '     -     Sum value is ', SUM(pdata(nldi:nlei,nldj:nlej,jc)) 
    362368                     WRITE(numout,*) '****************' 
    363369                  ENDIF 
  • NEMO/branches/2019/dev_r11943_MERGE_2019/src/OCE/SBC/sbc_oce.F90

    r12199 r12252  
    107107   !!              Ocean Surface Boundary Condition fields 
    108108   !!---------------------------------------------------------------------- 
    109    INTEGER , PUBLIC ::  ncpl_qsr_freq            !: qsr coupling frequency per days from atmosphere 
     109   INTEGER , PUBLIC ::  ncpl_qsr_freq = 0        !: qsr coupling frequency per days from atmosphere (used by top) 
    110110   ! 
    111111   !!                                   !!   now    ! before   !! 
  • NEMO/branches/2019/dev_r11943_MERGE_2019/src/OCE/SBC/sbccpl.F90

    r12193 r12252  
    571571      IF( TRIM( sn_rcv_emp%clcat    ) == 'yes' )   srcv(jpr_ievp)%nct       = nn_cats_cpl 
    572572 
     573#if defined key_si3 
     574      IF( ln_cndflx .AND. .NOT.ln_cndemulate ) THEN  
     575         IF( .NOT.srcv(jpr_ts_ice)%laction )  & 
     576            &   CALL ctl_stop( 'sbc_cpl_init: srcv(jpr_ts_ice)%laction should be set to true when ln_cndflx=T' )      
     577      ENDIF 
     578#endif 
    573579      !                                                      ! ------------------------- ! 
    574580      !                                                      !      Wave breaking        !     
     
    860866      ELSE IF( sn_snd_crt%clvgrd /= 'T' ) THEN   
    861867         CALL ctl_stop( 'sn_snd_crt%clvgrd must be equal to T' ) 
    862          ssnd(jps_ocx1:jps_ivz1)%clgrid  = 'T'      ! all oce and ice components on the same unique grid 
    863868      ENDIF 
    864869      ssnd(jps_ocx1:jps_ivz1)%laction = .TRUE.   ! default: all are send 
     
    10381043      ENDIF 
    10391044      xcplmask(:,:,0) = 1. - SUM( xcplmask(:,:,1:nn_cplmodel), dim = 3 ) 
    1040       ! 
    1041       ncpl_qsr_freq = cpl_freq( 'O_QsrOce' ) + cpl_freq( 'O_QsrMix' ) + cpl_freq( 'I_QsrOce' ) + cpl_freq( 'I_QsrMix' ) 
    1042       IF( ln_dm2dc .AND. ln_cpl .AND. ncpl_qsr_freq /= 86400 )   & 
    1043          &   CALL ctl_stop( 'sbc_cpl_init: diurnal cycle reconstruction (ln_dm2dc) needs daily couping for solar radiation' ) 
    1044       IF( ln_dm2dc .AND. ln_cpl ) ncpl_qsr_freq = 86400 / ncpl_qsr_freq 
    10451045      ! 
    10461046   END SUBROUTINE sbc_cpl_init 
     
    11091109      REAL(wp), DIMENSION(jpi,jpj) ::   ztx, zty, zmsk, zemp, zqns, zqsr 
    11101110      !!---------------------------------------------------------------------- 
     1111      ! 
     1112      IF( kt == nit000 ) THEN 
     1113      !   cannot be done in the init phase when we use agrif as cpl_freq requires that oasis_enddef is done 
     1114         ncpl_qsr_freq = cpl_freq( 'O_QsrOce' ) + cpl_freq( 'O_QsrMix' ) + cpl_freq( 'I_QsrOce' ) + cpl_freq( 'I_QsrMix' ) 
     1115         IF( ln_dm2dc .AND. ncpl_qsr_freq /= 86400 )   & 
     1116            &   CALL ctl_stop( 'sbc_cpl_rcv: diurnal cycle reconstruction (ln_dm2dc) needs daily couping for solar radiation' ) 
     1117         ncpl_qsr_freq = 86400 / ncpl_qsr_freq   ! used by top 
     1118      ENDIF 
    11111119      ! 
    11121120      IF( ln_mixcpl )   zmsk(:,:) = 1. - xcplmask(:,:,0) 
     
    12421250      IF( srcv(jpr_co2)%laction )   atm_co2(:,:) = frcv(jpr_co2)%z3(:,:,1) 
    12431251      ! 
    1244       !                                                      ! ================== ! 
    1245       !                                                      !   ice skin temp.   ! 
    1246       !                                                      ! ================== ! 
    1247 #if defined key_si3 
    1248       ! needed by Met Office 
    1249       IF( srcv(jpr_ts_ice)%laction ) THEN  
    1250          WHERE    ( frcv(jpr_ts_ice)%z3(:,:,:) > 0.0  )   ;   tsfc_ice(:,:,:) = 0.0  
    1251          ELSEWHERE( frcv(jpr_ts_ice)%z3(:,:,:) < -60. )   ;   tsfc_ice(:,:,:) = -60. 
    1252          ELSEWHERE                                        ;   tsfc_ice(:,:,:) = frcv(jpr_ts_ice)%z3(:,:,:) 
    1253          END WHERE 
    1254       ENDIF  
    1255 #endif 
    12561252      !                                                      ! ========================= !  
    12571253      !                                                      ! Mean Sea Level Pressure   !   (taum)  
     
    16331629      !!                   sprecip           solid precipitation over the ocean   
    16341630      !!---------------------------------------------------------------------- 
    1635       REAL(wp), INTENT(in), DIMENSION(:,:)             ::   picefr     ! ice fraction                [0 to 1] 
    1636       !                                                !!           ! optional arguments, used only in 'mixed oce-ice' case 
    1637       REAL(wp), INTENT(in), DIMENSION(:,:,:), OPTIONAL ::   palbi      ! all skies ice albedo  
    1638       REAL(wp), INTENT(in), DIMENSION(:,:  ), OPTIONAL ::   psst       ! sea surface temperature     [Celsius] 
    1639       REAL(wp), INTENT(in), DIMENSION(:,:,:), OPTIONAL ::   pist       ! ice surface temperature     [Kelvin] 
    1640       REAL(wp), INTENT(in), DIMENSION(:,:,:), OPTIONAL ::   phs        ! snow depth                  [m] 
    1641       REAL(wp), INTENT(in), DIMENSION(:,:,:), OPTIONAL ::   phi        ! ice thickness               [m] 
     1631      REAL(wp), INTENT(in)   , DIMENSION(:,:)             ::   picefr     ! ice fraction                [0 to 1] 
     1632      !                                                   !!           ! optional arguments, used only in 'mixed oce-ice' case or for Met-Office coupling 
     1633      REAL(wp), INTENT(in)   , DIMENSION(:,:,:), OPTIONAL ::   palbi      ! all skies ice albedo  
     1634      REAL(wp), INTENT(in)   , DIMENSION(:,:  ), OPTIONAL ::   psst       ! sea surface temperature     [Celsius] 
     1635      REAL(wp), INTENT(inout), DIMENSION(:,:,:), OPTIONAL ::   pist       ! ice surface temperature     [Kelvin] => inout for Met-Office 
     1636      REAL(wp), INTENT(in)   , DIMENSION(:,:,:), OPTIONAL ::   phs        ! snow depth                  [m] 
     1637      REAL(wp), INTENT(in)   , DIMENSION(:,:,:), OPTIONAL ::   phi        ! ice thickness               [m] 
    16421638      ! 
    16431639      INTEGER  ::   ji, jj, jl   ! dummy loop index 
     
    16461642      REAL(wp), DIMENSION(jpi,jpj)     ::   zemp_tot, zemp_ice, zemp_oce, ztprecip, zsprecip  , zevap_oce, zdevap_ice 
    16471643      REAL(wp), DIMENSION(jpi,jpj)     ::   zqns_tot, zqns_oce, zqsr_tot, zqsr_oce, zqprec_ice, zqemp_oce, zqemp_ice 
    1648       REAL(wp), DIMENSION(jpi,jpj,jpl) ::   zqns_ice, zqsr_ice, zdqns_ice, zqevap_ice, zevap_ice    !!gm , zfrqsr_tr_i 
     1644      REAL(wp), DIMENSION(jpi,jpj,jpl) ::   zqns_ice, zqsr_ice, zdqns_ice, zqevap_ice, zevap_ice, zqtr_ice_top, ztsu 
    16491645      !!---------------------------------------------------------------------- 
    16501646      ! 
     
    18141810! ** NEED TO SORT OUT HOW THIS SHOULD WORK IN THE MULTI-CATEGORY CASE - CURRENTLY NOT ALLOWED WHEN INTERFACE INITIALISED ** 
    18151811         zqns_tot(:,:  ) = frcv(jpr_qnsmix)%z3(:,:,1) 
    1816          zqns_ice(:,:,1) = frcv(jpr_qnsmix)%z3(:,:,1)    & 
    1817             &            + frcv(jpr_dqnsdt)%z3(:,:,1) * ( pist(:,:,1) - ( (rt0 + psst(:,:  ) ) * ziceld(:,:)   & 
    1818             &                                           + pist(:,:,1) * picefr(:,:) ) ) 
     1812         IF ( TRIM(sn_rcv_qsr%clcat) == 'yes' ) THEN 
     1813            DO jl = 1, jpl 
     1814               zqns_ice(:,:,jl) = frcv(jpr_qnsmix)%z3(:,:,jl)    & 
     1815                  &             + frcv(jpr_dqnsdt)%z3(:,:,jl) * ( pist(:,:,jl) - ( ( rt0 + psst(:,:) ) * ziceld(:,:)   & 
     1816                  &                                                                + pist(:,:,jl) * picefr(:,:) ) ) 
     1817            END DO 
     1818         ELSE 
     1819            DO jl = 1, jpl 
     1820               zqns_ice(:,:,jl) = frcv(jpr_qnsmix)%z3(:,:, 1)    & 
     1821                  &             + frcv(jpr_dqnsdt)%z3(:,:, 1) * ( pist(:,:,jl) - ( ( rt0 + psst(:,:) ) * ziceld(:,:)   & 
     1822                  &                                                                + pist(:,:,jl) * picefr(:,:) ) ) 
     1823            END DO 
     1824         ENDIF 
    18191825      END SELECT 
    18201826      !                                      
     
    19301936            END DO 
    19311937         ENDIF 
    1932          zqsr_tot(:,:  ) = frcv(jpr_qsrmix)%z3(:,:,1) 
    1933          zqsr_ice(:,:,1) = frcv(jpr_qsrice)%z3(:,:,1) 
    19341938      CASE( 'oce and ice' ) 
    19351939         zqsr_tot(:,:  ) =  ziceld(:,:) * frcv(jpr_qsroce)%z3(:,:,1) 
     
    19511955!       Create solar heat flux over ice using incoming solar heat flux and albedos 
    19521956!       ( see OASIS3 user guide, 5th edition, p39 ) 
    1953          zqsr_ice(:,:,1) = frcv(jpr_qsrmix)%z3(:,:,1) * ( 1.- palbi(:,:,1) )   & 
    1954             &            / (  1.- ( alb_oce_mix(:,:  ) * ziceld(:,:)       & 
    1955             &                     + palbi      (:,:,1) * picefr(:,:) ) ) 
     1957         IF ( TRIM(sn_rcv_qsr%clcat) == 'yes' ) THEN 
     1958            DO jl = 1, jpl 
     1959               zqsr_ice(:,:,jl) = frcv(jpr_qsrmix)%z3(:,:,jl) * ( 1.- palbi(:,:,jl) )   & 
     1960                  &            / (  1.- ( alb_oce_mix(:,:   ) * ziceld(:,:)       & 
     1961                  &                     + palbi      (:,:,jl) * picefr(:,:) ) ) 
     1962            END DO 
     1963         ELSE 
     1964            DO jl = 1, jpl 
     1965               zqsr_ice(:,:,jl) = frcv(jpr_qsrmix)%z3(:,:, 1) * ( 1.- palbi(:,:,jl) )   & 
     1966                  &            / (  1.- ( alb_oce_mix(:,:   ) * ziceld(:,:)       & 
     1967                  &                     + palbi      (:,:,jl) * picefr(:,:) ) ) 
     1968            END DO 
     1969         ENDIF 
    19561970      CASE( 'none'      )       ! Not available as for now: needs additional coding   
    19571971      !                         ! since fields received, here zqsr_tot,  are not defined with none option 
     
    20132027      !                                                      ! ========================= ! 
    20142028      CASE ('coupled') 
    2015          qml_ice(:,:,:) = frcv(jpr_topm)%z3(:,:,:) 
    2016          qcn_ice(:,:,:) = frcv(jpr_botm)%z3(:,:,:) 
     2029         IF( ln_mixcpl ) THEN 
     2030            DO jl=1,jpl 
     2031               qml_ice(:,:,jl) = qml_ice(:,:,jl) * xcplmask(:,:,0) + frcv(jpr_topm)%z3(:,:,jl) * zmsk(:,:) 
     2032               qcn_ice(:,:,jl) = qcn_ice(:,:,jl) * xcplmask(:,:,0) + frcv(jpr_botm)%z3(:,:,jl) * zmsk(:,:) 
     2033            ENDDO 
     2034         ELSE 
     2035            qml_ice(:,:,:) = frcv(jpr_topm)%z3(:,:,:) 
     2036            qcn_ice(:,:,:) = frcv(jpr_botm)%z3(:,:,:) 
     2037         ENDIF 
    20172038      END SELECT 
    2018       ! 
    20192039      !                                                      ! ========================= ! 
    20202040      !                                                      !      Transmitted Qsr      !   [W/m2] 
     
    20232043         ! 
    20242044         !                    ! ===> used prescribed cloud fraction representative for polar oceans in summer (0.81) 
    2025          ztri = 0.18 * ( 1.0 - cldf_ice ) + 0.35 * cldf_ice    ! surface transmission parameter (Grenfell Maykut 77) 
     2045         ztri = 0.18 * ( 1.0 - cldf_ice ) + 0.35 * cldf_ice    ! surface transmission when hi>10cm (Grenfell Maykut 77) 
    20262046         ! 
    2027          qtr_ice_top(:,:,:) = ztri * qsr_ice(:,:,:) 
    2028          WHERE( phs(:,:,:) >= 0.0_wp )   qtr_ice_top(:,:,:) = 0._wp            ! snow fully opaque 
    2029          WHERE( phi(:,:,:) <= 0.1_wp )   qtr_ice_top(:,:,:) = qsr_ice(:,:,:)   ! thin ice transmits all solar radiation 
     2047         WHERE    ( phs(:,:,:) <= 0._wp .AND. phi(:,:,:) <  0.1_wp )       ! linear decrease from hi=0 to 10cm   
     2048            zqtr_ice_top(:,:,:) = qsr_ice(:,:,:) * ( ztri + ( 1._wp - ztri ) * ( 1._wp - phi(:,:,:) * 10._wp ) ) 
     2049         ELSEWHERE( phs(:,:,:) <= 0._wp .AND. phi(:,:,:) >= 0.1_wp )       ! constant (ztri) when hi>10cm 
     2050            zqtr_ice_top(:,:,:) = qsr_ice(:,:,:) * ztri 
     2051         ELSEWHERE                                                         ! zero when hs>0 
     2052            zqtr_ice_top(:,:,:) = 0._wp 
     2053         END WHERE 
    20302054         !      
    20312055      ELSEIF( ln_cndflx .AND. .NOT.ln_cndemulate ) THEN      !==  conduction flux as surface forcing  ==! 
     
    20332057         !                    ! ===> here we must receive the qtr_ice_top array from the coupler 
    20342058         !                           for now just assume zero (fully opaque ice) 
    2035          qtr_ice_top(:,:,:) = 0._wp 
     2059         zqtr_ice_top(:,:,:) = 0._wp 
     2060         ! 
     2061      ENDIF 
     2062      ! 
     2063      IF( ln_mixcpl ) THEN 
     2064         DO jl=1,jpl 
     2065            qtr_ice_top(:,:,jl) = qtr_ice_top(:,:,jl) * xcplmask(:,:,0) + zqtr_ice_top(:,:,jl) * zmsk(:,:) 
     2066         ENDDO 
     2067      ELSE 
     2068         qtr_ice_top(:,:,:) = zqtr_ice_top(:,:,:) 
     2069      ENDIF 
     2070      !                                                      ! ================== ! 
     2071      !                                                      !   ice skin temp.   ! 
     2072      !                                                      ! ================== ! 
     2073      ! needed by Met Office 
     2074      IF( srcv(jpr_ts_ice)%laction ) THEN  
     2075         WHERE    ( frcv(jpr_ts_ice)%z3(:,:,:) > 0.0  )   ;   ztsu(:,:,:) =   0. + rt0  
     2076         ELSEWHERE( frcv(jpr_ts_ice)%z3(:,:,:) < -60. )   ;   ztsu(:,:,:) = -60. + rt0 
     2077         ELSEWHERE                                        ;   ztsu(:,:,:) = frcv(jpr_ts_ice)%z3(:,:,:) + rt0 
     2078         END WHERE 
     2079         ! 
     2080         IF( ln_mixcpl ) THEN 
     2081            DO jl=1,jpl 
     2082               pist(:,:,jl) = pist(:,:,jl) * xcplmask(:,:,0) + ztsu(:,:,jl) * zmsk(:,:) 
     2083            ENDDO 
     2084         ELSE 
     2085            pist(:,:,:) = ztsu(:,:,:) 
     2086         ENDIF 
    20362087         ! 
    20372088      ENDIF 
     
    21972248         CASE default    ;   CALL ctl_stop( 'sbc_cpl_snd: wrong definition of sn_snd_thick%clcat' ) 
    21982249         END SELECT 
    2199          IF( ssnd(jps_fice)%laction )   CALL cpl_snd( jps_fice, isec, ztmp3, info ) 
     2250         CALL cpl_snd( jps_fice, isec, ztmp3, info ) 
    22002251      ENDIF 
    22012252 
     
    22572308      !                                                      !      Ice melt ponds       !  
    22582309      !                                                      ! ------------------------- ! 
    2259       ! needed by Met Office 
     2310      ! needed by Met Office: 1) fraction of ponded ice 2) local/actual pond depth  
    22602311      IF( ssnd(jps_a_p)%laction .OR. ssnd(jps_ht_p)%laction ) THEN  
    22612312         SELECT CASE( sn_snd_mpnd%cldes)   
     
    22632314            SELECT CASE( sn_snd_mpnd%clcat )   
    22642315            CASE( 'yes' )   
    2265                ztmp3(:,:,1:jpl) =  a_ip(:,:,1:jpl) 
    2266                ztmp4(:,:,1:jpl) =  v_ip(:,:,1:jpl)   
     2316               ztmp3(:,:,1:jpl) =  a_ip_frac(:,:,1:jpl) 
     2317               ztmp4(:,:,1:jpl) =  h_ip(:,:,1:jpl)   
    22672318            CASE( 'no' )   
    22682319               ztmp3(:,:,:) = 0.0   
    22692320               ztmp4(:,:,:) = 0.0   
    22702321               DO jl=1,jpl   
    2271                  ztmp3(:,:,1) = ztmp3(:,:,1) + a_ip(:,:,jpl)   
    2272                  ztmp4(:,:,1) = ztmp4(:,:,1) + v_ip(:,:,jpl)  
     2322                 ztmp3(:,:,1) = ztmp3(:,:,1) + a_ip_frac(:,:,jpl)   
     2323                 ztmp4(:,:,1) = ztmp4(:,:,1) + h_ip(:,:,jpl)  
    22732324               ENDDO   
    22742325            CASE default   ;   CALL ctl_stop( 'sbc_cpl_snd: wrong definition of sn_snd_mpnd%clcat' )   
  • NEMO/branches/2019/dev_r11943_MERGE_2019/src/OCE/SBC/sbcrnf.F90

    r12193 r12252  
    366366               IF( h_rnf(ji,jj) > 0._wp ) THEN 
    367367                  jk = 2 
    368                   DO WHILE ( jk /= mbkt(ji,jj) .AND. gdept_0(ji,jj,jk) < h_rnf(ji,jj) ) ;  jk = jk + 1 
     368                  DO WHILE ( jk < mbkt(ji,jj) .AND. gdept_0(ji,jj,jk) < h_rnf(ji,jj) ) ;  jk = jk + 1 
    369369                  END DO 
    370370                  nk_rnf(ji,jj) = jk 
     
    423423               IF( zrnfcl(ji,jj,1) > 0._wp ) THEN 
    424424                  jk = 2 
    425                   DO WHILE ( jk /= mbkt(ji,jj) .AND. gdept_0(ji,jj,jk) < h_rnf(ji,jj) ) ;  jk = jk + 1 
     425                  DO WHILE ( jk < mbkt(ji,jj) .AND. gdept_0(ji,jj,jk) < h_rnf(ji,jj) ) ;  jk = jk + 1 
    426426                  END DO 
    427427                  nk_rnf(ji,jj) = jk 
  • NEMO/branches/2019/dev_r11943_MERGE_2019/src/OCE/nemogcm.F90

    r12236 r12252  
    7373   USE step_diu       ! diurnal bulk SST timestepping (called from here if run offline) 
    7474   USE crsini         ! initialise grid coarsening utility 
    75    USE diatmb         ! Top,middle,bottom output 
    7675   USE dia25h         ! 25h mean output 
    7776   USE diadetide      ! Weights computation for daily detiding of model diagnostics 
     
    497496                           CALL     trd_init( Nnn )    ! Mixed-layer/Vorticity/Integral constraints trends 
    498497                           CALL dia_obs_init( Nnn )    ! Initialize observational data 
    499                            CALL dia_tmb_init    ! TMB outputs 
    500498                           CALL dia_25h_init( Nbb )    ! 25h mean  outputs 
    501499                           CALL dia_detide_init ! Weights computation for daily detiding of model diagnostics 
  • NEMO/branches/2019/dev_r11943_MERGE_2019/src/TOP/PISCES/P4Z/p4zmeso.F90

    r12236 r12252  
    7272      REAL(wp) :: zgrazn, zgrazpoc, zgraznf, zgrazf 
    7373      REAL(wp) :: zgrazfffp, zgrazfffg, zgrazffep, zgrazffeg 
     74      REAL(wp), DIMENSION(jpi,jpj,jpk) :: zgrazing2, zfezoo2, zz2ligprod 
    7475      CHARACTER (len=25) :: charout 
    75       REAL(wp), DIMENSION(jpi,jpj,jpk) :: zgrazing, zfezoo2 
    76       REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) ::   zw3d, zz2ligprod 
    7776      !!--------------------------------------------------------------------- 
    7877      ! 
    7978      IF( ln_timing )   CALL timing_start('p4z_meso') 
    80       ! 
    81       zgrazing(:,:,:) = 0._wp 
    82       zfezoo2 (:,:,:) = 0._wp 
    83       ! 
    84       IF (ln_ligand) THEN 
    85          ALLOCATE( zz2ligprod(jpi,jpj,jpk) ) 
    86          zz2ligprod(:,:,:) = 0._wp 
    87       ENDIF 
    8879      ! 
    8980      DO jk = 1, jpkm1 
     
    163154 
    164155               ! Total grazing ( grazing by microzoo is already computed in p4zmicro ) 
    165                zgrazing(ji,jj,jk) = zgraztotc 
     156               zgrazing2(ji,jj,jk) = zgraztotc 
    166157 
    167158               !    Mesozooplankton efficiency 
     
    234225      ! 
    235226      IF( lk_iomput .AND. knt == nrdttrc ) THEN 
    236          ALLOCATE( zw3d(jpi,jpj,jpk) ) 
    237          IF( iom_use( "GRAZ2" ) ) THEN 
    238             zw3d(:,:,:) = zgrazing(:,:,:) * 1.e+3 * rfact2r * tmask(:,:,:)  !   Total grazing of phyto by zooplankton 
    239             CALL iom_put( "GRAZ2", zw3d ) 
     227         zgrazing2(:,:,jpk) = 0._wp 
     228         zfezoo2 (:,:,jpk) = 0._wp 
     229         CALL iom_put( "GRAZ2" , zgrazing2(:,:,:) * 1.e+3       * rfact2r * tmask(:,:,:) )  !   Total grazing of phyto by zooplankton 
     230         CALL iom_put( "PCAL"  , prodcal  (:,:,:) * 1.e+3       * rfact2r * tmask(:,:,:) )  !  Calcite production  
     231         CALL iom_put( "FEZOO2", zfezoo2  (:,:,:) * 1e9 * 1.e+3 * rfact2r * tmask(:,:,:) ) 
     232         IF( ln_ligand )  THEN 
     233            zz2ligprod(:,:,jpk) = 0._wp 
     234            CALL iom_put( "LPRODZ2", zz2ligprod(:,:,:) * 1e9 * 1.e+3 * rfact2r * tmask(:,:,:)  ) 
    240235         ENDIF 
    241          IF( iom_use( "PCAL" ) ) THEN 
    242             zw3d(:,:,:) = prodcal(:,:,:) * 1.e+3 * rfact2r * tmask(:,:,:)   !  Calcite production 
    243             CALL iom_put( "PCAL", zw3d )   
    244          ENDIF 
    245          IF( iom_use( "FEZOO2" ) ) THEN 
    246             zw3d(:,:,:) = zfezoo2(:,:,:) * 1e9 * 1.e+3 * rfact2r * tmask(:,:,:)   ! 
    247             CALL iom_put( "FEZOO2", zw3d ) 
    248          ENDIF 
    249          IF( iom_use( "LPRODZ2" ) .AND. ln_ligand )  THEN 
    250             zw3d(:,:,:) = zz2ligprod(:,:,:) * 1e9 * 1.e+3 * rfact2r * tmask(:,:,:) 
    251             CALL iom_put( "LPRODZ2"  , zw3d ) 
    252          ENDIF 
    253          DEALLOCATE( zw3d ) 
    254236      ENDIF 
    255       ! 
    256       IF (ln_ligand)  DEALLOCATE( zz2ligprod ) 
    257237      ! 
    258238      IF(sn_cfctl%l_prttrc)   THEN  ! print mean trends (used for debugging) 
  • NEMO/branches/2019/dev_r11943_MERGE_2019/src/TOP/PISCES/P4Z/p4zmicro.F90

    r12236 r12252  
    7070      REAL(wp) :: zgrazp, zgrazm, zgrazsd 
    7171      REAL(wp) :: zgrazmf, zgrazsf, zgrazpf 
    72       REAL(wp), DIMENSION(jpi,jpj,jpk) :: zgrazing, zfezoo 
    73       REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: zw3d, zzligprod 
     72      REAL(wp), DIMENSION(jpi,jpj,jpk) :: zgrazing, zfezoo, zzligprod 
    7473      CHARACTER (len=25) :: charout 
    7574      !!--------------------------------------------------------------------- 
    7675      ! 
    7776      IF( ln_timing )   CALL timing_start('p4z_micro') 
    78       ! 
    79       IF (ln_ligand) THEN 
    80          ALLOCATE( zzligprod(jpi,jpj,jpk) ) 
    81          zzligprod(:,:,:) = 0._wp 
    82       ENDIF 
    8377      ! 
    8478      DO jk = 1, jpkm1 
     
    187181      END DO 
    188182      ! 
    189       IF( lk_iomput ) THEN 
    190          IF( knt == nrdttrc ) THEN 
    191            ALLOCATE( zw3d(jpi,jpj,jpk) ) 
    192            IF( iom_use( "GRAZ1" ) ) THEN 
    193               zw3d(:,:,:) = zgrazing(:,:,:) * 1.e+3 * rfact2r * tmask(:,:,:)  !  Total grazing of phyto by zooplankton 
    194               CALL iom_put( "GRAZ1", zw3d ) 
    195            ENDIF 
    196            IF( iom_use( "FEZOO" ) ) THEN 
    197               zw3d(:,:,:) = zfezoo(:,:,:) * 1e9 * 1.e+3 * rfact2r * tmask(:,:,:)   ! 
    198               CALL iom_put( "FEZOO", zw3d ) 
    199            ENDIF 
    200            IF( iom_use( "LPRODZ" ) .AND. ln_ligand )  THEN 
    201               zw3d(:,:,:) = zzligprod(:,:,:) * 1e9 * 1.e+3 * rfact2r * tmask(:,:,:) 
    202               CALL iom_put( "LPRODZ"  , zw3d ) 
    203            ENDIF 
    204            DEALLOCATE( zw3d ) 
     183      IF( lk_iomput .AND. knt == nrdttrc ) THEN 
     184         zgrazing(:,:,jpk) = 0._wp 
     185         zfezoo  (:,:,jpk) = 0._wp 
     186         CALL iom_put( "GRAZ1", zgrazing(:,:,:) * 1.e+3       * rfact2r * tmask(:,:,:) )  !   Total grazing of phyto by zooplankton 
     187         CALL iom_put( "FEZOO", zfezoo  (:,:,:) * 1e9 * 1.e+3 * rfact2r * tmask(:,:,:) ) 
     188         IF( ln_ligand )  THEN 
     189            zzligprod(:,:,jpk) = 0._wp 
     190            CALL iom_put( "LPRODZ", zzligprod(:,:,:) * 1e9 * 1.e+3 * rfact2r * tmask(:,:,:)  ) 
    205191         ENDIF 
    206192      ENDIF 
    207       ! 
    208       IF (ln_ligand)  DEALLOCATE( zzligprod ) 
    209193      ! 
    210194      IF(sn_cfctl%l_prttrc) THEN      ! print mean trends (used for debugging) 
  • NEMO/branches/2019/dev_r11943_MERGE_2019/src/TOP/trcini.F90

    r12236 r12252  
    5858      IF(lwp) WRITE(numout,*) '~~~~~~~~' 
    5959      ! 
    60       CALL trc_ini_ctl   ! control  
    6160      CALL trc_nam       ! read passive tracers namelists 
    6261      CALL top_alloc()   ! allocate TOP arrays 
     
    8483      ! 
    8584   END SUBROUTINE trc_init 
    86  
    87  
    88    SUBROUTINE trc_ini_ctl 
    89       !!---------------------------------------------------------------------- 
    90       !!                     ***  ROUTINE trc_ini_ctl  *** 
    91       !! ** Purpose :        Control  + ocean volume 
    92       !!---------------------------------------------------------------------- 
    93       INTEGER ::   jk    ! dummy loop indices 
    94       ! 
    95       ! Define logical parameter ton control dirunal cycle in TOP 
    96       l_trcdm2dc = ln_dm2dc .OR. ( ln_cpl .AND. ncpl_qsr_freq /= 1 ) 
    97       l_trcdm2dc = l_trcdm2dc  .AND. .NOT. l_offline 
    98       IF( l_trcdm2dc .AND. lwp )   CALL ctl_warn( 'Coupling with passive tracers and used of diurnal cycle.',   & 
    99          &                           'Computation of a daily mean shortwave for some biogeochemical models ' ) 
    100       ! 
    101    END SUBROUTINE trc_ini_ctl 
    10285 
    10386 
  • NEMO/branches/2019/dev_r11943_MERGE_2019/src/TOP/trcstp.F90

    r12236 r12252  
    7272      ll_trcstat  = ( sn_cfctl%l_trcstat ) .AND. & 
    7373     &              ( ( MOD( kt, sn_cfctl%ptimincr ) == 0 ) .OR. ( kt == nitend ) ) 
     74 
     75      IF( kt == nittrc000 )                      CALL trc_stp_ctl   ! control  
    7476      IF( kt == nittrc000 .AND. lk_trdmxl_trc )  CALL trd_mxl_trc_init    ! trends: Mixed-layer 
    7577      ! 
     
    131133      ! 
    132134   END SUBROUTINE trc_stp 
     135 
     136 
     137   SUBROUTINE trc_stp_ctl 
     138      !!---------------------------------------------------------------------- 
     139      !!                     ***  ROUTINE trc_stp_ctl  *** 
     140      !! ** Purpose :        Control  + ocean volume 
     141      !!---------------------------------------------------------------------- 
     142      ! 
     143      ! Define logical parameter ton control dirunal cycle in TOP 
     144      l_trcdm2dc = ln_dm2dc .OR. ( ln_cpl .AND. ncpl_qsr_freq /= 1 ) 
     145      l_trcdm2dc = l_trcdm2dc  .AND. .NOT. l_offline 
     146      IF( l_trcdm2dc .AND. lwp )   CALL ctl_warn( 'Coupling with passive tracers and used of diurnal cycle.',   & 
     147         &                           'Computation of a daily mean shortwave for some biogeochemical models ' ) 
     148      ! 
     149   END SUBROUTINE trc_stp_ctl 
     150 
    133151 
    134152   SUBROUTINE trc_mean_qsr( kt ) 
Note: See TracChangeset for help on using the changeset viewer.