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

Changeset 9243 for branches/UKMO


Ignore:
Timestamp:
2018-01-16T15:59:51+01:00 (6 years ago)
Author:
clne
Message:

Add changes for surge surface fluxes (ie wind/pressure only)

Location:
branches/UKMO/dev_r8814_surge_modelling_Nemo4/NEMOGCM
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/UKMO/dev_r8814_surge_modelling_Nemo4/NEMOGCM/CONFIG/AMM7_SURGE/EXP00/field_def_nemo-opa.xml

    r9120 r9243  
    203203         <field id="taum"         long_name="wind stress module"                    standard_name="magnitude_of_surface_downward_stress"                                 unit="N/m2"                           /> 
    204204         <field id="wspd"         long_name="wind speed module"                     standard_name="wind_speed"                                                           unit="m/s"                            /> 
    205          <field id="uwnd"         long_name="u component of wind"       unit="m/s"         /> 
    206          <field id="vwnd"         long_name="v component of wind"       unit="m/s"        /> 
     205         <field id="uwnd"         long_name="u component of wind"       unit="m/s"          grid_ref="grid_U_2D"     /> 
     206         <field id="vwnd"         long_name="v component of wind"       unit="m/s"          grid_ref="grid_V_2D"    /> 
    207207          
    208208         <!-- * variable relative to atmospheric pressure forcing : available with ln_apr_dyn --> 
  • branches/UKMO/dev_r8814_surge_modelling_Nemo4/NEMOGCM/CONFIG/AMM7_SURGE/EXP00/namelist_cfg

    r9120 r9243  
    7878!              !  file name                    ! frequency (hours) ! variable  ! time interp. !  clim  ! 'yearly'/ ! weights  ! rotation ! 
    7979!              !                               !  (if <0  months)  !   name    !   (logical)  !  (T/F) ! 'monthly' ! filename ! pairing  ! 
    80    sn_wndi     = 'windspd_u_amm7'              ,       1           ,'10mwind_u',   .true.     , .false. , 'daily'  ,'' , '' 
    81    sn_wndj     = 'windspd_v_amm7'              ,       1           ,'10mwind_v',   .true.     , .false. , 'daily'  ,'' , '' 
     80   sn_wndi     = 'windspd_u_amm7'              ,       1           ,'x_wind',   .true.     , .false. , 'daily'  ,'' , '' 
     81   sn_wndj     = 'windspd_v_amm7'              ,       1           ,'y_wind',   .true.     , .false. , 'daily'  ,'' , '' 
    8282   cn_dir      = './fluxes/'          !  root directory for the location of the bulk files 
    8383   rn_vfac     = 1.                   !  multiplicative factor for ocean/ice velocity 
     
    9898!          !  file name  ! frequency (hours) ! variable  ! time interp. !  clim  ! 'yearly'/ ! weights  ! rotation ! land/sea mask ! 
    9999!          !             !  (if <0  months)  !   name    !   (logical)  !  (T/F) ! 'monthly' ! filename ! pairing  ! filename      ! 
    100    sn_apr= 'pressure_amm7',        1         ,   'p_msl' ,    .true.    , .false., 'daily'   ,  ''      ,   ''     ,  '' 
     100   sn_apr= 'pressure_amm7',        1         ,   'air_pressure_at_sea_level' ,    .true.    , .false., 'daily'   ,  ''      ,   ''     ,  '' 
    101101   cn_dir      = './fluxes/'!  root directory for the location of the bulk files 
    102102   rn_pref     = 101200.    !  reference atmospheric pressure   [N/m2]/ 
  • branches/UKMO/dev_r8814_surge_modelling_Nemo4/NEMOGCM/CONFIG/AMM7_SURGE/MY_SRC/usrdef_sbc.F90

    r9120 r9243  
    1818   USE dom_oce         ! ocean space and time domain 
    1919   USE sbc_oce         ! Surface boundary condition: ocean fields 
     20   USE sbc_ice         ! Surface boundary condition: ocean fields 
     21   USE fldread         ! read input fields 
    2022   USE phycst          ! physical constants 
     23   USE lib_fortran     ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined)  
    2124   ! 
    2225   USE in_out_manager  ! I/O manager 
     
    2427   USE lib_mpp         ! distribued memory computing library 
    2528   USE lbclnk          ! ocean lateral boundary conditions (or mpp link) 
    26    USE lib_fortran     ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined)  
     29   USE wrk_nemo       ! work arrays 
     30   USE timing         ! Timing 
     31   USE prtctl         ! Print control 
    2732 
    2833   IMPLICIT NONE 
     
    3237   PUBLIC   usrdef_sbc_ice_tau  ! routine called by sbcice_lim.F90 for ice dynamics 
    3338   PUBLIC   usrdef_sbc_ice_flx  ! routine called by sbcice_lim.F90 for ice thermo 
    34  
    35    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   uwnd              !: wind speed i-component                       [m/s] 
    36    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   vwnd              !: wind speed j-component                       [m/s] 
     39   PUBLIC   surge_oce    ! routine called by usrdef_sbc_oce (if required) 
     40    
     41    
     42   INTEGER , PARAMETER ::   jpfld   = 2           ! maximum number of files to read 
     43   INTEGER , PARAMETER ::   jp_wndi = 1           ! index of 10m wind velocity (i-component) (m/s)    at T-point 
     44   INTEGER , PARAMETER ::   jp_wndj = 2           ! index of 10m wind velocity (j-component) (m/s)    at T-point 
     45 
     46   TYPE(FLD), ALLOCATABLE, DIMENSION(:) ::   sf   ! structure of input fields (file informations, fields read) 
     47 
     48   REAL(wp), PARAMETER ::   rhoa =    1.22        ! air density 
     49 
     50   !                                  !!* Namelist namsbc_usr 
     51   REAL(wp) ::   rn_vfac     ! multiplication factor for ice/ocean velocity in the calculation of wind stress (clem) 
     52   REAL(wp) ::   rn_charn_const  
     53   LOGICAL  ::   ln_use_sbc  ! Surface fluxes on or not  
     54 
    3755 
    3856   !! * Substitutions 
     
    5573      !!                CAUTION : never mask the surface stress field ! 
    5674      !! 
    57       !! ** Action  : - if no-flx case - set to ZERO all the ocean surface boundary condition, i.e.    
     75      !! ** Action  : - if tide-only case - set to ZERO all the ocean surface boundary condition, i.e.    
    5876      !!                   utau, vtau, taum, wndm, qns, qsr, emp, sfx 
    59       !! 
     77      !!              - if tide+surge case - read in wind and air pressure      !! 
    6078      !!---------------------------------------------------------------------- 
    6179      INTEGER, INTENT(in) ::   kt   ! ocean time step 
     80 
     81      INTEGER  ::   ierror   ! return error code 
     82      INTEGER  ::   ifpr     ! dummy loop indice 
     83      INTEGER  ::   ios      ! Local integer output status for namelist read 
     84      ! 
     85      CHARACTER(len=100) ::  cn_dir   !   Root directory for location of flux files 
     86      TYPE(FLD_N), DIMENSION(jpfld) ::   slf_i     ! array of namelist informations on the fields to read 
     87      TYPE(FLD_N) ::   sn_wndi, sn_wndj                        ! informations about the fields to be read 
     88 
     89      NAMELIST/namsbc_usr/ ln_use_sbc, cn_dir , rn_vfac,  & 
     90         &                   sn_wndi, sn_wndj, rn_charn_const 
    6291      !!--------------------------------------------------------------------- 
    6392      ! 
    6493      IF( kt == nit000 ) THEN 
    65          ! 
    66          IF(lwp) WRITE(numout,*)' usr_sbc : AMM7_SURGE tide only case: NO surface forcing' 
    67          IF(lwp) WRITE(numout,*)' ~~~~~~~~~~~   utau = vtau = taum = wndm = qns = qsr = emp = sfx = 0' 
    68          ! 
    69          utau(:,:) = 0._wp 
    70          vtau(:,:) = 0._wp 
    71          taum(:,:) = 0._wp 
    72          wndm(:,:) = 0._wp 
    73          ! 
    74          emp (:,:) = 0._wp 
    75          sfx (:,:) = 0._wp 
    76          qns (:,:) = 0._wp 
    77          qsr (:,:) = 0._wp 
    78          !          
    79          uwnd(:,:) = 0._wp 
    80          vwnd(:,:) = 0._wp 
     94          
     95          
     96         REWIND( numnam_cfg )              ! Namelist namsbc_usr in configuration namelist 
     97         READ  ( numnam_cfg, namsbc_usr, IOSTAT = ios, ERR = 902 ) 
     98902      IF( ios /= 0 ) CALL ctl_nam ( ios , 'namsbc_surge in configuration namelist', lwp ) 
     99 
     100         IF(lwm) WRITE( numond, namsbc_usr ) 
     101 
     102         IF(ln_use_sbc) THEN 
     103             IF(lwp) WRITE(numout,*)' usr_sbc : AMM7_SURGE tide + surge case: surface wind and pressure (assuming ln_dyn_apr=T) applied' 
     104             IF(lwp) WRITE(numout,*)' ~~~~~~~~~~~ ' 
     105 
     106             !                                         ! store namelist information in an array 
     107             slf_i(jp_wndi) = sn_wndi   ;   slf_i(jp_wndj) = sn_wndj 
     108             ! 
     109             ! 
     110             ALLOCATE( sf(jpfld), STAT=ierror )         ! set sf structure 
     111             IF( ierror > 0 )   CALL ctl_stop( 'STOP', 'sbc_surge: unable to allocate sf structure' ) 
     112             DO ifpr= 1, jpfld 
     113                ALLOCATE( sf(ifpr)%fnow(jpi,jpj,1) ) 
     114                IF( slf_i(ifpr)%ln_tint )   ALLOCATE( sf(ifpr)%fdta(jpi,jpj,1,2) ) 
     115             END DO 
     116             !                                         ! fill sf with slf_i and control print 
     117             CALL fld_fill( sf, slf_i, cn_dir, 'sbc_surge', 'flux formulation for ocean surface boundary condition', 'namsbc_surge' ) 
     118 
     119         ELSE 
     120             IF(lwp) WRITE(numout,*)' usr_sbc : AMM7_SURGE tide only case: NO surface forcing' 
     121             IF(lwp) WRITE(numout,*)' ~~~~~~~~~~~   utau = vtau = taum = wndm = qns = qsr = emp = sfx = 0' 
     122 
     123             utau(:,:) = 0._wp 
     124             vtau(:,:) = 0._wp 
     125             taum(:,:) = 0._wp 
     126             wndm(:,:) = 0._wp 
     127             ! 
     128             emp (:,:) = 0._wp 
     129             sfx (:,:) = 0._wp 
     130             qns (:,:) = 0._wp 
     131             qsr (:,:) = 0._wp 
     132             !          
     133             uwnd(:,:) = 0._wp 
     134             vwnd(:,:) = 0._wp 
     135         ENDIF 
    81136 
    82137      ENDIF 
    83138      ! 
     139      IF(ln_use_sbc) THEN 
     140          CALL fld_read( kt, nn_fsbc, sf )             ! input fields provided at the current time-step 
     141 
     142          !                                            ! compute the surface ocean fluxes using CORE bulk formulea 
     143          IF( MOD( kt - 1, nn_fsbc ) == 0 )   CALL surge_oce( kt, sf, ssu_m, ssv_m, rn_charn_const ) 
     144          
     145      ENDIF 
     146   END SUBROUTINE usrdef_sbc_oce 
     147 
     148 
    84149     
    85 !     CALL iom_put( "uwnd", uwnd )   ! output wind stress module 
    86 !     CALL iom_put( "vwnd", vwnd )   ! output wind stress module 
    87  
    88    END SUBROUTINE usrdef_sbc_oce 
     150   SUBROUTINE surge_oce( kt, sf, pu, pv, rn_charn_const ) 
     151      !!--------------------------------------------------------------------- 
     152      !!                     ***  ROUTINE surge_oce  *** 
     153      !! 
     154      !! ** Purpose :   provide the momentum fluxes at 
     155      !!      the ocean surface at each time step 
     156      !! 
     157      !! ** Method  :   Charnock formulea for the ocean using atmospheric 
     158      !!      fields read in sbc_read 
     159      !!  
     160      !! ** Outputs : - utau    : i-component of the stress at U-point  (N/m2) 
     161      !!              - vtau    : j-component of the stress at V-point  (N/m2) 
     162      !!              - taum    : Wind stress module at T-point         (N/m2) 
     163      !!              - wndm    : Wind speed module at T-point          (m/s) 
     164      !! 
     165      !!  ** Nota  :   sf has to be a dummy argument for AGRIF on NEC 
     166      !!--------------------------------------------------------------------- 
     167      INTEGER  , INTENT(in   )                 ::   kt    ! time step index 
     168      TYPE(fld), INTENT(inout), DIMENSION(:)   ::   sf    ! input data 
     169      REAL(wp) , INTENT(in)   , DIMENSION(:,:) ::   pu    ! surface current at U-point (i-component) [m/s] 
     170      REAL(wp) , INTENT(in)   , DIMENSION(:,:) ::   pv    ! surface current at V-point (j-component) [m/s] 
     171      REAL(wp) , INTENT(in)                    ::   rn_charn_const! local variable 
     172      ! 
     173      INTEGER  ::   ji, jj               ! dummy loop indices 
     174      REAL(wp) ::   zztmp                ! local variable 
     175      REAL(wp) ::   z_z0, z_Cd1          ! local variable 
     176      REAL(wp) ::   zi                   ! local variable 
     177      REAL(wp), DIMENSION(:,:), POINTER ::   zwnd_i, zwnd_j    ! wind speed components at T-point 
     178      REAL(wp), DIMENSION(:,:), POINTER ::   Cd                ! transfer coefficient for momentum      (tau) 
     179      !!--------------------------------------------------------------------- 
     180      ! 
     181      write(numout,*) '####### in surge_oce' 
     182      IF( nn_timing == 1 )  CALL timing_start('surge_oce') 
     183      ! 
     184      CALL wrk_alloc( jpi,jpj, zwnd_i, zwnd_j ) 
     185      CALL wrk_alloc( jpi,jpj, Cd ) 
     186      ! 
     187      ! ----------------------------------------------------------------------------- ! 
     188      !      0   Wind components and module at T-point relative to the moving ocean   ! 
     189      ! ----------------------------------------------------------------------------- ! 
     190 
     191      ! ... components ( U10m - U_oce ) at T-point (unmasked) 
     192      zwnd_i(:,:) = 0.e0   
     193      zwnd_j(:,:) = 0.e0 
     194      DO jj = 2, jpjm1 
     195         DO ji = fs_2, fs_jpim1   ! vect. opt. 
     196            uwnd(ji,jj) = (  sf(jp_wndi)%fnow(ji,jj,1) - rn_vfac * 0.5 * ( pu(ji-1,jj  ) + pu(ji,jj) )  ) 
     197            vwnd(ji,jj) = (  sf(jp_wndj)%fnow(ji,jj,1) - rn_vfac * 0.5 * ( pv(ji  ,jj-1) + pv(ji,jj) )  ) 
     198         END DO 
     199      END DO 
     200      zwnd_i(:,:) = uwnd(:,:) 
     201      zwnd_j(:,:) = vwnd(:,:) 
     202 
     203      CALL lbc_lnk( zwnd_i(:,:) , 'T', -1. ) 
     204      CALL lbc_lnk( zwnd_j(:,:) , 'T', -1. ) 
     205      ! ... scalar wind ( = | U10m - U_oce | ) at T-point (masked) 
     206      wndm(:,:) = SQRT(  zwnd_i(:,:) * zwnd_i(:,:)   & 
     207         &             + zwnd_j(:,:) * zwnd_j(:,:)  ) * tmask(:,:,1) 
     208 
     209      ! ----------------------------------------------------------------------------- ! 
     210      !      I   Radiative FLUXES                                                     ! 
     211      ! ----------------------------------------------------------------------------- ! 
     212       
     213      qsr(:,:)=0._wp 
     214 
     215      ! ----------------------------------------------------------------------------- ! 
     216      !     II    Turbulent FLUXES                                                    ! 
     217      ! ----------------------------------------------------------------------------- ! 
     218      Cd(:,:)=0.0001_wp 
     219      DO jj = 1,jpj 
     220         DO ji = 1,jpi 
     221            z_Cd1=0._wp 
     222            zi=1 
     223            !Iterate 
     224            DO WHILE((abs(Cd(ji,jj)-z_Cd1))>1E-6) 
     225               z_Cd1=Cd(ji,jj) 
     226               z_z0=rn_charn_const*z_Cd1*wndm(ji,jj)**2/grav 
     227               Cd(ji,jj)=(0.41_wp/log(10._wp/z_z0))**2 
     228               zi=zi+1 
     229            ENDDO 
     230         ENDDO 
     231      ENDDO 
     232 
     233      ! ... tau module, i and j component 
     234      DO jj = 1, jpj 
     235         DO ji = 1, jpi 
     236            zztmp = rhoa * wndm(ji,jj) * Cd(ji,jj) 
     237            taum  (ji,jj) = zztmp * wndm  (ji,jj) 
     238            zwnd_i(ji,jj) = zztmp * zwnd_i(ji,jj) 
     239            zwnd_j(ji,jj) = zztmp * zwnd_j(ji,jj) 
     240         END DO 
     241      END DO 
     242 
     243      CALL iom_put( "taum_oce", taum )   ! output wind stress module 
     244      CALL iom_put( "uwnd", uwnd )   ! output wind stress module 
     245      CALL iom_put( "vwnd", vwnd )   ! output wind stress module 
     246 
     247      ! ... utau, vtau at U- and V_points, resp. 
     248      !     Note the use of 0.5*(2-umask) in order to unmask the stress along coastlines 
     249      !     Note the use of MAX(tmask(i,j),tmask(i+1,j) is to mask tau over ice shelves 
     250      DO jj = 1, jpjm1 
     251         DO ji = 1, fs_jpim1 
     252            utau(ji,jj) = 0.5 * ( 2. - umask(ji,jj,1) ) * ( zwnd_i(ji,jj) + zwnd_i(ji+1,jj  ) ) & 
     253               &          * MAX(tmask(ji,jj,1),tmask(ji+1,jj,1)) 
     254            vtau(ji,jj) = 0.5 * ( 2. - vmask(ji,jj,1) ) * ( zwnd_j(ji,jj) + zwnd_j(ji  ,jj+1) ) & 
     255               &          * MAX(tmask(ji,jj,1),tmask(ji,jj+1,1)) 
     256         END DO 
     257      END DO 
     258      CALL lbc_lnk( utau(:,:), 'U', -1. ) 
     259      CALL lbc_lnk( vtau(:,:), 'V', -1. ) 
     260 
     261     
     262      IF(ln_ctl) THEN 
     263         CALL prt_ctl( tab2d_1=utau  , clinfo1=' surge_oce: utau   : ', mask1=umask,   & 
     264            &          tab2d_2=vtau  , clinfo2=           ' vtau : '  , mask2=vmask ) 
     265         CALL prt_ctl( tab2d_1=wndm  , clinfo1=' surge_oce: wndm   : ') 
     266      ENDIF 
     267        
     268      ! ----------------------------------------------------------------------------- ! 
     269      !     III    Total FLUXES                                                       ! 
     270      ! ----------------------------------------------------------------------------- ! 
     271      ! 
     272      emp (:,:) = 0._wp 
     273      qns(:,:)  = 0._wp 
     274      sfx(:,:) = 0._wp                          ! salt flux; zero unless ice is present (computed in limsbc(_2).F90) 
     275      ! 
     276!       IF ( nn_ice == 0 ) THEN 
     277!          CALL iom_put( "qns_oce" ,   qns  )                 ! output downward non solar heat over the ocean 
     278!          CALL iom_put( "qsr_oce" ,   qsr  )                 ! output downward solar heat over the ocean 
     279!          CALL iom_put( "qt_oce"  ,   qns+qsr )              ! output total downward heat over the ocean 
     280!       ENDIF 
     281      ! 
     282      IF(ln_ctl) THEN 
     283         CALL prt_ctl(tab2d_1=utau , clinfo1=' surge_oce: utau   : ', mask1=umask,   & 
     284            &         tab2d_2=vtau , clinfo2=           ' vtau  : ' , mask2=vmask ) 
     285      ENDIF 
     286      ! 
     287      CALL wrk_dealloc( jpi,jpj, zwnd_i, zwnd_j ) 
     288      CALL wrk_dealloc( jpi,jpj, Cd ) 
     289      ! 
     290      IF( nn_timing == 1 )  CALL timing_stop('surge_oce') 
     291 
     292      ! 
     293   END SUBROUTINE surge_oce 
     294 
    89295 
    90296   SUBROUTINE usrdef_sbc_ice_tau( kt ) 
  • branches/UKMO/dev_r8814_surge_modelling_Nemo4/NEMOGCM/NEMO/OPA_SRC/DIA/diawri.F90

    r8465 r9243  
    197197         CALL iom_put( "taubot", z2d )            
    198198      ENDIF 
     199 
     200      CALL iom_put( "uwnd" ,   uwnd  ) 
     201      CALL iom_put( "vwnd" ,   vwnd  ) 
     202 
    199203          
    200204      CALL iom_put( "uoce", un(:,:,:)         )    ! 3D i-current 
  • branches/UKMO/dev_r8814_surge_modelling_Nemo4/NEMOGCM/NEMO/OPA_SRC/DOM/istate.F90

    r9120 r9243  
    9595         ! 
    9696         IF (ln_2d) THEN 
     97            IF(lwp) WRITE(numout,*) 'istate_init : 2D case, setting tracers to 0 and ocean at rest' 
    9798            tsn(:,:,:,:)= 0._wp                ! No tracers 
    9899            sshb(:,:)   = 0._wp               ! set the ocean at rest 
  • branches/UKMO/dev_r8814_surge_modelling_Nemo4/NEMOGCM/NEMO/OPA_SRC/SBC/sbc_oce.F90

    r7788 r9243  
    9898   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   vtau   , vtau_b   !: sea surface j-stress (ocean referential)     [N/m2] 
    9999   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   taum              !: module of sea surface stress (at T-point)    [N/m2]  
     100   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   uwnd              !: wind speed i-component                       [m/s] 
     101   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   vwnd              !: wind speed j-component                       [m/s] 
    100102   !! wndm is used onmpute surface gases exchanges in ice-free ocean or leads 
    101103   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   wndm              !: wind speed module at T-point (=|U10m-Uoce|)  [m/s] 
     
    153155      ! 
    154156      ALLOCATE( utau(jpi,jpj) , utau_b(jpi,jpj) , taum(jpi,jpj) ,     & 
    155          &      vtau(jpi,jpj) , vtau_b(jpi,jpj) , wndm(jpi,jpj) , STAT=ierr(1) )  
     157         &      vtau(jpi,jpj) , vtau_b(jpi,jpj) , wndm(jpi,jpj) ,     & 
     158         &      uwnd(jpi,jpj) , vwnd(jpi,jpj)   , STAT=ierr(1) )  
     159 
    156160         ! 
    157161      ALLOCATE( qns_tot(jpi,jpj) , qns  (jpi,jpj) , qns_b(jpi,jpj),        & 
Note: See TracChangeset for help on using the changeset viewer.