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 2198 for branches/DEV_r2106_LOCEAN2010/NEMO/OPA_SRC/SBC/sbcflx.F90 – NEMO

Ignore:
Timestamp:
2010-10-11T13:09:49+02:00 (14 years ago)
Author:
smasson
Message:

merge dev_r2174_DCY into DEV_r2106_LOCEAN2010

File:
1 edited

Legend:

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

    r1951 r2198  
    44   !! Ocean forcing:  momentum, heat and freshwater flux formulation 
    55   !!===================================================================== 
    6    !! History :  9.0   !  06-06  (G. Madec)  Original code 
     6   !! History :  1.0  !  2006-06  (G. Madec)  Original code 
     7   !!            3.3  !  2010-10  (S. Masson)  add diurnal cycle 
    78   !!---------------------------------------------------------------------- 
    89 
    910   !!---------------------------------------------------------------------- 
    1011   !!   namflx   : flux formulation namlist 
    11    !!   sbc_flx  : flux formulation as ocean surface boundary condition 
    12    !!              (forced mode, fluxes read in NetCDF files) 
    13    !!---------------------------------------------------------------------- 
    14    !! question diverses 
    15    !!  *   ajouter un test sur la division entier de freqh et rdttra ??? 
    16    !!  **  ajoute dans namelist: 1 year forcing files 
    17    !!                         or forcing file starts at the begining of the run 
    18    !!  *** we assume that the forcing file start and end with the previous 
    19    !!      year last record and the next year first record (useful for 
    20    !!      time interpolation, required even if no time interp???) 
    21    !!  *   ajouter un test sur la division de la frequence en pas de temps 
    22    !!  ==> daymod ajout de nsec_year = number of second since the begining of the year 
    23    !!      assumed to be 0 at 0h january the 1st (i.e. 24h december the 31) 
    24    !! 
    25    !!  *** regrouper dtatem et dtasal 
     12   !!   sbc_flx  : flux formulation as ocean surface boundary condition (forced mode, fluxes read in NetCDF files) 
    2613   !!---------------------------------------------------------------------- 
    2714   USE oce             ! ocean dynamics and tracers 
    2815   USE dom_oce         ! ocean space and time domain 
    29    USE sbc_oce         ! Surface boundary condition: ocean fields 
     16   USE sbc_oce         ! surface boundary condition: ocean fields 
     17   USE sbcdcy          ! surface boundary condition: diurnal cycle on qsr 
    3018   USE phycst          ! physical constants 
    3119   USE fldread         ! read input fields 
     
    5240#  include "vectopt_loop_substitute.h90" 
    5341   !!---------------------------------------------------------------------- 
    54    !!   OPA 9.0 , LOCEAN-IPSL (2006)  
     42   !! NEMO/OPA 3.3 , NEMO-consortium (2010)  
    5543   !! $Id$ 
    5644   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
    5745   !!---------------------------------------------------------------------- 
    58  
    5946CONTAINS 
    6047 
     
    9885      NAMELIST/namsbc_flx/ cn_dir, sn_utau, sn_vtau, sn_qtot, sn_qsr, sn_emp 
    9986      !!--------------------------------------------------------------------- 
    100       !                                         ! ====================== ! 
    101       IF( kt == nit000 ) THEN                   !  First call kt=nit000  ! 
    102          !                                      ! ====================== ! 
     87      ! 
     88      IF( kt == nit000 ) THEN                ! First call kt=nit000   
    10389         ! set file information 
    10490         cn_dir = './'        ! directory in which the model is executed 
    10591         ! ... default values (NB: frequency positive => hours, negative => months) 
    106          !              !   file    ! frequency !  variable  ! time intep !  clim   ! 'yearly' or ! weights  ! rotation   ! 
    107          !              !   name    !  (hours)  !   name     !   (T/F)    !  (T/F)  !  'monthly'  ! filename ! pairs      ! 
    108          sn_utau = FLD_N(   'utau'  ,    24     ,  'utau'    ,  .false.   , .false. ,   'yearly'  , ''       , ''         ) 
    109          sn_vtau = FLD_N(   'vtau'  ,    24     ,  'vtau'    ,  .false.   , .false. ,   'yearly'  , ''       , ''         ) 
    110          sn_qtot = FLD_N(   'qtot'  ,    24     ,  'qtot'    ,  .false.   , .false. ,   'yearly'  , ''       , ''         ) 
    111          sn_qsr  = FLD_N(   'qsr'   ,    24     ,  'qsr'     ,  .false.   , .false. ,   'yearly'  , ''       , ''         ) 
    112          sn_emp  = FLD_N(   'emp'   ,    24     ,  'emp'     ,  .false.   , .false. ,   'yearly'  , ''       , ''         ) 
    113  
    114          REWIND ( numnam )               ! ... read in namlist namflx 
     92         !              !  file   ! frequency !  variable  ! time intep !  clim   ! 'yearly' or ! weights  ! rotation  ! 
     93         !              !  name   !  (hours)  !   name     !   (T/F)    !  (T/F)  !  'monthly'  ! filename ! pairs     ! 
     94         sn_utau = FLD_N(  'utau' ,    24     ,  'utau'    ,  .false.   , .false. ,   'yearly'  , ''       , ''        ) 
     95         sn_vtau = FLD_N(  'vtau' ,    24     ,  'vtau'    ,  .false.   , .false. ,   'yearly'  , ''       , ''        ) 
     96         sn_qtot = FLD_N(  'qtot' ,    24     ,  'qtot'    ,  .false.   , .false. ,   'yearly'  , ''       , ''        ) 
     97         sn_qsr  = FLD_N(  'qsr'  ,    24     ,  'qsr'     ,  .false.   , .false. ,   'yearly'  , ''       , ''        ) 
     98         sn_emp  = FLD_N(  'emp'  ,    24     ,  'emp'     ,  .false.   , .false. ,   'yearly'  , ''       , ''        ) 
     99         ! 
     100         REWIND ( numnam )                         ! read in namlist namflx 
    115101         READ   ( numnam, namsbc_flx )  
    116  
    117          ! store namelist information in an array 
     102         ! 
     103         !                                         ! check: do we plan to use ln_dm2dc with non-daily forcing? 
     104         IF( ln_dm2dc .AND. sn_qsr%nfreqh /= 24 )   & 
     105            &   CALL ctl_stop( 'sbc_blk_core: ln_dm2dc can be activated only with daily short-wave forcing' )  
     106         ! 
     107         !                                         ! store namelist information in an array 
    118108         slf_i(jp_utau) = sn_utau   ;   slf_i(jp_vtau) = sn_vtau 
    119109         slf_i(jp_qtot) = sn_qtot   ;   slf_i(jp_qsr ) = sn_qsr  
    120110         slf_i(jp_emp ) = sn_emp 
    121  
    122          ! set sf structure 
    123          ALLOCATE( sf(jpfld), STAT=ierror ) 
     111         ! 
     112         ALLOCATE( sf(jpfld), STAT=ierror )        ! set sf structure 
    124113         IF( ierror > 0 ) THEN    
    125114            CALL ctl_stop( 'sbc_flx: unable to allocate sf structure' )   ;   RETURN   
     
    129118            ALLOCATE( sf(ji)%fdta(jpi,jpj,1,2) ) 
    130119         END DO 
    131  
    132  
    133          ! fill sf with slf_i and control print 
     120         !                                         ! fill sf with slf_i and control print 
    134121         CALL fld_fill( sf, slf_i, cn_dir, 'sbc_flx', 'flux formulation for ocean surface boundary condition', 'namsbc_flx' ) 
    135122         ! 
    136123      ENDIF 
    137124 
    138       CALL fld_read( kt, nn_fsbc, sf )           ! Read input fields and provides the 
    139       !                                          ! input fields at the current time-step 
     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 
    140128 
    141       IF( MOD( kt-1, nn_fsbc ) == 0 ) THEN 
    142          ! 
    143          ! set the ocean fluxes from read fields 
     129      IF( MOD( kt-1, nn_fsbc ) == 0 ) THEN                    ! update ocean fluxes at each SBC frequency 
    144130!CDIR COLLAPSE 
    145          DO jj = 1, jpj 
     131         DO jj = 1, jpj                                           ! set the ocean fluxes from read fields 
    146132            DO ji = 1, jpi 
    147133               utau(ji,jj) = sf(jp_utau)%fnow(ji,jj,1) 
     
    152138            END DO 
    153139         END DO 
    154           
    155          ! module of wind stress and wind speed at T-point 
    156          zcoef = 1. / ( zrhoa * zcdrag )  
     140         !                                                        ! module of wind stress and wind speed at T-point 
     141         zcoef = 1. / ( zrhoa * zcdrag ) 
    157142!CDIR NOVERRCHK 
    158143         DO jj = 2, jpjm1 
     
    168153         CALL lbc_lnk( taum(:,:), 'T', 1. )   ;   CALL lbc_lnk( wndm(:,:), 'T', 1. ) 
    169154 
    170          ! Initialization of emps (when no ice model) 
    171          emps(:,:) = emp (:,:)  
     155         emps(:,:) = emp (:,:)                                    ! Initialization of emps (needed when no ice model) 
    172156                   
    173          ! control print (if less than 100 time-step asked) 
    174          IF( nitend-nit000 <= 100 .AND. lwp ) THEN 
     157         IF( nitend-nit000 <= 100 .AND. lwp ) THEN                ! control print (if less than 100 time-step asked) 
    175158            WRITE(numout,*)  
    176159            WRITE(numout,*) '        read daily momentum, heat and freshwater fluxes OK' 
Note: See TracChangeset for help on using the changeset viewer.