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 2228 – NEMO

Changeset 2228


Ignore:
Timestamp:
2010-10-12T16:33:06+02:00 (14 years ago)
Author:
smasson
Message:

update diurnal cycle from dev_r2174_DCY into DEV_r2106_LOCEAN2010

Location:
branches/DEV_r2106_LOCEAN2010/NEMO/OPA_SRC/SBC
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/DEV_r2106_LOCEAN2010/NEMO/OPA_SRC/SBC/sbcblk_core.F90

    r2198 r2228  
    177177      ENDIF 
    178178 
    179                        CALL fld_read( kt, nn_fsbc, sf )        ! input fields provided at the current time-step 
    180  
    181       IF( ln_dm2dc )   CALL sbc_dcy ( kt , sf(jp_qsr)%fnow )   ! modify now Qsr to include the diurnal cycle 
     179      CALL fld_read( kt, nn_fsbc, sf )        ! input fields provided at the current time-step 
    182180 
    183181#if defined key_lim3 
     
    264262      ! ----------------------------------------------------------------------------- ! 
    265263     
     264      IF( ln_dm2dc ) THEN   ;   qsr(:,:) = sbc_dcy( sf(jp_qsr)%fnow(:,:,1) )   ! modify now Qsr to include the diurnal cycle 
     265      ELSE                  ;   qsr(:,:) =          sf(jp_qsr)%fnow(:,:,1) 
     266      ENDIF 
    266267      ! ocean albedo assumed to be 0.066 
    267 !CDIR COLLAPSE 
    268       qsr (:,:) = ( 1. - 0.066 ) * sf(jp_qsr)%fnow(:,:,1) * tmask(:,:,1)                                     ! Short Wave 
     268      qsr (:,:) = ( 1. - 0.066 ) * qsr(:,:) * tmask(:,:,1)                                                 ! Short Wave 
    269269!CDIR COLLAPSE 
    270270      zqlw(:,:) = (  sf(jp_qlw)%fnow(:,:,1) - Stef * zst(:,:)*zst(:,:)*zst(:,:)*zst(:,:)  ) * tmask(:,:,1)   ! Long  Wave 
  • branches/DEV_r2106_LOCEAN2010/NEMO/OPA_SRC/SBC/sbccpl.F90

    r2224 r2228  
    2323   USE sbc_oce         ! Surface boundary condition: ocean fields 
    2424   USE sbc_ice         ! Surface boundary condition: ice fields 
     25   USE sbcdcy          ! surface boundary condition: diurnal cycle 
    2526   USE phycst          ! physical constants 
    2627#if defined key_lim3 
     
    728729         IF( srcv(jpr_qsroce)%laction )   qsr(:,:) = frcv(:,:,jpr_qsroce)  
    729730         IF( srcv(jpr_qsrmix)%laction )   qsr(:,:) = frcv(:,:,jpr_qsrmix) 
     731         IF( ln_dm2dc )   qsr(:,:) = sbc_dcy( qsr )                           ! modify qsr to include the diurnal cycle 
    730732         ! 
    731733         !                                                       ! total freshwater fluxes over the ocean (emp, emps) 
     
    11591161            &                     + palbi         (:,:,1) * zicefr(:,:,1) ) ) 
    11601162      END SELECT 
     1163      IF( ln_dm2dc ) THEN   ! modify qsr to include the diurnal cycle 
     1164         pqsr_tot(:,:  ) = sbc_dcy( pqsr_tot(:,:  ) ) 
     1165         pqsr_ice(:,:,1) = sbc_dcy( pqsr_ice(:,:,1) ) 
     1166      ENDIF 
    11611167 
    11621168      SELECT CASE( TRIM( cn_rcv_dqnsdt ) ) 
  • branches/DEV_r2106_LOCEAN2010/NEMO/OPA_SRC/SBC/sbcdcy.F90

    r2198 r2228  
    1616   USE phycst           ! ocean physics 
    1717   USE dom_oce          ! ocean space and time domain 
     18   USE sbc_oce          ! Surface boundary condition: ocean fields 
    1819   USE in_out_manager   ! I/O manager 
    1920 
    2021   IMPLICIT NONE 
    2122   PRIVATE 
    22    INTEGER                      ::   nday_qsr                    ! day when parameters were computed 
     23   INTEGER, PUBLIC              ::   nday_qsr                    ! day when parameters were computed 
    2324   REAL(wp), DIMENSION(jpi,jpj) ::   raa , rbb  , rcc  , rab     ! parameters used to compute the diurnal cycle 
    2425   REAL(wp), DIMENSION(jpi,jpj) ::   rtmd, rdawn, rdusk, rscal   !     -       -         -           -      - 
    25    REAL(wp), DIMENSION(jpi,jpj) ::   qsr_daily                   ! to hold daily mean QSR 
    2626   
    2727   PUBLIC   sbc_dcy     ! routine called by sbc 
     
    3434CONTAINS 
    3535 
    36       SUBROUTINE sbc_dcy( kt, pqsr ) 
     36      FUNCTION sbc_dcy( pqsrin ) RESULT( zqsrout ) 
    3737      !!---------------------------------------------------------------------- 
    3838      !!                  ***  ROUTINE sbc_dcy  *** 
     
    4848      !!              Part 1: a diurnally forced OGCM. Climate Dynamics 29:6, 575-590. 
    4949      !!---------------------------------------------------------------------- 
    50       INTEGER,                        INTENT(in   ) ::   kt     ! ocean time-step index 
    51       REAL(wp), DIMENSION(jpi,jpj,1), INTENT(inout) ::   pqsr   ! QSR flux with diurnal cycle 
    52       !! 
    53       INTEGER  ::   ji, jj                                      ! dummy loop indices 
     50      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) ::   pqsrin    ! input daily QSR flux  
     51      !! 
     52      INTEGER  ::   ji, jj                                       ! dummy loop indices 
    5453      REAL(wp) ::   ztwopi, zinvtwopi, zconvrad  
    5554      REAL(wp) ::   zlo, zup, zlousd, zupusd 
    56       REAL(wp) ::   zdsws, zdecrad, ztx 
     55      REAL(wp) ::   zdsws, zdecrad, ztx, zsin, zcos 
    5756      REAL(wp) ::   ztmp, ztmp1, ztmp2, ztest 
     57      REAL(wp), DIMENSION(jpi,jpj) ::   zqsrout                  ! output QSR flux with diurnal cycle 
    5858      !---------------------------statement functions------------------------ 
    59       REAL(wp) ::   fintegral, pt1, pt2, paaa, pbbb, pccc       ! dummy statement function arguments 
     59      REAL(wp) ::   fintegral, pt1, pt2, paaa, pbbb, pccc        ! dummy statement function arguments 
    6060      fintegral( pt1, pt2, paaa, pbbb, pccc ) =                         & 
    6161         &   paaa * pt2 + zinvtwopi * pbbb * SIN(pccc + ztwopi * pt2)   & 
     
    7070 
    7171      ! When are we during the day (from 0 to 1) 
    72       zlo = MOD( rdt / rday * REAL( kt-nit000, wp ), 1.) 
    73       zup = zlo + rdt / rday 
     72      zlo = ( REAL(nsec_day, wp) - 0.5   * rdttra(1) ) / rday 
     73      zup = zlo + ( REAL(nn_fsbc, wp) * rdttra(1) ) / rday 
    7474 
    7575      !                                           
    76       IF( kt == nit000 ) THEN       ! first time step only                
     76      IF( nday_qsr == -1 ) THEN       ! first time step only                
    7777         IF(lwp) THEN 
    7878            WRITE(numout,*) 
     
    8181            WRITE(numout,*) 
    8282         ENDIF 
    83          nday_qsr = 0 
    8483         ! Compute rcc needed to compute the time integral of the diurnal cycle 
    8584         rcc(:,:) = zconvrad * glamt(:,:) - rpi 
     
    9998         nday_qsr = nday  
    10099         ! number of days since the previous winter solstice (supposed to be always 21 December)          
    101          zdsws = 11 + nday_year 
     100         zdsws = REAL(11 + nday_year, wp) 
    102101         ! declination of the earths orbit 
    103102         zdecrad = (-23.5 * zconvrad) * COS( zdsws * ztwopi / REAL(nyear_len(1),wp) ) 
    104          ! save the daily QSR for nest hours of the day 
    105          qsr_daily(:,:) = pqsr(:,:,1) 
    106103         ! Compute A and B needed to compute the time integral of the diurnal cycle 
    107104         
     105         zsin = SIN( zdecrad )   ;   zcos = COS( zdecrad ) 
    108106         DO jj = 1, jpj 
    109107            DO ji = 1, jpi 
    110108               ztmp = zconvrad * gphit(ji,jj) 
    111                raa(ji,jj) = SIN( ztmp ) * SIN( zdecrad ) 
    112                rbb(ji,jj) = COS( ztmp ) * COS( zdecrad ) 
     109               raa(ji,jj) = SIN( ztmp ) * zsin 
     110               rbb(ji,jj) = COS( ztmp ) * zcos 
    113111            END DO   
    114112         END DO   
     
    140138         rdawn(:,:) = MOD((rdawn(:,:) + 1.), 1.) 
    141139         rdusk(:,:) = MOD((rdusk(:,:) + 1.), 1.) 
    142  
    143140 
    144141         !     2.2 Compute the scalling function: 
     
    166163         END DO   
    167164         ! 
    168          ztmp = rday / rdt 
     165         ztmp = rday / ( rdttra(1) * REAL(nn_fsbc, wp) ) 
    169166         rscal(:,:) = rscal(:,:) * ztmp 
    170167 
     
    184181                  zupusd = MAX(zupusd, zlo) 
    185182                  ztmp = fintegral(zlousd, zupusd, raa(ji,jj), rbb(ji,jj), rcc(ji,jj))  
    186                   pqsr(ji,jj,1) = qsr_daily(ji,jj) * ztmp * rscal(ji,jj) 
     183                  zqsrout(ji,jj) = pqsrin(ji,jj) * ztmp * rscal(ji,jj) 
    187184                  ! 
    188185               ELSE                                         ! day time in two parts 
     
    194191                  ztmp2 = fintegral(zlousd, zupusd, raa(ji,jj), rbb(ji,jj), rcc(ji,jj))  
    195192                  ztmp = ztmp1 + ztmp2 
    196                   pqsr(ji,jj,1) = qsr_daily(ji,jj) * ztmp * rscal(ji,jj) 
     193                  zqsrout(ji,jj) = pqsrin(ji,jj) * ztmp * rscal(ji,jj) 
    197194               ENDIF 
    198195            ELSE                                   ! 24h light or 24h night 
    199196               ! 
    200                IF( raa(ji,jj) > rbb(ji,jj) ) THEN         ! 24h day 
     197               IF( raa(ji,jj) > rbb(ji,jj) ) THEN           ! 24h day 
    201198                  ztmp = fintegral(zlo, zup, raa(ji,jj), rbb(ji,jj), rcc(ji,jj))  
    202                   pqsr(ji,jj,1) = qsr_daily(ji,jj) * ztmp * rscal(ji,jj) 
     199                  zqsrout(ji,jj) = pqsrin(ji,jj) * ztmp * rscal(ji,jj) 
    203200                  ! 
    204201               ELSE                                         ! No day 
    205                   pqsr(ji,jj,1) = 0.e0 
     202                  zqsrout(ji,jj) = 0.e0 
    206203               ENDIF 
    207204            ENDIF 
     
    209206      END DO   
    210207      ! 
    211    END SUBROUTINE sbc_dcy 
     208   END FUNCTION sbc_dcy 
    212209 
    213210   !!====================================================================== 
  • branches/DEV_r2106_LOCEAN2010/NEMO/OPA_SRC/SBC/sbcflx.F90

    r2198 r2228  
    123123      ENDIF 
    124124 
    125                        CALL fld_read( kt, nn_fsbc, sf )       ! input fields provided at the current time-step 
    126        
    127       IF( ln_dm2dc )   CALL sbc_dcy( kt , sf(jp_qsr)%fnow )   ! modify now Qsr to include the diurnal cycle 
     125      CALL fld_read( kt, nn_fsbc, sf )                            ! input fields provided at the current time-step 
     126      
     127      IF( MOD( kt-1, nn_fsbc ) == 0 ) THEN                        ! update ocean fluxes at each SBC frequency 
    128128 
    129       IF( MOD( kt-1, nn_fsbc ) == 0 ) THEN                    ! update ocean fluxes at each SBC frequency 
     129         IF( ln_dm2dc ) THEN   ;   qsr(:,:) = sbc_dcy( sf(jp_qsr)%fnow(:,:,1) )   ! modify now Qsr to include the diurnal cycle 
     130         ELSE                  ;   qsr(:,:) =          sf(jp_qsr)%fnow(:,:,1) 
     131         ENDIF 
    130132!CDIR COLLAPSE 
    131133         DO jj = 1, jpj                                           ! set the ocean fluxes from read fields 
     
    134136               vtau(ji,jj) = sf(jp_vtau)%fnow(ji,jj,1) 
    135137               qns (ji,jj) = sf(jp_qtot)%fnow(ji,jj,1) - sf(jp_qsr)%fnow(ji,jj,1) 
    136                qsr (ji,jj) = sf(jp_qsr )%fnow(ji,jj,1) 
    137138               emp (ji,jj) = sf(jp_emp )%fnow(ji,jj,1) 
    138139            END DO 
  • branches/DEV_r2106_LOCEAN2010/NEMO/OPA_SRC/SBC/sbcmod.F90

    r2198 r2228  
    1919   USE sbc_oce          ! Surface boundary condition: ocean fields 
    2020   USE sbc_ice          ! Surface boundary condition: ice fields 
     21   USE sbcdcy           ! surface boundary condition: diurnal cycle 
    2122   USE sbcssm           ! surface boundary condition: sea-surface mean variables 
    2223   USE sbcana           ! surface boundary condition: analytical formulation 
     
    134135         &   CALL ctl_stop( 'sea-ice model requires a bulk formulation or coupled configuration' ) 
    135136       
     137      IF( ln_dm2dc )   nday_qsr = -1   ! initialisation flag 
     138 
    136139      IF( ln_dm2dc .AND. .NOT.( ln_flx .OR. ln_blk_core ) )   & 
    137140         &   CALL ctl_stop( 'diurnal cycle into qsr field from daily values requires a flux or core-bulk formulation' ) 
Note: See TracChangeset for help on using the changeset viewer.