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 7278 for branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/SBC/sbccpl.F90 – NEMO

Ignore:
Timestamp:
2016-11-21T10:38:43+01:00 (7 years ago)
Author:
flavoni
Message:

update branch CNRS-2016 to trunk 6720

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/SBC/sbccpl.F90

    r7277 r7278  
    10061006      IF( srcv(jpr_toce)%laction ) THEN                      ! received by sas in case of opa <-> sas coupling 
    10071007         sst_m(:,:) = frcv(jpr_toce)%z3(:,:,1) 
    1008          IF( srcv(jpr_soce)%laction .AND. ln_useCT ) THEN    ! make sure that sst_m is the potential temperature 
     1008         IF( srcv(jpr_soce)%laction .AND. l_useCT ) THEN    ! make sure that sst_m is the potential temperature 
    10091009            sst_m(:,:) = eos_pt_from_ct( sst_m(:,:), sss_m(:,:) ) 
    10101010         ENDIF 
     
    13701370      ! 
    13711371      INTEGER ::   jl   ! dummy loop index 
    1372       REAL(wp), POINTER, DIMENSION(:,:  ) ::   zcptn, ztmp, zicefr, zmsk 
    1373       REAL(wp), POINTER, DIMENSION(:,:  ) ::   zemp_tot, zemp_ice, zsprecip, ztprecip, zqns_tot, zqsr_tot 
    1374       REAL(wp), POINTER, DIMENSION(:,:,:) ::   zqns_ice, zqsr_ice, zdqns_ice 
    1375       REAL(wp), POINTER, DIMENSION(:,:  ) ::   zevap, zsnw, zqns_oce, zqsr_oce, zqprec_ice, zqemp_oce ! for LIM3 
     1372      REAL(wp), POINTER, DIMENSION(:,:  ) ::   zcptn, ztmp, zicefr, zmsk, zsnw 
     1373      REAL(wp), POINTER, DIMENSION(:,:  ) ::   zemp_tot, zemp_ice, zemp_oce, ztprecip, zsprecip, zevap, zevap_ice, zdevap_ice 
     1374      REAL(wp), POINTER, DIMENSION(:,:  ) ::   zqns_tot, zqns_oce, zqsr_tot, zqsr_oce, zqprec_ice, zqemp_oce, zqemp_ice 
     1375      REAL(wp), POINTER, DIMENSION(:,:,:) ::   zqns_ice, zqsr_ice, zdqns_ice, zqevap_ice 
    13761376      !!---------------------------------------------------------------------- 
    13771377      ! 
    13781378      IF( nn_timing == 1 )   CALL timing_start('sbc_cpl_ice_flx') 
    13791379      ! 
    1380       CALL wrk_alloc( jpi,jpj,       zcptn, ztmp, zicefr, zmsk, zemp_tot, zemp_ice, zsprecip, ztprecip, zqns_tot, zqsr_tot ) 
    1381       CALL wrk_alloc( jpi,jpj,jpl,   zqns_ice, zqsr_ice, zdqns_ice ) 
     1380      CALL wrk_alloc( jpi,jpj,     zcptn, ztmp, zicefr, zmsk, zsnw ) 
     1381      CALL wrk_alloc( jpi,jpj,     zemp_tot, zemp_ice, zemp_oce, ztprecip, zsprecip, zevap, zevap_ice, zdevap_ice ) 
     1382      CALL wrk_alloc( jpi,jpj,     zqns_tot, zqns_oce, zqsr_tot, zqsr_oce, zqprec_ice, zqemp_oce, zqemp_ice ) 
     1383      CALL wrk_alloc( jpi,jpj,jpl, zqns_ice, zqsr_ice, zdqns_ice, zqevap_ice ) 
    13821384 
    13831385      IF( ln_mixcpl )   zmsk(:,:) = 1. - xcplmask(:,:,0) 
     
    14141416         ztprecip(:,:) = frcv(jpr_semp)%z3(:,:,1) - frcv(jpr_sbpr)%z3(:,:,1) + zsprecip(:,:) 
    14151417      END SELECT 
    1416  
    1417       IF( iom_use('subl_ai_cea') )   & 
    1418          CALL iom_put( 'subl_ai_cea', frcv(jpr_ievp)%z3(:,:,1) * zicefr(:,:) )   ! Sublimation over sea-ice         (cell average) 
    1419       !    
    1420       !                                                           ! runoffs and calving (put in emp_tot) 
     1418#if defined key_lim3 
     1419      ! zsnw = snow percentage over ice after wind blowing 
     1420      zsnw(:,:) = 0._wp 
     1421      CALL lim_thd_snwblow( p_frld, zsnw ) 
     1422       
     1423      ! --- evaporation (used later in sbccpl) --- ! 
     1424      zevap(:,:) = zemp_tot(:,:) + ztprecip(:,:) 
     1425 
     1426      ! --- evaporation over ice (kg/m2/s) --- ! 
     1427      zevap_ice(:,:) = frcv(jpr_ievp)%z3(:,:,1) 
     1428      ! since the sensitivity of evap to temperature (devap/dT) is not prescribed by the atmosphere, we set it to 0 
     1429      ! therefore, sublimation is not redistributed over the ice categories in case no subgrid scale fluxes are provided by atm. 
     1430      zdevap_ice(:,:) = 0._wp 
     1431       
     1432      ! --- evaporation minus precipitation corrected for the effect of wind blowing on snow --- ! 
     1433      zemp_oce(:,:) = zemp_tot(:,:) - zemp_ice(:,:) - zsprecip * (1._wp - zsnw) 
     1434      zemp_ice(:,:) = zemp_ice(:,:) + zsprecip * (1._wp - zsnw)     
     1435 
     1436      ! --- runoffs (included in emp later on) --- ! 
     1437      IF( srcv(jpr_rnf)%laction )   rnf(:,:) = frcv(jpr_rnf)%z3(:,:,1) 
     1438 
     1439      ! --- calving (put in emp_tot and emp_oce) --- ! 
     1440      IF( srcv(jpr_cal)%laction ) THEN  
     1441         zemp_tot(:,:) = zemp_tot(:,:) - frcv(jpr_cal)%z3(:,:,1) 
     1442         zemp_oce(:,:) = zemp_oce(:,:) - frcv(jpr_cal)%z3(:,:,1) 
     1443         CALL iom_put( 'calving_cea', frcv(jpr_cal)%z3(:,:,1) ) 
     1444      ENDIF 
     1445       
     1446      IF( ln_mixcpl ) THEN 
     1447         emp_tot(:,:) = emp_tot(:,:) * xcplmask(:,:,0) + zemp_tot(:,:) * zmsk(:,:) 
     1448         emp_ice(:,:) = emp_ice(:,:) * xcplmask(:,:,0) + zemp_ice(:,:) * zmsk(:,:) 
     1449         emp_oce(:,:) = emp_oce(:,:) * xcplmask(:,:,0) + zemp_oce(:,:) * zmsk(:,:) 
     1450         sprecip(:,:) = sprecip(:,:) * xcplmask(:,:,0) + zsprecip(:,:) * zmsk(:,:) 
     1451         tprecip(:,:) = tprecip(:,:) * xcplmask(:,:,0) + ztprecip(:,:) * zmsk(:,:) 
     1452         DO jl=1,jpl 
     1453            evap_ice (:,:,jl) = evap_ice (:,:,jl) * xcplmask(:,:,0) + zevap_ice (:,:) * zmsk(:,:) 
     1454            devap_ice(:,:,jl) = devap_ice(:,:,jl) * xcplmask(:,:,0) + zdevap_ice(:,:) * zmsk(:,:) 
     1455         ENDDO 
     1456      ELSE 
     1457         emp_tot(:,:) =         zemp_tot(:,:) 
     1458         emp_ice(:,:) =         zemp_ice(:,:) 
     1459         emp_oce(:,:) =         zemp_oce(:,:)      
     1460         sprecip(:,:) =         zsprecip(:,:) 
     1461         tprecip(:,:) =         ztprecip(:,:) 
     1462         DO jl=1,jpl 
     1463            evap_ice (:,:,jl) = zevap_ice (:,:) 
     1464            devap_ice(:,:,jl) = zdevap_ice(:,:) 
     1465         ENDDO 
     1466      ENDIF 
     1467       
     1468      IF( iom_use('subl_ai_cea') )   CALL iom_put( 'subl_ai_cea', zevap_ice(:,:) * zicefr(:,:)    )  ! Sublimation over sea-ice (cell average) 
     1469                                     CALL iom_put( 'snowpre'    , sprecip                         )  ! Snow 
     1470      IF( iom_use('snow_ao_cea') )   CALL iom_put( 'snow_ao_cea', sprecip(:,:) * ( 1._wp - zsnw ) )  ! Snow over ice-free ocean  (cell average) 
     1471      IF( iom_use('snow_ai_cea') )   CALL iom_put( 'snow_ai_cea', sprecip(:,:) *           zsnw   )  ! Snow over sea-ice         (cell average)     
     1472#else 
     1473      ! Sublimation over sea-ice (cell average) 
     1474      IF( iom_use('subl_ai_cea') )  CALL iom_put( 'subl_ai_cea', frcv(jpr_ievp)%z3(:,:,1) * zicefr(:,:) ) 
     1475      ! runoffs and calving (put in emp_tot) 
    14211476      IF( srcv(jpr_rnf)%laction )   rnf(:,:) = frcv(jpr_rnf)%z3(:,:,1) 
    14221477      IF( srcv(jpr_cal)%laction ) THEN  
     
    14421497      IF( iom_use('snow_ai_cea') )   & 
    14431498         CALL iom_put( 'snow_ai_cea', sprecip(:,:) * zicefr(:,:)             )   ! Snow        over sea-ice         (cell average) 
     1499#endif 
    14441500 
    14451501      !                                                      ! ========================= ! 
     
    14971553      IF( iom_use('hflx_snow_cea') )    CALL iom_put( 'hflx_snow_cea', ztmp + sprecip(:,:) * zcptn(:,:) )   ! heat flux from snow (cell average) 
    14981554 
    1499 #if defined key_lim3 
    1500       CALL wrk_alloc( jpi,jpj, zevap, zsnw, zqns_oce, zqprec_ice, zqemp_oce )  
    1501  
    1502       ! --- evaporation --- ! 
    1503       ! clem: evap_ice is set to 0 for LIM3 since we still do not know what to do with sublimation 
    1504       ! the problem is: the atm. imposes both mass evaporation and heat removed from the snow/ice 
    1505       !                 but it is incoherent WITH the ice model   
    1506       DO jl=1,jpl 
    1507          evap_ice(:,:,jl) = 0._wp  ! should be: frcv(jpr_ievp)%z3(:,:,1) 
    1508       ENDDO 
    1509       zevap(:,:) = zemp_tot(:,:) + ztprecip(:,:) ! evaporation over ocean 
    1510  
    1511       ! --- evaporation minus precipitation --- ! 
    1512       emp_oce(:,:) = emp_tot(:,:) - emp_ice(:,:) 
    1513  
     1555#if defined key_lim3       
    15141556      ! --- non solar flux over ocean --- ! 
    15151557      !         note: p_frld cannot be = 0 since we limit the ice concentration to amax 
     
    15171559      WHERE( p_frld /= 0._wp )  zqns_oce(:,:) = ( zqns_tot(:,:) - SUM( a_i * zqns_ice, dim=3 ) ) / p_frld(:,:) 
    15181560 
    1519       ! --- heat flux associated with emp --- ! 
    1520       zsnw(:,:) = 0._wp 
    1521       CALL lim_thd_snwblow( p_frld, zsnw )  ! snow distribution over ice after wind blowing 
     1561      ! --- heat flux associated with emp (W/m2) --- ! 
    15221562      zqemp_oce(:,:) = -      zevap(:,:)                   * p_frld(:,:)      *   zcptn(:,:)   &      ! evap 
    15231563         &             + ( ztprecip(:,:) - zsprecip(:,:) )                    *   zcptn(:,:)   &      ! liquid precip 
    15241564         &             +   zsprecip(:,:)                   * ( 1._wp - zsnw ) * ( zcptn(:,:) - lfus ) ! solid precip over ocean 
    1525       qemp_ice(:,:)  = -   frcv(jpr_ievp)%z3(:,:,1)        * zicefr(:,:)      *   zcptn(:,:)   &      ! ice evap 
    1526          &             +   zsprecip(:,:)                   * zsnw             * ( zcptn(:,:) - lfus ) ! solid precip over ice 
    1527  
     1565!      zqemp_ice(:,:) = -   frcv(jpr_ievp)%z3(:,:,1)        * zicefr(:,:)      *   zcptn(:,:)   &      ! ice evap 
     1566!         &             +   zsprecip(:,:)                   * zsnw             * ( zcptn(:,:) - lfus ) ! solid precip over ice 
     1567      zqemp_ice(:,:) =      zsprecip(:,:)                   * zsnw             * ( zcptn(:,:) - lfus ) ! solid precip over ice (only) 
     1568                                                                                                       ! qevap_ice=0 since we consider Tice=0°C 
     1569       
    15281570      ! --- heat content of precip over ice in J/m3 (to be used in 1D-thermo) --- ! 
    15291571      zqprec_ice(:,:) = rhosn * ( zcptn(:,:) - lfus ) 
    15301572 
    1531       ! --- total non solar flux --- ! 
    1532       zqns_tot(:,:) = zqns_tot(:,:) + qemp_ice(:,:) + zqemp_oce(:,:) 
     1573      ! --- heat content of evap over ice in W/m2 (to be used in 1D-thermo) --- ! 
     1574      DO jl = 1, jpl 
     1575         zqevap_ice(:,:,jl) = 0._wp ! should be -evap * ( ( Tice - rt0 ) * cpic ) but we do not have Tice, so we consider Tice=0°C 
     1576      END DO 
     1577 
     1578      ! --- total non solar flux (including evap/precip) --- ! 
     1579      zqns_tot(:,:) = zqns_tot(:,:) + zqemp_ice(:,:) + zqemp_oce(:,:) 
    15331580 
    15341581      ! --- in case both coupled/forced are active, we must mix values --- !  
     
    15371584         qns_oce(:,:) = qns_oce(:,:) * xcplmask(:,:,0) + zqns_oce(:,:)* zmsk(:,:) 
    15381585         DO jl=1,jpl 
    1539             qns_ice(:,:,jl) = qns_ice(:,:,jl) * xcplmask(:,:,0) +  zqns_ice(:,:,jl)* zmsk(:,:) 
     1586            qns_ice  (:,:,jl) = qns_ice  (:,:,jl) * xcplmask(:,:,0) +  zqns_ice  (:,:,jl)* zmsk(:,:) 
     1587            qevap_ice(:,:,jl) = qevap_ice(:,:,jl) * xcplmask(:,:,0) +  zqevap_ice(:,:,jl)* zmsk(:,:) 
    15401588         ENDDO 
    15411589         qprec_ice(:,:) = qprec_ice(:,:) * xcplmask(:,:,0) + zqprec_ice(:,:)* zmsk(:,:) 
    15421590         qemp_oce (:,:) =  qemp_oce(:,:) * xcplmask(:,:,0) +  zqemp_oce(:,:)* zmsk(:,:) 
    1543 !!clem         evap_ice(:,:) = evap_ice(:,:) * xcplmask(:,:,0) 
     1591         qemp_ice (:,:) =  qemp_ice(:,:) * xcplmask(:,:,0) +  zqemp_ice(:,:)* zmsk(:,:) 
    15441592      ELSE 
    15451593         qns_tot  (:,:  ) = zqns_tot  (:,:  ) 
    15461594         qns_oce  (:,:  ) = zqns_oce  (:,:  ) 
    15471595         qns_ice  (:,:,:) = zqns_ice  (:,:,:) 
    1548          qprec_ice(:,:)   = zqprec_ice(:,:) 
    1549          qemp_oce (:,:)   = zqemp_oce (:,:) 
    1550       ENDIF 
    1551  
    1552       CALL wrk_dealloc( jpi,jpj, zevap, zsnw, zqns_oce, zqprec_ice, zqemp_oce )  
     1596         qevap_ice(:,:,:) = zqevap_ice(:,:,:) 
     1597         qprec_ice(:,:  ) = zqprec_ice(:,:  ) 
     1598         qemp_oce (:,:  ) = zqemp_oce (:,:  ) 
     1599         qemp_ice (:,:  ) = zqemp_ice (:,:  ) 
     1600      ENDIF 
    15531601#else 
    1554       ! 
    15551602      ! clem: this formulation is certainly wrong... but better than it was before... 
    15561603      zqns_tot(:,:) = zqns_tot(:,:)                       &            ! zqns_tot update over free ocean with: 
     
    16191666 
    16201667#if defined key_lim3 
    1621       CALL wrk_alloc( jpi,jpj, zqsr_oce )  
    16221668      ! --- solar flux over ocean --- ! 
    16231669      !         note: p_frld cannot be = 0 since we limit the ice concentration to amax 
     
    16271673      IF( ln_mixcpl ) THEN   ;   qsr_oce(:,:) = qsr_oce(:,:) * xcplmask(:,:,0) +  zqsr_oce(:,:)* zmsk(:,:) 
    16281674      ELSE                   ;   qsr_oce(:,:) = zqsr_oce(:,:)   ;   ENDIF 
    1629  
    1630       CALL wrk_dealloc( jpi,jpj, zqsr_oce )  
    16311675#endif 
    16321676 
     
    16791723      fr2_i0(:,:) = ( 0.82 * ( 1.0 - cldf_ice ) + 0.65 * cldf_ice ) 
    16801724 
    1681       CALL wrk_dealloc( jpi,jpj,       zcptn, ztmp, zicefr, zmsk, zemp_tot, zemp_ice, zsprecip, ztprecip, zqns_tot, zqsr_tot ) 
    1682       CALL wrk_dealloc( jpi,jpj,jpl,   zqns_ice, zqsr_ice, zdqns_ice ) 
     1725      CALL wrk_dealloc( jpi,jpj,     zcptn, ztmp, zicefr, zmsk, zsnw ) 
     1726      CALL wrk_dealloc( jpi,jpj,     zemp_tot, zemp_ice, zemp_oce, ztprecip, zsprecip, zevap, zevap_ice, zdevap_ice ) 
     1727      CALL wrk_dealloc( jpi,jpj,     zqns_tot, zqns_oce, zqsr_tot, zqsr_oce, zqprec_ice, zqemp_oce, zqemp_ice ) 
     1728      CALL wrk_dealloc( jpi,jpj,jpl, zqns_ice, zqsr_ice, zdqns_ice, zqevap_ice ) 
    16831729      ! 
    16841730      IF( nn_timing == 1 )   CALL timing_stop('sbc_cpl_ice_flx') 
     
    17191765          
    17201766         IF ( nn_components == jp_iam_opa ) THEN 
    1721             ztmp1(:,:) = tsn(:,:,1,jp_tem)   ! send temperature as it is (potential or conservative) -> use of ln_useCT on the received part 
     1767            ztmp1(:,:) = tsn(:,:,1,jp_tem)   ! send temperature as it is (potential or conservative) -> use of l_useCT on the received part 
    17221768         ELSE 
    17231769            ! we must send the surface potential temperature  
    1724             IF( ln_useCT )  THEN    ;   ztmp1(:,:) = eos_pt_from_ct( tsn(:,:,1,jp_tem), tsn(:,:,1,jp_sal) ) 
     1770            IF( l_useCT )  THEN    ;   ztmp1(:,:) = eos_pt_from_ct( tsn(:,:,1,jp_tem), tsn(:,:,1,jp_sal) ) 
    17251771            ELSE                    ;   ztmp1(:,:) = tsn(:,:,1,jp_tem) 
    17261772            ENDIF 
Note: See TracChangeset for help on using the changeset viewer.