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 13571 for NEMO/branches/2020/dev_r13296_HPC-07_mocavero_mpi3/src/OCE/SBC – NEMO

Ignore:
Timestamp:
2020-10-06T18:17:44+02:00 (4 years ago)
Author:
mocavero
Message:

Align branch with trunk

Location:
NEMO/branches/2020/dev_r13296_HPC-07_mocavero_mpi3/src/OCE/SBC
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2020/dev_r13296_HPC-07_mocavero_mpi3/src/OCE/SBC/cpl_oasis3.F90

    r13286 r13571  
    165165      ENDIF 
    166166      ! 
    167       ! ... Define the shape for the area that excludes the halo 
    168       !     For serial configuration (key_mpp_mpi not being active) 
    169       !     nl* is set to the global values 1 and jp*glo. 
     167      ! ... Define the shape for the area that excludes the halo as we don't want them to be "seen" by oasis 
    170168      ! 
    171169      ishape(1) = 1 
     
    176174      ! ... Allocate memory for data exchange 
    177175      ! 
    178       ALLOCATE(exfld(Ni_0, Nj_0), stat = nerror) 
     176      ALLOCATE(exfld(Ni_0, Nj_0), stat = nerror)        ! allocate only inner domain (without halos) 
    179177      IF( nerror > 0 ) THEN 
    180178         CALL oasis_abort ( ncomp_id, 'cpl_define', 'Failure in allocating exfld')   ;   RETURN 
     
    182180      ! 
    183181      ! ----------------------------------------------------------------- 
    184       ! ... Define the partition  
     182      ! ... Define the partition, excluding halos as we don't want them to be "seen" by oasis     
    185183      ! ----------------------------------------------------------------- 
    186184       
    187       paral(1) = 2                                              ! box partitioning 
    188       paral(2) = jpiglo * (Njs0-1+njmpp-1) + (Nis0-1+nimpp-1)   ! NEMO lower left corner global offset     
    189       paral(3) = Ni_0                                           ! local extent in i  
    190       paral(4) = Nj_0                                           ! local extent in j 
    191       paral(5) = jpiglo                                         ! global extent in x 
     185      paral(1) = 2                                      ! box partitioning 
     186      paral(2) = Ni0glo * mjg0(nn_hls) + mig0(nn_hls)   ! NEMO lower left corner global offset, without halos  
     187      paral(3) = Ni_0                                   ! local extent in i, excluding halos 
     188      paral(4) = Nj_0                                   ! local extent in j, excluding halos 
     189      paral(5) = Ni0glo                                 ! global extent in x, excluding halos 
    192190       
    193191      IF( sn_cfctl%l_oasout ) THEN 
    194192         WRITE(numout,*) ' multiexchg: paral (1:5)', paral 
    195          WRITE(numout,*) ' multiexchg: jpi, jpj =', jpi, jpj 
     193         WRITE(numout,*) ' multiexchg: Ni_0, Nj_0 =', Ni_0, Nj_0 
    196194         WRITE(numout,*) ' multiexchg: Nis0, Nie0, nimpp =', Nis0, Nie0, nimpp 
    197195         WRITE(numout,*) ' multiexchg: Njs0, Nje0, njmpp =', Njs0, Nje0, njmpp 
    198196      ENDIF 
    199197    
    200       CALL oasis_def_partition ( id_part, paral, nerror, jpiglo*jpjglo ) 
     198      CALL oasis_def_partition ( id_part, paral, nerror, Ni0glo*Nj0glo )   ! global number of points, excluding halos 
    201199      ! 
    202200      ! ... Announce send variables.  
     
    327325         DO jm = 1, ssnd(kid)%ncplmodel 
    328326         
    329             IF( ssnd(kid)%nid(jc,jm) /= -1 ) THEN 
     327            IF( ssnd(kid)%nid(jc,jm) /= -1 ) THEN   ! exclude halos from data sent to oasis 
    330328               CALL oasis_put ( ssnd(kid)%nid(jc,jm), kstep, pdata(Nis0:Nie0, Njs0:Nje0,jc), kinfo ) 
    331329                
     
    386384                  &        kinfo == OASIS_RecvOut .OR. kinfo == OASIS_FromRestOut 
    387385                
    388                IF ( sn_cfctl%l_oasout )   WRITE(numout,*) "llaction, kinfo, kstep, ivarid: " , llaction, kinfo, kstep, srcv(kid)%nid(jc,jm) 
     386               IF ( sn_cfctl%l_oasout )   & 
     387                  &  WRITE(numout,*) "llaction, kinfo, kstep, ivarid: " , llaction, kinfo, kstep, srcv(kid)%nid(jc,jm) 
    389388                
    390                IF( llaction ) THEN 
     389               IF( llaction ) THEN   ! data received from oasis do not include halos 
    391390                   
    392391                  kinfo = OASIS_Rcv 
     
    417416         ENDDO 
    418417 
    419          !--- Fill the overlap areas and extra hallows (mpp) 
    420          !--- check periodicity conditions (all cases) 
     418         !--- we must call lbc_lnk to fill the halos that where not received. 
    421419         IF( .NOT. ll_1st ) THEN 
    422420            CALL lbc_lnk( 'cpl_oasis3', pdata(:,:,jc), srcv(kid)%clgrid, srcv(kid)%nsgn )    
  • NEMO/branches/2020/dev_r13296_HPC-07_mocavero_mpi3/src/OCE/SBC/fldread.F90

    r13295 r13571  
    216216                  WRITE(numout, clfmt)  TRIM( sd(jf)%clvar ), kt, REAL(isecsbc,wp)/rday, nyear, nmonth, nday,   &             
    217217                     & sd(jf)%nrec(1,ibb), sd(jf)%nrec(1,iaa), REAL(sd(jf)%nrec(2,ibb),wp)/rday, REAL(sd(jf)%nrec(2,iaa),wp)/rday 
    218                   WRITE(numout, *) '      zt_offset is : ',zt_offset 
     218                  IF( zt_offset /= 0._wp )   WRITE(numout, *) '      zt_offset is : ', zt_offset 
    219219               ENDIF 
    220220               ! temporal interpolation weights 
  • NEMO/branches/2020/dev_r13296_HPC-07_mocavero_mpi3/src/OCE/SBC/sbc_ice.F90

    r12396 r13571  
    6969   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   emp_oce        !: evap - precip over ocean                 [kg/m2/s] 
    7070   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   wndm_ice       !: wind speed module at T-point                 [m/s] 
    71    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   sstfrz         !: wind speed module at T-point                 [m/s] 
     71   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   sstfrz         !: sea surface freezing temperature            [degC] 
     72   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   rCdU_ice       !: ice-ocean drag at T-point (<0)               [m/s] 
    7273#endif 
    7374 
     
    8990   ! variables used in the coupled interface 
    9091   INTEGER , PUBLIC, PARAMETER ::   jpl = ncat 
    91    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   u_ice, v_ice          ! jpi, jpj 
     92   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   u_ice, v_ice  
    9293    
    9394   ! already defined in ice.F90 for SI3 
     
    9899#endif 
    99100 
    100    REAL(wp), PUBLIC, SAVE ::   cldf_ice = 0.81    !: cloud fraction over sea ice, summer CLIO value   [-] 
     101   REAL(wp), PUBLIC, SAVE ::   pp_cldf = 0.81    !: cloud fraction over sea ice, summer CLIO value   [-] 
    101102 
    102103   !! arrays relating to embedding ice in the ocean 
     
    131132         &      qemp_ice(jpi,jpj)     , qevap_ice(jpi,jpj,jpl) , qemp_oce   (jpi,jpj)     ,   & 
    132133         &      qns_oce (jpi,jpj)     , qsr_oce  (jpi,jpj)     , emp_oce    (jpi,jpj)     ,   & 
    133          &      emp_ice (jpi,jpj)     , sstfrz   (jpi,jpj)     , STAT= ierr(2) ) 
     134         &      emp_ice (jpi,jpj)     , sstfrz   (jpi,jpj)     , rCdU_ice   (jpi,jpj)     , STAT= ierr(2) ) 
    134135#endif 
    135136 
     
    167168   LOGICAL         , PUBLIC, PARAMETER ::   lk_si3     = .FALSE.  !: no SI3 ice model 
    168169   LOGICAL         , PUBLIC, PARAMETER ::   lk_cice    = .FALSE.  !: no CICE ice model 
    169    REAL(wp)        , PUBLIC, PARAMETER ::   cldf_ice = 0.81       !: cloud fraction over sea ice, summer CLIO value   [-] 
     170   REAL(wp)        , PUBLIC, PARAMETER ::   pp_cldf    = 0.81     !: cloud fraction over sea ice, summer CLIO value   [-] 
    170171   INTEGER         , PUBLIC, PARAMETER ::   jpl = 1  
    171172   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   u_ice, v_ice                        ! jpi, jpj 
  • NEMO/branches/2020/dev_r13296_HPC-07_mocavero_mpi3/src/OCE/SBC/sbc_oce.F90

    r13295 r13571  
    136136   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   atm_co2           !: atmospheric pCO2                             [ppm] 
    137137   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: xcplmask          !: coupling mask for ln_mixcpl (warning: allocated in sbccpl) 
     138   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   cloud_fra         !: cloud cover (fraction of cloud in a gridcell) [-] 
    138139 
    139140   !!--------------------------------------------------------------------- 
     
    188189      ! 
    189190      ALLOCATE( tprecip(jpi,jpj) , sprecip(jpi,jpj) , fr_i(jpi,jpj) ,     & 
    190          &      atm_co2(jpi,jpj) , tsk_m(jpi,jpj) ,                       & 
     191         &      atm_co2(jpi,jpj) , tsk_m(jpi,jpj) , cloud_fra(jpi,jpj),   & 
    191192         &      ssu_m  (jpi,jpj) , sst_m(jpi,jpj) , frq_m(jpi,jpj) ,      & 
    192193         &      ssv_m  (jpi,jpj) , sss_m(jpi,jpj) , ssh_m(jpi,jpj) , STAT=ierr(4) ) 
  • NEMO/branches/2020/dev_r13296_HPC-07_mocavero_mpi3/src/OCE/SBC/sbcblk.F90

    r13295 r13571  
    4444   USE lib_fortran    ! to use key_nosignedzero 
    4545#if defined key_si3 
    46    USE ice     , ONLY :   jpl, a_i_b, at_i_b, rn_cnd_s, hfx_err_dif 
    47    USE icethd_dh      ! for CALL ice_thd_snwblow 
     46   USE ice     , ONLY :   u_ice, v_ice, jpl, a_i_b, at_i_b, t_su, rn_cnd_s, hfx_err_dif, nn_qtrice 
     47   USE icevar         ! for CALL ice_var_snwblow 
    4848#endif 
    4949   USE sbcblk_algo_ncar     ! => turb_ncar     : NCAR - CORE (Large & Yeager, 2009) 
     
    8787   INTEGER , PUBLIC, PARAMETER ::   jp_voatm = 11   ! index of surface current (j-component) 
    8888   !                                                !          seen by the atmospheric forcing (m/s) at T-point 
    89    INTEGER , PUBLIC, PARAMETER ::   jp_hpgi  = 12   ! index of ABL geostrophic wind or hpg (i-component) (m/s) at T-point 
    90    INTEGER , PUBLIC, PARAMETER ::   jp_hpgj  = 13   ! index of ABL geostrophic wind or hpg (j-component) (m/s) at T-point 
    91    INTEGER , PUBLIC, PARAMETER ::   jpfld    = 13   ! maximum number of files to read 
     89   INTEGER , PUBLIC, PARAMETER ::   jp_cc    = 12   ! index of cloud cover                     (-)      range:0-1 
     90   INTEGER , PUBLIC, PARAMETER ::   jp_hpgi  = 13   ! index of ABL geostrophic wind or hpg (i-component) (m/s) at T-point 
     91   INTEGER , PUBLIC, PARAMETER ::   jp_hpgj  = 14   ! index of ABL geostrophic wind or hpg (j-component) (m/s) at T-point 
     92   INTEGER , PUBLIC, PARAMETER ::   jpfld    = 14   ! maximum number of files to read 
    9293 
    9394   ! Warning: keep this structure allocatable for Agrif... 
     
    175176      TYPE(FLD_N) ::   sn_qlw , sn_tair , sn_prec, sn_snow     !       "                        " 
    176177      TYPE(FLD_N) ::   sn_slp , sn_uoatm, sn_voatm             !       "                        " 
    177       TYPE(FLD_N) ::   sn_hpgi, sn_hpgj                        !       "                        " 
     178      TYPE(FLD_N) ::   sn_cc, sn_hpgi, sn_hpgj                 !       "                        " 
    178179      INTEGER     ::   ipka                                    ! number of levels in the atmospheric variable 
    179180      NAMELIST/namsbc_blk/ sn_wndi, sn_wndj, sn_humi, sn_qsr, sn_qlw ,                &   ! input fields 
    180181         &                 sn_tair, sn_prec, sn_snow, sn_slp, sn_uoatm, sn_voatm,     & 
    181          &                 sn_hpgi, sn_hpgj,                                          & 
     182         &                 sn_cc, sn_hpgi, sn_hpgj,                                   & 
    182183         &                 ln_NCAR, ln_COARE_3p0, ln_COARE_3p6, ln_ECMWF,             &   ! bulk algorithm 
    183184         &                 cn_dir , rn_zqt, rn_zu,                                    & 
     
    260261      slf_i(jp_tair ) = sn_tair    ;   slf_i(jp_humi ) = sn_humi 
    261262      slf_i(jp_prec ) = sn_prec    ;   slf_i(jp_snow ) = sn_snow 
    262       slf_i(jp_slp  ) = sn_slp 
     263      slf_i(jp_slp  ) = sn_slp     ;   slf_i(jp_cc   ) = sn_cc 
    263264      slf_i(jp_uoatm) = sn_uoatm   ;   slf_i(jp_voatm) = sn_voatm 
    264265      slf_i(jp_hpgi ) = sn_hpgi    ;   slf_i(jp_hpgj ) = sn_hpgj 
     
    289290         ! 
    290291         IF( TRIM(sf(jfpr)%clrootname) == 'NOT USED' ) THEN    !--  not used field  --!   (only now allocated and set to default) 
    291             IF(     jfpr == jp_slp  ) THEN 
     292            IF(     jfpr == jp_slp ) THEN 
    292293               sf(jfpr)%fnow(:,:,1:ipka) = 101325._wp   ! use standard pressure in Pa 
    293294            ELSEIF( jfpr == jp_prec .OR. jfpr == jp_snow .OR. jfpr == jp_uoatm .OR. jfpr == jp_voatm ) THEN 
    294295               sf(jfpr)%fnow(:,:,1:ipka) = 0._wp        ! no precip or no snow or no surface currents 
    295             ELSEIF( ( jfpr == jp_hpgi .OR. jfpr == jp_hpgj ) .AND. .NOT. ln_abl ) THEN 
    296                DEALLOCATE( sf(jfpr)%fnow )              ! deallocate as not used in this case 
     296            ELSEIF( jfpr == jp_hpgi .OR. jfpr == jp_hpgj ) THEN 
     297               IF( .NOT. ln_abl ) THEN 
     298                  DEALLOCATE( sf(jfpr)%fnow )   ! deallocate as not used in this case 
     299               ELSE 
     300                  sf(jfpr)%fnow(:,:,1:ipka) = 0._wp 
     301               ENDIF 
     302            ELSEIF( jfpr == jp_cc  ) THEN 
     303               sf(jp_cc)%fnow(:,:,1:ipka) = pp_cldf 
    297304            ELSE 
    298305               WRITE(ctmp1,*) 'sbc_blk_init: no default value defined for field number', jfpr 
     
    303310            ! 
    304311            IF( sf(jfpr)%freqh > 0. .AND. MOD( NINT(3600. * sf(jfpr)%freqh), nn_fsbc * NINT(rn_Dt) ) /= 0 )   & 
    305                &  CALL ctl_warn( 'sbc_blk_init: sbcmod timestep rn_Dt*nn_fsbc is NOT a submultiple of atmospheric forcing frequency.',   & 
    306                &                 '               This is not ideal. You should consider changing either rn_Dt or nn_fsbc value...' ) 
     312         &  CALL ctl_warn( 'sbc_blk_init: sbcmod timestep rn_Dt*nn_fsbc is NOT a submultiple of atmospheric forcing frequency.',   & 
     313         &                 '               This is not ideal. You should consider changing either rn_Dt or nn_fsbc value...' ) 
    307314         ENDIF 
    308315      END DO 
     
    559566      ptsk(:,:) = pst(:,:) + rt0  ! by default: skin temperature = "bulk SST" (will remain this way if NCAR algorithm used!) 
    560567 
     568      ! --- cloud cover --- ! 
     569      cloud_fra(:,:) = sf(jp_cc)%fnow(:,:,1) 
     570 
    561571      ! ----------------------------------------------------------------------------- ! 
    562572      !      0   Wind components and module at T-point relative to the moving ocean   ! 
     
    568578      zwnd_j(:,:) = 0._wp 
    569579      CALL wnd_cyc( kt, zwnd_i, zwnd_j )    ! add analytical tropical cyclone (Vincent et al. JGR 2012) 
    570       DO_2D( 1, 1, 1, 1 ) 
     580      DO_2D( nn_hls, nn_hls, nn_hls, nn_hls ) 
    571581         zwnd_i(ji,jj) = pwndi(ji,jj) + zwnd_i(ji,jj) 
    572582         zwnd_j(ji,jj) = pwndj(ji,jj) + zwnd_j(ji,jj) 
     
    576586#else 
    577587      ! ... scalar wind module at T-point (not masked) 
    578       DO_2D( 1, 1, 1, 1 ) 
     588      DO_2D( nn_hls, nn_hls, nn_hls, nn_hls ) 
    579589         wndm(ji,jj) = SQRT(  pwndi(ji,jj) * pwndi(ji,jj) + pwndj(ji,jj) * pwndj(ji,jj)  ) 
    580590      END_2D 
     
    628638         !     use scalar version of gamma_moist() ... 
    629639         IF( ln_tpot ) THEN 
    630             DO_2D( 1, 1, 1, 1 ) 
     640            DO_2D( nn_hls, nn_hls, nn_hls, nn_hls ) 
    631641               ztpot(ji,jj) = ptair(ji,jj) + gamma_moist( ptair(ji,jj), zqair(ji,jj) ) * rn_zqt 
    632642            END_2D 
     
    690700 
    691701      IF( ln_abl ) THEN         !==  ABL formulation  ==!   multiplication by rho_air and turbulent fluxes computation done in ablstp 
    692          DO_2D( 1, 1, 1, 1 ) 
     702         DO_2D( nn_hls, nn_hls, nn_hls, nn_hls ) 
    693703            zztmp = zU_zu(ji,jj) 
    694704            wndm(ji,jj)   = zztmp                   ! Store zU_zu in wndm to compute ustar2 in ablmod 
     
    710720         pevp(:,:) = pevp(:,:) * tmask(:,:,1) 
    711721 
    712          DO_2D( 1, 1, 1, 1 ) 
     722         DO_2D( nn_hls, nn_hls, nn_hls, nn_hls ) 
    713723            IF( wndm(ji,jj) > 0._wp ) THEN 
    714724               zztmp = taum(ji,jj) / wndm(ji,jj) 
     
    828838 
    829839      ! use scalar version of L_vap() for AGRIF compatibility 
    830       DO_2D( 1, 1, 1, 1 ) 
     840      DO_2D( nn_hls, nn_hls, nn_hls, nn_hls ) 
    831841         zqla(ji,jj) = - L_vap( ztskk(ji,jj) ) * pevp(ji,jj)    ! Latent Heat flux !!GS: possibility to add a global qla to avoid recomputation after abl update 
    832842      END_2D 
     
    933943      ! ------------------------------------------------------------ ! 
    934944      ! C-grid ice dynamics :   U & V-points (same as ocean) 
    935       DO_2D( 1, 1, 1, 1 ) 
     945      DO_2D( nn_hls, nn_hls, nn_hls, nn_hls ) 
    936946         wndm_ice(ji,jj) = SQRT( pwndi(ji,jj) * pwndi(ji,jj) + pwndj(ji,jj) * pwndj(ji,jj) ) 
    937947      END_2D 
     
    978988         zztmp1 = 11637800.0_wp 
    979989         zztmp2 =    -5897.8_wp 
    980          DO_2D( 1, 1, 1, 1 ) 
     990         DO_2D( nn_hls, nn_hls, nn_hls, nn_hls ) 
    981991            pcd_dui(ji,jj) = zcd_dui (ji,jj) 
    982992            pseni  (ji,jj) = wndm_ice(ji,jj) * Ch_ice(ji,jj) 
     
    10191029      REAL(wp) ::   zcoef_dqlw, zcoef_dqla   !   -      - 
    10201030      REAL(wp) ::   zztmp, zztmp2, z1_rLsub  !   -      - 
    1021       REAL(wp) ::   zfr1, zfr2               ! local variables 
    10221031      REAL(wp), DIMENSION(jpi,jpj,jpl) ::   z1_st         ! inverse of surface temperature 
    10231032      REAL(wp), DIMENSION(jpi,jpj,jpl) ::   z_qlw         ! long wave heat flux over ice 
     
    10281037      REAL(wp), DIMENSION(jpi,jpj)     ::   zqair         ! specific humidity of air at z=rn_zqt [kg/kg] !LB 
    10291038      REAL(wp), DIMENSION(jpi,jpj)     ::   ztmp, ztmp2 
     1039      REAL(wp), DIMENSION(jpi,jpj)     ::   ztri 
    10301040      !!--------------------------------------------------------------------- 
    10311041      ! 
     
    11121122      ! --- evaporation minus precipitation --- ! 
    11131123      zsnw(:,:) = 0._wp 
    1114       CALL ice_thd_snwblow( (1.-at_i_b(:,:)), zsnw )  ! snow distribution over ice after wind blowing 
     1124      CALL ice_var_snwblow( (1.-at_i_b(:,:)), zsnw )  ! snow distribution over ice after wind blowing 
    11151125      emp_oce(:,:) = ( 1._wp - at_i_b(:,:) ) * zevap(:,:) - ( tprecip(:,:) - sprecip(:,:) ) - sprecip(:,:) * (1._wp - zsnw ) 
    11161126      emp_ice(:,:) = SUM( a_i_b(:,:,:) * evap_ice(:,:,:), dim=3 ) - sprecip(:,:) * zsnw 
     
    11391149      END DO 
    11401150 
    1141       ! --- shortwave radiation transmitted below the surface (W/m2, see Grenfell Maykut 77) --- ! 
    1142       zfr1 = ( 0.18 * ( 1.0 - cldf_ice ) + 0.35 * cldf_ice )            ! transmission when hi>10cm 
    1143       zfr2 = ( 0.82 * ( 1.0 - cldf_ice ) + 0.65 * cldf_ice )            ! zfr2 such that zfr1 + zfr2 to equal 1 
    1144       ! 
    1145       WHERE    ( phs(:,:,:) <= 0._wp .AND. phi(:,:,:) <  0.1_wp )       ! linear decrease from hi=0 to 10cm 
    1146          qtr_ice_top(:,:,:) = qsr_ice(:,:,:) * ( zfr1 + zfr2 * ( 1._wp - phi(:,:,:) * 10._wp ) ) 
    1147       ELSEWHERE( phs(:,:,:) <= 0._wp .AND. phi(:,:,:) >= 0.1_wp )       ! constant (zfr1) when hi>10cm 
    1148          qtr_ice_top(:,:,:) = qsr_ice(:,:,:) * zfr1 
    1149       ELSEWHERE                                                         ! zero when hs>0 
    1150          qtr_ice_top(:,:,:) = 0._wp 
    1151       END WHERE 
    1152       ! 
    1153  
     1151      ! --- shortwave radiation transmitted thru the surface scattering layer (W/m2) --- ! 
     1152      IF( nn_qtrice == 0 ) THEN 
     1153         ! formulation derived from Grenfell and Maykut (1977), where transmission rate 
     1154         !    1) depends on cloudiness 
     1155         !    2) is 0 when there is any snow 
     1156         !    3) tends to 1 for thin ice 
     1157         ztri(:,:) = 0.18 * ( 1.0 - cloud_fra(:,:) ) + 0.35 * cloud_fra(:,:)  ! surface transmission when hi>10cm 
     1158         DO jl = 1, jpl 
     1159            WHERE    ( phs(:,:,jl) <= 0._wp .AND. phi(:,:,jl) <  0.1_wp )     ! linear decrease from hi=0 to 10cm   
     1160               qtr_ice_top(:,:,jl) = qsr_ice(:,:,jl) * ( ztri(:,:) + ( 1._wp - ztri(:,:) ) * ( 1._wp - phi(:,:,jl) * 10._wp ) ) 
     1161            ELSEWHERE( phs(:,:,jl) <= 0._wp .AND. phi(:,:,jl) >= 0.1_wp )     ! constant (ztri) when hi>10cm 
     1162               qtr_ice_top(:,:,jl) = qsr_ice(:,:,jl) * ztri(:,:) 
     1163            ELSEWHERE                                                         ! zero when hs>0 
     1164               qtr_ice_top(:,:,jl) = 0._wp  
     1165            END WHERE 
     1166         ENDDO 
     1167      ELSEIF( nn_qtrice == 1 ) THEN 
     1168         ! formulation is derived from the thesis of M. Lebrun (2019). 
     1169         !    It represents the best fit using several sets of observations 
     1170         !    It comes with snow conductivities adapted to freezing/melting conditions (see icethd_zdf_bl99.F90) 
     1171         qtr_ice_top(:,:,:) = 0.3_wp * qsr_ice(:,:,:) 
     1172      ENDIF 
     1173      ! 
    11541174      IF( iom_use('evap_ao_cea') .OR. iom_use('hflx_evap_cea') ) THEN 
    11551175         ztmp(:,:) = zevap(:,:) * ( 1._wp - at_i_b(:,:) ) 
     
    12331253         ! 
    12341254         DO jl = 1, jpl 
    1235             DO_2D( 1, 1, 1, 1 ) 
     1255            DO_2D( nn_hls, nn_hls, nn_hls, nn_hls ) 
    12361256               zhe = ( rn_cnd_s * phi(ji,jj,jl) + rcnd_i * phs(ji,jj,jl) ) * zfac                            ! Effective thickness 
    12371257               IF( zhe >=  zfac2 )   zgfac(ji,jj,jl) = MIN( 2._wp, 0.5_wp * ( 1._wp + LOG( zhe * zfac3 ) ) ) ! Enhanced conduction factor 
     
    12481268      ! 
    12491269      DO jl = 1, jpl 
    1250          DO_2D( 1, 1, 1, 1 ) 
     1270         DO_2D( nn_hls, nn_hls, nn_hls, nn_hls ) 
    12511271            ! 
    12521272            zkeff_h = zfac * zgfac(ji,jj,jl) / &                                    ! Effective conductivity of the snow-ice system divided by thickness 
  • NEMO/branches/2020/dev_r13296_HPC-07_mocavero_mpi3/src/OCE/SBC/sbcblk_algo_coare3p0.F90

    r13295 r13571  
    394394      !!------------------------------------------------------------------- 
    395395      ! 
    396       DO_2D( 1, 1, 1, 1 ) 
     396      DO_2D( nn_hls, nn_hls, nn_hls, nn_hls ) 
    397397      ! 
    398398      zw = pwnd(ji,jj)   ! wind speed 
     
    430430      !!---------------------------------------------------------------------------------- 
    431431      ! 
    432       DO_2D( 1, 1, 1, 1 ) 
     432      DO_2D( nn_hls, nn_hls, nn_hls, nn_hls ) 
    433433      ! 
    434434      zta = pzeta(ji,jj) 
     
    481481      REAL(wp) :: zta, zphi_h, zphi_c, zpsi_k, zpsi_c, zf, zc, zstab 
    482482      ! 
    483       DO_2D( 1, 1, 1, 1 ) 
     483      DO_2D( nn_hls, nn_hls, nn_hls, nn_hls ) 
    484484      ! 
    485485      zta = pzeta(ji,jj) 
  • NEMO/branches/2020/dev_r13296_HPC-07_mocavero_mpi3/src/OCE/SBC/sbcblk_algo_coare3p6.F90

    r13295 r13571  
    430430      !!---------------------------------------------------------------------------------- 
    431431      ! 
    432       DO_2D( 1, 1, 1, 1 ) 
     432      DO_2D( nn_hls, nn_hls, nn_hls, nn_hls ) 
    433433      ! 
    434434      zta = pzeta(ji,jj) 
     
    481481      REAL(wp) :: zta, zphi_h, zphi_c, zpsi_k, zpsi_c, zf, zc, zstab 
    482482      ! 
    483       DO_2D( 1, 1, 1, 1 ) 
     483      DO_2D( nn_hls, nn_hls, nn_hls, nn_hls ) 
    484484      ! 
    485485      zta = pzeta(ji,jj) 
  • NEMO/branches/2020/dev_r13296_HPC-07_mocavero_mpi3/src/OCE/SBC/sbcblk_algo_ecmwf.F90

    r13295 r13571  
    410410      REAL(wp) :: zzeta, zx, ztmp, psi_unst, psi_stab, stab 
    411411      !!---------------------------------------------------------------------------------- 
    412       DO_2D( 1, 1, 1, 1 ) 
     412      DO_2D( nn_hls, nn_hls, nn_hls, nn_hls ) 
    413413      ! 
    414414      zzeta = MIN( pzeta(ji,jj) , 5._wp ) !! Very stable conditions (L positif and big!): 
     
    455455      !!---------------------------------------------------------------------------------- 
    456456      ! 
    457       DO_2D( 1, 1, 1, 1 ) 
     457      DO_2D( nn_hls, nn_hls, nn_hls, nn_hls ) 
    458458      ! 
    459459      zzeta = MIN(pzeta(ji,jj) , 5._wp)   ! Very stable conditions (L positif and big!): 
  • NEMO/branches/2020/dev_r13296_HPC-07_mocavero_mpi3/src/OCE/SBC/sbcblk_algo_ncar.F90

    r13295 r13571  
    241241      !!---------------------------------------------------------------------------------- 
    242242      ! 
    243       DO_2D( 1, 1, 1, 1 ) 
     243      DO_2D( nn_hls, nn_hls, nn_hls, nn_hls ) 
    244244         ! 
    245245         zw  = pw10(ji,jj) 
     
    277277      REAL(wp) :: zx2, zx, zstab   ! local scalars 
    278278      !!---------------------------------------------------------------------------------- 
    279       DO_2D( 1, 1, 1, 1 ) 
     279      DO_2D( nn_hls, nn_hls, nn_hls, nn_hls ) 
    280280         zx2 = SQRT( ABS( 1._wp - 16._wp*pzeta(ji,jj) ) ) 
    281281         zx2 = MAX( zx2 , 1._wp ) 
     
    308308      !!---------------------------------------------------------------------------------- 
    309309      ! 
    310       DO_2D( 1, 1, 1, 1 ) 
     310      DO_2D( nn_hls, nn_hls, nn_hls, nn_hls ) 
    311311         zx2 = SQRT( ABS( 1._wp - 16._wp*pzeta(ji,jj) ) ) 
    312312         zx2 = MAX( zx2 , 1._wp ) 
  • NEMO/branches/2020/dev_r13296_HPC-07_mocavero_mpi3/src/OCE/SBC/sbcblk_phy.F90

    r13295 r13571  
    181181      !!---------------------------------------------------------------------------------- 
    182182      ! 
    183       DO_2D( 1, 1, 1, 1 ) 
     183      DO_2D( nn_hls, nn_hls, nn_hls, nn_hls ) 
    184184         ztc  = ptak(ji,jj) - rt0   ! air temp, in deg. C 
    185185         ztc2 = ztc*ztc 
     
    270270      INTEGER  ::   ji, jj         ! dummy loop indices 
    271271      !!---------------------------------------------------------------------------------- 
    272       DO_2D( 1, 1, 1, 1 ) 
     272      DO_2D( nn_hls, nn_hls, nn_hls, nn_hls ) 
    273273         gamma_moist_vctr(ji,jj) = gamma_moist_sclr( ptak(ji,jj), pqa(ji,jj) ) 
    274274      END_2D 
     
    315315      !!------------------------------------------------------------------- 
    316316      ! 
    317       DO_2D( 1, 1, 1, 1 ) 
     317      DO_2D( nn_hls, nn_hls, nn_hls, nn_hls ) 
    318318         ! 
    319319         zqa = (1._wp + rctv0*pqa(ji,jj)) 
     
    351351      !!------------------------------------------------------------------- 
    352352      ! 
    353       DO_2D( 1, 1, 1, 1 ) 
     353      DO_2D( nn_hls, nn_hls, nn_hls, nn_hls ) 
    354354         ! 
    355355         zqa = 0.5_wp*(pqa(ji,jj)+pssq(ji,jj))                                        ! ~ mean q within the layer... 
     
    448448      !!---------------------------------------------------------------------------------- 
    449449      ! 
    450       DO_2D( 1, 1, 1, 1 ) 
     450      DO_2D( nn_hls, nn_hls, nn_hls, nn_hls ) 
    451451         ! 
    452452         ze_sat =  e_sat_sclr( ptak(ji,jj) ) 
     
    473473      !!---------------------------------------------------------------------------------- 
    474474      ! 
    475       DO_2D( 1, 1, 1, 1 ) 
     475      DO_2D( nn_hls, nn_hls, nn_hls, nn_hls ) 
    476476         ze = prha(ji,jj)*e_sat_sclr(ptak(ji,jj)) 
    477477         q_air_rh(ji,jj) = ze*reps0/(pslp(ji,jj) - (1. - reps0)*ze) 
     
    511511      INTEGER  ::   ji, jj     ! dummy loop indices 
    512512      !!---------------------------------------------------------------------------------- 
    513       DO_2D( 1, 1, 1, 1 ) 
     513      DO_2D( nn_hls, nn_hls, nn_hls, nn_hls ) 
    514514 
    515515         zdt = pTa(ji,jj) - pTs(ji,jj) ;  zdt = SIGN( MAX(ABS(zdt),1.E-6_wp), zdt ) 
     
    621621      IF( PRESENT(pfact_evap) ) zfact_evap = pfact_evap 
    622622 
    623       DO_2D( 1, 1, 1, 1 ) 
     623      DO_2D( nn_hls, nn_hls, nn_hls, nn_hls ) 
    624624 
    625625         CALL BULK_FORMULA_SCLR( pzu, pTs(ji,jj), pqs(ji,jj), pTa(ji,jj), pqa(ji,jj), & 
  • NEMO/branches/2020/dev_r13296_HPC-07_mocavero_mpi3/src/OCE/SBC/sbcblk_skin_coare.F90

    r13295 r13571  
    8989      REAL(wp) :: zQabs, zdlt, zfr, zalfa, zqlat, zus 
    9090      !!--------------------------------------------------------------------- 
    91       DO_2D( 1, 1, 1, 1 ) 
     91      DO_2D( nn_hls, nn_hls, nn_hls, nn_hls ) 
    9292 
    9393         zQabs = pQnsol(ji,jj) ! first guess of heat flux absorbed within the viscous sublayer of thicknes delta, 
     
    156156      ztime = REAL(nsec_day,wp)/(24._wp*3600._wp) ! time of current time step since 00:00 for current day (UTC) -> ztime = 0 -> 00:00 / ztime = 0.5 -> 12:00 ... 
    157157 
    158       DO_2D( 1, 1, 1, 1 ) 
     158      DO_2D( nn_hls, nn_hls, nn_hls, nn_hls ) 
    159159 
    160160         l_exit       = .FALSE. 
  • NEMO/branches/2020/dev_r13296_HPC-07_mocavero_mpi3/src/OCE/SBC/sbcblk_skin_ecmwf.F90

    r13295 r13571  
    9595      REAL(wp) :: zQabs, zdlt, zfr, zalfa, zus 
    9696      !!--------------------------------------------------------------------- 
    97       DO_2D( 1, 1, 1, 1 ) 
     97      DO_2D( nn_hls, nn_hls, nn_hls, nn_hls ) 
    9898 
    9999         zQabs = pQnsol(ji,jj) ! first guess of heat flux absorbed within the viscous sublayer of thicknes delta, 
     
    173173      IF( PRESENT(pustk) ) l_pustk_known = .TRUE. 
    174174 
    175       DO_2D( 1, 1, 1, 1 ) 
     175      DO_2D( nn_hls, nn_hls, nn_hls, nn_hls ) 
    176176 
    177177         zHwl = Hz_wl(ji,jj) ! first guess for warm-layer depth (and unique..., less advanced than COARE3p6 !) 
  • NEMO/branches/2020/dev_r13296_HPC-07_mocavero_mpi3/src/OCE/SBC/sbccpl.F90

    r13295 r13571  
    4141#endif 
    4242#if defined key_si3 
    43    USE icethd_dh      ! for CALL ice_thd_snwblow 
     43   USE icevar         ! for CALL ice_var_snwblow 
    4444#endif 
    4545   ! 
     
    4848   USE lib_mpp        ! distribued memory computing library 
    4949   USE lbclnk         ! ocean lateral boundary conditions (or mpp link) 
     50 
     51#if defined key_oasis3  
     52   USE mod_oasis, ONLY : OASIS_Sent, OASIS_ToRest, OASIS_SentOut, OASIS_ToRestOut  
     53#endif  
    5054 
    5155   IMPLICIT NONE 
     
    152156   INTEGER, PARAMETER ::   jps_wlev   = 32   ! water level  
    153157   INTEGER, PARAMETER ::   jps_fice1  = 33   ! first-order ice concentration (for semi-implicit coupling of atmos-ice fluxes) 
    154    INTEGER, PARAMETER ::   jps_a_p    = 34   ! meltpond area 
     158   INTEGER, PARAMETER ::   jps_a_p    = 34   ! meltpond area fraction 
    155159   INTEGER, PARAMETER ::   jps_ht_p   = 35   ! meltpond thickness 
    156160   INTEGER, PARAMETER ::   jps_kice   = 36   ! sea ice effective conductivity 
     
    159163 
    160164   INTEGER, PARAMETER ::   jpsnd      = 38   ! total number of fields sent  
     165 
     166#if ! defined key_oasis3  
     167   ! Dummy variables to enable compilation when oasis3 is not being used  
     168   INTEGER                    ::   OASIS_Sent        = -1  
     169   INTEGER                    ::   OASIS_SentOut     = -1  
     170   INTEGER                    ::   OASIS_ToRest      = -1  
     171   INTEGER                    ::   OASIS_ToRestOut   = -1  
     172#endif  
    161173 
    162174   !                                  !!** namelist namsbc_cpl ** 
     
    184196   LOGICAL     ::   ln_usecplmask         !  use a coupling mask file to merge data received from several models 
    185197                                          !   -> file cplmask.nc with the float variable called cplmask (jpi,jpj,nn_cplmodel) 
     198   LOGICAL     ::   ln_scale_ice_flux     !  use ice fluxes that are already "ice weighted" ( i.e. multiplied ice concentration)  
     199 
    186200   TYPE ::   DYNARR      
    187201      REAL(wp), POINTER, DIMENSION(:,:,:) ::   z3    
     
    191205 
    192206   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   alb_oce_mix    ! ocean albedo sent to atmosphere (mix clear/overcast sky) 
     207#if defined key_si3 || defined key_cice 
     208   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   a_i_last_couple !: Ice fractional area at last coupling time 
     209#endif 
    193210 
    194211   REAL(wp) ::   rpref = 101000._wp   ! reference atmospheric pressure[N/m2]  
     
    211228      !!             ***  FUNCTION sbc_cpl_alloc  *** 
    212229      !!---------------------------------------------------------------------- 
    213       INTEGER :: ierr(4) 
     230      INTEGER :: ierr(5) 
    214231      !!---------------------------------------------------------------------- 
    215232      ierr(:) = 0 
     
    221238#endif 
    222239      ALLOCATE( xcplmask(jpi,jpj,0:nn_cplmodel) , STAT=ierr(3) ) 
    223       ! 
    224       IF( .NOT. ln_apr_dyn ) ALLOCATE( ssh_ib(jpi,jpj), ssh_ibb(jpi,jpj), apr(jpi, jpj), STAT=ierr(4) )  
     240#if defined key_si3 || defined key_cice 
     241      ALLOCATE( a_i_last_couple(jpi,jpj,jpl) , STAT=ierr(4) ) 
     242#endif 
     243      ! 
     244      IF( .NOT. ln_apr_dyn ) ALLOCATE( ssh_ib(jpi,jpj), ssh_ibb(jpi,jpj), apr(jpi, jpj), STAT=ierr(5) ) 
    225245 
    226246      sbc_cpl_alloc = MAXVAL( ierr ) 
     
    249269      REAL(wp), DIMENSION(jpi,jpj) ::   zacs, zaos 
    250270      !! 
    251       NAMELIST/namsbc_cpl/  sn_snd_temp  , sn_snd_alb   , sn_snd_thick, sn_snd_crt   , sn_snd_co2  ,   &  
     271      NAMELIST/namsbc_cpl/  nn_cplmodel  , ln_usecplmask, nn_cats_cpl , ln_scale_ice_flux,             & 
     272         &                  sn_snd_temp  , sn_snd_alb   , sn_snd_thick, sn_snd_crt   , sn_snd_co2   ,  &  
    252273         &                  sn_snd_ttilyr, sn_snd_cond  , sn_snd_mpnd , sn_snd_sstfrz, sn_snd_thick1,  &  
    253          &                  sn_snd_ifrac , sn_snd_crtw  , sn_snd_wlev , sn_rcv_hsig  , sn_rcv_phioc,   &  
    254          &                  sn_rcv_w10m  , sn_rcv_taumod, sn_rcv_tau  , sn_rcv_dqnsdt, sn_rcv_qsr  ,   &  
     274         &                  sn_snd_ifrac , sn_snd_crtw  , sn_snd_wlev , sn_rcv_hsig  , sn_rcv_phioc ,  &  
     275         &                  sn_rcv_w10m  , sn_rcv_taumod, sn_rcv_tau  , sn_rcv_dqnsdt, sn_rcv_qsr   ,  &  
    255276         &                  sn_rcv_sdrfx , sn_rcv_sdrfy , sn_rcv_wper , sn_rcv_wnum  , sn_rcv_tauwoc,  & 
    256          &                  sn_rcv_wdrag , sn_rcv_qns   , sn_rcv_emp  , sn_rcv_rnf   , sn_rcv_cal  ,   & 
    257          &                  sn_rcv_iceflx, sn_rcv_co2   , nn_cplmodel , ln_usecplmask, sn_rcv_mslp ,   & 
    258          &                  sn_rcv_icb   , sn_rcv_isf   , sn_rcv_wfreq , sn_rcv_tauw, nn_cats_cpl  ,   & 
     277         &                  sn_rcv_wdrag , sn_rcv_qns   , sn_rcv_emp  , sn_rcv_rnf   , sn_rcv_cal   ,  & 
     278         &                  sn_rcv_iceflx, sn_rcv_co2   , sn_rcv_mslp ,                                & 
     279         &                  sn_rcv_icb   , sn_rcv_isf   , sn_rcv_wfreq, sn_rcv_tauw  ,                 & 
    259280         &                  sn_rcv_ts_ice 
    260  
    261281      !!--------------------------------------------------------------------- 
    262282      ! 
     
    278298      ENDIF 
    279299      IF( lwp .AND. ln_cpl ) THEN                        ! control print 
     300         WRITE(numout,*)'  nn_cplmodel                         = ', nn_cplmodel 
     301         WRITE(numout,*)'  ln_usecplmask                       = ', ln_usecplmask 
     302         WRITE(numout,*)'  ln_scale_ice_flux                   = ', ln_scale_ice_flux 
     303         WRITE(numout,*)'  nn_cats_cpl                         = ', nn_cats_cpl 
    280304         WRITE(numout,*)'  received fields (mutiple ice categogies)' 
    281305         WRITE(numout,*)'      10m wind module                 = ', TRIM(sn_rcv_w10m%cldes  ), ' (', TRIM(sn_rcv_w10m%clcat  ), ')' 
     
    326350         WRITE(numout,*)'                      - orientation   = ', sn_snd_crtw%clvor  
    327351         WRITE(numout,*)'                      - mesh          = ', sn_snd_crtw%clvgrd  
    328          WRITE(numout,*)'  nn_cplmodel                         = ', nn_cplmodel 
    329          WRITE(numout,*)'  ln_usecplmask                       = ', ln_usecplmask 
    330          WRITE(numout,*)'  nn_cats_cpl                         = ', nn_cats_cpl 
    331352      ENDIF 
    332353 
     
    367388      IF(       TRIM( sn_rcv_tau%cldes ) == 'oce only' .OR. TRIM( sn_rcv_tau%cldes ) == 'oce and ice'  & 
    368389           .OR. TRIM( sn_rcv_tau%cldes ) == 'mixed oce-ice' ) THEN ! avoid working with the atmospheric fields if they are not coupled 
    369  
     390      ! 
    370391      IF( TRIM( sn_rcv_tau%clvor ) == 'local grid' )   srcv(jpr_otx1:jpr_itz2)%nsgn = -1. 
    371392       
     
    698719         ! Change first letter to couple with atmosphere if already coupled OPA 
    699720         ! this is nedeed as each variable name used in the namcouple must be unique: 
    700          ! for example O_Runoff received by OPA from SAS and therefore O_Runoff received by SAS from the Atmosphere 
     721         ! for example O_Runoff received by OPA from SAS and therefore S_Runoff received by SAS from the Atmosphere 
    701722         DO jn = 1, jprcv 
    702723            IF( srcv(jn)%clname(1:1) == "O" ) srcv(jn)%clname = "S"//srcv(jn)%clname(2:LEN(srcv(jn)%clname)) 
     
    822843      END SELECT 
    823844 
     845      ! Initialise ice fractions from last coupling time to zero (needed by Met-Office) 
     846#if defined key_si3 || defined key_cice 
     847       a_i_last_couple(:,:,:) = 0._wp 
     848#endif 
    824849      !                                                      ! ------------------------- !  
    825850      !                                                      !      Ice Meltponds        !  
     
    11101135      REAL(wp) ::   zcdrag = 1.5e-3        ! drag coefficient 
    11111136      REAL(wp) ::   zzx, zzy               ! temporary variables 
    1112       REAL(wp), DIMENSION(jpi,jpj) ::   ztx, zty, zmsk, zemp, zqns, zqsr 
     1137      REAL(wp), DIMENSION(jpi,jpj) ::   ztx, zty, zmsk, zemp, zqns, zqsr, zcloud_fra 
    11131138      !!---------------------------------------------------------------------- 
    11141139      ! 
     
    11701195            !                               
    11711196            IF( srcv(jpr_otx1)%clgrid == 'T' ) THEN 
    1172                DO_2D( 0, 0, 0, 0 ) 
     1197               DO_2D( 0, 0, 0, 0 )                                        ! T ==> (U,V) 
    11731198                  frcv(jpr_otx1)%z3(ji,jj,1) = 0.5 * ( frcv(jpr_otx1)%z3(ji+1,jj  ,1) + frcv(jpr_otx1)%z3(ji,jj,1) ) 
    11741199                  frcv(jpr_oty1)%z3(ji,jj,1) = 0.5 * ( frcv(jpr_oty1)%z3(ji  ,jj+1,1) + frcv(jpr_oty1)%z3(ji,jj,1) ) 
     
    12241249         ENDIF 
    12251250      ENDIF 
    1226  
     1251!!$      !                                                      ! ========================= ! 
     1252!!$      SELECT CASE( TRIM( sn_rcv_clouds%cldes ) )             !       cloud fraction      ! 
     1253!!$      !                                                      ! ========================= ! 
     1254!!$      cloud_fra(:,:) = frcv(jpr_clfra)*z3(:,:,1) 
     1255!!$      END SELECT 
     1256!!$ 
     1257      zcloud_fra(:,:) = pp_cldf   ! should be real cloud fraction instead (as in the bulk) but needs to be read from atm. 
     1258      IF( ln_mixcpl ) THEN 
     1259         cloud_fra(:,:) = cloud_fra(:,:) * xcplmask(:,:,0) + zcloud_fra(:,:)* zmsk(:,:) 
     1260      ELSE 
     1261         cloud_fra(:,:) = zcloud_fra(:,:) 
     1262      ENDIF 
     1263      !                                                      ! ========================= ! 
    12271264      ! u(v)tau and taum will be modified by ice model 
    12281265      ! -> need to be reset before each call of the ice/fsbc       
     
    15491586            p_tauj(:,:) = frcv(jpr_ity1)%z3(:,:,1) 
    15501587         CASE( 'T' ) 
    1551             DO_2D( 0, 0, 0, 0 ) 
     1588            DO_2D( 0, 0, 0, 0 )                    ! T ==> (U,V) 
    15521589               ! take care of the land-sea mask to avoid "pollution" of coastal stress. p[uv]taui used in frazil and  rheology  
    15531590               zztmp1 = 0.5_wp * ( 2. - umask(ji,jj,1) ) * MAX( tmask(ji,jj,1),tmask(ji+1,jj  ,1) ) 
     
    16231660      ! 
    16241661      INTEGER  ::   ji, jj, jl   ! dummy loop index 
    1625       REAL(wp) ::   ztri         ! local scalar 
    16261662      REAL(wp), DIMENSION(jpi,jpj)     ::   zcptn, zcptrain, zcptsnw, ziceld, zmsk, zsnw 
    16271663      REAL(wp), DIMENSION(jpi,jpj)     ::   zemp_tot, zemp_ice, zemp_oce, ztprecip, zsprecip  , zevap_oce, zdevap_ice 
    16281664      REAL(wp), DIMENSION(jpi,jpj)     ::   zqns_tot, zqns_oce, zqsr_tot, zqsr_oce, zqprec_ice, zqemp_oce, zqemp_ice 
     1665      REAL(wp), DIMENSION(jpi,jpj)     ::   zevap_ice_total 
    16291666      REAL(wp), DIMENSION(jpi,jpj,jpl) ::   zqns_ice, zqsr_ice, zdqns_ice, zqevap_ice, zevap_ice, zqtr_ice_top, ztsu 
     1667      REAL(wp), DIMENSION(jpi,jpj)     ::   ztri 
    16301668      !!---------------------------------------------------------------------- 
    16311669      ! 
     
    16471685         ztprecip(:,:) =   frcv(jpr_rain)%z3(:,:,1) + zsprecip(:,:)  ! May need to ensure positive here 
    16481686         zemp_tot(:,:) =   frcv(jpr_tevp)%z3(:,:,1) - ztprecip(:,:) 
    1649          zemp_ice(:,:) = ( frcv(jpr_ievp)%z3(:,:,1) - frcv(jpr_snow)%z3(:,:,1) ) * picefr(:,:) 
    16501687      CASE( 'oce and ice'   )   ! received fields: jpr_sbpr, jpr_semp, jpr_oemp, jpr_ievp 
    16511688         zemp_tot(:,:) = ziceld(:,:) * frcv(jpr_oemp)%z3(:,:,1) + picefr(:,:) * frcv(jpr_sbpr)%z3(:,:,1) 
     
    16591696 
    16601697#if defined key_si3 
     1698 
     1699      ! --- evaporation over ice (kg/m2/s) --- ! 
     1700      IF (ln_scale_ice_flux) THEN ! typically met-office requirements 
     1701         IF (sn_rcv_emp%clcat == 'yes') THEN 
     1702            WHERE( a_i(:,:,:) > 1.e-10 )  ; zevap_ice(:,:,:) = frcv(jpr_ievp)%z3(:,:,:) * a_i_last_couple(:,:,:) / a_i(:,:,:) 
     1703            ELSEWHERE                     ; zevap_ice(:,:,:) = 0._wp 
     1704            END WHERE 
     1705            WHERE( picefr(:,:) > 1.e-10 ) ; zevap_ice_total(:,:) = SUM( zevap_ice(:,:,:) * a_i(:,:,:), dim=3 ) / picefr(:,:) 
     1706            ELSEWHERE                     ; zevap_ice_total(:,:) = 0._wp 
     1707            END WHERE 
     1708         ELSE 
     1709            WHERE( picefr(:,:) > 1.e-10 ) ; zevap_ice(:,:,1) = frcv(jpr_ievp)%z3(:,:,1) * SUM( a_i_last_couple, dim=3 ) / picefr(:,:) 
     1710            ELSEWHERE                     ; zevap_ice(:,:,1) = 0._wp 
     1711            END WHERE 
     1712            zevap_ice_total(:,:) = zevap_ice(:,:,1) 
     1713            DO jl = 2, jpl 
     1714               zevap_ice(:,:,jl) = zevap_ice(:,:,1) 
     1715            ENDDO 
     1716         ENDIF 
     1717      ELSE 
     1718         IF (sn_rcv_emp%clcat == 'yes') THEN 
     1719            zevap_ice(:,:,1:jpl) = frcv(jpr_ievp)%z3(:,:,1:jpl) 
     1720            WHERE( picefr(:,:) > 1.e-10 ) ; zevap_ice_total(:,:) = SUM( zevap_ice(:,:,:) * a_i(:,:,:), dim=3 ) / picefr(:,:) 
     1721            ELSEWHERE                     ; zevap_ice_total(:,:) = 0._wp 
     1722            END WHERE 
     1723         ELSE 
     1724            zevap_ice(:,:,1) = frcv(jpr_ievp)%z3(:,:,1) 
     1725            zevap_ice_total(:,:) = zevap_ice(:,:,1) 
     1726            DO jl = 2, jpl 
     1727               zevap_ice(:,:,jl) = zevap_ice(:,:,1) 
     1728            ENDDO 
     1729         ENDIF 
     1730      ENDIF 
     1731 
     1732      IF ( TRIM( sn_rcv_emp%cldes ) == 'conservative' ) THEN 
     1733         ! For conservative case zemp_ice has not been defined yet. Do it now. 
     1734         zemp_ice(:,:) = zevap_ice_total(:,:) * picefr(:,:) - frcv(jpr_snow)%z3(:,:,1) * picefr(:,:) 
     1735      ENDIF 
     1736 
    16611737      ! zsnw = snow fraction over ice after wind blowing (=picefr if no blowing) 
    1662       zsnw(:,:) = 0._wp   ;   CALL ice_thd_snwblow( ziceld, zsnw ) 
     1738      zsnw(:,:) = 0._wp   ;   CALL ice_var_snwblow( ziceld, zsnw ) 
    16631739       
    16641740      ! --- evaporation minus precipitation corrected (because of wind blowing on snow) --- ! 
     
    16671743 
    16681744      ! --- evaporation over ocean (used later for qemp) --- ! 
    1669       zevap_oce(:,:) = frcv(jpr_tevp)%z3(:,:,1) - frcv(jpr_ievp)%z3(:,:,1) * picefr(:,:) 
    1670  
    1671       ! --- evaporation over ice (kg/m2/s) --- ! 
    1672       DO jl=1,jpl 
    1673          IF(sn_rcv_emp%clcat == 'yes') THEN   ;   zevap_ice(:,:,jl) = frcv(jpr_ievp)%z3(:,:,jl) 
    1674          ELSE                                  ;   zevap_ice(:,:,jl) = frcv(jpr_ievp)%z3(:,:,1 )   ;   ENDIF 
    1675       ENDDO 
     1745      zevap_oce(:,:) = frcv(jpr_tevp)%z3(:,:,1) - zevap_ice_total(:,:) * picefr(:,:) 
    16761746 
    16771747      ! since the sensitivity of evap to temperature (devap/dT) is not prescribed by the atmosphere, we set it to 0 
     
    17511821!!      IF( srcv(jpr_rnf)%laction )   CALL iom_put( 'runoffs' , rnf(:,:) * tmask(:,:,1)                                 )  ! runoff 
    17521822!!      IF( srcv(jpr_isf)%laction )   CALL iom_put( 'iceshelf_cea', -fwfisf(:,:) * tmask(:,:,1)                         )  ! iceshelf 
    1753       IF( srcv(jpr_cal)%laction )   CALL iom_put( 'calving_cea' , frcv(jpr_cal)%z3(:,:,1) * tmask(:,:,1)                )  ! calving 
    1754       IF( srcv(jpr_icb)%laction )   CALL iom_put( 'iceberg_cea' , frcv(jpr_icb)%z3(:,:,1) * tmask(:,:,1)                )  ! icebergs 
    1755       IF( iom_use('snowpre') )      CALL iom_put( 'snowpre'     , sprecip(:,:)                                          )  ! Snow 
    1756       IF( iom_use('precip') )       CALL iom_put( 'precip'      , tprecip(:,:)                                          )  ! total  precipitation 
    1757       IF( iom_use('rain') )         CALL iom_put( 'rain'        , tprecip(:,:) - sprecip(:,:)                           )  ! liquid precipitation  
    1758       IF( iom_use('snow_ao_cea') )  CALL iom_put( 'snow_ao_cea' , sprecip(:,:) * ( 1._wp - zsnw(:,:) )                  )  ! Snow over ice-free ocean  (cell average) 
    1759       IF( iom_use('snow_ai_cea') )  CALL iom_put( 'snow_ai_cea' , sprecip(:,:) *           zsnw(:,:)                    )  ! Snow over sea-ice         (cell average) 
    1760       IF( iom_use('rain_ao_cea') )  CALL iom_put( 'rain_ao_cea' , ( tprecip(:,:) - sprecip(:,:) ) * picefr(:,:)         )  ! liquid precipitation over ocean (cell average) 
    1761       IF( iom_use('subl_ai_cea') )  CALL iom_put( 'subl_ai_cea' , frcv(jpr_ievp)%z3(:,:,1) * picefr(:,:) * tmask(:,:,1) )  ! Sublimation over sea-ice (cell average) 
    1762       IF( iom_use('evap_ao_cea') )  CALL iom_put( 'evap_ao_cea' , ( frcv(jpr_tevp)%z3(:,:,1)  & 
    1763          &                                                        - frcv(jpr_ievp)%z3(:,:,1) * picefr(:,:) ) * tmask(:,:,1) ) ! ice-free oce evap (cell average) 
     1823      IF( srcv(jpr_cal)%laction )    CALL iom_put( 'calving_cea' , frcv(jpr_cal)%z3(:,:,1) * tmask(:,:,1)                )  ! calving 
     1824      IF( srcv(jpr_icb)%laction )    CALL iom_put( 'iceberg_cea' , frcv(jpr_icb)%z3(:,:,1) * tmask(:,:,1)                )  ! icebergs 
     1825      IF( iom_use('snowpre') )       CALL iom_put( 'snowpre'     , sprecip(:,:)                                          )  ! Snow 
     1826      IF( iom_use('precip') )        CALL iom_put( 'precip'      , tprecip(:,:)                                          )  ! total  precipitation 
     1827      IF( iom_use('rain') )          CALL iom_put( 'rain'        , tprecip(:,:) - sprecip(:,:)                           )  ! liquid precipitation  
     1828      IF( iom_use('snow_ao_cea') )   CALL iom_put( 'snow_ao_cea' , sprecip(:,:) * ( 1._wp - zsnw(:,:) )                  )  ! Snow over ice-free ocean  (cell average) 
     1829      IF( iom_use('snow_ai_cea') )   CALL iom_put( 'snow_ai_cea' , sprecip(:,:) *           zsnw(:,:)                    )  ! Snow over sea-ice         (cell average) 
     1830      IF( iom_use('rain_ao_cea') )   CALL iom_put( 'rain_ao_cea' , ( tprecip(:,:) - sprecip(:,:) ) * picefr(:,:)         )  ! liquid precipitation over ocean (cell average) 
     1831      IF( iom_use('subl_ai_cea') )   CALL iom_put( 'subl_ai_cea' , frcv(jpr_ievp)%z3(:,:,1) * picefr(:,:) * tmask(:,:,1) )     ! Sublimation over sea-ice (cell average) 
     1832      IF( iom_use('evap_ao_cea') )   CALL iom_put( 'evap_ao_cea' , ( frcv(jpr_tevp)%z3(:,:,1)  & 
     1833         &                                                         - frcv(jpr_ievp)%z3(:,:,1) * picefr(:,:) ) * tmask(:,:,1) ) ! ice-free oce evap (cell average) 
    17641834      ! note: runoff output is done in sbcrnf (which includes icebergs too) and iceshelf output is done in sbcisf 
    17651835      ! 
     
    17691839      CASE( 'oce only' )         ! the required field is directly provided 
    17701840         zqns_tot(:,:) = frcv(jpr_qnsoce)%z3(:,:,1) 
     1841         ! For Met Office sea ice non-solar fluxes are already delt with by JULES so setting to zero 
     1842         ! here so the only flux is the ocean only one. 
     1843         zqns_ice(:,:,:) = 0._wp  
    17711844      CASE( 'conservative' )     ! the required fields are directly provided 
    17721845         zqns_tot(:,:) = frcv(jpr_qnsmix)%z3(:,:,1) 
     
    17981871               zqns_ice(:,:,jl) = frcv(jpr_qnsmix)%z3(:,:,jl)    & 
    17991872                  &             + frcv(jpr_dqnsdt)%z3(:,:,jl) * ( pist(:,:,jl) - ( ( rt0 + psst(:,:) ) * ziceld(:,:)   & 
    1800                   &                                                                + pist(:,:,jl) * picefr(:,:) ) ) 
     1873                  &                                             + pist(:,:,jl) * picefr(:,:) ) ) 
    18011874            END DO 
    18021875         ELSE 
     
    18041877               zqns_ice(:,:,jl) = frcv(jpr_qnsmix)%z3(:,:, 1)    & 
    18051878                  &             + frcv(jpr_dqnsdt)%z3(:,:, 1) * ( pist(:,:,jl) - ( ( rt0 + psst(:,:) ) * ziceld(:,:)   & 
    1806                   &                                                                + pist(:,:,jl) * picefr(:,:) ) ) 
     1879                  &                                             + pist(:,:,jl) * picefr(:,:) ) ) 
    18071880            END DO 
    18081881         ENDIF 
     
    19101983      CASE( 'oce only' ) 
    19111984         zqsr_tot(:,:  ) = MAX( 0._wp , frcv(jpr_qsroce)%z3(:,:,1) ) 
     1985         ! For Met Office sea ice solar fluxes are already delt with by JULES so setting to zero 
     1986         ! here so the only flux is the ocean only one. 
     1987         zqsr_ice(:,:,:) = 0._wp 
    19121988      CASE( 'conservative' ) 
    19131989         zqsr_tot(:,:  ) = frcv(jpr_qsrmix)%z3(:,:,1) 
     
    19952071            ENDDO 
    19962072         ENDIF 
     2073      CASE( 'none' )  
     2074         zdqns_ice(:,:,:) = 0._wp 
    19972075      END SELECT 
    19982076       
     
    20102088      !                                                      ! ========================= ! 
    20112089      CASE ('coupled') 
    2012          IF( ln_mixcpl ) THEN 
    2013             DO jl=1,jpl 
    2014                qml_ice(:,:,jl) = qml_ice(:,:,jl) * xcplmask(:,:,0) + frcv(jpr_topm)%z3(:,:,jl) * zmsk(:,:) 
    2015                qcn_ice(:,:,jl) = qcn_ice(:,:,jl) * xcplmask(:,:,0) + frcv(jpr_botm)%z3(:,:,jl) * zmsk(:,:) 
    2016             ENDDO 
     2090         IF (ln_scale_ice_flux) THEN 
     2091            WHERE( a_i(:,:,:) > 1.e-10_wp ) 
     2092               qml_ice(:,:,:) = frcv(jpr_topm)%z3(:,:,:) * a_i_last_couple(:,:,:) / a_i(:,:,:) 
     2093               qcn_ice(:,:,:) = frcv(jpr_botm)%z3(:,:,:) * a_i_last_couple(:,:,:) / a_i(:,:,:) 
     2094            ELSEWHERE 
     2095               qml_ice(:,:,:) = 0.0_wp 
     2096               qcn_ice(:,:,:) = 0.0_wp 
     2097            END WHERE 
    20172098         ELSE 
    20182099            qml_ice(:,:,:) = frcv(jpr_topm)%z3(:,:,:) 
     
    20252106      IF( .NOT.ln_cndflx ) THEN                              !==  No conduction flux as surface forcing  ==! 
    20262107         ! 
    2027          !                    ! ===> used prescribed cloud fraction representative for polar oceans in summer (0.81) 
    2028          ztri = 0.18 * ( 1.0 - cldf_ice ) + 0.35 * cldf_ice    ! surface transmission when hi>10cm (Grenfell Maykut 77) 
    2029          ! 
    2030          WHERE    ( phs(:,:,:) <= 0._wp .AND. phi(:,:,:) <  0.1_wp )       ! linear decrease from hi=0 to 10cm   
    2031             zqtr_ice_top(:,:,:) = qsr_ice(:,:,:) * ( ztri + ( 1._wp - ztri ) * ( 1._wp - phi(:,:,:) * 10._wp ) ) 
    2032          ELSEWHERE( phs(:,:,:) <= 0._wp .AND. phi(:,:,:) >= 0.1_wp )       ! constant (ztri) when hi>10cm 
    2033             zqtr_ice_top(:,:,:) = qsr_ice(:,:,:) * ztri 
    2034          ELSEWHERE                                                         ! zero when hs>0 
    2035             zqtr_ice_top(:,:,:) = 0._wp 
    2036          END WHERE 
     2108         IF( nn_qtrice == 0 ) THEN 
     2109            ! formulation derived from Grenfell and Maykut (1977), where transmission rate 
     2110            !    1) depends on cloudiness 
     2111            !       ! ===> used prescribed cloud fraction representative for polar oceans in summer (0.81) 
     2112            !       !      should be real cloud fraction instead (as in the bulk) but needs to be read from atm. 
     2113            !    2) is 0 when there is any snow 
     2114            !    3) tends to 1 for thin ice 
     2115            ztri(:,:) = 0.18 * ( 1.0 - cloud_fra(:,:) ) + 0.35 * cloud_fra(:,:)  ! surface transmission when hi>10cm 
     2116            DO jl = 1, jpl 
     2117               WHERE    ( phs(:,:,jl) <= 0._wp .AND. phi(:,:,jl) <  0.1_wp )       ! linear decrease from hi=0 to 10cm   
     2118                  zqtr_ice_top(:,:,jl) = zqsr_ice(:,:,jl) * ( ztri(:,:) + ( 1._wp - ztri(:,:) ) * ( 1._wp - phi(:,:,jl) * 10._wp ) ) 
     2119               ELSEWHERE( phs(:,:,jl) <= 0._wp .AND. phi(:,:,jl) >= 0.1_wp )       ! constant (ztri) when hi>10cm 
     2120                  zqtr_ice_top(:,:,jl) = zqsr_ice(:,:,jl) * ztri(:,:) 
     2121               ELSEWHERE                                                           ! zero when hs>0 
     2122                  zqtr_ice_top(:,:,jl) = 0._wp  
     2123               END WHERE 
     2124            ENDDO 
     2125         ELSEIF( nn_qtrice == 1 ) THEN 
     2126            ! formulation is derived from the thesis of M. Lebrun (2019). 
     2127            !    It represents the best fit using several sets of observations 
     2128            !    It comes with snow conductivities adapted to freezing/melting conditions (see icethd_zdf_bl99.F90) 
     2129            zqtr_ice_top(:,:,:) = 0.3_wp * zqsr_ice(:,:,:) 
     2130         ENDIF 
    20372131         !      
    20382132      ELSEIF( ln_cndflx .AND. .NOT.ln_cndemulate ) THEN      !==  conduction flux as surface forcing  ==! 
    20392133         ! 
    2040          !                    ! ===> here we must receive the qtr_ice_top array from the coupler 
    2041          !                           for now just assume zero (fully opaque ice) 
     2134         !          ! ===> here we must receive the qtr_ice_top array from the coupler 
     2135         !                 for now just assume zero (fully opaque ice) 
    20422136         zqtr_ice_top(:,:,:) = 0._wp 
    20432137         ! 
     
    20962190      ! 
    20972191      isec = ( kt - nit000 ) * NINT( rn_Dt )        ! date of exchanges 
     2192      info = OASIS_idle 
    20982193 
    20992194      zfr_l(:,:) = 1.- fr_i(:,:) 
     
    22342329      ENDIF 
    22352330 
     2331#if defined key_si3 || defined key_cice 
     2332      ! If this coupling was successful then save ice fraction for use between coupling points.  
     2333      ! This is needed for some calculations where the ice fraction at the last coupling point  
     2334      ! is needed.  
     2335      IF(  info == OASIS_Sent    .OR. info == OASIS_ToRest .OR. &  
     2336         & info == OASIS_SentOut .OR. info == OASIS_ToRestOut ) THEN  
     2337         IF ( sn_snd_thick%clcat == 'yes' ) THEN  
     2338           a_i_last_couple(:,:,1:jpl) = a_i(:,:,1:jpl) 
     2339         ENDIF 
     2340      ENDIF 
     2341#endif 
     2342 
    22362343      IF( ssnd(jps_fice1)%laction ) THEN 
    22372344         SELECT CASE( sn_snd_thick1%clcat ) 
     
    22972404            SELECT CASE( sn_snd_mpnd%clcat )   
    22982405            CASE( 'yes' )   
    2299                ztmp3(:,:,1:jpl) =  a_ip_frac(:,:,1:jpl) 
     2406               ztmp3(:,:,1:jpl) =  a_ip_eff(:,:,1:jpl) 
    23002407               ztmp4(:,:,1:jpl) =  h_ip(:,:,1:jpl)   
    23012408            CASE( 'no' )   
     
    23032410               ztmp4(:,:,:) = 0.0   
    23042411               DO jl=1,jpl   
    2305                  ztmp3(:,:,1) = ztmp3(:,:,1) + a_ip_frac(:,:,jpl)   
    2306                  ztmp4(:,:,1) = ztmp4(:,:,1) + h_ip(:,:,jpl)  
     2412                 ztmp3(:,:,1) = ztmp3(:,:,1) + a_ip_frac(:,:,jpl) 
     2413                 ztmp4(:,:,1) = ztmp4(:,:,1) + h_ip(:,:,jpl) 
    23072414               ENDDO   
    23082415            CASE default   ;   CALL ctl_stop( 'sbc_cpl_snd: wrong definition of sn_snd_mpnd%clcat' )   
  • NEMO/branches/2020/dev_r13296_HPC-07_mocavero_mpi3/src/OCE/SBC/sbcdcy.F90

    r13295 r13571  
    110110 
    111111      imask_night(:,:) = 0 
    112       DO_2D( 1, 1, 1, 1 ) 
     112      DO_2D( nn_hls, nn_hls, nn_hls, nn_hls ) 
    113113         ztmpm = 0._wp 
    114114         IF( ABS(rab(ji,jj)) < 1. ) THEN         ! day duration is less than 24h 
     
    193193 
    194194         zsin = SIN( zdecrad )   ;   zcos = COS( zdecrad ) 
    195          DO_2D( 1, 1, 1, 1 ) 
     195         DO_2D( nn_hls, nn_hls, nn_hls, nn_hls ) 
    196196            ztmp = rad * gphit(ji,jj) 
    197197            raa(ji,jj) = SIN( ztmp ) * zsin 
     
    202202         ! rab to test if the day time is equal to 0, less than 24h of full day 
    203203         rab(:,:) = -raa(:,:) / rbb(:,:) 
    204          DO_2D( 1, 1, 1, 1 ) 
     204         DO_2D( nn_hls, nn_hls, nn_hls, nn_hls ) 
    205205            IF( ABS(rab(ji,jj)) < 1._wp ) THEN         ! day duration is less than 24h 
    206206               ! When is it night? 
     
    226226         !         Avoid possible infinite scaling factor, associated with very short daylight 
    227227         !         periods, by ignoring periods less than 1/1000th of a day (ticket #1040) 
    228          DO_2D( 1, 1, 1, 1 ) 
     228         DO_2D( nn_hls, nn_hls, nn_hls, nn_hls ) 
    229229            IF( ABS(rab(ji,jj)) < 1._wp ) THEN         ! day duration is less than 24h 
    230230               rscal(ji,jj) = 0.0_wp 
  • NEMO/branches/2020/dev_r13296_HPC-07_mocavero_mpi3/src/OCE/SBC/sbcflx.F90

    r13295 r13571  
    2929   PUBLIC sbc_flx       ! routine called by step.F90 
    3030 
    31    INTEGER , PARAMETER ::   jpfld   = 5   ! maximum number of files to read  
    3231   INTEGER , PARAMETER ::   jp_utau = 1   ! index of wind stress (i-component) file 
    3332   INTEGER , PARAMETER ::   jp_vtau = 2   ! index of wind stress (j-component) file 
     
    3534   INTEGER , PARAMETER ::   jp_qsr  = 4   ! index of solar heat file 
    3635   INTEGER , PARAMETER ::   jp_emp  = 5   ! index of evaporation-precipation file 
     36 !!INTEGER , PARAMETER ::   jp_sfx  = 6   ! index of salt flux flux 
     37   INTEGER , PARAMETER ::   jpfld   = 5 !! 6 ! maximum number of files to read  
    3738   TYPE(FLD), ALLOCATABLE, DIMENSION(:) ::   sf    ! structure of input fields (file informations, fields read) 
    3839 
     
    5960      !!                   net downward radiative flux            qsr   (watt/m2) 
    6061      !!                   net upward freshwater (evapo - precip) emp   (kg/m2/s) 
     62      !!                   salt flux                              sfx   (pss*dh*rho/dt => g/m2/s) 
    6163      !! 
    6264      !!      CAUTION :  - never mask the surface stress fields 
     
    7173      !!              - emp         upward mass flux (evap. - precip.) 
    7274      !!              - sfx         salt flux; set to zero at nit000 but possibly non-zero 
    73       !!                            if ice is present 
     75      !!                            if ice 
    7476      !!---------------------------------------------------------------------- 
    7577      INTEGER, INTENT(in) ::   kt   ! ocean time step 
     
    8587      CHARACTER(len=100) ::  cn_dir                               ! Root directory for location of flx files 
    8688      TYPE(FLD_N), DIMENSION(jpfld) ::   slf_i                    ! array of namelist information structures 
    87       TYPE(FLD_N) ::   sn_utau, sn_vtau, sn_qtot, sn_qsr, sn_emp ! informations about the fields to be read 
    88       NAMELIST/namsbc_flx/ cn_dir, sn_utau, sn_vtau, sn_qtot, sn_qsr, sn_emp 
     89      TYPE(FLD_N) ::   sn_utau, sn_vtau, sn_qtot, sn_qsr, sn_emp !!, sn_sfx ! informations about the fields to be read 
     90      NAMELIST/namsbc_flx/ cn_dir, sn_utau, sn_vtau, sn_qtot, sn_qsr, sn_emp !!, sn_sfx 
    8991      !!--------------------------------------------------------------------- 
    9092      ! 
     
    105107         slf_i(jp_utau) = sn_utau   ;   slf_i(jp_vtau) = sn_vtau 
    106108         slf_i(jp_qtot) = sn_qtot   ;   slf_i(jp_qsr ) = sn_qsr  
    107          slf_i(jp_emp ) = sn_emp 
     109         slf_i(jp_emp ) = sn_emp !! ;   slf_i(jp_sfx ) = sn_sfx 
    108110         ! 
    109111         ALLOCATE( sf(jpfld), STAT=ierror )        ! set sf structure 
     
    118120         CALL fld_fill( sf, slf_i, cn_dir, 'sbc_flx', 'flux formulation for ocean surface boundary condition', 'namsbc_flx' ) 
    119121         ! 
    120          sfx(:,:) = 0.0_wp                         ! salt flux due to freezing/melting (non-zero only if ice is present) 
    121          ! 
    122122      ENDIF 
    123123 
     
    126126      IF( MOD( kt-1, nn_fsbc ) == 0 ) THEN                        ! update ocean fluxes at each SBC frequency 
    127127 
    128          IF( ln_dm2dc ) THEN   ;   qsr(:,:) = sbc_dcy( sf(jp_qsr)%fnow(:,:,1) )   ! modify now Qsr to include the diurnal cycle 
    129          ELSE                  ;   qsr(:,:) =          sf(jp_qsr)%fnow(:,:,1) 
     128         IF( ln_dm2dc ) THEN   ! modify now Qsr to include the diurnal cycle 
     129            qsr(:,:) = sbc_dcy( sf(jp_qsr)%fnow(:,:,1) ) * tmask(ji,jj,1) 
     130         ELSE 
     131            DO_2D( 0, 0, 0, 0 ) 
     132               qsr(ji,jj) =          sf(jp_qsr)%fnow(ji,jj,1)   * tmask(ji,jj,1) 
     133            END_2D 
    130134         ENDIF 
    131          DO_2D( 1, 1, 1, 1 ) 
    132             utau(ji,jj) = sf(jp_utau)%fnow(ji,jj,1) 
    133             vtau(ji,jj) = sf(jp_vtau)%fnow(ji,jj,1) 
    134             qns (ji,jj) = sf(jp_qtot)%fnow(ji,jj,1) - sf(jp_qsr)%fnow(ji,jj,1) 
    135             emp (ji,jj) = sf(jp_emp )%fnow(ji,jj,1) 
     135         DO_2D( 0, 0, 0, 0 )                                      ! set the ocean fluxes from read fields 
     136            utau(ji,jj) =   sf(jp_utau)%fnow(ji,jj,1)                              * umask(ji,jj,1) 
     137            vtau(ji,jj) =   sf(jp_vtau)%fnow(ji,jj,1)                              * vmask(ji,jj,1) 
     138            qns (ji,jj) = ( sf(jp_qtot)%fnow(ji,jj,1) - sf(jp_qsr)%fnow(ji,jj,1) ) * tmask(ji,jj,1) 
     139            emp (ji,jj) =   sf(jp_emp )%fnow(ji,jj,1)                              * tmask(ji,jj,1) 
     140            !!sfx (ji,jj) = sf(jp_sfx )%fnow(ji,jj,1)                              * tmask(ji,jj,1)  
    136141         END_2D 
    137142         !                                                        ! add to qns the heat due to e-p 
    138          qns(:,:) = qns(:,:) - emp(:,:) * sst_m(:,:) * rcp        ! mass flux is at SST 
     143         !!clem: I do not think it is needed 
     144         !!qns(:,:) = qns(:,:) - emp(:,:) * sst_m(:,:) * rcp        ! mass flux is at SST 
    139145         ! 
    140          qns(:,:) = qns(:,:) * tmask(:,:,1) 
    141          emp(:,:) = emp(:,:) * tmask(:,:,1) 
     146         ! clem: without these lbc calls, it seems that the northfold is not ok (true in 3.6, not sure in 4.x)  
     147         CALL lbc_lnk_multi( 'sbcflx', utau, 'U', -1._wp, vtau, 'V', -1._wp, & 
     148            &                           qns, 'T',  1._wp, emp , 'T',  1._wp, qsr, 'T', 1._wp ) !! sfx, 'T', 1._wp  ) 
    142149         ! 
    143          !                                                        ! module of wind stress and wind speed at T-point 
    144          zcoef = 1. / ( zrhoa * zcdrag ) 
    145          DO_2D( 0, 0, 0, 0 ) 
    146             ztx = utau(ji-1,jj  ) + utau(ji,jj)  
    147             zty = vtau(ji  ,jj-1) + vtau(ji,jj)  
    148             zmod = 0.5 * SQRT( ztx * ztx + zty * zty ) 
    149             taum(ji,jj) = zmod 
    150             wndm(ji,jj) = SQRT( zmod * zcoef ) 
    151          END_2D 
    152          taum(:,:) = taum(:,:) * tmask(:,:,1) ; wndm(:,:) = wndm(:,:) * tmask(:,:,1) 
    153          CALL lbc_lnk( 'sbcflx', taum(:,:), 'T', 1.0_wp )   ;   CALL lbc_lnk( 'sbcflx', wndm(:,:), 'T', 1.0_wp ) 
    154  
    155150         IF( nitend-nit000 <= 100 .AND. lwp ) THEN                ! control print (if less than 100 time-step asked) 
    156151            WRITE(numout,*)  
     
    166161         ! 
    167162      ENDIF 
     163      !                                                           ! module of wind stress and wind speed at T-point 
     164      ! Note the use of 0.5*(2-umask) in order to unmask the stress along coastlines 
     165      zcoef = 1. / ( zrhoa * zcdrag ) 
     166      DO_2D( 0, 0, 0, 0 ) 
     167         ztx = ( utau(ji-1,jj  ) + utau(ji,jj) ) * 0.5_wp * ( 2._wp - MIN( umask(ji-1,jj  ,1), umask(ji,jj,1) ) ) 
     168         zty = ( vtau(ji  ,jj-1) + vtau(ji,jj) ) * 0.5_wp * ( 2._wp - MIN( vmask(ji  ,jj-1,1), vmask(ji,jj,1) ) )  
     169         zmod = 0.5_wp * SQRT( ztx * ztx + zty * zty ) * tmask(ji,jj,1) 
     170         taum(ji,jj) = zmod 
     171         wndm(ji,jj) = SQRT( zmod * zcoef )  !!clem: not used? 
     172      END_2D 
     173      ! 
     174      CALL lbc_lnk_multi( 'sbcflx', taum, 'T', 1._wp, wndm, 'T', 1._wp ) 
    168175      ! 
    169176   END SUBROUTINE sbc_flx 
  • NEMO/branches/2020/dev_r13296_HPC-07_mocavero_mpi3/src/OCE/SBC/sbcmod.F90

    r13286 r13571  
    9999         &             nn_ice   , ln_ice_embd,                                       & 
    100100         &             ln_traqsr, ln_dm2dc ,                                         & 
    101          &             ln_rnf   , nn_fwb     , ln_ssr   , ln_apr_dyn,              & 
    102          &             ln_wave  , ln_cdgw  , ln_sdw   , ln_tauwoc  , ln_stcor  ,     & 
     101         &             ln_rnf   , nn_fwb   , ln_ssr   , ln_apr_dyn,                  & 
     102         &             ln_wave  , ln_cdgw  , ln_sdw   , ln_tauwoc , ln_stcor  ,      & 
    103103         &             ln_tauw  , nn_lsm, nn_sdrift 
    104104      !!---------------------------------------------------------------------- 
     
    119119#if defined key_mpp_mpi 
    120120      ncom_fsbc = nn_fsbc    ! make nn_fsbc available for lib_mpp 
     121#endif 
     122#if ! defined key_si3 
     123      IF( nn_ice == 2 )    nn_ice = 0  ! without key key_si3 you cannot use si3... 
    121124#endif 
    122125      ! 
     
    243246      ENDIF 
    244247      ! 
    245  
    246248      IF( nn_ice == 0 ) THEN        !* No sea-ice in the domain : ice fraction is always zero 
    247249         IF( nn_components /= jp_iam_opa )   fr_i(:,:) = 0._wp    ! except for OPA in SAS-OPA coupled case 
     
    250252      sfx   (:,:) = 0._wp           !* salt flux due to freezing/melting 
    251253      fmmflx(:,:) = 0._wp           !* freezing minus melting flux 
     254      cloud_fra(:,:) = pp_cldf      !* cloud fraction over sea ice (used in si3) 
    252255 
    253256      taum(:,:) = 0._wp             !* wind stress module (needed in GLS in case of reduced restart) 
     
    334337      IF( l_sbc_clo   )   CALL sbc_clo_init              ! closed sea surface initialisation 
    335338      ! 
    336       IF( ln_blk      )   CALL sbc_blk_init            ! bulk formulae initialization 
    337  
    338       IF( ln_abl      )   CALL sbc_abl_init            ! Atmospheric Boundary Layer (ABL) 
    339  
    340       IF( ln_ssr      )   CALL sbc_ssr_init            ! Sea-Surface Restoring initialization 
     339      IF( ln_blk      )   CALL sbc_blk_init              ! bulk formulae initialization 
     340 
     341      IF( ln_abl      )   CALL sbc_abl_init              ! Atmospheric Boundary Layer (ABL) 
     342 
     343      IF( ln_ssr      )   CALL sbc_ssr_init              ! Sea-Surface Restoring initialization 
    341344      ! 
    342345      ! 
     
    563566      ENDIF 
    564567      ! 
    565       CALL iom_put( "utau", utau )   ! i-wind stress   (stress can be updated at each time step in sea-ice) 
    566       CALL iom_put( "vtau", vtau )   ! j-wind stress 
    567       ! 
    568568      IF(sn_cfctl%l_prtctl) THEN     ! print mean trends (used for debugging) 
    569569         CALL prt_ctl(tab2d_1=fr_i             , clinfo1=' fr_i     - : ', mask1=tmask ) 
  • NEMO/branches/2020/dev_r13296_HPC-07_mocavero_mpi3/src/OCE/SBC/sbcrnf.F90

    r13295 r13571  
    215215            END_2D 
    216216         ELSE                    !* variable volume case 
    217             DO_2D( 1, 1, 1, 1 ) 
     217            DO_2D( 1, 1, 1, 1 )              ! update the depth over which runoffs are distributed 
    218218               h_rnf(ji,jj) = 0._wp 
    219                DO jk = 1, nk_rnf(ji,jj)                           ! recalculates h_rnf to be the depth in metres 
     219               DO jk = 1, nk_rnf(ji,jj)                             ! recalculates h_rnf to be the depth in metres 
    220220                  h_rnf(ji,jj) = h_rnf(ji,jj) + e3t(ji,jj,jk,Kmm)   ! to the bottom of the relevant grid box 
    221221               END DO 
     
    374374            ENDIF 
    375375         END_2D 
    376          DO_2D( 1, 1, 1, 1 ) 
     376         DO_2D( 1, 1, 1, 1 )                           ! set the associated depth 
    377377            h_rnf(ji,jj) = 0._wp 
    378378            DO jk = 1, nk_rnf(ji,jj) 
     
    404404         WHERE( zrnfcl(:,:,1) > 0._wp )  h_rnf(:,:) = zacoef * zrnfcl(:,:,1)   ! compute depth for all runoffs 
    405405         ! 
    406          DO_2D( 1, 1, 1, 1 ) 
     406         DO_2D( 1, 1, 1, 1 )                ! take in account min depth of ocean rn_hmin 
    407407            IF( zrnfcl(ji,jj,1) > 0._wp ) THEN 
    408408               jk = mbkt(ji,jj) 
     
    423423         END_2D 
    424424         ! 
    425          DO_2D( 1, 1, 1, 1 ) 
     425         DO_2D( 1, 1, 1, 1 )                          ! set the associated depth 
    426426            h_rnf(ji,jj) = 0._wp 
    427427            DO jk = 1, nk_rnf(ji,jj) 
  • NEMO/branches/2020/dev_r13296_HPC-07_mocavero_mpi3/src/OCE/SBC/sbcwave.F90

    r13295 r13571  
    106106      !!--------------------------------------------------------------------- 
    107107      ! 
    108       ALLOCATE( ze3divh(jpi,jpj,jpk) ) 
     108      ALLOCATE( ze3divh(jpi,jpj,jpkm1) )   ! jpkm1 -> avoid lbc_lnk on jpk that is not defined 
    109109      ALLOCATE( zk_t(jpi,jpj), zk_u(jpi,jpj), zk_v(jpi,jpj), zu0_sd(jpi,jpj), zv0_sd(jpi,jpj) ) 
    110110      ! 
     
    121121            zk_t(ji,jj) = ABS( tsd2d(ji,jj) ) / MAX( ABS( 5.97_wp*ztransp ), 0.0000001_wp ) 
    122122         END_2D 
    123          DO_2D( 1, 0, 1, 0 ) 
     123         DO_2D( 1, 0, 1, 0 )          ! exp. wave number & Stokes drift velocity at u- & v-points 
    124124            zk_u(ji,jj) = 0.5_wp * ( zk_t(ji,jj) + zk_t(ji+1,jj) ) 
    125125            zk_v(ji,jj) = 0.5_wp * ( zk_t(ji,jj) + zk_t(ji,jj+1) ) 
     
    164164         zsqrtpi = SQRT(rpi) 
    165165         z_two_thirds = 2.0_wp / 3.0_wp 
    166          DO_3D( 0, 0, 0, 0, 1, jpkm1 ) 
     166         DO_3D( 0, 0, 0, 0, 1, jpkm1 )       ! exp. wave number & Stokes drift velocity at u- & v-points 
    167167            zbot_u = ( gdepw(ji,jj,jk+1,Kmm) + gdepw(ji+1,jj,jk+1,Kmm) )  ! 2 * bottom depth 
    168168            zbot_v = ( gdepw(ji,jj,jk+1,Kmm) + gdepw(ji,jj+1,jk+1,Kmm) )  ! 2 * bottom depth 
     
    204204      !                       !==  vertical Stokes Drift 3D velocity  ==! 
    205205      ! 
    206       DO_3D( 0, 1, 0, 1, 1, jpkm1 ) 
     206      DO_3D( 0, 1, 0, 1, 1, jpkm1 )    ! Horizontal e3*divergence 
    207207         ze3divh(ji,jj,jk) = (  e2u(ji  ,jj) * e3u(ji  ,jj,jk,Kmm) * usd(ji  ,jj,jk)    & 
    208208            &                 - e2u(ji-1,jj) * e3u(ji-1,jj,jk,Kmm) * usd(ji-1,jj,jk)    & 
Note: See TracChangeset for help on using the changeset viewer.