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 1232 for trunk/NEMO/OPA_SRC/SBC/sbccpl.F90 – NEMO

Ignore:
Timestamp:
2008-12-24T09:29:44+01:00 (15 years ago)
Author:
smasson
Message:

coupling interface, bugfix from A. Caubel and E. Maisonnave, see ticket:155

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMO/OPA_SRC/SBC/sbccpl.F90

    r1230 r1232  
    7272   INTEGER, PARAMETER ::   jpr_tevp   = 21            ! total evaporation 
    7373   INTEGER, PARAMETER ::   jpr_ievp   = 22            ! solid evaporation (sublimation) 
    74    INTEGER, PARAMETER ::   jpr_prsb   = 23            ! sublimation - liquid precipitation - solid precipitation 
     74   INTEGER, PARAMETER ::   jpr_sbpr   = 23            ! sublimation - liquid precipitation - solid precipitation 
    7575   INTEGER, PARAMETER ::   jpr_semp   = 24            ! solid freshwater budget (sublimation - snow) 
    7676   INTEGER, PARAMETER ::   jpr_oemp   = 25            ! ocean freshwater budget (evap - precip) 
     
    116116   CHARACTER(len=100) ::   cn_rcv_qsr         = 'oce only'    ! 'oce only' 'conservative' 'oce and ice' or 'mixed oce-ice' 
    117117   CHARACTER(len=100) ::   cn_rcv_qns         = 'oce only'    ! 'oce only' 'conservative' 'oce and ice' or 'mixed oce-ice' 
    118    CHARACTER(len=100) ::   cn_rcv_emp         = 'oce only'    ! 'oce only' 'conservative' 'oce and ice' or 'mixed oce-ice' 
     118   CHARACTER(len=100) ::   cn_rcv_emp         = 'oce only'    ! 'oce only' 'conservative' or 'oce and ice' 
    119119   CHARACTER(len=100) ::   cn_rcv_rnf         = 'coupled'     ! 'coupled' 'climato' or 'mixed' 
    120120   CHARACTER(len=100) ::   cn_rcv_cal         = 'none'        ! 'none' or 'coupled' 
     
    302302      srcv(jpr_tevp)%clname = 'OTotEvap'      ! total evaporation (over oce + ice sublimation) 
    303303      srcv(jpr_ievp)%clname = 'OIceEvap'      ! evaporation over ice = sublimation 
    304       srcv(jpr_prsb)%clname = 'OPre-Sub'      ! sublimation - liquid precipitation - solid precipitation  
    305       srcv(jpr_semp)%clname = 'OISub-Sn'      ! ice solid water budget = sublimation - solid precipitation 
    306       srcv(jpr_oemp)%clname = 'OOEva-Pr'      ! ocean water budget = ocean Evap - ocean precip 
     304      srcv(jpr_sbpr)%clname = 'OSubMPre'      ! sublimation - liquid precipitation - solid precipitation  
     305      srcv(jpr_semp)%clname = 'OISubMSn'      ! ice solid water budget = sublimation - solid precipitation 
     306      srcv(jpr_oemp)%clname = 'OOEvaMPr'      ! ocean water budget = ocean Evap - ocean precip 
    307307      SELECT CASE( TRIM( cn_rcv_emp ) ) 
    308308      CASE( 'oce only'      )   ;   srcv(                                 jpr_oemp   )%laction = .TRUE.  
    309309      CASE( 'conservative'  )   ;   srcv( (/jpr_rain, jpr_snow, jpr_ievp, jpr_tevp/) )%laction = .TRUE. 
    310       CASE( 'oce and ice'   )   ;   srcv( (/jpr_ievp, jpr_prsb, jpr_semp, jpr_oemp/) )%laction = .TRUE. 
    311       CASE( 'mixed oce-ice' )   ;   srcv( (/jpr_rain,           jpr_semp, jpr_tevp/) )%laction = .TRUE.  
     310      CASE( 'oce and ice'   )   ;   srcv( (/jpr_ievp, jpr_sbpr, jpr_semp, jpr_oemp/) )%laction = .TRUE. 
    312311      CASE default              ;   CALL ctl_stop( 'sbc_cpl_init: wrong definition of cn_rcv_emp' ) 
    313312      END SELECT 
     
    355354      srcv(jpr_dqnsdt)%clname = 'O_dQnsdT'    
    356355      IF( TRIM( cn_rcv_dqnsdt ) == 'coupled' )   srcv(jpr_dqnsdt)%laction = .TRUE. 
    357  
     356      ! 
     357      ! non solar sensitivity mandatory for ice model 
     358      IF( TRIM( cn_rcv_dqnsdt ) == 'none' .and. k_ice /= 0 ) & 
     359            CALL ctl_stop( 'sbc_cpl_init: cn_rcv_dqnsdt must be coupled in namsbc_cpl namelist' ) 
     360      ! non solar sensitivity mandatory for mixed oce-ice solar radiation coupling technique 
     361      IF( TRIM( cn_rcv_dqnsdt ) == 'none' .and. TRIM( cn_rcv_qns ) == 'mixed oce-ice' ) & 
     362            CALL ctl_stop( 'sbc_cpl_init: namsbc_cpl namelist mismatch between cn_rcv_qns and cn_rcv_dqnsdt' ) 
    358363      !                                                      ! ------------------------- ! 
    359364      !                                                      !    Ice Qsr penetration    !    
     
    403408      CASE( 'weighted ice'  )   ;   ssnd(jps_albice)%laction = .TRUE. 
    404409      CASE( 'mixed oce-ice' )   ;   ssnd(jps_albmix)%laction = .TRUE. 
    405                                     CALL albedo_oce( zaos, zacs ) 
    406                                     ! Due to lack of information on nebulosity : mean clear/overcast sky 
    407                                     albedo_oce_mix(:,:) = ( zacs(:,:) + zaos(:,:) ) * 0.5 
    408410      END SELECT 
    409           
     411      ! 
     412      ! Need to calculate oceanic albedo if 
     413      !     1. sending mixed oce-ice albedo or 
     414      !     2. receiving mixed oce-ice solar radiation  
     415      IF ( TRIM ( cn_snd_albedo ) == 'mixed oce-ice' .OR. TRIM ( cn_rcv_qsr ) == 'mixed oce-ice' ) THEN 
     416        CALL albedo_oce( zaos, zacs ) 
     417        ! Due to lack of information on nebulosity : mean clear/overcast sky 
     418        albedo_oce_mix(:,:) = ( zacs(:,:) + zaos(:,:) ) * 0.5 
     419      ENDIF 
     420 
    410421      !                                                      ! ------------------------- ! 
    411422      !                                                      !  Ice fraction & Thickness !  
     
    588599         CASE( 'conservative' ) 
    589600            emp(:,:) = frcv(:,:,jpr_tevp) - ( frcv(:,:,jpr_rain) + frcv(:,:,jpr_snow) ) 
    590          CASE( 'mixed oce-ice' ) 
    591             emp(:,:) = frcv(:,:,jpr_tevp) - ( frcv(:,:,jpr_rain) + frcv(:,:,jpr_semp) ) 
    592601         CASE( 'ocean only', 'oce and ice' ) 
    593602            emp(:,:) = frcv(:,:,jpr_oemp) 
     
    854863      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj) ::   palbi      ! ice albedo 
    855864      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj) ::   psst       ! sea surface temperature      [Celcius] 
    856       REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj) ::   pist       ! ice surface temperature      [Celcius] 
     865      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj) ::   pist       ! ice surface temperature      [Kelvin] 
    857866      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   pqns_tot   ! total non solar heat flux    [W/m2] 
    858867      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   pqns_ice   ! ice   non solar heat flux    [W/m2] 
    859868      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   pqsr_tot   ! total     solar heat flux    [W/m2] 
    860869      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   pqsr_ice   ! ice       solar heat flux    [W/m2] 
    861       REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   pemp_tot   ! total     freshwater budget  [Kg/m2/s] 
    862       REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   pemp_ice   ! ice solid freshwater budget  [Kg/m2/s] 
    863       REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   psprecip   ! solid precipitation          [Kg/m2/s] 
     870      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   pemp_tot   ! total     freshwater budget        [Kg/m2/s] 
     871      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   pemp_ice   ! solid freshwater budget over ice   [Kg/m2/s] 
     872      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   psprecip   ! Net solid precipitation (=emp_ice) [Kg/m2/s] 
    864873      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   pdqns_ice  ! d(Q non solar)/d(Temperature) over ice 
    865874     !! 
     
    867876      INTEGER ::   isec, info       ! temporary integer 
    868877      REAL(wp)::   zcoef, ztsurf    ! temporary scalar 
     878      REAL(wp), DIMENSION(jpi,jpj)::   zsnow    ! snow precipitation  
    869879      !!---------------------------------------------------------------------- 
    870880      ! 
     
    880890         pemp_tot(:,:) = frcv(:,:,jpr_tevp) - frcv(:,:,jpr_rain) - frcv(:,:,jpr_snow) 
    881891         pemp_ice(:,:) = frcv(:,:,jpr_ievp) - frcv(:,:,jpr_snow) 
    882          psprecip(:,:) = frcv(:,:,jpr_snow) 
    883       CASE( 'oce and ice'   )   ! received fields: jpr_prsb, jpr_semp, jpr_oemp 
    884          pemp_tot(:,:) = p_frld(:,:) * frcv(:,:,jpr_oemp) + (1.- p_frld(:,:)) * frcv(:,:,jpr_prsb)  
     892         zsnow   (:,:) = frcv(:,:,jpr_snow) 
     893      CASE( 'oce and ice'   )   ! received fields: jpr_sbpr, jpr_semp, jpr_oemp 
     894         pemp_tot(:,:) = p_frld(:,:) * frcv(:,:,jpr_oemp) + (1.- p_frld(:,:)) * frcv(:,:,jpr_sbpr)  
    885895         pemp_ice(:,:) = frcv(:,:,jpr_semp) 
    886          psprecip(:,:) = - frcv(:,:,jpr_semp) + frcv(:,:,jpr_ievp) 
    887       CASE( 'mixed oce-ice' )   ! received fields: jpr_rain, jpr_semp, jpr_tevp 
    888          pemp_tot(:,:) = frcv(:,:,jpr_tevp) - frcv(:,:,jpr_rain) + frcv(:,:,jpr_semp)       !!gm here sublimation error  ??? 
    889          pemp_ice(:,:) = frcv(:,:,jpr_semp) 
    890          psprecip(:,:) = frcv(:,:,jpr_semp)                            !!gm here error due to sublimation 
     896         zsnow   (:,:) = - frcv(:,:,jpr_semp) + frcv(:,:,jpr_ievp) 
    891897      END SELECT 
     898      psprecip(:,:) = - pemp_ice(:,:) 
    892899      !    
    893  
    894900      !                                                           ! runoffs and calving (put in emp_tot) 
    895901      IF( srcv(jpr_rnf)%laction )   pemp_tot(:,:) = pemp_tot(:,:) -      frcv(:,:,jpr_rnf) 
     
    924930         pqns_tot(:,:) = frcv(:,:,jpr_qnsmix) 
    925931         pqns_ice(:,:) = frcv(:,:,jpr_qnsmix)    & 
    926             &          + frcv(:,:,jpr_dqnsdt) * ( pist(:,:) - psst(:,:) ) * ( 1. - p_frld(:,:) ) 
     932            &          + frcv(:,:,jpr_dqnsdt) * ( pist(:,:) - ( (rt0 + psst(:,:))*p_frld(:,:) + pist(:,:)*(1. - p_frld(:,:)) ) ) 
    927933      END SELECT 
    928934      !                                                           ! snow melting heat flux .... 
    929935      !   energy for melting solid precipitation over free ocean 
    930936      zcoef = xlsn / rhosn 
    931       pqns_tot(:,:) = pqns_tot(:,:) - p_frld(:,:) * psprecip(:,:) * zcoef 
     937      pqns_tot(:,:) = pqns_tot(:,:) - p_frld(:,:) * zsnow(:,:) * zcoef 
    932938!!gm 
    933939!!    currently it is taken into account in leads budget but not in the qns_tot, and thus not in  
     
    949955      CASE( 'mixed oce-ice' ) 
    950956         pqsr_tot(:,:) = frcv(:,:,jpr_qsrmix) 
    951 !!gm  cpl_albedo ???? kezako ?????   je pige pas grand chose ici.... 
     957!       Create solar heat flux over ice using incoming solar heat flux and albedos 
     958!       ( see OASIS3 user guide, 5th edition, p39 ) 
    952959         pqsr_ice(:,:) = frcv(:,:,jpr_qsrmix) * ( 1.- palbi(:,:) )   & 
    953960            &          / (  1.- ( albedo_oce_mix(:,:) * ( 1.- p_frld(:,:) )   & 
Note: See TracChangeset for help on using the changeset viewer.