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 1870 for branches/DEV_r1837_MLF/NEMO/OPA_SRC/SBC/sbcmod.F90 – NEMO

Ignore:
Timestamp:
2010-05-12T17:36:00+02:00 (14 years ago)
Author:
gm
Message:

ticket: #663 step-1 : introduce the modified forcing term

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/DEV_r1837_MLF/NEMO/OPA_SRC/SBC/sbcmod.F90

    r1792 r1870  
    44   !! Surface module :  provide to the ocean its surface boundary condition 
    55   !!====================================================================== 
    6    !! History :  3.0   !  07-2006  (G. Madec)  Original code 
    7    !!             -    !  08-2008  (S. Masson, E. .... ) coupled interface 
     6   !! History :  3.0  !  2006-07  (G. Madec)  Original code 
     7   !!            3.1  !  2008-08  (S. Masson, E. Maisonnave, G. Madec) coupled interface 
     8   !!            3.3  !  2010-04  (M. Leclair, G. Madec)  Forcing averaged over 2 time steps 
    89   !!---------------------------------------------------------------------- 
    910 
     
    4950#  include "domzgr_substitute.h90" 
    5051   !!---------------------------------------------------------------------- 
    51    !! NEMO/OPA 3.0 , LOCEAN-IPSL (2008)  
     52   !! NEMO/OPA 3.3 , LOCEAN-IPSL (2010)  
    5253   !! $Id$ 
    5354   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
     
    8687!!gm  IF( lk_sbc_cpl       ) THEN   ;   ln_cpl      = .TRUE.   ;   ELSE   ;   ln_cpl      = .FALSE.   ;   ENDIF 
    8788 
    88       IF ( Agrif_Root() ) THEN 
     89      IF( Agrif_Root() ) THEN 
    8990        IF( lk_lim2 )            nn_ice      = 2 
    9091        IF( lk_lim3 )            nn_ice      = 3 
     
    179180      !!                CAUTION : never mask the surface stress field (tke sbc) 
    180181      !! 
    181       !! ** Action  : - set the ocean surface boundary condition, i.e.   
    182       !!                utau, vtau, qns, qsr, emp, emps, qrp, erp 
     182      !! ** Action  : - set the ocean surface boundary condition at before and now  
     183      !!                time step, i.e.   
     184      !!                utau_b, vtau_b, qns_b, qsr_b, emp_n, emps_b, qrp_b, erp_b 
     185      !!                utau  , vtau  , qns  , qsr  , emp  , emps  , qrp  , erp 
    183186      !!              - updte the ice fraction : fr_i 
    184187      !!---------------------------------------------------------------------- 
     
    186189      !!--------------------------------------------------------------------- 
    187190 
    188       CALL iom_setkt( kt + nn_fsbc - 1 )         !  in sbc, iom_put is called every nn_fsbc time step 
    189       ! 
    190       ! ocean to sbc mean sea surface variables (ss._m) 
    191       ! --------------------------------------- 
    192       CALL sbc_ssm( kt )                         ! sea surface mean currents (at U- and V-points),  
    193       !                                          ! temperature and salinity (at T-point) over nf_sbc time-step 
    194       !                                          ! (i.e. sst_m, sss_m, ssu_m, ssv_m) 
    195  
    196       ! sbc formulation 
    197       ! --------------- 
    198           
    199       SELECT CASE( nsbc )                        ! Compute ocean surface boundary condition 
    200       !                                          ! (i.e. utau,vtau, qns, qsr, emp, emps) 
     191      !                                            ! ---------------------------------------- ! 
     192      IF( kt /= nit000 ) THEN                      !          Swap of forcing fields          ! 
     193         !                                         ! ---------------------------------------- ! 
     194         utau_b(:,:) = utau(:,:)                         ! Swap the ocean forcing fields 
     195         utau_b(:,:) = utau(:,:)                         ! (except at nitOOO where before fields 
     196         qns_b (:,:) = qns (:,:)                         !  are set the end of the routine) 
     197         qsr_b (:,:) = qsr (:,:) 
     198         emp_b (:,:) = emp (:,:) 
     199         emps_b(:,:) = emps(:,:) 
     200      ENDIF 
     201 
     202      !                                            ! ---------------------------------------- ! 
     203      !                                            !        forcing field computation         ! 
     204      !                                            ! ---------------------------------------- ! 
     205 
     206      CALL iom_setkt( kt + nn_fsbc - 1 )                 ! in sbc, iom_put is called every nn_fsbc time step 
     207      ! 
     208      CALL sbc_ssm( kt )                                 ! ocean sea surface variables (sst_m, sss_m, ssu_m, ssv_m) 
     209      !                                                  ! averaged over nf_sbc time-step 
     210 
     211                                                   !==  sbc formulation  ==! 
     212                                                             
     213      SELECT CASE( nsbc )                                ! Compute ocean surface boundary condition 
     214      !                                                  ! (i.e. utau,vtau, qns, qsr, emp, emps) 
    201215      CASE(  0 )   ;   CALL sbc_gyre    ( kt )                    ! analytical formulation : GYRE configuration 
    202216      CASE(  1 )   ;   CALL sbc_ana     ( kt )                    ! analytical formulation : uniform sbc 
     
    214228      END SELECT 
    215229 
    216       ! Misc. Options 
    217       ! ------------- 
     230      !                                            !==  Misc. Options  ==! 
    218231 
    219232!!gm  IF( ln_dm2dc       )   CALL sbc_dcy( kt )                 ! Daily mean qsr distributed over the Diurnal Cycle 
     
    236249      !                                                         ! (update freshwater fluxes) 
    237250      ! 
     251      !                                                ! ---------------------------------------- ! 
     252      IF( kt == nit000 ) THEN                          !   set the forcing field at nit000 - 1    ! 
     253         !                                             ! ---------------------------------------- ! 
     254         IF( ln_rstart .AND.    &                               !* Restart: read in restart file 
     255            & iom_varid( numror, 'utau_b', ldstop = .FALSE. ) > 0 ) THEN  
     256            IF(lwp) WRITE(numout,*) '          nit000-1 surface forcing fields red in the restart file' 
     257            CALL iom_get( numror, jpdom_autoglo, 'utau_b', utau_b )   ! before i-stress  (U-point) 
     258            CALL iom_get( numror, jpdom_autoglo, 'utau_b', utau_b )   ! before j-stress  (V-point) 
     259            CALL iom_get( numror, jpdom_autoglo, 'qns_b' , qns_b  )   ! before non solar heat flux (T-point) 
     260            CALL iom_get( numror, jpdom_autoglo, 'qsr_b' , qsr_b  )   ! before     solar heat flux (T-point) 
     261            CALL iom_get( numror, jpdom_autoglo, 'emp_b' , emp_b  )   ! before     freshwater flux (T-point) 
     262            CALL iom_get( numror, jpdom_autoglo, 'emps_b', emp_b  )   ! before C/D freshwater flux (T-point) 
     263            ! 
     264         ELSE                                                   !* no restart: set from nit000 values 
     265            IF(lwp) WRITE(numout,*) '          nit000-1 surface forcing fields set to nit000' 
     266            utau_b(:,:) = utau(:,:)  
     267            utau_b(:,:) = utau(:,:) 
     268            qns_b (:,:) = qns (:,:) 
     269            qsr_b (:,:) = qsr (:,:) 
     270            emp_b (:,:) = emp (:,:) 
     271            emps_b(:,:) = emps(:,:) 
     272         ENDIF 
     273      ENDIF 
     274 
     275      !                                                ! ---------------------------------------- ! 
     276      IF( lrst_oce ) THEN                              !      Write in the ocean restart file     ! 
     277         !                                             ! ---------------------------------------- ! 
     278         IF(lwp) WRITE(numout,*) 
     279         IF(lwp) WRITE(numout,*) 'sbc : ocean surface forcing fields written in ocean restart file ',   & 
     280            &                    'at it= ', kt,' date= ', ndastp 
     281         IF(lwp) WRITE(numout,*) '~~~~' 
     282         CALL iom_rstput( kt, nitrst, numrow, 'utau_b' , utau )    !  
     283         CALL iom_rstput( kt, nitrst, numrow, 'utau_b' , vtau ) 
     284         CALL iom_rstput( kt, nitrst, numrow, 'qns_b'  , qns  ) 
     285         CALL iom_rstput( kt, nitrst, numrow, 'qsr_b'  , qsr  ) 
     286         CALL iom_rstput( kt, nitrst, numrow, 'emp_b'  , emp  ) 
     287         CALL iom_rstput( kt, nitrst, numrow, 'emps_b' , emp  ) 
     288         ! 
     289      ENDIF 
     290 
     291      !                                                ! ---------------------------------------- ! 
     292      !                                                !        Outputs and control print         ! 
     293      !                                                ! ---------------------------------------- ! 
    238294      IF( MOD( kt-1, nn_fsbc ) == 0 ) THEN 
    239295         CALL iom_put( "emp"    , emp       )                   ! upward water flux 
     
    242298         CALL iom_put( "qns"    , qns       )                   ! solar heat flux    moved after the call to iom_setkt) 
    243299         CALL iom_put( "qsr"    ,       qsr )                   ! solar heat flux    moved after the call to iom_setkt) 
    244          IF(  nn_ice > 0 )   CALL iom_put( "ice_cover", fr_i )  ! ice fraction  
     300         IF( nn_ice > 0 )   CALL iom_put( "ice_cover", fr_i )   ! ice fraction  
    245301      ENDIF 
    246302      ! 
Note: See TracChangeset for help on using the changeset viewer.