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 10803 for NEMO/branches/UKMO/r8395_cpl-pressure/NEMOGCM/NEMO/OPA_SRC/SBC/sbcssm.F90 – NEMO

Ignore:
Timestamp:
2019-03-26T11:46:36+01:00 (5 years ago)
Author:
jcastill
Message:

Complete set of changes to use pressure read from coupling when available rather than from file

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/UKMO/r8395_cpl-pressure/NEMOGCM/NEMO/OPA_SRC/SBC/sbcssm.F90

    r10797 r10803  
    2727 
    2828   PUBLIC   sbc_ssm        ! routine called by step.F90 
     29   PUBLIC   sbc_ssm_cpl    ! routine called by sbccpl.F90 
    2930   PUBLIC   sbc_ssm_init   ! routine called by sbcmod.F90 
    3031 
     
    7576         sss_m(:,:) = zts(:,:,jp_sal) 
    7677         !                          ! removed inverse barometer ssh when Patm forcing is used (for sea-ice dynamics) 
    77          IF( ln_apr_dyn ) THEN   ;   ssh_m(:,:) = sshn(:,:) - 0.5 * ( ssh_ib(:,:) + ssh_ibb(:,:) ) 
    78          ELSE                    ;   ssh_m(:,:) = sshn(:,:) 
     78         IF( .NOT. cpl_mslp ) THEN 
     79            IF( ln_apr_dyn ) THEN   ;   ssh_m(:,:) = sshn(:,:) - 0.5 * ( ssh_ib(:,:) + ssh_ibb(:,:) ) 
     80            ELSE                    ;   ssh_m(:,:) = sshn(:,:) 
     81            ENDIF 
    7982         ENDIF 
    8083         ! 
     
    98101            sss_m(:,:) = zcoef * zts(:,:,jp_sal) 
    99102            !                          ! removed inverse barometer ssh when Patm forcing is used (for sea-ice dynamics) 
    100             IF( ln_apr_dyn ) THEN   ;   ssh_m(:,:) = zcoef * ( sshn(:,:) - 0.5 * ( ssh_ib(:,:) + ssh_ibb(:,:) ) ) 
    101             ELSE                    ;   ssh_m(:,:) = zcoef * sshn(:,:) 
     103            IF( .NOT. cpl_mslp ) THEN 
     104               IF( ln_apr_dyn ) THEN   ;   ssh_m(:,:) = zcoef * ( sshn(:,:) - 0.5 * ( ssh_ib(:,:) + ssh_ibb(:,:) ) ) 
     105               ELSE                    ;   ssh_m(:,:) = zcoef * sshn(:,:) 
     106               ENDIF 
    102107            ENDIF 
    103108            ! 
     
    112117            sst_m(:,:) = 0._wp 
    113118            sss_m(:,:) = 0._wp 
    114             ssh_m(:,:) = 0._wp 
     119            IF( .NOT. cpl_mslp ) ssh_m(:,:) = 0._wp 
    115120            e3t_m(:,:) = 0._wp 
    116121            frq_m(:,:) = 0._wp 
     
    126131         sss_m(:,:) = sss_m(:,:) + zts(:,:,jp_sal) 
    127132         !                          ! removed inverse barometer ssh when Patm forcing is used (for sea-ice dynamics) 
    128          IF( ln_apr_dyn ) THEN   ;   ssh_m(:,:) = ssh_m(:,:) + sshn(:,:) - 0.5 * ( ssh_ib(:,:) + ssh_ibb(:,:) ) 
    129          ELSE                    ;   ssh_m(:,:) = ssh_m(:,:) + sshn(:,:) 
     133         IF( .NOT. cpl_mslp ) THEN 
     134            IF( ln_apr_dyn ) THEN   ;   ssh_m(:,:) = ssh_m(:,:) + sshn(:,:) - 0.5 * ( ssh_ib(:,:) + ssh_ibb(:,:) ) 
     135            ELSE                    ;   ssh_m(:,:) = ssh_m(:,:) + sshn(:,:) 
     136            ENDIF 
    130137         ENDIF 
    131138         ! 
     
    142149            ssu_m(:,:) = ssu_m(:,:) * zcoef     ! mean suface current  [m/s] 
    143150            ssv_m(:,:) = ssv_m(:,:) * zcoef     ! 
    144             ssh_m(:,:) = ssh_m(:,:) * zcoef     ! mean SSH             [m] 
     151            IF( .NOT. cpl_mslp ) ssh_m(:,:) = ssh_m(:,:) * zcoef     ! mean SSH             [m] 
    145152            e3t_m(:,:) = e3t_m(:,:) * zcoef     ! mean vertical scale factor [m] 
    146153            frq_m(:,:) = frq_m(:,:) * zcoef     ! mean fraction of solar net radiation absorbed in the 1st T level [-] 
     
    160167            CALL iom_rstput( kt, nitrst, numrow, 'sst_m'  , sst_m  ) 
    161168            CALL iom_rstput( kt, nitrst, numrow, 'sss_m'  , sss_m  ) 
    162             CALL iom_rstput( kt, nitrst, numrow, 'ssh_m'  , ssh_m  ) 
     169            IF( .NOT. cpl_mslp ) CALL iom_rstput( kt, nitrst, numrow, 'ssh_m'  , ssh_m  ) 
    163170            CALL iom_rstput( kt, nitrst, numrow, 'e3t_m'  , e3t_m  ) 
    164171            CALL iom_rstput( kt, nitrst, numrow, 'frq_m'  , frq_m  ) 
     
    180187   END SUBROUTINE sbc_ssm 
    181188 
     189   SUBROUTINE sbc_ssm_cpl( kt )  
     190      !!---------------------------------------------------------------------  
     191      !!                   ***  ROUTINE sbc_ssm_cpl  ***  
     192      !!                       
     193      !! ** Purpose :   provide ocean surface variable to sea-surface boundary  
     194      !!                condition computation when pressure is read from coupling  
     195      !!                  
     196      !! ** Method  :   The inverse barometer ssh (i.e. ssh associated with Patm)  
     197      !!                is added to ssh_m when ln_apr_dyn = T. Required for sea-ice dynamics.  
     198      !!---------------------------------------------------------------------  
     199      INTEGER, INTENT(in) ::   kt   ! ocean time step  
     200      !  
     201      REAL(wp) ::   zcoef       ! local scalar  
     202      !!---------------------------------------------------------------------  
     203      !  
     204      IF( nn_fsbc == 1 ) THEN                             !      Instantaneous surface fields        !  
     205         !                                                ! ---------------------------------------- !  
     206         IF( ln_apr_dyn ) THEN   ;   ssh_m(:,:) = sshn(:,:) - 0.5 * ( ssh_ib(:,:) + ssh_ibb(:,:) )  
     207         ELSE                    ;   ssh_m(:,:) = sshn(:,:)  
     208         ENDIF  
     209      ELSE  
     210         !                                                ! ----------------------------------------------- !  
     211         IF( kt == nit000 .AND. .NOT. l_ssm_mean ) THEN   !   Initialisation: 1st time-step, no input means !  
     212            !                                             ! ----------------------------------------------- !  
     213            IF(lwp) WRITE(numout,*)  
     214            IF(lwp) WRITE(numout,*) '~~~~~~~   mean ssh field initialised to instantaneous values'  
     215            zcoef = REAL( nn_fsbc - 1, wp )  
     216            zcoef = REAL( nn_fsbc - 1, wp )  
     217            IF( ln_apr_dyn ) THEN    ;  ssh_m(:,:) = zcoef * ( sshn(:,:) - 0.5 * ( ssh_ib(:,:) + ssh_ibb(:,:) ) )  
     218            ELSE                     ;  ssh_m(:,:) = zcoef * sshn(:,:)  
     219            ENDIF  
     220            !                                             ! ---------------------------------------- !  
     221         ELSEIF( MOD( kt - 2 , nn_fsbc ) == 0 ) THEN      !   Initialisation: New mean computation   !  
     222            !                                             ! ---------------------------------------- !  
     223            ssh_m(:,:) = 0.e0  
     224         ENDIF  
     225    
     226         IF( ln_apr_dyn ) THEN   ;   ssh_m(:,:) = ssh_m(:,:) + sshn(:,:) - 0.5 * ( ssh_ib(:,:) + ssh_ibb(:,:) )  
     227         ELSE                    ;   ssh_m(:,:) = ssh_m(:,:) + sshn(:,:)  
     228         ENDIF  
     229         !                                                ! ---------------------------------------- !  
     230         IF( MOD( kt - 1 , nn_fsbc ) == 0 ) THEN          !   Mean value at each nn_fsbc time-step   !  
     231            !                                             ! ---------------------------------------- !  
     232            zcoef = 1. / REAL( nn_fsbc, wp )  
     233            ssh_m(:,:) = ssh_m(:,:) * zcoef           ! mean SSH [m]  
     234         ENDIF  
     235         !                                                ! ---------------------------------------- !  
     236         IF( lrst_oce ) THEN                              !      Write in the ocean restart file     !  
     237            !                                             ! ---------------------------------------- !  
     238            IF(lwp) WRITE(numout,*)  
     239            IF(lwp) WRITE(numout,*) 'sbc_ssm_cpl : ssh mean field written in ocean restart file ',   &  
     240               &                    'at it= ', kt,' date= ', ndastp  
     241            IF(lwp) WRITE(numout,*) '~~~~~~~'  
     242            CALL iom_rstput( kt, nitrst, numrow, 'ssh_m'  , ssh_m  )  
     243         ENDIF  
     244      ENDIF  
     245      !  
     246      IF( MOD( kt - 1 , nn_fsbc ) == 0 ) THEN          !   Mean value at each nn_fsbc time-step   !  
     247         CALL iom_put( 'ssh_m', ssh_m )  
     248      ENDIF  
     249      !  
     250   END SUBROUTINE sbc_ssm_cpl 
    182251 
    183252   SUBROUTINE sbc_ssm_init 
Note: See TracChangeset for help on using the changeset viewer.