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 9259 for branches/UKMO – NEMO

Changeset 9259 for branches/UKMO


Ignore:
Timestamp:
2018-01-18T13:14:23+01:00 (6 years ago)
Author:
jcastill
Message:

Changes to stop reading and using the pressure forcing file when coupling to the atmospheric mean sea level pressure

Location:
branches/UKMO/r6232_HZG_WAVE-coupling/NEMOGCM/NEMO/OPA_SRC
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/UKMO/r6232_HZG_WAVE-coupling/NEMOGCM/NEMO/OPA_SRC/SBC/sbcapr.F90

    r7470 r9259  
    2626    
    2727   !                                !!* namsbc_apr namelist (Atmospheric PRessure) * 
     28   LOGICAL, PUBLIC ::   cpl_mslp = .FALSE. ! Is the pressure read from coupling? 
    2829   LOGICAL, PUBLIC ::   ln_apr_obc   !: inverse barometer added to OBC ssh data  
    2930   LOGICAL, PUBLIC ::   ln_ref_apr   !: ref. pressure: global mean Patm (F) or a constant (F) 
    30    REAL(wp)        ::   rn_pref      !  reference atmospheric pressure   [N/m2] 
     31   REAL(wp), PUBLIC ::  rn_pref      !  reference atmospheric pressure   [N/m2] 
    3132 
    3233   REAL(wp), ALLOCATABLE, SAVE, PUBLIC, DIMENSION(:,:) ::   ssh_ib    ! Inverse barometer now    sea surface height   [m] 
     
    3435   REAL(wp), ALLOCATABLE, SAVE, PUBLIC, DIMENSION(:,:) ::   apr       ! atmospheric pressure at kt                 [N/m2] 
    3536    
    36    REAL(wp) ::   tarea                ! whole domain mean masked ocean surface 
    37    REAL(wp) ::   r1_grau              ! = 1.e0 / (grav * rau0) 
     37   REAL(wp), PUBLIC ::   tarea                ! whole domain mean masked ocean surface 
     38   REAL(wp), PUBLIC ::   r1_grau              ! = 1.e0 / (grav * rau0) 
    3839    
    3940   TYPE(FLD), ALLOCATABLE, DIMENSION(:) ::   sf_apr   ! structure of input fields (file informations, fields read) 
     
    8586         IF(lwm) WRITE ( numond, namsbc_apr ) 
    8687         ! 
    87          ALLOCATE( sf_apr(1), STAT=ierror )           !* allocate and fill sf_sst (forcing structure) with sn_sst 
    88          IF( ierror > 0 )   CALL ctl_stop( 'STOP', 'sbc_apr: unable to allocate sf_apr structure' ) 
    89          ! 
    90          CALL fld_fill( sf_apr, (/ sn_apr /), cn_dir, 'sbc_apr', 'Atmospheric pressure ', 'namsbc_apr' ) 
    91                                 ALLOCATE( sf_apr(1)%fnow(jpi,jpj,1)   ) 
    92          IF( sn_apr%ln_tint )   ALLOCATE( sf_apr(1)%fdta(jpi,jpj,1,2) ) 
     88         IF( .NOT. cpl_mslp ) THEN 
     89            ALLOCATE( sf_apr(1), STAT=ierror )           !* allocate and fill sf_sst (forcing structure) with sn_sst 
     90            IF( ierror > 0 )   CALL ctl_stop( 'STOP', 'sbc_apr: unable to allocate sf_apr structure' ) 
     91            ! 
     92            CALL fld_fill( sf_apr, (/ sn_apr /), cn_dir, 'sbc_apr', 'Atmospheric pressure ', 'namsbc_apr' ) 
     93                                   ALLOCATE( sf_apr(1)%fnow(jpi,jpj,1)   ) 
     94            IF( sn_apr%ln_tint )   ALLOCATE( sf_apr(1)%fdta(jpi,jpj,1,2) ) 
     95         ENDIF 
    9396                                ALLOCATE( ssh_ib(jpi,jpj) , ssh_ibb(jpi,jpj) ) 
    9497                                ALLOCATE( apr (jpi,jpj) ) 
     
    9699         IF(lwp) THEN                                 !* control print 
    97100            WRITE(numout,*) 
    98             WRITE(numout,*) '   Namelist namsbc_apr : Atmospheric PRessure as extrenal forcing' 
     101            IF( cpl_mslp ) THEN 
     102               WRITE(numout,*) '   Namelist namsbc_apr : Atmospheric Pressure as extrenal coupling' 
     103            ELSE 
     104               WRITE(numout,*) '   Namelist namsbc_apr : Atmospheric Pressure as extrenal forcing' 
     105            ENDIF 
    99106            WRITE(numout,*) '      ref. pressure: global mean Patm (T) or a constant (F)  ln_ref_apr = ', ln_ref_apr 
    100107         ENDIF 
     
    119126      ENDIF 
    120127 
    121       !                                         ! ========================== ! 
    122       IF( MOD( kt-1, nn_fsbc ) == 0 ) THEN      !    At each sbc time-step   ! 
    123          !                                      ! ===========+++============ ! 
    124          ! 
    125          IF( kt /= nit000 )   ssh_ibb(:,:) = ssh_ib(:,:)    !* Swap of ssh_ib fields 
    126          ! 
    127          CALL fld_read( kt, nn_fsbc, sf_apr )               !* input Patm provided at kt + nn_fsbc/2 
    128          ! 
    129          !                                                  !* update the reference atmospheric pressure (if necessary) 
    130          IF( ln_ref_apr )   rn_pref = glob_sum( sf_apr(1)%fnow(:,:,1) * e1e2t(:,:) ) / tarea 
    131          ! 
    132          !                                                  !* Patm related forcing at kt 
    133          ssh_ib(:,:) = - ( sf_apr(1)%fnow(:,:,1) - rn_pref ) * r1_grau    ! equivalent ssh (inverse barometer) 
    134          apr   (:,:) =     sf_apr(1)%fnow(:,:,1)                        ! atmospheric pressure 
    135          ! 
    136          CALL iom_put( "ssh_ib", ssh_ib )                   !* output the inverse barometer ssh 
    137       ENDIF 
    138  
    139       !                                         ! ---------------------------------------- ! 
    140       IF( kt == nit000 ) THEN                   !   set the forcing field at nit000 - 1    ! 
    141          !                                      ! ---------------------------------------- ! 
    142          !                                            !* Restart: read in restart file 
    143          IF( ln_rstart .AND. iom_varid( numror, 'ssh_ibb', ldstop = .FALSE. ) > 0 ) THEN  
    144             IF(lwp) WRITE(numout,*) 'sbc_apr:   ssh_ibb read in the restart file' 
    145             CALL iom_get( numror, jpdom_autoglo, 'ssh_ibb', ssh_ibb )   ! before inv. barometer ssh 
     128      IF( .NOT. cpl_mslp ) THEN                    ! ========================== ! 
     129         IF( MOD( kt-1, nn_fsbc ) == 0 ) THEN      !    At each sbc time-step   ! 
     130            !                                      ! ===========+++============ ! 
    146131            ! 
    147          ELSE                                         !* no restart: set from nit000 values 
    148             IF(lwp) WRITE(numout,*) 'sbc_apr:   ssh_ibb set to nit000 values' 
    149             ssh_ibb(:,:) = ssh_ib(:,:) 
     132            IF( kt /= nit000 )   ssh_ibb(:,:) = ssh_ib(:,:)    !* Swap of ssh_ib fields 
     133            ! 
     134            CALL fld_read( kt, nn_fsbc, sf_apr )               !* input Patm provided at kt + nn_fsbc/2 
     135            ! 
     136            !                                                  !* update the reference atmospheric pressure (if necessary) 
     137            IF( ln_ref_apr )   rn_pref = glob_sum( sf_apr(1)%fnow(:,:,1) * e1e2t(:,:) ) / tarea 
     138            ! 
     139            !                                                  !* Patm related forcing at kt 
     140            ssh_ib(:,:) = - ( sf_apr(1)%fnow(:,:,1) - rn_pref ) * r1_grau    ! equivalent ssh (inverse barometer) 
     141            apr   (:,:) =     sf_apr(1)%fnow(:,:,1)                        ! atmospheric pressure 
     142            ! 
     143            CALL iom_put( "ssh_ib", ssh_ib )                   !* output the inverse barometer ssh 
    150144         ENDIF 
    151       ENDIF 
    152       !                                         ! ---------------------------------------- ! 
    153       IF( lrst_oce ) THEN                       !      Write in the ocean restart file     ! 
    154          !                                      ! ---------------------------------------- ! 
    155          IF(lwp) WRITE(numout,*) 
    156          IF(lwp) WRITE(numout,*) 'sbc_apr : ssh_ib written in ocean restart file at it= ', kt,' date= ', ndastp 
    157          IF(lwp) WRITE(numout,*) '~~~~' 
    158          CALL iom_rstput( kt, nitrst, numrow, 'ssh_ibb' , ssh_ib ) 
     145     
     146         !                                         ! ---------------------------------------- ! 
     147         IF( kt == nit000 ) THEN                   !   set the forcing field at nit000 - 1    ! 
     148            !                                      ! ---------------------------------------- ! 
     149            !                                            !* Restart: read in restart file 
     150            IF( ln_rstart .AND. iom_varid( numror, 'ssh_ibb', ldstop = .FALSE. ) > 0 ) THEN  
     151               IF(lwp) WRITE(numout,*) 'sbc_apr:   ssh_ibb read in the restart file' 
     152               CALL iom_get( numror, jpdom_autoglo, 'ssh_ibb', ssh_ibb )   ! before inv. barometer ssh 
     153               ! 
     154            ELSE                                         !* no restart: set from nit000 values 
     155               IF(lwp) WRITE(numout,*) 'sbc_apr:   ssh_ibb set to nit000 values' 
     156               ssh_ibb(:,:) = ssh_ib(:,:) 
     157            ENDIF 
     158         ENDIF 
     159         !                                         ! ---------------------------------------- ! 
     160         IF( lrst_oce ) THEN                       !      Write in the ocean restart file     ! 
     161            !                                      ! ---------------------------------------- ! 
     162            IF(lwp) WRITE(numout,*) 
     163            IF(lwp) WRITE(numout,*) 'sbc_apr : ssh_ib written in ocean restart file at it= ', kt,' date= ', ndastp 
     164            IF(lwp) WRITE(numout,*) '~~~~' 
     165            CALL iom_rstput( kt, nitrst, numrow, 'ssh_ibb' , ssh_ib ) 
     166         ENDIF 
    159167      ENDIF 
    160168      ! 
  • branches/UKMO/r6232_HZG_WAVE-coupling/NEMOGCM/NEMO/OPA_SRC/SBC/sbccpl.F90

    r8917 r9259  
    185185   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   albedo_oce_mix     ! ocean albedo sent to atmosphere (mix clear/overcast sky) 
    186186    
    187    REAL(wp) ::   rpref = 101000._wp   ! reference atmospheric pressure[N/m2]   
    188    REAL(wp) ::   r1_grau              ! = 1.e0 / (grav * rau0 
    189  
    190187   INTEGER , ALLOCATABLE, SAVE, DIMENSION(    :) ::   nrcvinfo           ! OASIS info argument 
    191188 
     
    523520      !                                                      ! Mean Sea Level Pressure   !   
    524521      !                                                      ! ------------------------- !   
    525       srcv(jpr_mslp)%clname = 'O_MSLP'     ;   IF( TRIM(sn_rcv_mslp%cldes  ) == 'coupled' )    srcv(jpr_mslp)%laction = .TRUE.   
     522      srcv(jpr_mslp)%clname = 'O_MSLP' 
     523      IF( TRIM(sn_rcv_mslp%cldes  ) == 'coupled' ) THEN 
     524         srcv(jpr_mslp)%laction = .TRUE. 
     525         cpl_mslp = .TRUE. 
     526      ENDIF 
    526527       
    527528      !                                                      ! ------------------------- ! 
     
    977978      !!---------------------------------------------------------------------- 
    978979      USE sbcflx ,  ONLY : ln_shelf_flx 
     980      USE sbcssm ,  ONLY : sbc_ssm_cpl 
     981      USE lib_fortran     ! distributed memory computing library 
    979982 
    980983      INTEGER, INTENT(in)           ::   kt          ! ocean model time step index 
     
    11751178      !   
    11761179      IF( srcv(jpr_mslp)%laction ) THEN                    ! UKMO SHELF effect of atmospheric pressure on SSH   
    1177           IF( kt /= nit000 )   ssh_ibb(:,:) = ssh_ib(:,:)    !* Swap of ssh_ib fields   
     1180         IF( kt /= nit000 )   ssh_ibb(:,:) = ssh_ib(:,:)    !* Swap of ssh_ib fields   
    11781181       
    1179           r1_grau = 1.e0 / (grav * rau0)               !* constant for optimization   
    1180           ssh_ib(:,:) = - ( frcv(jpr_mslp)%z3(:,:,1) - rpref ) * r1_grau    ! equivalent ssh (inverse barometer)   
    1181           apr   (:,:) =     frcv(jpr_mslp)%z3(:,:,1) !atmospheric pressure   
     1182         !                                                  !* update the reference atmospheric pressure (if necessary) 
     1183         IF( ln_ref_apr )  rn_pref = glob_sum( frcv(jpr_mslp)%z3(:,:,1) * e1e2t(:,:) ) / tarea 
     1184 
     1185         ssh_ib(:,:) = - ( frcv(jpr_mslp)%z3(:,:,1) - rn_pref ) * r1_grau    ! equivalent ssh (inverse barometer)   
     1186         apr   (:,:) =     frcv(jpr_mslp)%z3(:,:,1) !atmospheric pressure   
     1187         ! 
     1188         CALL iom_put( "ssh_ib", ssh_ib )                                    !* output the inverse barometer ssh 
    11821189       
    1183           IF( kt == nit000 ) ssh_ibb(:,:) = ssh_ib(:,:)  ! correct this later (read from restart if possible)   
     1190         !                                         ! ---------------------------------------- ! 
     1191         IF( kt == nit000 ) THEN                   !   set the forcing field at nit000 - 1    ! 
     1192            !                                      ! ---------------------------------------- ! 
     1193            !* Restart: read in restart file 
     1194            IF( ln_rstart .AND. iom_varid( numror, 'ssh_ibb', ldstop = .FALSE. ) > 0 ) THEN 
     1195               IF(lwp) WRITE(numout,*) 'sbc_cpl:   ssh_ibb read in the restart file' 
     1196               CALL iom_get( numror, jpdom_autoglo, 'ssh_ibb', ssh_ibb )   ! before inv. barometer ssh 
     1197            ELSE                                         !* no restart: set from nit000 values 
     1198               IF(lwp) WRITE(numout,*) 'sbc_cpl:   ssh_ibb set to nit000 values' 
     1199               ssh_ibb(:,:) = ssh_ib(:,:) 
     1200            ENDIF 
     1201         ENDIF 
     1202         !                                         ! ---------------------------------------- ! 
     1203         IF( lrst_oce ) THEN                       !      Write in the ocean restart file     ! 
     1204            !                                      ! ---------------------------------------- ! 
     1205            IF(lwp) WRITE(numout,*) 
     1206            IF(lwp) WRITE(numout,*) 'sbc_cpl : ssh_ib written in ocean restart file at it= ', kt,' date= ', ndastp 
     1207            IF(lwp) WRITE(numout,*) '~~~~' 
     1208            CALL iom_rstput( kt, nitrst, numrow, 'ssh_ibb' , ssh_ib ) 
     1209         ENDIF 
     1210 
     1211         ! Update mean ssh 
     1212         CALL sbc_ssm_cpl( kt ) 
    11841213      END IF   
    11851214      !  
  • branches/UKMO/r6232_HZG_WAVE-coupling/NEMOGCM/NEMO/OPA_SRC/SBC/sbcmod.F90

    r8756 r9259  
    317317      !!              - updte the ice fraction : fr_i 
    318318      !!---------------------------------------------------------------------- 
     319      USE bdydta, ONLY: bdy_dta  
     320      ! 
    319321      INTEGER, INTENT(in) ::   kt       ! ocean time step 
    320322      !!--------------------------------------------------------------------- 
     
    337339      !                                            ! ---------------------------------------- ! 
    338340      ! 
    339       IF ( .NOT. lk_bdy ) then 
    340          IF( ln_apr_dyn ) CALL sbc_apr( kt )                ! atmospheric pressure provided at kt+0.5*nn_fsbc 
    341       ENDIF 
     341 
     342      IF( ln_apr_dyn ) CALL sbc_apr( kt )                ! atmospheric pressure provided at kt+0.5*nn_fsbc 
    342343                                                         ! (caution called before sbc_ssm) 
    343344      ! 
     
    376377      IF( ln_mixcpl .OR. ln_wavcpl )  CALL sbc_cpl_rcv ( kt, nn_fsbc, nn_ice )   ! forced-coupled mixed formulation after forcing 
    377378 
    378       IF ( ln_wave .AND. (ln_tauoc .OR. ln_tauw) ) CALL sbc_stress( )   ! Wave stress update  
     379      IF( ln_wave .AND. (ln_tauoc .OR. ln_tauw) ) CALL sbc_stress( )    ! Wave stress update  
     380      IF( lk_bdy )           CALL bdy_dta ( kt, time_offset=+1 )        ! update dynamic & tracer data at open boundaries 
     381                                                                        ! (caution called after sbc_ssm[_cpl] and before ice) 
    379382 
    380383      !                                            !==  Misc. Options  ==! 
  • branches/UKMO/r6232_HZG_WAVE-coupling/NEMOGCM/NEMO/OPA_SRC/SBC/sbcssm.F90

    r7470 r9259  
    2626 
    2727   PUBLIC   sbc_ssm         ! routine called by step.F90 
     28   PUBLIC   sbc_ssm_cpl     ! routine called by sbccpl.F90 
    2829   PUBLIC   sbc_ssm_init    ! routine called by sbcmod.F90 
    2930 
     
    7778         sss_m(:,:) = zts(:,:,jp_sal) 
    7879         !                          ! removed inverse barometer ssh when Patm forcing is used (for sea-ice dynamics) 
    79          IF( ln_apr_dyn ) THEN   ;   ssh_m(:,:) = sshn(:,:) - 0.5 * ( ssh_ib(:,:) + ssh_ibb(:,:) ) 
    80          ELSE                    ;   ssh_m(:,:) = sshn(:,:) 
     80         IF( .NOT. cpl_mslp ) THEN 
     81            IF( ln_apr_dyn ) THEN   ;   ssh_m(:,:) = sshn(:,:) - 0.5 * ( ssh_ib(:,:) + ssh_ibb(:,:) ) 
     82            ELSE                    ;   ssh_m(:,:) = sshn(:,:) 
     83            ENDIF 
    8184         ENDIF 
    8285         ! 
     
    99102            sss_m(:,:) = zcoef * zts(:,:,jp_sal) 
    100103            !                          ! removed inverse barometer ssh when Patm forcing is used (for sea-ice dynamics) 
    101             IF( ln_apr_dyn ) THEN   ;   ssh_m(:,:) = zcoef * ( sshn(:,:) - 0.5 * ( ssh_ib(:,:) + ssh_ibb(:,:) ) ) 
    102             ELSE                    ;   ssh_m(:,:) = zcoef * sshn(:,:) 
     104            IF( .NOT. cpl_mslp ) THEN 
     105               IF( ln_apr_dyn ) THEN   ;   ssh_m(:,:) = zcoef * ( sshn(:,:) - 0.5 * ( ssh_ib(:,:) + ssh_ibb(:,:) ) ) 
     106               ELSE                    ;   ssh_m(:,:) = zcoef * sshn(:,:) 
     107               ENDIF 
    103108            ENDIF 
    104109            ! 
     
    113118            sst_m(:,:) = 0.e0 
    114119            sss_m(:,:) = 0.e0 
    115             ssh_m(:,:) = 0.e0 
     120            IF( .NOT. cpl_mslp ) ssh_m(:,:) = 0.e0 
    116121            IF( lk_vvl )   e3t_m(:,:) = 0.e0 
    117122            frq_m(:,:) = 0.e0 
     
    127132         sss_m(:,:) = sss_m(:,:) + zts(:,:,jp_sal) 
    128133         !                          ! removed inverse barometer ssh when Patm forcing is used (for sea-ice dynamics) 
    129          IF( ln_apr_dyn ) THEN   ;   ssh_m(:,:) = ssh_m(:,:) + sshn(:,:) - 0.5 * ( ssh_ib(:,:) + ssh_ibb(:,:) ) 
    130          ELSE                    ;   ssh_m(:,:) = ssh_m(:,:) + sshn(:,:) 
     134         IF( .NOT. cpl_mslp ) THEN 
     135            IF( ln_apr_dyn ) THEN   ;   ssh_m(:,:) = ssh_m(:,:) + sshn(:,:) - 0.5 * ( ssh_ib(:,:) + ssh_ibb(:,:) ) 
     136            ELSE                    ;   ssh_m(:,:) = ssh_m(:,:) + sshn(:,:) 
     137            ENDIF 
    131138         ENDIF 
    132139         ! 
     
    143150            ssu_m(:,:) = ssu_m(:,:) * zcoef           ! mean suface current  [m/s] 
    144151            ssv_m(:,:) = ssv_m(:,:) * zcoef           ! 
    145             ssh_m(:,:) = ssh_m(:,:) * zcoef           ! mean SSH             [m] 
     152            IF( .NOT. cpl_mslp ) ssh_m(:,:) = ssh_m(:,:) * zcoef           ! mean SSH             [m] 
    146153            IF( lk_vvl )   e3t_m(:,:) = fse3t_m(:,:) * zcoef   ! mean vertical scale factor [m] 
    147154            frq_m(:,:) = frq_m(:,:) * zcoef   ! mean fraction of solar net radiation absorbed in the 1st T level [-] 
     
    161168            CALL iom_rstput( kt, nitrst, numrow, 'sst_m'  , sst_m  ) 
    162169            CALL iom_rstput( kt, nitrst, numrow, 'sss_m'  , sss_m  ) 
    163             CALL iom_rstput( kt, nitrst, numrow, 'ssh_m'  , ssh_m  ) 
     170            IF( .NOT. cpl_mslp ) CALL iom_rstput( kt, nitrst, numrow, 'ssh_m'  , ssh_m  ) 
    164171            IF( lk_vvl )   CALL iom_rstput( kt, nitrst, numrow, 'e3t_m'  , e3t_m  ) 
    165172            CALL iom_rstput( kt, nitrst, numrow, 'frq_m'  , frq_m  ) 
     
    174181         CALL iom_put( 'sst_m', sst_m ) 
    175182         CALL iom_put( 'sss_m', sss_m ) 
    176          CALL iom_put( 'ssh_m', ssh_m ) 
     183         IF( .NOT. cpl_mslp ) CALL iom_put( 'ssh_m', ssh_m ) 
    177184         IF( lk_vvl )   CALL iom_put( 'e3t_m', e3t_m ) 
    178185         CALL iom_put( 'frq_m', frq_m ) 
     
    180187      ! 
    181188   END SUBROUTINE sbc_ssm 
     189 
     190   SUBROUTINE sbc_ssm_cpl( kt ) 
     191      !!--------------------------------------------------------------------- 
     192      !!                   ***  ROUTINE sbc_ssm_cpl  *** 
     193      !!                      
     194      !! ** Purpose :   provide ocean surface variable to sea-surface boundary 
     195      !!                condition computation when pressure is read from coupling 
     196      !!                 
     197      !! ** Method  :   The inverse barometer ssh (i.e. ssh associated with Patm) 
     198      !!                is added to ssh_m when ln_apr_dyn = T. Required for sea-ice dynamics. 
     199      !!--------------------------------------------------------------------- 
     200      INTEGER, INTENT(in) ::   kt   ! ocean time step 
     201      ! 
     202      REAL(wp) ::   zcoef       ! local scalar 
     203      !!--------------------------------------------------------------------- 
     204      ! 
     205      IF( nn_fsbc == 1 ) THEN                             !   Instantaneous surface fields        ! 
     206         !                                                ! ---------------------------------------- ! 
     207         IF( ln_apr_dyn ) THEN   ;   ssh_m(:,:) = sshn(:,:) - 0.5 * ( ssh_ib(:,:) + ssh_ibb(:,:) ) 
     208         ELSE                    ;   ssh_m(:,:) = sshn(:,:) 
     209         ENDIF 
     210      ELSE 
     211         !                                                ! ----------------------------------------------- ! 
     212         IF( kt == nit000 .AND. .NOT. l_ssm_mean ) THEN   !   Initialisation: 1st time-step, no input means ! 
     213            !                                             ! ----------------------------------------------- ! 
     214            IF(lwp) WRITE(numout,*) 
     215            IF(lwp) WRITE(numout,*) '~~~~~~~   mean ssh field initialised to instantaneous values' 
     216            zcoef = REAL( nn_fsbc - 1, wp ) 
     217            zcoef = REAL( nn_fsbc - 1, wp ) 
     218            IF( ln_apr_dyn ) THEN    ;  ssh_m(:,:) = zcoef * ( sshn(:,:) - 0.5 * ( ssh_ib(:,:) + ssh_ibb(:,:) ) ) 
     219            ELSE                     ;  ssh_m(:,:) = zcoef * sshn(:,:) 
     220            ENDIF 
     221            !                                             ! ---------------------------------------- ! 
     222         ELSEIF( MOD( kt - 2 , nn_fsbc ) == 0 ) THEN      !   Initialisation: New mean computation   ! 
     223            !                                             ! ---------------------------------------- ! 
     224            ssh_m(:,:) = 0.e0 
     225         ENDIF 
     226 
     227         IF( ln_apr_dyn ) THEN   ;   ssh_m(:,:) = ssh_m(:,:) + sshn(:,:) - 0.5 * ( ssh_ib(:,:) + ssh_ibb(:,:) ) 
     228         ELSE                    ;   ssh_m(:,:) = ssh_m(:,:) + sshn(:,:) 
     229         ENDIF 
     230         !                                                ! ---------------------------------------- ! 
     231         IF( MOD( kt - 1 , nn_fsbc ) == 0 ) THEN          !   Mean value at each nn_fsbc time-step   ! 
     232            !                                             ! ---------------------------------------- ! 
     233            zcoef = 1. / REAL( nn_fsbc, wp ) 
     234            ssh_m(:,:) = ssh_m(:,:) * zcoef           ! mean SSH             [m] 
     235         ENDIF 
     236         !                                                ! ---------------------------------------- ! 
     237         IF( lrst_oce ) THEN                              !      Write in the ocean restart file     ! 
     238            !                                             ! ---------------------------------------- ! 
     239            IF(lwp) WRITE(numout,*) 
     240            IF(lwp) WRITE(numout,*) 'sbc_ssm_cpl : ssh mean field written in ocean restart file ',   & 
     241               &                    'at it= ', kt,' date= ', ndastp 
     242            IF(lwp) WRITE(numout,*) '~~~~~~~' 
     243            CALL iom_rstput( kt, nitrst, numrow, 'ssh_m'  , ssh_m  ) 
     244         ENDIF 
     245      ENDIF 
     246      ! 
     247      IF( MOD( kt - 1 , nn_fsbc ) == 0 ) THEN          !   Mean value at each nn_fsbc time-step   ! 
     248         CALL iom_put( 'ssh_m', ssh_m ) 
     249      ENDIF 
     250      ! 
     251   END SUBROUTINE sbc_ssm_cpl 
    182252 
    183253   SUBROUTINE sbc_ssm_init 
  • branches/UKMO/r6232_HZG_WAVE-coupling/NEMOGCM/NEMO/OPA_SRC/step.F90

    r7481 r9259  
    106106      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    107107      IF( lk_tide    )   CALL sbc_tide( kstp ) 
    108       IF( lk_bdy     )  THEN 
    109          IF( ln_apr_dyn) CALL sbc_apr( kstp )   ! bdy_dta needs ssh_ib  
    110                          CALL bdy_dta ( kstp, time_offset=+1 )   ! update dynamic & tracer data at open boundaries 
    111       ENDIF 
    112                          CALL sbc    ( kstp )         ! Sea Boundary Condition (including sea-ice) 
     108                         CALL sbc     ( kstp )        ! Sea Boundary Condition (including sea-ice) 
    113109                                                      ! clem: moved here for bdy ice purpose 
    114110      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
Note: See TracChangeset for help on using the changeset viewer.