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 13463 for NEMO/branches/2019/dev_r11351_fldread_with_XIOS/src/ICE/icesbc.F90 – NEMO

Ignore:
Timestamp:
2020-09-14T17:40:34+02:00 (4 years ago)
Author:
andmirek
Message:

Ticket #2195:update to trunk 13461

Location:
NEMO/branches/2019/dev_r11351_fldread_with_XIOS
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2019/dev_r11351_fldread_with_XIOS

    • Property svn:externals
      •  

        old new  
        33^/utils/build/mk@HEAD         mk 
        44^/utils/tools@HEAD            tools 
        5 ^/vendors/AGRIF/dev@HEAD      ext/AGRIF 
         5^/vendors/AGRIF/dev_r12970_AGRIF_CMEMS      ext/AGRIF 
        66^/vendors/FCM@HEAD            ext/FCM 
        77^/vendors/IOIPSL@HEAD         ext/IOIPSL 
         8 
         9# SETTE 
         10^/utils/CI/sette@13382        sette 
  • NEMO/branches/2019/dev_r11351_fldread_with_XIOS/src/ICE/icesbc.F90

    r10535 r13463  
    2727   USE lbclnk         ! lateral boundary conditions (or mpp links) 
    2828   USE timing         ! Timing 
     29   USE fldread        !!GS: needed by agrif 
    2930 
    3031   IMPLICIT NONE 
     
    3637 
    3738   !! * Substitutions 
    38 #  include "vectopt_loop_substitute.h90" 
     39#  include "do_loop_substitute.h90" 
    3940   !!---------------------------------------------------------------------- 
    4041   !! NEMO/ICE 4.0 , NEMO Consortium (2018) 
     
    7172      SELECT CASE( ksbc ) 
    7273         CASE( jp_usr     )   ;    CALL usrdef_sbc_ice_tau( kt )                 ! user defined formulation 
    73          CASE( jp_blk     )   ;    CALL blk_ice_tau                              ! Bulk         formulation 
     74         CASE( jp_blk     )   ;    CALL blk_ice_1( sf(jp_wndi)%fnow(:,:,1), sf(jp_wndj)%fnow(:,:,1),   & 
     75            &                                      sf(jp_tair)%fnow(:,:,1), sf(jp_humi)%fnow(:,:,1),   & 
     76            &                                      sf(jp_slp )%fnow(:,:,1), u_ice, v_ice, tm_su    ,   &   ! inputs 
     77            &                                      putaui = utau_ice, pvtaui = vtau_ice            )       ! outputs                              
     78 !        CASE( jp_abl     )    utau_ice & vtau_ice are computed in ablmod 
    7479         CASE( jp_purecpl )   ;    CALL sbc_cpl_ice_tau( utau_ice , vtau_ice )   ! Coupled      formulation 
    7580      END SELECT 
     
    7782      IF( ln_mixcpl) THEN                                                        ! Case of a mixed Bulk/Coupled formulation 
    7883                                   CALL sbc_cpl_ice_tau( zutau_ice , zvtau_ice ) 
    79          DO jj = 2, jpjm1 
    80             DO ji = 2, jpim1 
    81                utau_ice(ji,jj) = utau_ice(ji,jj) * xcplmask(ji,jj,0) + zutau_ice(ji,jj) * ( 1. - xcplmask(ji,jj,0) ) 
    82                vtau_ice(ji,jj) = vtau_ice(ji,jj) * xcplmask(ji,jj,0) + zvtau_ice(ji,jj) * ( 1. - xcplmask(ji,jj,0) ) 
    83             END DO 
    84          END DO 
    85          CALL lbc_lnk_multi( 'icesbc', utau_ice, 'U', -1., vtau_ice, 'V', -1. ) 
     84         DO_2D( 0, 0, 0, 0 ) 
     85            utau_ice(ji,jj) = utau_ice(ji,jj) * xcplmask(ji,jj,0) + zutau_ice(ji,jj) * ( 1. - xcplmask(ji,jj,0) ) 
     86            vtau_ice(ji,jj) = vtau_ice(ji,jj) * xcplmask(ji,jj,0) + zvtau_ice(ji,jj) * ( 1. - xcplmask(ji,jj,0) ) 
     87         END_2D 
     88         CALL lbc_lnk_multi( 'icesbc', utau_ice, 'U', -1.0_wp, vtau_ice, 'V', -1.0_wp ) 
    8689      ENDIF 
    8790      ! 
     
    114117      INTEGER, INTENT(in) ::   ksbc   ! flux formulation (user defined, bulk or Pure Coupled) 
    115118      ! 
    116       INTEGER  ::   ji, jj, jl                                ! dummy loop index 
    117       REAL(wp), DIMENSION(jpi,jpj,jpl) ::   zalb_os, zalb_cs  ! ice albedo under overcast/clear sky 
    118       REAL(wp), DIMENSION(jpi,jpj)     ::   zalb              ! 2D workspace 
     119      INTEGER  ::   ji, jj, jl      ! dummy loop index 
     120      REAL(wp) ::   zmiss_val       ! missing value retrieved from xios  
     121      REAL(wp), DIMENSION(jpi,jpj,jpl)              ::   zalb_os, zalb_cs  ! ice albedo under overcast/clear sky 
     122      REAL(wp), DIMENSION(:,:)        , ALLOCATABLE ::   zalb, zmsk00      ! 2D workspace 
    119123      !!-------------------------------------------------------------------- 
    120124      ! 
     
    127131      ENDIF 
    128132 
     133      ! get missing value from xml 
     134      CALL iom_miss_val( "icetemp", zmiss_val ) 
     135 
    129136      ! --- cloud-sky and overcast-sky ice albedos --- ! 
    130137      CALL ice_alb( t_su, h_i, h_s, ln_pnd_alb, a_ip_frac, h_ip, zalb_cs, zalb_os ) 
     
    139146      CASE( jp_usr )              !--- user defined formulation 
    140147                                  CALL usrdef_sbc_ice_flx( kt, h_s, h_i ) 
    141       CASE( jp_blk )              !--- bulk formulation 
    142                                   CALL blk_ice_flx    ( t_su, h_s, h_i, alb_ice )    !  
     148      CASE( jp_blk, jp_abl )  !--- bulk formulation & ABL formulation 
     149                                  CALL blk_ice_2    ( t_su, h_s, h_i, alb_ice, sf(jp_tair)%fnow(:,:,1), sf(jp_humi)%fnow(:,:,1),    & 
     150            &                                           sf(jp_slp)%fnow(:,:,1), sf(jp_qlw)%fnow(:,:,1), sf(jp_prec)%fnow(:,:,1), sf(jp_snow)%fnow(:,:,1) )    !  
    143151         IF( ln_mixcpl        )   CALL sbc_cpl_ice_flx( picefr=at_i_b, palbi=alb_ice, psst=sst_m, pist=t_su, phs=h_s, phi=h_i ) 
    144152         IF( nn_flxdist /= -1 )   CALL ice_flx_dist   ( t_su, alb_ice, qns_ice, qsr_ice, dqns_ice, evap_ice, devap_ice, nn_flxdist ) 
     
    152160 
    153161      !--- output ice albedo and surface albedo ---! 
    154       IF( iom_use('icealb') ) THEN 
    155          WHERE( at_i_b <= epsi06 )   ;   zalb(:,:) = rn_alb_oce 
    156          ELSEWHERE                   ;   zalb(:,:) = SUM( alb_ice * a_i_b, dim=3 ) / at_i_b 
     162      IF( iom_use('icealb') .OR. iom_use('albedo') ) THEN 
     163 
     164         ALLOCATE( zalb(jpi,jpj), zmsk00(jpi,jpj) ) 
     165 
     166         WHERE( at_i_b < 1.e-03 ) 
     167            zmsk00(:,:) = 0._wp 
     168            zalb  (:,:) = rn_alb_oce 
     169         ELSEWHERE 
     170            zmsk00(:,:) = 1._wp             
     171            zalb  (:,:) = SUM( alb_ice * a_i_b, dim=3 ) / at_i_b 
    157172         END WHERE 
    158          CALL iom_put( "icealb" , zalb(:,:) ) 
    159       ENDIF 
    160       IF( iom_use('albedo') ) THEN 
     173         ! ice albedo 
     174         CALL iom_put( 'icealb' , zalb * zmsk00 + zmiss_val * ( 1._wp - zmsk00 ) ) 
     175         ! ice+ocean albedo 
    161176         zalb(:,:) = SUM( alb_ice * a_i_b, dim=3 ) + rn_alb_oce * ( 1._wp - at_i_b ) 
    162          CALL iom_put( "albedo" , zalb(:,:) ) 
     177         CALL iom_put( 'albedo' , zalb ) 
     178 
     179         DEALLOCATE( zalb, zmsk00 ) 
     180 
    163181      ENDIF 
    164182      ! 
     
    270288      !!------------------------------------------------------------------- 
    271289      ! 
    272       REWIND( numnam_ice_ref )         ! Namelist namsbc in reference namelist : Ice dynamics 
    273290      READ  ( numnam_ice_ref, namsbc, IOSTAT = ios, ERR = 901) 
    274 901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namsbc in reference namelist', lwp ) 
    275       REWIND( numnam_ice_cfg )         ! Namelist namsbc in configuration namelist : Ice dynamics 
     291901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namsbc in reference namelist' ) 
    276292      READ  ( numnam_ice_cfg, namsbc, IOSTAT = ios, ERR = 902 ) 
    277 902   IF( ios >  0 )   CALL ctl_nam ( ios , 'namsbc in configuration namelist', lwp ) 
     293902   IF( ios >  0 )   CALL ctl_nam ( ios , 'namsbc in configuration namelist' ) 
    278294      IF(lwm) WRITE( numoni, namsbc ) 
    279295      ! 
Note: See TracChangeset for help on using the changeset viewer.