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 14424 for NEMO/branches/UKMO/NEMO_4.0.4_ocean_mean_fluxes – NEMO

Ignore:
Timestamp:
2021-02-09T19:18:32+01:00 (4 years ago)
Author:
dancopsey
Message:

Process ocean mean ocean fluxes instead of grid box mean ocean fluxes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/UKMO/NEMO_4.0.4_ocean_mean_fluxes/src/OCE/SBC/sbccpl.F90

    r14423 r14424  
    213213#if defined key_si3 || defined key_cice 
    214214   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   a_i_last_couple !: Ice fractional area at last coupling time 
     215   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   leads_last_couple !: Leads fractional area at last coupling time 
    215216#endif 
    216217 
     
    233234      !!             ***  FUNCTION sbc_cpl_alloc  *** 
    234235      !!---------------------------------------------------------------------- 
    235       INTEGER :: ierr(5) 
     236      INTEGER :: ierr(6) 
    236237      !!---------------------------------------------------------------------- 
    237238      ierr(:) = 0 
     
    245246#if defined key_si3 || defined key_cice 
    246247      ALLOCATE( a_i_last_couple(jpi,jpj,jpl) , STAT=ierr(4) ) 
     248      ALLOCATE( leads_last_couple(jpi,jpj) , STAT=ierr(5) ) 
    247249#endif 
    248250      ! 
    249       IF( .NOT. ln_apr_dyn ) ALLOCATE( ssh_ib(jpi,jpj), ssh_ibb(jpi,jpj), apr(jpi, jpj), STAT=ierr(5) ) 
     251      IF( .NOT. ln_apr_dyn ) ALLOCATE( ssh_ib(jpi,jpj), ssh_ibb(jpi,jpj), apr(jpi, jpj), STAT=ierr(6) ) 
    250252 
    251253      sbc_cpl_alloc = MAXVAL( ierr ) 
     
    868870#if defined key_si3 || defined key_cice 
    869871       a_i_last_couple(:,:,:) = 0._wp 
     872       leads_last_couple(:,:) = 1._wp 
    870873#endif 
    871874      !                                                      ! ------------------------- !  
     
    11761179         IF( srcv(jn)%laction )   CALL cpl_rcv( jn, isec, frcv(jn)%z3, xcplmask(:,:,1:nn_cplmodel), nrcvinfo(jn) ) 
    11771180      END DO 
     1181 
     1182      ! Find out the leads fraction at the last coupling point 
     1183      leads_last_couple(:,:) = SUM(a_i_last_couple(:,:,:), dim=3) 
    11781184 
    11791185      !                                                      ! ========================= ! 
     
    14431449            SELECT CASE( TRIM( sn_rcv_emp%cldes ) )                                    ! evaporation - precipitation 
    14441450            CASE( 'conservative' ) 
    1445                zemp(:,:) = frcv(jpr_tevp)%z3(:,:,1) - ( frcv(jpr_rain)%z3(:,:,1) + frcv(jpr_snow)%z3(:,:,1) ) 
     1451               zemp(:,:) = frcv(jpr_tevp)%z3(:,:,1) * leads_last_couple(:,:) - ( frcv(jpr_rain)%z3(:,:,1) + frcv(jpr_snow)%z3(:,:,1) ) 
    14461452            CASE( 'oce only', 'oce and ice' ) 
    14471453               zemp(:,:) = frcv(jpr_oemp)%z3(:,:,1) 
     
    14681474         ! 
    14691475         !                                                       ! non solar heat flux over the ocean (qns) 
    1470          IF(      srcv(jpr_qnsoce)%laction ) THEN   ;   zqns(:,:) = frcv(jpr_qnsoce)%z3(:,:,1) 
     1476         IF(      srcv(jpr_qnsoce)%laction ) THEN   ;   zqns(:,:) = frcv(jpr_qnsoce)%z3(:,:,1) * leads_last_couple(:,:) 
    14711477         ELSE IF( srcv(jpr_qnsmix)%laction ) THEN   ;   zqns(:,:) = frcv(jpr_qnsmix)%z3(:,:,1) 
    14721478         ELSE                                       ;   zqns(:,:) = 0._wp 
     
    14871493 
    14881494         !                                                       ! solar flux over the ocean          (qsr) 
    1489          IF     ( srcv(jpr_qsroce)%laction ) THEN   ;   zqsr(:,:) = frcv(jpr_qsroce)%z3(:,:,1) 
     1495         IF     ( srcv(jpr_qsroce)%laction ) THEN   ;   zqsr(:,:) = frcv(jpr_qsroce)%z3(:,:,1) * leads_last_couple(:,:) 
    14901496         ELSE IF( srcv(jpr_qsrmix)%laction ) then   ;   zqsr(:,:) = frcv(jpr_qsrmix)%z3(:,:,1) 
    14911497         ELSE                                       ;   zqsr(:,:) = 0._wp 
     
    17281734         zsprecip(:,:) =   frcv(jpr_snow)%z3(:,:,1)                  ! May need to ensure positive here 
    17291735         ztprecip(:,:) =   frcv(jpr_rain)%z3(:,:,1) + zsprecip(:,:)  ! May need to ensure positive here 
    1730          zemp_tot(:,:) =   frcv(jpr_tevp)%z3(:,:,1) - ztprecip(:,:) 
     1736         zemp_tot(:,:) =   frcv(jpr_tevp)%z3(:,:,1) * leads_last_couple(:,:) - ztprecip(:,:) 
    17311737      CASE( 'oce and ice'   )   ! received fields: jpr_sbpr, jpr_semp, jpr_oemp, jpr_ievp 
    17321738         zemp_tot(:,:) = ziceld(:,:) * frcv(jpr_oemp)%z3(:,:,1) + picefr(:,:) * frcv(jpr_sbpr)%z3(:,:,1) 
     
    17871793 
    17881794      ! --- evaporation over ocean (used later for qemp) --- ! 
    1789       zevap_oce(:,:) = frcv(jpr_tevp)%z3(:,:,1) - zevap_ice_total(:,:) * picefr(:,:) 
     1795      zevap_oce(:,:) = frcv(jpr_tevp)%z3(:,:,1) * leads_last_couple(:,:) - zevap_ice_total(:,:) * picefr(:,:) 
    17901796 
    17911797      ! since the sensitivity of evap to temperature (devap/dT) is not prescribed by the atmosphere, we set it to 0 
     
    18741880      IF( iom_use('rain_ao_cea') )   CALL iom_put( 'rain_ao_cea' , ( tprecip(:,:) - sprecip(:,:) ) * picefr(:,:)         )  ! liquid precipitation over ocean (cell average) 
    18751881      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) 
    1876       IF( iom_use('evap_ao_cea') )   CALL iom_put( 'evap_ao_cea' , ( frcv(jpr_tevp)%z3(:,:,1) & 
     1882      IF( iom_use('evap_ao_cea') )   CALL iom_put( 'evap_ao_cea' , ( frcv(jpr_tevp)%z3(:,:,1) * leads_last_couple(:,:) & 
    18771883         &                                                         - frcv(jpr_ievp)%z3(:,:,1) * picefr(:,:) ) * tmask(:,:,1) ) ! ice-free oce evap (cell average) 
    18781884      ! note: runoff output is done in sbcrnf (which includes icebergs too) and iceshelf output is done in sbcisf 
     
    18921898         ! Calculate the total non solar heat flux. The ocean only non solar heat flux (zqns_oce) will be recalculated after this CASE 
    18931899         ! statement to be consistent with other coupling methods even though .zqns_oce = frcv(jpr_qnsoce)%z3(:,:,1) 
    1894          zqns_tot(:,:) = frcv(jpr_qnsoce)%z3(:,:,1) * ziceld(:,:) + SUM( zqns_ice(:,:,:) * a_i(:,:,:), dim=3 ) 
     1900         zqns_tot(:,:) = frcv(jpr_qnsoce)%z3(:,:,1) * leads_last_couple(:,:) + SUM( zqns_ice(:,:,:) * a_i_last_couple(:,:,:), dim=3 ) 
    18951901          
    18961902      CASE( 'conservative' )     ! the required fields are directly provided 
     
    20192025      IF ( srcv(jpr_icb)%laction ) CALL iom_put('hflx_icb_cea'    , - frcv(jpr_icb)%z3(:,:,1) * rLfus )   ! latent heat from icebergs melting 
    20202026      IF ( iom_use(   'hflx_rain_cea') ) CALL iom_put('hflx_rain_cea' , ( tprecip(:,:) - sprecip(:,:) ) * zcptrain(:,:) )        ! heat flux from rain (cell average) 
    2021       IF ( iom_use(   'hflx_evap_cea') ) CALL iom_put('hflx_evap_cea' , ( frcv(jpr_tevp)%z3(:,:,1) - frcv(jpr_ievp)%z3(:,:,1) * picefr(:,:) )  & 
     2027      IF ( iom_use(   'hflx_evap_cea') ) CALL iom_put('hflx_evap_cea' , ( frcv(jpr_tevp)%z3(:,:,1) * leads_last_couple(:,:) - frcv(jpr_ievp)%z3(:,:,1) * picefr(:,:) )  & 
    20222028           &                         * zcptn(:,:) * tmask(:,:,1) )            ! heat flux from evap (cell average) 
    20232029      IF ( iom_use(   'hflx_prec_cea') ) CALL iom_put('hflx_prec_cea' ,    sprecip(:,:) * ( zcptsnw(:,:) - rLfus )  &                    ! heat flux from all precip (cell avg) 
     
    20322038      !                                                      ! ========================= ! 
    20332039      CASE( 'oce only' ) 
    2034          zqsr_tot(:,:  ) = MAX( 0._wp , frcv(jpr_qsroce)%z3(:,:,1) ) * ziceld(:,:) 
     2040         zqsr_tot(:,:  ) = MAX( 0._wp , frcv(jpr_qsroce)%z3(:,:,1) ) * leads_last_couple(:,:) 
    20352041 
    20362042         ! For the Met Office the only sea ice solar flux is the transmitted qsr which is added onto zqsr_ice 
     
    21342140            ! Add retrieved transmitted solar radiation onto the ice and total solar radiation 
    21352141            zqsr_ice(:,:,:) = zqsr_ice(:,:,:) + zqtr_ice_top(:,:,:) 
    2136             zqsr_tot(:,:) = zqsr_tot(:,:) + SUM( zqtr_ice_top(:,:,:) * a_i(:,:,:), dim=3 ) 
     2142            zqsr_tot(:,:) = zqsr_tot(:,:) + SUM( zqtr_ice_top(:,:,:) * a_i_last_couple(:,:,:), dim=3 ) 
    21372143 
    21382144         !      if we are not getting this data from the coupler then assume zero (fully opaque ice) 
Note: See TracChangeset for help on using the changeset viewer.