MODULE sbcsurge !!====================================================================== !! *** MODULE sbcsurge *** !! Ocean forcing: momentum flux formulation !!===================================================================== !! History : 3.7 ! 2016-02 (R. Furner) New code, imlementing charnock parameterisation for wind stress !!---------------------------------------------------------------------- !!---------------------------------------------------------------------- !! sbc_surge : charnock formulation as ocean surface boundary condition (forced mode) !! surge_oce : computes momentum fluxes over ocean !!---------------------------------------------------------------------- USE oce ! ocean dynamics and tracers USE dom_oce ! ocean space and time domain USE phycst ! physical constants USE fldread ! read input fields USE sbc_oce ! Surface boundary condition: ocean fields USE iom ! I/O manager library USE in_out_manager ! I/O manager USE lib_mpp ! distribued memory computing library USE wrk_nemo ! work arrays USE timing ! Timing USE lbclnk ! ocean lateral boundary conditions (or mpp link) USE prtctl ! Print control USE sbc_ice ! Surface boundary condition: ice fields USE lib_fortran ! to use key_nosignedzero IMPLICIT NONE PRIVATE PUBLIC sbc_surge ! routine called in sbcmod module INTEGER , PARAMETER :: jpfld = 2 ! maximum number of files to read INTEGER , PARAMETER :: jp_wndi = 1 ! index of 10m wind velocity (i-component) (m/s) at T-point INTEGER , PARAMETER :: jp_wndj = 2 ! index of 10m wind velocity (j-component) (m/s) at T-point TYPE(FLD), ALLOCATABLE, DIMENSION(:) :: sf ! structure of input fields (file informations, fields read) REAL(wp), PARAMETER :: rhoa = 1.22 ! air density ! !!* Namelist namsbc_core : CORE bulk parameters REAL(wp) :: rn_vfac ! multiplication factor for ice/ocean velocity in the calculation of wind stress (clem) REAL(wp) :: rn_charn_const ! logical flag for charnock wind stress in surge model(true) or not(false) !! * Substitutions # include "domzgr_substitute.h90" # include "vectopt_loop_substitute.h90" !!---------------------------------------------------------------------- !! NEMO/OPA 3.7 , NEMO-consortium (2014) !! $Id: sbcblk_core.F90 5954 2015-11-30 14:04:08Z rfurner $ !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) !!---------------------------------------------------------------------- CONTAINS SUBROUTINE sbc_surge( kt ) !!--------------------------------------------------------------------- !! *** ROUTINE sbc_surge *** !! !! ** Purpose : provide at each time step the surface ocean fluxes !! (momentum only) !! !! ** Method : (1) READ each fluxes in NetCDF files: !! the 10m wind velocity (i-component) (m/s) at T-point !! the 10m wind velocity (j-component) (m/s) at T-point !! (2) CALL surge_oce !! !! C A U T I O N : never mask the surface stress fields !! the stress is assumed to be in the (i,j) mesh referential !! !! ** Action : defined at each time-step at the air-sea interface !! - utau, vtau i- and j-component of the wind stress !! - taum wind stress module at T-point !! - wndm wind speed module at T-point over free ocean or leads in presence of sea-ice !! (set in limsbc(_2).F90) !! !!---------------------------------------------------------------------- INTEGER, INTENT(in) :: kt ! ocean time step ! INTEGER :: ierror ! return error code INTEGER :: ifpr ! dummy loop indice INTEGER :: ios ! Local integer output status for namelist read ! CHARACTER(len=100) :: cn_dir ! Root directory for location of flux files TYPE(FLD_N), DIMENSION(jpfld) :: slf_i ! array of namelist informations on the fields to read TYPE(FLD_N) :: sn_wndi, sn_wndj ! informations about the fields to be read NAMELIST/namsbc_surge/ cn_dir , rn_vfac, & & sn_wndi, sn_wndj, rn_charn_const !!--------------------------------------------------------------------- ! ! ! ====================== ! IF( kt == nit000 ) THEN ! First call kt=nit000 ! ! ! ====================== ! ! REWIND( numnam_ref ) ! Namelist namsbc_surge in reference namelist : CORE bulk parameters READ ( numnam_ref, namsbc_surge, IOSTAT = ios, ERR = 901) 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namsbc_surge in reference namelist', lwp ) ! REWIND( numnam_cfg ) ! Namelist namsbc_surge in configuration namelist : CORE bulk parameters READ ( numnam_cfg, namsbc_surge, IOSTAT = ios, ERR = 902 ) 902 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namsbc_surge in configuration namelist', lwp ) IF(lwm) WRITE( numond, namsbc_surge ) ! ! check: do we plan to use ln_dm2dc with non-daily forcing? ! ! store namelist information in an array slf_i(jp_wndi) = sn_wndi ; slf_i(jp_wndj) = sn_wndj ! ! ALLOCATE( sf(jpfld), STAT=ierror ) ! set sf structure IF( ierror > 0 ) CALL ctl_stop( 'STOP', 'sbc_surge: unable to allocate sf structure' ) DO ifpr= 1, jpfld ALLOCATE( sf(ifpr)%fnow(jpi,jpj,1) ) IF( slf_i(ifpr)%ln_tint ) ALLOCATE( sf(ifpr)%fdta(jpi,jpj,1,2) ) END DO ! ! fill sf with slf_i and control print CALL fld_fill( sf, slf_i, cn_dir, 'sbc_surge', 'flux formulation for ocean surface boundary condition', 'namsbc_surge' ) ! sfx(:,:) = 0._wp ! salt flux; zero unless ice is present (computed in limsbc(_2).F90) ! ENDIF CALL fld_read( kt, nn_fsbc, sf ) ! input fields provided at the current time-step ! ! compute the surface ocean fluxes using CORE bulk formulea IF( MOD( kt - 1, nn_fsbc ) == 0 ) CALL surge_oce( kt, sf, ssu_m, ssv_m, rn_charn_const ) ! END SUBROUTINE sbc_surge SUBROUTINE surge_oce( kt, sf, pu, pv, rn_charn_const ) !!--------------------------------------------------------------------- !! *** ROUTINE surge_oce *** !! !! ** Purpose : provide the momentum fluxes at !! the ocean surface at each time step !! !! ** Method : Charnock formulea for the ocean using atmospheric !! fields read in sbc_read !! !! ** Outputs : - utau : i-component of the stress at U-point (N/m2) !! - vtau : j-component of the stress at V-point (N/m2) !! - taum : Wind stress module at T-point (N/m2) !! - wndm : Wind speed module at T-point (m/s) !! !! ** Nota : sf has to be a dummy argument for AGRIF on NEC !!--------------------------------------------------------------------- INTEGER , INTENT(in ) :: kt ! time step index TYPE(fld), INTENT(inout), DIMENSION(:) :: sf ! input data REAL(wp) , INTENT(in) , DIMENSION(:,:) :: pu ! surface current at U-point (i-component) [m/s] REAL(wp) , INTENT(in) , DIMENSION(:,:) :: pv ! surface current at V-point (j-component) [m/s] REAL(wp) , INTENT(in) :: rn_charn_const! local variable ! INTEGER :: ji, jj ! dummy loop indices REAL(wp) :: zztmp ! local variable REAL(wp) :: z_z0, z_Cd1 ! local variable REAL(wp) :: zi ! local variable REAL(wp), DIMENSION(:,:), POINTER :: zwnd_i, zwnd_j ! wind speed components at T-point REAL(wp), DIMENSION(:,:), POINTER :: Cd ! transfer coefficient for momentum (tau) !!--------------------------------------------------------------------- ! IF( nn_timing == 1 ) CALL timing_start('surge_oce') ! CALL wrk_alloc( jpi,jpj, zwnd_i, zwnd_j ) CALL wrk_alloc( jpi,jpj, Cd ) ! ! ----------------------------------------------------------------------------- ! ! 0 Wind components and module at T-point relative to the moving ocean ! ! ----------------------------------------------------------------------------- ! ! ... components ( U10m - U_oce ) at T-point (unmasked) zwnd_i(:,:) = 0.e0 zwnd_j(:,:) = 0.e0 DO jj = 2, jpjm1 DO ji = fs_2, fs_jpim1 ! vect. opt. uwnd(ji,jj) = ( sf(jp_wndi)%fnow(ji,jj,1) - rn_vfac * 0.5 * ( pu(ji-1,jj ) + pu(ji,jj) ) ) vwnd(ji,jj) = ( sf(jp_wndj)%fnow(ji,jj,1) - rn_vfac * 0.5 * ( pv(ji ,jj-1) + pv(ji,jj) ) ) END DO END DO zwnd_i(:,:) = uwnd(:,:) zwnd_j(:,:) = vwnd(:,:) CALL lbc_lnk( zwnd_i(:,:) , 'T', -1. ) CALL lbc_lnk( zwnd_j(:,:) , 'T', -1. ) ! ... scalar wind ( = | U10m - U_oce | ) at T-point (masked) wndm(:,:) = SQRT( zwnd_i(:,:) * zwnd_i(:,:) & & + zwnd_j(:,:) * zwnd_j(:,:) ) * tmask(:,:,1) ! ----------------------------------------------------------------------------- ! ! I Radiative FLUXES ! ! ----------------------------------------------------------------------------- ! qsr(:,:)=0._wp ! ----------------------------------------------------------------------------- ! ! II Turbulent FLUXES ! ! ----------------------------------------------------------------------------- ! Cd(:,:)=0.0001_wp DO jj = 1,jpj DO ji = 1,jpi z_Cd1=0._wp zi=1 !Iterate DO WHILE((abs(Cd(ji,jj)-z_Cd1))>1E-6) z_Cd1=Cd(ji,jj) z_z0=rn_charn_const*z_Cd1*wndm(ji,jj)**2/grav Cd(ji,jj)=(0.41_wp/log(10._wp/z_z0))**2 zi=zi+1 ENDDO ENDDO ENDDO ! ... tau module, i and j component DO jj = 1, jpj DO ji = 1, jpi zztmp = rhoa * wndm(ji,jj) * Cd(ji,jj) taum (ji,jj) = zztmp * wndm (ji,jj) zwnd_i(ji,jj) = zztmp * zwnd_i(ji,jj) zwnd_j(ji,jj) = zztmp * zwnd_j(ji,jj) END DO END DO CALL iom_put( "taum_oce", taum ) ! output wind stress module CALL iom_put( "uwnd", uwnd ) ! output wind stress module CALL iom_put( "vwnd", vwnd ) ! output wind stress module ! ... utau, vtau at U- and V_points, resp. ! Note the use of 0.5*(2-umask) in order to unmask the stress along coastlines ! Note the use of MAX(tmask(i,j),tmask(i+1,j) is to mask tau over ice shelves DO jj = 1, jpjm1 DO ji = 1, fs_jpim1 utau(ji,jj) = 0.5 * ( 2. - umask(ji,jj,1) ) * ( zwnd_i(ji,jj) + zwnd_i(ji+1,jj ) ) & & * MAX(tmask(ji,jj,1),tmask(ji+1,jj,1)) vtau(ji,jj) = 0.5 * ( 2. - vmask(ji,jj,1) ) * ( zwnd_j(ji,jj) + zwnd_j(ji ,jj+1) ) & & * MAX(tmask(ji,jj,1),tmask(ji,jj+1,1)) END DO END DO CALL lbc_lnk( utau(:,:), 'U', -1. ) CALL lbc_lnk( vtau(:,:), 'V', -1. ) IF(ln_ctl) THEN CALL prt_ctl( tab2d_1=utau , clinfo1=' surge_oce: utau : ', mask1=umask, & & tab2d_2=vtau , clinfo2= ' vtau : ' , mask2=vmask ) CALL prt_ctl( tab2d_1=wndm , clinfo1=' surge_oce: wndm : ') ENDIF ! ----------------------------------------------------------------------------- ! ! III Total FLUXES ! ! ----------------------------------------------------------------------------- ! ! emp (:,:) = 0._wp qns(:,:) = 0._wp ! IF ( nn_ice == 0 ) THEN CALL iom_put( "qns_oce" , qns ) ! output downward non solar heat over the ocean CALL iom_put( "qsr_oce" , qsr ) ! output downward solar heat over the ocean CALL iom_put( "qt_oce" , qns+qsr ) ! output total downward heat over the ocean ENDIF ! IF(ln_ctl) THEN CALL prt_ctl(tab2d_1=utau , clinfo1=' surge_oce: utau : ', mask1=umask, & & tab2d_2=vtau , clinfo2= ' vtau : ' , mask2=vmask ) ENDIF ! CALL wrk_dealloc( jpi,jpj, zwnd_i, zwnd_j ) CALL wrk_dealloc( jpi,jpj, Cd ) ! IF( nn_timing == 1 ) CALL timing_stop('surge_oce') ! END SUBROUTINE surge_oce END MODULE sbcsurge