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

Changeset 8415 for branches/UKMO


Ignore:
Timestamp:
2017-08-08T12:54:49+02:00 (7 years ago)
Author:
jcastill
Message:

Calculate wind velocity relative to currents if needed for flux forcing in shelf seas configuration

Location:
branches/UKMO/r6232_HZG_WAVE-coupling/NEMOGCM
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/UKMO/r6232_HZG_WAVE-coupling/NEMOGCM/CONFIG/SHARED/namelist_ref

    r7906 r8415  
    302302   cn_dir       = './'      !  root directory for the location of the flux files 
    303303   ln_shelf_flx = .false.   !  UKMO SHELF specific flux flag - read from file wind components instead of momentum  
     304   ln_rel_wind  = .false.   !  UKMO SHELF - calculate momentum from wind speed relative to currents  
     305   rn_wfac      = 1.0       !  UKMO SHELF - multiplicative factor for ocean/wind velocity 
    304306/ 
    305307!----------------------------------------------------------------------- 
  • branches/UKMO/r6232_HZG_WAVE-coupling/NEMOGCM/NEMO/OPA_SRC/SBC/sbcflx.F90

    r7854 r8415  
    2020   USE iom             ! IOM library 
    2121   USE in_out_manager  ! I/O manager 
     22   USE sbcwave         ! wave physics 
    2223   USE lib_mpp         ! distribued memory computing library 
    2324   USE lbclnk          ! ocean lateral boundary conditions (or mpp link) 
    24    USE sbcwave         ! wave physics 
     25   USE wrk_nemo        ! work arrays 
    2526 
    2627   IMPLICIT NONE 
     
    3738   TYPE(FLD), ALLOCATABLE, DIMENSION(:) ::   sf    ! structure of input fields (file informations, fields read) 
    3839   LOGICAL , PUBLIC    ::   ln_shelf_flx = .FALSE. ! UKMO SHELF specific flux flag 
     40   LOGICAL , PUBLIC    ::   ln_rel_wind = .FALSE.  ! UKMO SHELF specific flux flag - relative winds 
     41   REAL(wp)            ::   rn_wfac                ! multiplication factor for ice/ocean velocity in the calculation of wind stress (clem) 
    3942   INTEGER             ::   jpfld_local   ! maximum number of files to read (locally modified depending on ln_shelf_flx)  
    4043 
     
    8891      !! 
    8992      CHARACTER(len=100) ::  cn_dir                               ! Root directory for location of flx files 
    90       NAMELIST/namsbc_flx/ ln_shelf_flx                           ! Put here to allow merging with another UKMO branch 
     93      NAMELIST/namsbc_flx/ ln_shelf_flx, ln_rel_wind, rn_wfac     ! Put here to allow merging with another UKMO branch 
    9194      TYPE(FLD_N), DIMENSION(jpfld) ::   slf_i                    ! array of namelist information structures 
    9295      TYPE(FLD_N) ::   sn_utau, sn_vtau, sn_qtot, sn_qsr, sn_emp  ! informations about the fields to be read 
     
    132135      
    133136      IF( MOD( kt-1, nn_fsbc ) == 0 ) THEN                        ! update ocean fluxes at each SBC frequency 
     137 
     138         !!UKMO SHELF wind speed relative to surface currents - put here to allow merging with coupling branch 
     139         IF( ln_shelf_flx ) THEN 
     140            CALL wrk_alloc( jpi,jpj, zwnd_i, zwnd_j ) 
     141 
     142            IF( ln_rel_wind ) THEN 
     143               DO jj = 2, jpjm1 
     144                  DO ji = fs_2, fs_jpim1   ! vect. opt. 
     145                     zwnd_i(ji,jj) = ( sf(jp_utau)%fnow(ji,jj,1) - rn_wfac * 0.5 * ( ssu_m(ji-1,jj  ) + ssu_m(ji,jj) )) 
     146                     zwnd_j(ji,jj) = ( sf(jp_vtau)%fnow(ji,jj,1) - rn_wfac * 0.5 * ( ssv_m(ji  ,jj-1) + ssv_m(ji,jj) )) 
     147                  END DO 
     148               END DO 
     149               CALL lbc_lnk( zwnd_i(:,:) , 'T', -1. ) 
     150               CALL lbc_lnk( zwnd_j(:,:) , 'T', -1. ) 
     151            ELSE 
     152               zwnd_i(:,:) = sf(jp_utau)%fnow(:,:,1) 
     153               zwnd_j(:,:) = sf(jp_vtau)%fnow(:,:,1) 
     154            ENDIF 
     155         ENDIF 
    134156 
    135157         IF( ln_dm2dc ) THEN   ;   qsr(:,:) = sbc_dcy( sf(jp_qsr)%fnow(:,:,1) )   ! modify now Qsr to include the diurnal cycle 
     
    154176                  DO jj = 1, jpj 
    155177                     DO ji = 1, jpi 
    156                         utau(ji,jj) = sf(jp_utau)%fnow(ji,jj,1) 
    157                         vtau(ji,jj) = sf(jp_vtau)%fnow(ji,jj,1) 
     178                        utau(ji,jj) = zwnd_i(ji,jj) 
     179                        vtau(ji,jj) = zwnd_i(ji,jj) 
    158180                     END DO 
    159181                  END DO 
     
    161183                  DO jj = 1, jpj 
    162184                     DO ji = 1, jpi 
    163                         totwind = sqrt((sf(jp_utau)%fnow(ji,jj,1))**2.0 + (sf(jp_vtau)%fnow(ji,jj,1))**2.0) 
    164                         utau(ji,jj) = zrhoa * cdn_wave(ji,jj) * sf(jp_utau)%fnow(ji,jj,1) * totwind 
    165                         vtau(ji,jj) = zrhoa * cdn_wave(ji,jj) * sf(jp_vtau)%fnow(ji,jj,1) * totwind 
     185                        totwind = sqrt(zwnd_i(ji,jj)*zwnd_i(ji,jj) + zwnd_j(ji,jj)*zwnd_j(ji,jj)) 
     186                        utau(ji,jj) = zrhoa * cdn_wave(ji,jj) * zwnd_i(ji,jj) * totwind 
     187                        vtau(ji,jj) = zrhoa * cdn_wave(ji,jj) * zwnd_j(ji,jj) * totwind 
    166188                     END DO 
    167189                  END DO 
     
    170192               DO jj = 1, jpj 
    171193                  DO ji = 1, jpi 
    172                      totwind = sqrt((sf(jp_utau)%fnow(ji,jj,1))**2.0 + (sf(jp_vtau)%fnow(ji,jj,1))**2.0) 
    173                      utau(ji,jj) = zrhoa * zcdrag * sf(jp_utau)%fnow(ji,jj,1) * totwind 
    174                      vtau(ji,jj) = zrhoa * zcdrag * sf(jp_vtau)%fnow(ji,jj,1) * totwind 
     194                     totwind = sqrt(zwnd_i(ji,jj)*zwnd_i(ji,jj) + zwnd_j(ji,jj)*zwnd_j(ji,jj)) 
     195                     utau(ji,jj) = zrhoa * zcdrag * zwnd_i(ji,jj) * totwind 
     196                     vtau(ji,jj) = zrhoa * zcdrag * zwnd_j(ji,jj) * totwind 
    175197                  END DO 
    176198               END DO 
     
    191213               taum(ji,jj) = zmod 
    192214               IF( ln_shelf_flx ) THEN 
     215                  ! winds as received, not relative to the current 
    193216                  ztx = sf(jp_utau)%fnow(ji-1,jj  ) + sf(jp_utau)%fnow(ji,jj) 
    194217                  zty = sf(jp_vtau)%fnow(ji  ,jj-1) + sf(jp_vtau)%fnow(ji,jj) 
     
    216239         ENDIF 
    217240         ! 
     241         IF( ln_shelf_flx ) THEN 
     242            CALL wrk_dealloc( jpi,jpj, zwnd_i, zwnd_j ) 
     243         ENDIF 
     244         ! 
    218245      ENDIF 
    219246      ! 
Note: See TracChangeset for help on using the changeset viewer.