Changeset 7383
- Timestamp:
- 2016-11-30T12:50:29+01:00 (8 years ago)
- Location:
- branches/2016/dev_INGV_METO_merge_2016/NEMOGCM
- Files:
-
- 15 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/2016/dev_INGV_METO_merge_2016/NEMOGCM/ARCH/INGV/arch-IBM_EKMAN_INGV.fcm
r5656 r7383 34 34 %USER_INC -I%XIOS_ROOT/inc %NCDF_INC %MPI_INTEL -I/srv/lib/zlib-last/include 35 35 %USER_LIB -L%XIOS_ROOT/lib -lxios %NCDF_LIB -L/srv/lib/zlib-last/lib -lz 36 %CC icc 37 %CFLAGS -O0 -
branches/2016/dev_INGV_METO_merge_2016/NEMOGCM/CONFIG/SHARED/namelist_ref
r6497 r7383 288 288 ln_apr_dyn = .false. ! Patm gradient added in ocean & ice Eqs. (T => fill namsbc_apr ) 289 289 ln_isf = .false. ! ice shelf (T => fill namsbc_isf) 290 ln_wave = .false. ! coupling with surface wave (T => fill namsbc_wave) 290 ln_wave = .false. ! Activate coupling with wave (T => fill namsbc_wave) 291 ln_cdgw = .false. ! Neutral drag coefficient read from wave model (T => ln_wave=.true. & fill namsbc_wave) 292 ln_sdw = .false. ! Read 2D Surf Stokes Drift & Computation of 3D stokes drift (T => ln_wave=.true. & fill namsbc_wave) 293 ln_tauoc = .false. ! Activate ocean stress modified by external wave induced stress (T => ln_wave=.true. & fill namsbc_wave) 294 ln_stcor = .false. ! Activate Stokes Coriolis term (T => ln_wave=.true. & ln_sdw=.true. & fill namsbc_wave) 291 295 nn_lsm = 0 ! =0 land/sea mask for input fields is not applied (keep empty land/sea mask filename field) , 292 296 ! =1:n number of iterations of land/sea mask application for input fields (fill land/sea mask filename field) … … 380 384 sn_snd_crt = 'none' , 'no' , 'spherical' , 'eastward-northward' , 'T' 381 385 sn_snd_co2 = 'coupled' , 'no' , '' , '' , '' 386 sn_snd_crtw = 'none' , 'no' , '' , '' , 'U,V' 387 sn_snd_ifrac = 'none' , 'no' , '' , '' , '' 388 sn_snd_wlev = 'coupled' , 'no' , '' , '' , '' 382 389 ! receive 383 390 sn_rcv_w10m = 'none' , 'no' , '' , '' , '' … … 391 398 sn_rcv_cal = 'coupled' , 'no' , '' , '' , '' 392 399 sn_rcv_co2 = 'coupled' , 'no' , '' , '' , '' 400 sn_rcv_hsig = 'none' , 'no' , '' , '' , '' 401 sn_rcv_iceflx = 'none' , 'no' , '' , '' , '' 402 sn_rcv_mslp = 'none' , 'no' , '' , '' , '' 403 sn_rcv_phioc = 'none' , 'no' , '' , '' , '' 404 sn_rcv_sdrfx = 'none' , 'no' , '' , '' , '' 405 sn_rcv_sdrfy = 'none' , 'no' , '' , '' , '' 406 sn_rcv_wper = 'none' , 'no' , '' , '' , '' 407 sn_rcv_wnum = 'none' , 'no' , '' , '' , '' 408 sn_rcv_wstrf = 'none' , 'no' , '' , '' , '' 409 sn_rcv_wdrag = 'none' , 'no' , '' , '' , '' 393 410 ! 394 411 nn_cplmodel = 1 ! Maximum number of models to/from which NEMO is potentialy sending/receiving data … … 535 552 / 536 553 !----------------------------------------------------------------------- 537 &namsbc_wave ! External fields from wave model (ln_wave=T) 538 !----------------------------------------------------------------------- 539 ! ! file name ! frequency (hours) ! variable ! time interp.! clim ! 'yearly'/ ! weights ! rotation ! land/sea mask ! 540 ! ! ! (if <0 months) ! name ! (logical) ! (T/F) ! 'monthly' ! filename ! pairing ! filename ! 541 sn_cdg = 'cdg_wave', 1 , 'drag_coeff', .true. , .false., 'daily' , '' , '' , '' 542 sn_usd = 'sdw_wave', 1 , 'u_sd2d' , .true. , .false., 'daily' , '' , '' , '' 543 sn_vsd = 'sdw_wave', 1 , 'v_sd2d' , .true. , .false., 'daily' , '' , '' , '' 544 sn_wn = 'sdw_wave', 1 , 'wave_num' , .true. , .false., 'daily' , '' , '' , '' 545 ! 546 cn_dir_cdg = './' ! root directory for the location of drag coefficient files 547 ln_cdgw = .false. ! Neutral drag coefficient read from wave model 548 ln_sdw = .false. ! Computation of 3D stokes drift 554 &namsbc_wave ! External fields from wave model 555 !----------------------------------------------------------------------- 556 ! ! file name ! frequency (hours) ! variable ! time interp. ! clim ! 'yearly'/ ! weights ! rotation ! land/sea mask ! 557 ! ! ! (if <0 months) ! name ! (logical) ! (T/F) ! 'monthly' ! filename ! pairing ! filename ! 558 sn_cdg = 'sdw_wave' , 1 , 'drag_coeff' , .true. , .false. , 'daily' , '' , '' , '' 559 sn_usd = 'sdw_wave' , 1 , 'u_sd2d' , .true. , .false. , 'daily' , '' , '' , '' 560 sn_vsd = 'sdw_wave' , 1 , 'v_sd2d' , .true. , .false. , 'daily' , '' , '' , '' 561 sn_swh = 'sdw_wave' , 1 , 'hs' , .true. , .false. , 'daily' , '' , '' , '' 562 sn_wmp = 'sdw_wave' , 1 , 'wmp' , .true. , .false. , 'daily' , '' , '' , '' 563 sn_wnum = 'sdw_wave' , 1 , 'wave_num' , .true. , .false. , 'daily' , '' , '' , '' 564 sn_tauoc = 'sdw_wave' , 1 , 'wave_stress', .true. , .false. , 'daily' , '' , '' , '' 565 ! 566 cn_dir = './' ! root directory for the location of drag coefficient files 549 567 / 550 568 !----------------------------------------------------------------------- … … 973 991 ln_zdfexp = .false. ! time-stepping: split-explicit (T) or implicit (F) time stepping 974 992 nn_zdfexp = 3 ! number of sub-timestep for ln_zdfexp=T 993 ln_zdfqiao = .false. ! Enhanced wave vertical mixing Qiao (2010) (T => ln_wave=.true. & ln_sdw=.true. & fill namsbc_wave) 975 994 / 976 995 !----------------------------------------------------------------------- -
branches/2016/dev_INGV_METO_merge_2016/NEMOGCM/NEMO/OPA_SRC/SBC/cpl_oasis3.F90
r5836 r7383 66 66 INTEGER :: nsnd ! total number of fields sent 67 67 INTEGER :: ncplmodel ! Maximum number of models to/from which NEMO is potentialy sending/receiving data 68 INTEGER, PUBLIC, PARAMETER :: nmaxfld=5 0! Maximum number of coupling fields68 INTEGER, PUBLIC, PARAMETER :: nmaxfld=55 ! Maximum number of coupling fields 69 69 INTEGER, PUBLIC, PARAMETER :: nmaxcat=5 ! Maximum number of coupling fields 70 70 INTEGER, PUBLIC, PARAMETER :: nmaxcpl=5 ! Maximum number of coupling fields -
branches/2016/dev_INGV_METO_merge_2016/NEMOGCM/NEMO/OPA_SRC/SBC/sbc_oce.F90
r6140 r7383 65 65 LOGICAL , PUBLIC :: ln_cdgw !: true if neutral drag coefficient from wave model 66 66 LOGICAL , PUBLIC :: ln_sdw !: true if 3d stokes drift from wave model 67 LOGICAL , PUBLIC :: ln_tauoc !: true if normalized stress from wave is used 68 LOGICAL , PUBLIC :: ln_stcor !: true if Stokes-Coriolis term is used 67 69 ! 68 70 LOGICAL , PUBLIC :: ln_icebergs !: Icebergs -
branches/2016/dev_INGV_METO_merge_2016/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk_core.F90
r6813 r7383 745 745 746 746 !! Neutral coefficients at 10m: 747 IF( ln_ cdgw ) THEN ! wave drag case747 IF( ln_wave .AND. ln_cdgw ) THEN ! wave drag case 748 748 cdn_wave(:,:) = cdn_wave(:,:) + rsmall * ( 1._wp - tmask(:,:,1) ) 749 749 ztmp0 (:,:) = cdn_wave(:,:) … … 791 791 END IF 792 792 793 IF( ln_ cdgw ) THEN ! surface wave case793 IF( ln_wave .AND. ln_cdgw ) THEN ! surface wave case 794 794 sqrt_Cd = vkarmn / ( vkarmn / sqrt_Cd_n10 - zpsi_m_u ) 795 795 Cd = sqrt_Cd * sqrt_Cd -
branches/2016/dev_INGV_METO_merge_2016/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk_mfs.F90
r6140 r7383 17 17 USE fldread ! read input fields 18 18 USE sbc_oce ! Surface boundary condition: ocean fields 19 USE sbcwave ,ONLY : cdn_wave !wave module20 19 ! 21 20 USE iom ! I/O manager library -
branches/2016/dev_INGV_METO_merge_2016/NEMOGCM/NEMO/OPA_SRC/SBC/sbccpl.F90
r6722 r7383 18 18 !! sbc_cpl_snd : send fields to the atmosphere 19 19 !!---------------------------------------------------------------------- 20 USE dom_oce ! ocean space and time domain 21 USE sbc_oce ! Surface boundary condition: ocean fields 22 USE sbc_ice ! Surface boundary condition: ice fields 23 USE sbcapr ! Stochastic param. : ??? 24 USE sbcdcy ! surface boundary condition: diurnal cycle 25 USE phycst ! physical constants 20 USE dom_oce ! ocean space and time domain 21 USE sbc_oce ! Surface boundary condition: ocean fields 22 USE sbc_ice ! Surface boundary condition: ice fields 23 USE sbcapr 24 USE sbcdcy ! surface boundary condition: diurnal cycle 25 USE sbcwave ! surface boundary condition: waves 26 USE phycst ! physical constants 26 27 #if defined key_lim3 27 28 USE ice ! ice variables … … 106 107 INTEGER, PARAMETER :: jpr_e3t1st = 41 ! first T level thickness 107 108 INTEGER, PARAMETER :: jpr_fraqsr = 42 ! fraction of solar net radiation absorbed in the first ocean level 108 INTEGER, PARAMETER :: jprcv = 42 ! total number of fields received 109 INTEGER, PARAMETER :: jpr_mslp = 43 ! mean sea level pressure 110 INTEGER, PARAMETER :: jpr_hsig = 44 ! Hsig 111 INTEGER, PARAMETER :: jpr_phioc = 45 ! Wave=>ocean energy flux 112 INTEGER, PARAMETER :: jpr_sdrftx = 46 ! Stokes drift on grid 1 113 INTEGER, PARAMETER :: jpr_sdrfty = 47 ! Stokes drift on grid 2 114 INTEGER, PARAMETER :: jpr_wper = 48 ! Mean wave period 115 INTEGER, PARAMETER :: jpr_wnum = 49 ! Mean wavenumber 116 INTEGER, PARAMETER :: jpr_wstrf = 50 ! Stress fraction adsorbed by waves 117 INTEGER, PARAMETER :: jpr_wdrag = 51 ! Neutral surface drag coefficient 118 INTEGER, PARAMETER :: jprcv = 51 ! total number of fields received 109 119 110 120 INTEGER, PARAMETER :: jps_fice = 1 ! ice fraction sent to the atmosphere … … 136 146 INTEGER, PARAMETER :: jps_e3t1st = 27 ! first level depth (vvl) 137 147 INTEGER, PARAMETER :: jps_fraqsr = 28 ! fraction of solar net radiation absorbed in the first ocean level 138 INTEGER, PARAMETER :: jpsnd = 28 ! total number of fields sended 148 INTEGER, PARAMETER :: jps_ficet = 29 ! total ice fraction 149 INTEGER, PARAMETER :: jps_ocxw = 30 ! currents on grid 1 150 INTEGER, PARAMETER :: jps_ocyw = 31 ! currents on grid 2 151 INTEGER, PARAMETER :: jps_wlev = 32 ! water level 152 INTEGER, PARAMETER :: jpsnd = 32 ! total number of fields sent 139 153 140 154 ! !!** namelist namsbc_cpl ** … … 150 164 ! ! Received from the atmosphere 151 165 TYPE(FLD_C) :: sn_rcv_w10m, sn_rcv_taumod, sn_rcv_tau, sn_rcv_dqnsdt, sn_rcv_qsr, sn_rcv_qns, sn_rcv_emp, sn_rcv_rnf 152 TYPE(FLD_C) :: sn_rcv_cal, sn_rcv_iceflx, sn_rcv_co2 166 TYPE(FLD_C) :: sn_rcv_cal, sn_rcv_iceflx, sn_rcv_co2, sn_rcv_mslp 167 ! Send to waves 168 TYPE(FLD_C) :: sn_snd_ifrac, sn_snd_crtw, sn_snd_wlev 169 ! Received from waves 170 TYPE(FLD_C) :: sn_rcv_hsig,sn_rcv_phioc,sn_rcv_sdrfx,sn_rcv_sdrfy,sn_rcv_wper,sn_rcv_wnum,sn_rcv_wstrf,sn_rcv_wdrag 153 171 ! ! Other namelist parameters 154 172 INTEGER :: nn_cplmodel ! Maximum number of models to/from which NEMO is potentialy sending/receiving data … … 163 181 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) :: albedo_oce_mix ! ocean albedo sent to atmosphere (mix clear/overcast sky) 164 182 165 INTEGER , ALLOCATABLE, SAVE, DIMENSION( :) :: nrcvinfo ! OASIS info argument 183 REAL(wp) :: rpref = 101000._wp ! reference atmospheric pressure[N/m2] 184 REAL(wp) :: r1_grau ! = 1.e0 / (grav * rau0) 185 186 INTEGER , ALLOCATABLE, SAVE, DIMENSION( :) :: nrcvinfo ! OASIS info argument 166 187 167 188 !! Substitution … … 178 199 !! *** FUNCTION sbc_cpl_alloc *** 179 200 !!---------------------------------------------------------------------- 180 INTEGER :: ierr( 3)201 INTEGER :: ierr(4) 181 202 !!---------------------------------------------------------------------- 182 203 ierr(:) = 0 … … 189 210 ALLOCATE( xcplmask(jpi,jpj,0:nn_cplmodel) , STAT=ierr(3) ) 190 211 ! 212 IF( .NOT. ln_apr_dyn ) ALLOCATE( ssh_ib(jpi,jpj), ssh_ibb(jpi,jpj), apr(jpi, jpj), STAT=ierr(4) ) 213 191 214 sbc_cpl_alloc = MAXVAL( ierr ) 192 215 IF( lk_mpp ) CALL mpp_sum ( sbc_cpl_alloc ) … … 214 237 REAL(wp), POINTER, DIMENSION(:,:) :: zacs, zaos 215 238 !! 216 NAMELIST/namsbc_cpl/ sn_snd_temp, sn_snd_alb , sn_snd_thick, sn_snd_crt , sn_snd_co2, & 217 & sn_rcv_w10m, sn_rcv_taumod, sn_rcv_tau , sn_rcv_dqnsdt, sn_rcv_qsr, & 218 & sn_rcv_qns , sn_rcv_emp , sn_rcv_rnf , sn_rcv_cal , sn_rcv_iceflx, & 219 & sn_rcv_co2 , nn_cplmodel , ln_usecplmask 239 NAMELIST/namsbc_cpl/ sn_snd_temp , sn_snd_alb , sn_snd_thick , sn_snd_crt , sn_snd_co2, & 240 & sn_rcv_w10m, sn_rcv_taumod, sn_rcv_tau , sn_rcv_dqnsdt, sn_rcv_qsr, & 241 & sn_snd_ifrac, sn_snd_crtw , sn_snd_wlev , sn_rcv_hsig , sn_rcv_phioc , & 242 & sn_rcv_sdrfx, sn_rcv_sdrfy, sn_rcv_wper , sn_rcv_wnum , sn_rcv_wstrf , & 243 & sn_rcv_wdrag, sn_rcv_qns , sn_rcv_emp , sn_rcv_rnf , sn_rcv_cal , & 244 & sn_rcv_iceflx,sn_rcv_co2 , nn_cplmodel , ln_usecplmask, sn_rcv_mslp 220 245 !!--------------------------------------------------------------------- 221 246 ! … … 258 283 WRITE(numout,*)' sea ice heat fluxes = ', TRIM(sn_rcv_iceflx%cldes), ' (', TRIM(sn_rcv_iceflx%clcat), ')' 259 284 WRITE(numout,*)' atm co2 = ', TRIM(sn_rcv_co2%cldes ), ' (', TRIM(sn_rcv_co2%clcat ), ')' 285 WRITE(numout,*)' significant wave heigth = ', TRIM(sn_rcv_hsig%cldes ), ' (', TRIM(sn_rcv_hsig%clcat ), ')' 286 WRITE(numout,*)' wave to oce energy flux = ', TRIM(sn_rcv_phioc%cldes ), ' (', TRIM(sn_rcv_phioc%clcat ), ')' 287 WRITE(numout,*)' Surface Stokes drift grid u = ', TRIM(sn_rcv_sdrfx%cldes ), ' (', TRIM(sn_rcv_sdrfx%clcat ), ')' 288 WRITE(numout,*)' Surface Stokes drift grid v = ', TRIM(sn_rcv_sdrfy%cldes ), ' (', TRIM(sn_rcv_sdrfy%clcat ), ')' 289 WRITE(numout,*)' Mean wave period = ', TRIM(sn_rcv_wper%cldes ), ' (', TRIM(sn_rcv_wper%clcat ), ')' 290 WRITE(numout,*)' Mean wave number = ', TRIM(sn_rcv_wnum%cldes ), ' (', TRIM(sn_rcv_wnum%clcat ), ')' 291 WRITE(numout,*)' Stress frac adsorbed by waves = ', TRIM(sn_rcv_wstrf%cldes ), ' (', TRIM(sn_rcv_wstrf%clcat ), ')' 292 WRITE(numout,*)' Neutral surf drag coefficient = ', TRIM(sn_rcv_wdrag%cldes ), ' (', TRIM(sn_rcv_wdrag%clcat ), ')' 260 293 WRITE(numout,*)' sent fields (multiple ice categories)' 261 294 WRITE(numout,*)' surface temperature = ', TRIM(sn_snd_temp%cldes ), ' (', TRIM(sn_snd_temp%clcat ), ')' 262 295 WRITE(numout,*)' albedo = ', TRIM(sn_snd_alb%cldes ), ' (', TRIM(sn_snd_alb%clcat ), ')' 263 296 WRITE(numout,*)' ice/snow thickness = ', TRIM(sn_snd_thick%cldes ), ' (', TRIM(sn_snd_thick%clcat ), ')' 297 WRITE(numout,*)' total ice fraction = ', TRIM(sn_snd_ifrac%cldes ), ' (', TRIM(sn_snd_ifrac%clcat ), ')' 264 298 WRITE(numout,*)' surface current = ', TRIM(sn_snd_crt%cldes ), ' (', TRIM(sn_snd_crt%clcat ), ')' 265 299 WRITE(numout,*)' - referential = ', sn_snd_crt%clvref … … 267 301 WRITE(numout,*)' - mesh = ', sn_snd_crt%clvgrd 268 302 WRITE(numout,*)' oce co2 flux = ', TRIM(sn_snd_co2%cldes ), ' (', TRIM(sn_snd_co2%clcat ), ')' 303 WRITE(numout,*)' water level = ', TRIM(sn_snd_wlev%cldes ), ' (', TRIM(sn_snd_wlev%clcat ), ')' 304 WRITE(numout,*)' mean sea level pressure = ', TRIM(sn_rcv_mslp%cldes ), ' (', TRIM(sn_rcv_mslp%clcat ), ')' 305 WRITE(numout,*)' surface current to waves = ', TRIM(sn_snd_crtw%cldes ), ' (', TRIM(sn_snd_crtw%clcat ), ')' 306 WRITE(numout,*)' - referential = ', sn_snd_crtw%clvref 307 WRITE(numout,*)' - orientation = ', sn_snd_crtw%clvor 308 WRITE(numout,*)' - mesh = ', sn_snd_crtw%clvgrd 269 309 WRITE(numout,*)' nn_cplmodel = ', nn_cplmodel 270 310 WRITE(numout,*)' ln_usecplmask = ', ln_usecplmask … … 305 345 ! 306 346 ! Vectors: change of sign at north fold ONLY if on the local grid 347 IF( TRIM( sn_rcv_tau%cldes ) == 'oce only' .OR. TRIM(sn_rcv_tau%cldes ) == 'oce and ice') THEN ! avoid working with the atmospheric fields if they are not coupled 307 348 IF( TRIM( sn_rcv_tau%clvor ) == 'local grid' ) srcv(jpr_otx1:jpr_itz2)%nsgn = -1. 308 349 … … 372 413 srcv(jpr_ity1)%clgrid = 'V' ! i.e. it is always at U- & V-points for i- & j-comp. resp. 373 414 ENDIF 374 ! 415 ENDIF 416 375 417 ! ! ------------------------- ! 376 418 ! ! freshwater budget ! E-P … … 468 510 ! ! ------------------------- ! 469 511 srcv(jpr_co2 )%clname = 'O_AtmCO2' ; IF( TRIM(sn_rcv_co2%cldes ) == 'coupled' ) srcv(jpr_co2 )%laction = .TRUE. 512 513 ! ! ------------------------- ! 514 ! ! Mean Sea Level Pressure ! 515 ! ! ------------------------- ! 516 srcv(jpr_mslp)%clname = 'O_MSLP' ; IF( TRIM(sn_rcv_mslp%cldes ) == 'coupled' ) srcv(jpr_mslp)%laction = .TRUE. 517 470 518 ! ! ------------------------- ! 471 519 ! ! topmelt and botmelt ! … … 481 529 srcv(jpr_topm:jpr_botm)%laction = .TRUE. 482 530 ENDIF 531 ! ! ------------------------- ! 532 ! ! Wave breaking ! 533 ! ! ------------------------- ! 534 srcv(jpr_hsig)%clname = 'O_Hsigwa' ! significant wave height 535 IF( TRIM(sn_rcv_hsig%cldes ) == 'coupled' ) THEN 536 srcv(jpr_hsig)%laction = .TRUE. 537 cpl_hsig = .TRUE. 538 ENDIF 539 srcv(jpr_phioc)%clname = 'O_PhiOce' ! wave to ocean energy 540 IF( TRIM(sn_rcv_phioc%cldes ) == 'coupled' ) THEN 541 srcv(jpr_phioc)%laction = .TRUE. 542 cpl_phioc = .TRUE. 543 ENDIF 544 srcv(jpr_sdrftx)%clname = 'O_Sdrfx' ! Stokes drift in the u direction 545 IF( TRIM(sn_rcv_sdrfx%cldes ) == 'coupled' ) THEN 546 srcv(jpr_sdrftx)%laction = .TRUE. 547 cpl_sdrftx = .TRUE. 548 ENDIF 549 srcv(jpr_sdrfty)%clname = 'O_Sdrfy' ! Stokes drift in the v direction 550 IF( TRIM(sn_rcv_sdrfy%cldes ) == 'coupled' ) THEN 551 srcv(jpr_sdrfty)%laction = .TRUE. 552 cpl_sdrfty = .TRUE. 553 ENDIF 554 srcv(jpr_wper)%clname = 'O_WPer' ! mean wave period 555 IF( TRIM(sn_rcv_wper%cldes ) == 'coupled' ) THEN 556 srcv(jpr_wper)%laction = .TRUE. 557 cpl_wper = .TRUE. 558 ENDIF 559 srcv(jpr_wnum)%clname = 'O_WNum' ! mean wave number 560 IF( TRIM(sn_rcv_wnum%cldes ) == 'coupled' ) THEN 561 srcv(jpr_wnum)%laction = .TRUE. 562 cpl_wnum = .TRUE. 563 ENDIF 564 srcv(jpr_wstrf)%clname = 'O_WStrf' ! stress fraction adsorbed by the wave 565 IF( TRIM(sn_rcv_wstrf%cldes ) == 'coupled' ) THEN 566 srcv(jpr_wstrf)%laction = .TRUE. 567 cpl_wstrf = .TRUE. 568 ENDIF 569 srcv(jpr_wdrag)%clname = 'O_WDrag' ! neutral surface drag coefficient 570 IF( TRIM(sn_rcv_wdrag%cldes ) == 'coupled' ) THEN 571 srcv(jpr_wdrag)%laction = .TRUE. 572 cpl_wdrag = .TRUE. 573 ENDIF 574 ! 483 575 ! ! ------------------------------- ! 484 576 ! ! OPA-SAS coupling - rcv by opa ! … … 635 727 ! ! ------------------------- ! 636 728 ssnd(jps_fice)%clname = 'OIceFrc' 729 ssnd(jps_ficet)%clname = 'OIceFrcT' 637 730 ssnd(jps_hice)%clname = 'OIceTck' 638 731 ssnd(jps_hsnw)%clname = 'OSnwTck' … … 643 736 ENDIF 644 737 738 IF (TRIM( sn_snd_ifrac%cldes ) == 'coupled') ssnd(jps_ficet)%laction = .TRUE. 739 645 740 SELECT CASE ( TRIM( sn_snd_thick%cldes ) ) 646 741 CASE( 'none' ) ! nothing to do … … 663 758 ssnd(jps_ocy1)%clname = 'O_OCury1' ; ssnd(jps_ivy1)%clname = 'O_IVely1' 664 759 ssnd(jps_ocz1)%clname = 'O_OCurz1' ; ssnd(jps_ivz1)%clname = 'O_IVelz1' 760 ssnd(jps_ocxw)%clname = 'O_OCurxw' 761 ssnd(jps_ocyw)%clname = 'O_OCuryw' 665 762 ! 666 763 ssnd(jps_ocx1:jps_ivz1)%nsgn = -1. ! vectors: change of the sign at the north fold … … 683 780 END SELECT 684 781 782 ssnd(jps_ocxw:jps_ocyw)%nsgn = -1. ! vectors: change of the sign at the north fold 783 784 IF( sn_snd_crtw%clvgrd == 'U,V' ) THEN 785 ssnd(jps_ocxw)%clgrid = 'U' ; ssnd(jps_ocyw)%clgrid = 'V' 786 ELSE IF( sn_snd_crtw%clvgrd /= 'T' ) THEN 787 CALL ctl_stop( 'sn_snd_crtw%clvgrd must be equal to T' ) 788 ENDIF 789 IF( TRIM( sn_snd_crtw%clvor ) == 'eastward-northward' ) ssnd(jps_ocxw:jps_ocyw)%nsgn = 1. 790 SELECT CASE( TRIM( sn_snd_crtw%cldes ) ) 791 CASE( 'none' ) ; ssnd(jps_ocxw:jps_ocyw)%laction = .FALSE. 792 CASE( 'oce only' ) ; ssnd(jps_ocxw:jps_ocyw)%laction = .TRUE. 793 CASE( 'weighted oce and ice' ) ! nothing to do 794 CASE( 'mixed oce-ice' ) ; ssnd(jps_ivx1:jps_ivz1)%laction = .FALSE. 795 CASE default ; CALL ctl_stop( 'sbc_cpl_init: wrong definition of sn_snd_crtw%cldes' ) 796 END SELECT 797 685 798 ! ! ------------------------- ! 686 799 ! ! CO2 flux ! 687 800 ! ! ------------------------- ! 688 801 ssnd(jps_co2)%clname = 'O_CO2FLX' ; IF( TRIM(sn_snd_co2%cldes) == 'coupled' ) ssnd(jps_co2 )%laction = .TRUE. 802 803 ! ! ------------------------- ! 804 ! ! Sea surface height ! 805 ! ! ------------------------- ! 806 ssnd(jps_wlev)%clname = 'O_Wlevel' ; IF( TRIM(sn_snd_wlev%cldes) == 'coupled' ) ssnd(jps_wlev)%laction = .TRUE. 689 807 690 808 ! ! ------------------------------- ! … … 781 899 IF( ln_dm2dc .AND. ln_cpl .AND. ncpl_qsr_freq /= 86400 ) & 782 900 & CALL ctl_stop( 'sbc_cpl_init: diurnal cycle reconstruction (ln_dm2dc) needs daily couping for solar radiation' ) 783 ncpl_qsr_freq = 86400 / ncpl_qsr_freq901 IF( ln_dm2dc .AND. ln_cpl ) ncpl_qsr_freq = 86400 / ncpl_qsr_freq 784 902 785 903 CALL wrk_dealloc( jpi,jpj, zacs, zaos ) … … 835 953 !! emp upward mass flux [evap. - precip. (- runoffs) (- calving)] (ocean only case) 836 954 !!---------------------------------------------------------------------- 837 INTEGER, INTENT(in) :: kt ! ocean model time step index 838 INTEGER, INTENT(in) :: k_fsbc ! frequency of sbc (-> ice model) computation 839 INTEGER, INTENT(in) :: k_ice ! ice management in the sbc (=0/1/2/3) 840 955 USE zdf_oce, ONLY : ln_zdfqiao 956 957 IMPLICIT NONE 958 959 INTEGER, INTENT(in) :: kt ! ocean model time step index 960 INTEGER, INTENT(in) :: k_fsbc ! frequency of sbc (-> ice model) computation 961 INTEGER, INTENT(in) :: k_ice ! ice management in the sbc (=0/1/2/3) 841 962 !! 842 963 LOGICAL :: llnewtx, llnewtau ! update wind stress components and module?? … … 990 1111 IF( srcv(jpr_co2)%laction ) atm_co2(:,:) = frcv(jpr_co2)%z3(:,:,1) 991 1112 #endif 1113 ! 1114 ! ! ========================= ! 1115 ! ! Mean Sea Level Pressure ! (taum) 1116 ! ! ========================= ! 1117 ! 1118 IF( srcv(jpr_mslp)%laction ) THEN ! UKMO SHELF effect of atmospheric pressure on SSH 1119 IF( kt /= nit000 ) ssh_ibb(:,:) = ssh_ib(:,:) !* Swap of ssh_ib fields 1120 1121 r1_grau = 1.e0 / (grav * rau0) !* constant for optimization 1122 ssh_ib(:,:) = - ( frcv(jpr_mslp)%z3(:,:,1) - rpref ) * r1_grau ! equivalent ssh (inverse barometer) 1123 apr (:,:) = frcv(jpr_mslp)%z3(:,:,1) !atmospheric pressure 1124 1125 IF( kt == nit000 ) ssh_ibb(:,:) = ssh_ib(:,:) ! correct this later (read from restart if possible) 1126 END IF 1127 ! 1128 IF( ln_sdw ) THEN ! Stokes Drift correction activated 1129 ! ! ========================= ! 1130 ! ! Stokes drift u ! 1131 ! ! ========================= ! 1132 IF( srcv(jpr_sdrftx)%laction ) zusd2dt(:,:) = frcv(jpr_sdrftx)%z3(:,:,1) 1133 ! 1134 ! ! ========================= ! 1135 ! ! Stokes drift v ! 1136 ! ! ========================= ! 1137 IF( srcv(jpr_sdrfty)%laction ) zvsd2dt(:,:) = frcv(jpr_sdrfty)%z3(:,:,1) 1138 ! 1139 ! ! ========================= ! 1140 ! ! Wave mean period ! 1141 ! ! ========================= ! 1142 IF( srcv(jpr_wper)%laction ) wmp(:,:) = frcv(jpr_wper)%z3(:,:,1) 1143 ! 1144 ! ! ========================= ! 1145 ! ! Significant wave height ! 1146 ! ! ========================= ! 1147 IF( srcv(jpr_hsig)%laction ) swh(:,:) = frcv(jpr_hsig)%z3(:,:,1) 1148 ! 1149 ! ! ========================= ! 1150 ! ! Vertical mixing Qiao ! 1151 ! ! ========================= ! 1152 IF( srcv(jpr_wnum)%laction .AND. ln_zdfqiao ) wnum(:,:) = frcv(jpr_wnum)%z3(:,:,1) 1153 1154 ! Calculate the 3D Stokes drift both in coupled and not fully uncoupled mode 1155 IF( srcv(jpr_sdrftx)%laction .OR. srcv(jpr_sdrfty)%laction .OR. srcv(jpr_wper)%laction & 1156 .OR. srcv(jpr_hsig)%laction ) THEN 1157 CALL sbc_stokes() 1158 IF( ln_zdfqiao .AND. .NOT. srcv(jpr_wnum)%laction ) CALL sbc_qiao() 1159 ENDIF 1160 IF( ln_zdfqiao .AND. srcv(jpr_wnum)%laction ) CALL sbc_qiao() 1161 ENDIF 1162 ! ! ========================= ! 1163 ! ! Stress adsorbed by waves ! 1164 ! ! ========================= ! 1165 IF( srcv(jpr_wstrf)%laction .AND. ln_tauoc ) tauoc_wave(:,:) = frcv(jpr_wstrf)%z3(:,:,1) 1166 1167 ! ! ========================= ! 1168 ! ! Wave drag coefficient ! 1169 ! ! ========================= ! 1170 IF( srcv(jpr_wdrag)%laction .AND. ln_cdgw ) cdn_wave(:,:) = frcv(jpr_wdrag)%z3(:,:,1) 992 1171 993 1172 ! Fields received by SAS when OASIS coupling … … 2063 2242 ENDIF 2064 2243 ! 2244 ! ! ------------------------- ! 2245 ! ! Surface current to waves ! 2246 ! ! ------------------------- ! 2247 IF( ssnd(jps_ocxw)%laction .OR. ssnd(jps_ocyw)%laction ) THEN 2248 ! 2249 ! j+1 j -----V---F 2250 ! surface velocity always sent from T point ! | 2251 ! j | T U 2252 ! | | 2253 ! j j-1 -I-------| 2254 ! (for I) | | 2255 ! i-1 i i 2256 ! i i+1 (for I) 2257 SELECT CASE( TRIM( sn_snd_crtw%cldes ) ) 2258 CASE( 'oce only' ) ! C-grid ==> T 2259 DO jj = 2, jpjm1 2260 DO ji = fs_2, fs_jpim1 ! vector opt. 2261 zotx1(ji,jj) = 0.5 * ( un(ji,jj,1) + un(ji-1,jj ,1) ) 2262 zoty1(ji,jj) = 0.5 * ( vn(ji,jj,1) + vn(ji , jj-1,1) ) 2263 END DO 2264 END DO 2265 CASE( 'weighted oce and ice' ) 2266 SELECT CASE ( cp_ice_msh ) 2267 CASE( 'C' ) ! Ocean and Ice on C-grid ==> T 2268 DO jj = 2, jpjm1 2269 DO ji = fs_2, fs_jpim1 ! vector opt. 2270 zotx1(ji,jj) = 0.5 * ( un (ji,jj,1) + un (ji-1,jj ,1) ) * zfr_l(ji,jj) 2271 zoty1(ji,jj) = 0.5 * ( vn (ji,jj,1) + vn (ji ,jj-1,1) ) * zfr_l(ji,jj) 2272 zitx1(ji,jj) = 0.5 * ( u_ice(ji,jj ) + u_ice(ji-1,jj ) ) * fr_i(ji,jj) 2273 zity1(ji,jj) = 0.5 * ( v_ice(ji,jj ) + v_ice(ji ,jj-1 ) ) * fr_i(ji,jj) 2274 END DO 2275 END DO 2276 CASE( 'I' ) ! Ocean on C grid, Ice on I-point (B-grid) ==> T 2277 DO jj = 2, jpjm1 2278 DO ji = 2, jpim1 ! NO vector opt. 2279 zotx1(ji,jj) = 0.5 * ( un(ji,jj,1) + un(ji-1,jj ,1) ) * zfr_l(ji,jj) 2280 zoty1(ji,jj) = 0.5 * ( vn(ji,jj,1) + vn(ji ,jj-1,1) ) * zfr_l(ji,jj) 2281 zitx1(ji,jj) = 0.25 * ( u_ice(ji+1,jj+1) + u_ice(ji,jj+1) & 2282 & + u_ice(ji+1,jj ) + u_ice(ji,jj ) ) * fr_i(ji,jj) 2283 zity1(ji,jj) = 0.25 * ( v_ice(ji+1,jj+1) + v_ice(ji,jj+1) & 2284 & + v_ice(ji+1,jj ) + v_ice(ji,jj ) ) * fr_i(ji,jj) 2285 END DO 2286 END DO 2287 CASE( 'F' ) ! Ocean on C grid, Ice on F-point (B-grid) ==> T 2288 DO jj = 2, jpjm1 2289 DO ji = 2, jpim1 ! NO vector opt. 2290 zotx1(ji,jj) = 0.5 * ( un(ji,jj,1) + un(ji-1,jj ,1) ) * zfr_l(ji,jj) 2291 zoty1(ji,jj) = 0.5 * ( vn(ji,jj,1) + vn(ji ,jj-1,1) ) * zfr_l(ji,jj) 2292 zitx1(ji,jj) = 0.25 * ( u_ice(ji-1,jj-1) + u_ice(ji,jj-1) & 2293 & + u_ice(ji-1,jj ) + u_ice(ji,jj ) ) * fr_i(ji,jj) 2294 zity1(ji,jj) = 0.25 * ( v_ice(ji-1,jj-1) + v_ice(ji,jj-1) & 2295 & + v_ice(ji-1,jj ) + v_ice(ji,jj ) ) * fr_i(ji,jj) 2296 END DO 2297 END DO 2298 END SELECT 2299 CALL lbc_lnk( zitx1, 'T', -1. ) ; CALL lbc_lnk( zity1, 'T', -1. ) 2300 CASE( 'mixed oce-ice' ) 2301 SELECT CASE ( cp_ice_msh ) 2302 CASE( 'C' ) ! Ocean and Ice on C-grid ==> T 2303 DO jj = 2, jpjm1 2304 DO ji = fs_2, fs_jpim1 ! vector opt. 2305 zotx1(ji,jj) = 0.5 * ( un (ji,jj,1) + un (ji-1,jj ,1) ) * zfr_l(ji,jj) & 2306 & + 0.5 * ( u_ice(ji,jj ) + u_ice(ji-1,jj ) ) * fr_i(ji,jj) 2307 zoty1(ji,jj) = 0.5 * ( vn (ji,jj,1) + vn (ji ,jj-1,1) ) * zfr_l(ji,jj) & 2308 & + 0.5 * ( v_ice(ji,jj ) + v_ice(ji ,jj-1 ) ) * fr_i(ji,jj) 2309 END DO 2310 END DO 2311 CASE( 'I' ) ! Ocean on C grid, Ice on I-point (B-grid) ==> T 2312 DO jj = 2, jpjm1 2313 DO ji = 2, jpim1 ! NO vector opt. 2314 zotx1(ji,jj) = 0.5 * ( un(ji,jj,1) + un(ji-1,jj ,1) ) * zfr_l(ji,jj) & 2315 & + 0.25 * ( u_ice(ji+1,jj+1) + u_ice(ji,jj+1) & 2316 & + u_ice(ji+1,jj ) + u_ice(ji,jj ) ) * fr_i(ji,jj) 2317 zoty1(ji,jj) = 0.5 * ( vn(ji,jj,1) + vn(ji ,jj-1,1) ) * zfr_l(ji,jj) & 2318 & + 0.25 * ( v_ice(ji+1,jj+1) + v_ice(ji,jj+1) & 2319 & + v_ice(ji+1,jj ) + v_ice(ji,jj ) ) * fr_i(ji,jj) 2320 END DO 2321 END DO 2322 CASE( 'F' ) ! Ocean on C grid, Ice on F-point (B-grid) ==> T 2323 DO jj = 2, jpjm1 2324 DO ji = 2, jpim1 ! NO vector opt. 2325 zotx1(ji,jj) = 0.5 * ( un(ji,jj,1) + un(ji-1,jj ,1) ) * zfr_l(ji,jj) & 2326 & + 0.25 * ( u_ice(ji-1,jj-1) + u_ice(ji,jj-1) & 2327 & + u_ice(ji-1,jj ) + u_ice(ji,jj ) ) * fr_i(ji,jj) 2328 zoty1(ji,jj) = 0.5 * ( vn(ji,jj,1) + vn(ji ,jj-1,1) ) * zfr_l(ji,jj) & 2329 & + 0.25 * ( v_ice(ji-1,jj-1) + v_ice(ji,jj-1) & 2330 & + v_ice(ji-1,jj ) + v_ice(ji,jj ) ) * fr_i(ji,jj) 2331 END DO 2332 END DO 2333 END SELECT 2334 END SELECT 2335 CALL lbc_lnk( zotx1, ssnd(jps_ocxw)%clgrid, -1. ) ; CALL lbc_lnk( zoty1, ssnd(jps_ocyw)%clgrid, -1. ) 2336 ! 2337 ! 2338 IF( TRIM( sn_snd_crtw%clvor ) == 'eastward-northward' ) THEN ! Rotation of the components 2339 ! ! Ocean component 2340 CALL rot_rep( zotx1, zoty1, ssnd(jps_ocxw)%clgrid, 'ij->e', ztmp1 ) ! 1st component 2341 CALL rot_rep( zotx1, zoty1, ssnd(jps_ocxw)%clgrid, 'ij->n', ztmp2 ) ! 2nd component 2342 zotx1(:,:) = ztmp1(:,:) ! overwrite the components 2343 zoty1(:,:) = ztmp2(:,:) 2344 IF( ssnd(jps_ivx1)%laction ) THEN ! Ice component 2345 CALL rot_rep( zitx1, zity1, ssnd(jps_ivx1)%clgrid, 'ij->e', ztmp1 ) ! 1st component 2346 CALL rot_rep( zitx1, zity1, ssnd(jps_ivx1)%clgrid, 'ij->n', ztmp2 ) ! 2nd component 2347 zitx1(:,:) = ztmp1(:,:) ! overwrite the components 2348 zity1(:,:) = ztmp2(:,:) 2349 ENDIF 2350 ENDIF 2351 ! 2352 ! ! spherical coordinates to cartesian -> 2 components to 3 components 2353 ! IF( TRIM( sn_snd_crtw%clvref ) == 'cartesian' ) THEN 2354 ! ztmp1(:,:) = zotx1(:,:) ! ocean currents 2355 ! ztmp2(:,:) = zoty1(:,:) 2356 ! CALL oce2geo ( ztmp1, ztmp2, 'T', zotx1, zoty1, zotz1 ) 2357 ! ! 2358 ! IF( ssnd(jps_ivx1)%laction ) THEN ! ice velocities 2359 ! ztmp1(:,:) = zitx1(:,:) 2360 ! ztmp1(:,:) = zity1(:,:) 2361 ! CALL oce2geo ( ztmp1, ztmp2, 'T', zitx1, zity1, zitz1 ) 2362 ! ENDIF 2363 ! ENDIF 2364 ! 2365 IF( ssnd(jps_ocxw)%laction ) CALL cpl_snd( jps_ocxw, isec, RESHAPE ( zotx1, (/jpi,jpj,1/) ), info ) ! ocean x current 1st grid 2366 IF( ssnd(jps_ocyw)%laction ) CALL cpl_snd( jps_ocyw, isec, RESHAPE ( zoty1, (/jpi,jpj,1/) ), info ) ! ocean y current 1st grid 2367 ! 2368 ENDIF 2369 ! 2370 IF( ssnd(jps_ficet)%laction ) THEN 2371 CALL cpl_snd( jps_ficet, isec, RESHAPE ( fr_i, (/jpi,jpj,1/) ), info ) 2372 END IF 2373 ! ! ------------------------- ! 2374 ! ! Water levels to waves ! 2375 ! ! ------------------------- ! 2376 IF( ssnd(jps_wlev)%laction ) THEN 2377 IF( ln_apr_dyn ) THEN 2378 IF( kt /= nit000 ) THEN 2379 ztmp1(:,:) = sshb(:,:) - 0.5 * ( ssh_ib(:,:) + ssh_ibb(:,:) ) 2380 ELSE 2381 ztmp1(:,:) = sshb(:,:) 2382 ENDIF 2383 ELSE 2384 ztmp1(:,:) = sshn(:,:) 2385 ENDIF 2386 CALL cpl_snd( jps_wlev , isec, RESHAPE ( ztmp1, (/jpi,jpj,1/) ), info ) 2387 END IF 2065 2388 ! 2066 2389 ! Fields sent by OPA to SAS when doing OPA<->SAS coupling -
branches/2016/dev_INGV_METO_merge_2016/NEMOGCM/NEMO/OPA_SRC/SBC/sbcmod.F90
r6460 r7383 89 89 NAMELIST/namsbc/ nn_fsbc , ln_ana , ln_flx, ln_blk_clio, ln_blk_core, ln_blk_mfs, & 90 90 & ln_cpl , ln_mixcpl, nn_components , nn_limflx , & 91 & ln_traqsr, ln_dm2dc , & 91 & ln_traqsr, ln_dm2dc , & 92 92 & nn_ice , nn_ice_embd, & 93 93 & ln_rnf , ln_ssr , ln_isf , nn_fwb , ln_apr_dyn, & 94 & ln_wave , 95 & nn_lsm 94 & ln_wave , ln_cdgw , ln_sdw , ln_tauoc , ln_stcor , & 95 & nn_lsm 96 96 INTEGER :: ios 97 97 INTEGER :: ierr, ierr0, ierr1, ierr2, ierr3, jpm … … 153 153 WRITE(numout,*) ' closed sea (=0/1) (set in namdom) nn_closea = ', nn_closea 154 154 WRITE(numout,*) ' nb of iterations if land-sea-mask applied nn_lsm = ', nn_lsm 155 WRITE(numout,*) ' surface wave ln_wave = ', ln_wave 155 WRITE(numout,*) ' surface wave ln_wave = ', ln_wave 156 WRITE(numout,*) ' Stokes drift corr. to vert. velocity ln_sdw = ', ln_sdw 157 WRITE(numout,*) ' wave modified ocean stress ln_tauoc = ', ln_tauoc 158 WRITE(numout,*) ' Stokes coriolis term ln_stcor = ', ln_stcor 159 WRITE(numout,*) ' neutral drag coefficient (CORE, MFS) ln_cdgw = ', ln_cdgw 156 160 ENDIF 157 161 ! … … 220 224 & CALL ctl_stop( 'diurnal cycle into qsr field from daily values requires a flux or core-bulk formulation' ) 221 225 226 IF ( ln_wave ) THEN 227 !Activated wave module but neither drag nor stokes drift activated 228 IF ( .NOT.(ln_cdgw .OR. ln_sdw .OR. ln_tauoc .OR. ln_stcor ) ) THEN 229 CALL ctl_warn( 'Ask for wave coupling but ln_cdgw=F, ln_sdw=F, ln_tauoc=F, ln_stcor=F') 230 !drag coefficient read from wave model definable only with mfs bulk formulae and core 231 ELSEIF (ln_cdgw .AND. .NOT.(ln_blk_mfs .OR. ln_blk_core) ) THEN 232 CALL ctl_stop( 'drag coefficient read from wave model definable only with mfs bulk formulae and core') 233 ELSEIF (ln_stcor .AND. .NOT. ln_sdw) THEN 234 CALL ctl_stop( 'Stokes-Coriolis term calculated only if activated Stokes Drift ln_sdw=T') 235 ENDIF 236 ELSE 237 IF ( ln_cdgw .OR. ln_sdw .OR. ln_tauoc .OR. ln_stcor ) & 238 & CALL ctl_stop( 'Not Activated Wave Module (ln_wave=F) but asked coupling ', & 239 & 'with drag coefficient (ln_cdgw =T) ' , & 240 & 'or Stokes Drift (ln_sdw=T) ' , & 241 & 'or ocean stress modification due to waves (ln_tauoc=T) ', & 242 & 'or Stokes-Coriolis term (ln_stcori=T)' ) 243 ENDIF 222 244 ! ! Choice of the Surface Boudary Condition (set nsbc) 223 245 ll_purecpl = ln_cpl .AND. .NOT. ln_mixcpl … … 357 379 & CALL sbc_cpl_rcv ( kt, nn_fsbc, nn_ice ) ! OPA-SAS coupling: OPA receiving fields from SAS 358 380 END SELECT 359 381 IF ( ln_wave .AND. ln_tauoc) THEN ! Wave stress subctracted 382 utau(:,:) = utau(:,:)*tauoc_wave(:,:) 383 vtau(:,:) = vtau(:,:)*tauoc_wave(:,:) 384 taum(:,:) = taum(:,:)*tauoc_wave(:,:) 385 ! 386 SELECT CASE( nsbc ) 387 CASE( 0,1,2,3,5,-1 ) ; 388 IF(lwp .AND. kt == nit000 ) WRITE(numout,*) 'WARNING: You are subtracting the wave stress to the ocean. & 389 & If not requested select ln_tauoc=.false' 390 END SELECT 391 ! 392 END IF 360 393 IF( ln_mixcpl ) CALL sbc_cpl_rcv ( kt, nn_fsbc, nn_ice ) ! forced-coupled mixed formulation after forcing 361 394 -
branches/2016/dev_INGV_METO_merge_2016/NEMOGCM/NEMO/OPA_SRC/SBC/sbcwave.F90
r6140 r7383 4 4 !! Wave module 5 5 !!====================================================================== 6 !! History : 3.3 ! 2011-09 (Adani M) Original code: Drag Coefficient 7 !! : 3.4 ! 2012-10 (Adani M) Stokes Drift 8 !!---------------------------------------------------------------------- 9 10 !!---------------------------------------------------------------------- 11 !! sbc_wave : read drag coefficient from wave model in netcdf files 6 !! History : 3.3 ! 2011-09 (M. Adani) Original code: Drag Coefficient 7 !! : 3.4 ! 2012-10 (M. Adani) Stokes Drift 8 !! 3.6 ! 2014-09 (E. Clementi,P. Oddo) New Stokes Drift Computation 9 !!---------------------------------------------------------------------- 10 11 !!---------------------------------------------------------------------- 12 !! sbc_wave : wave data from wave model in netcdf files 12 13 !!---------------------------------------------------------------------- 13 14 USE oce ! 14 USE sbc_oce 15 USE sbc_oce ! Surface boundary condition: ocean fields 15 16 USE bdy_oce ! 16 17 USE domvvl ! 17 !18 18 USE iom ! I/O manager library 19 19 USE in_out_manager ! I/O manager 20 20 USE lib_mpp ! distribued memory computing library 21 USE fldread 21 USE fldread ! read input fields 22 22 USE wrk_nemo ! 23 USE phycst ! physical constants 23 24 24 25 IMPLICIT NONE 25 26 PRIVATE 26 27 27 PUBLIC sbc_wave ! routine called in sbc_blk_core or sbc_blk_mfs 28 PUBLIC sbc_stokes, sbc_qiao ! routines called in sbccpl 29 PUBLIC sbc_wave ! routine called in sbcmod 28 30 29 INTEGER , PARAMETER :: jpfld = 3 ! maximum number of files to read for srokes drift 30 INTEGER , PARAMETER :: jp_usd = 1 ! index of stokes drift (i-component) (m/s) at T-point 31 INTEGER , PARAMETER :: jp_vsd = 2 ! index of stokes drift (j-component) (m/s) at T-point 32 INTEGER , PARAMETER :: jp_wn = 3 ! index of wave number (1/m) at T-point 33 34 TYPE(FLD), ALLOCATABLE, DIMENSION(:) :: sf_cd ! structure of input fields (file informations, fields read) Drag Coefficient 35 TYPE(FLD), ALLOCATABLE, DIMENSION(:) :: sf_sd ! structure of input fields (file informations, fields read) Stokes Drift 36 37 REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION (:,:) :: cdn_wave 38 REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION (:,:,:) :: usd3d, vsd3d, wsd3d 39 REAL(wp), ALLOCATABLE, DIMENSION (:,:) :: usd2d, vsd2d, uwavenum, vwavenum 31 ! Variables checking if the wave parameters are coupled (if not, they are read from file) 32 LOGICAL, PUBLIC :: cpl_hsig=.FALSE. 33 LOGICAL, PUBLIC :: cpl_phioc=.FALSE. 34 LOGICAL, PUBLIC :: cpl_sdrftx=.FALSE. 35 LOGICAL, PUBLIC :: cpl_sdrfty=.FALSE. 36 LOGICAL, PUBLIC :: cpl_wper=.FALSE. 37 LOGICAL, PUBLIC :: cpl_wnum=.FALSE. 38 LOGICAL, PUBLIC :: cpl_wstrf=.FALSE. 39 LOGICAL, PUBLIC :: cpl_wdrag=.FALSE. 40 41 INTEGER :: jpfld ! number of files to read for stokes drift 42 INTEGER :: jp_usd ! index of stokes drift (i-component) (m/s) at T-point 43 INTEGER :: jp_vsd ! index of stokes drift (j-component) (m/s) at T-point 44 INTEGER :: jp_swh ! index of significant wave hight (m) at T-point 45 INTEGER :: jp_wmp ! index of mean wave period (s) at T-point 46 47 TYPE(FLD), ALLOCATABLE, DIMENSION(:) :: sf_cd ! structure of input fields (file informations, fields read) Drag Coefficient 48 TYPE(FLD), ALLOCATABLE, DIMENSION(:) :: sf_sd ! structure of input fields (file informations, fields read) Stokes Drift 49 TYPE(FLD), ALLOCATABLE, DIMENSION(:) :: sf_wn ! structure of input fields (file informations, fields read) wave number for Qiao 50 TYPE(FLD), ALLOCATABLE, DIMENSION(:) :: sf_tauoc ! structure of input fields (file informations, fields read) normalized wave stress into the ocean 51 REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:) :: cdn_wave 52 REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:) :: swh,wmp, wnum 53 REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:) :: tauoc_wave 54 REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:) :: tsd2d 55 REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:) :: zusd2dt, zvsd2dt 56 REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:,:) :: usd3d, vsd3d, wsd3d 57 REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:,:) :: usd3dt, vsd3dt 40 58 41 59 !! * Substitutions … … 48 66 CONTAINS 49 67 68 SUBROUTINE sbc_stokes( ) 69 !!--------------------------------------------------------------------- 70 !! *** ROUTINE sbc_stokes *** 71 !! 72 !! ** Purpose : compute the 3d Stokes Drift according to Breivik et al., 73 !! 2014 (DOI: 10.1175/JPO-D-14-0020.1) 74 !! 75 !! ** Method : - Calculate Stokes transport speed 76 !! - Calculate horizontal divergence 77 !! - Integrate the horizontal divergenze from the bottom 78 !! ** action 79 !!--------------------------------------------------------------------- 80 INTEGER :: jj,ji,jk 81 REAL(wp) :: ztransp, zfac, zsp0, zk, zus, zvs 82 REAL(wp), DIMENSION(:,:,:), POINTER :: ze3hdiv ! 3D workspace 83 !!--------------------------------------------------------------------- 84 ! 85 86 CALL wrk_alloc( jpi,jpj,jpk, ze3hdiv ) 87 DO jk = 1, jpk 88 DO jj = 1, jpj 89 DO ji = 1, jpi 90 ! On T grid 91 ! Stokes transport speed estimated from Hs and Tmean 92 ztransp = 2.0_wp*rpi*swh(ji,jj)**2.0_wp/(16.0_wp*MAX(wmp(ji,jj),0.0000001_wp)) 93 ! Stokes surface speed 94 zsp0 = SQRT( zusd2dt(ji,jj)**2 + zvsd2dt(ji,jj)**2) 95 ! Wavenumber scale 96 zk = ABS(zsp0)/MAX(ABS(5.97_wp*ztransp),0.0000001_wp) 97 ! Depth attenuation 98 zfac = EXP(-2.0_wp*zk*gdept_n(ji,jj,jk))/(1.0_wp+8.0_wp*zk*gdept_n(ji,jj,jk)) 99 ! 100 usd3dt(ji,jj,jk) = zfac * zusd2dt(ji,jj) * tmask(ji,jj,jk) 101 vsd3dt(ji,jj,jk) = zfac * zvsd2dt(ji,jj) * tmask(ji,jj,jk) 102 END DO 103 END DO 104 END DO 105 ! Into the U and V Grid 106 DO jk = 1, jpkm1 107 DO jj = 1, jpjm1 108 DO ji = 1, fs_jpim1 109 usd3d(ji,jj,jk) = 0.5 * umask(ji,jj,jk) * & 110 & ( usd3dt(ji,jj,jk) + usd3dt(ji+1,jj,jk) ) 111 vsd3d(ji,jj,jk) = 0.5 * vmask(ji,jj,jk) * & 112 & ( vsd3dt(ji,jj,jk) + vsd3dt(ji,jj+1,jk) ) 113 END DO 114 END DO 115 END DO 116 ! 117 CALL lbc_lnk( usd3d(:,:,:), 'U', -1. ) 118 CALL lbc_lnk( vsd3d(:,:,:), 'V', -1. ) 119 ! 120 DO jk = 1, jpkm1 ! Horizontal divergence 121 DO jj = 2, jpj 122 DO ji = fs_2, jpi 123 ze3hdiv(ji,jj,jk) = ( e2u(ji ,jj) * usd3d(ji ,jj,jk) & 124 & - e2u(ji-1,jj) * usd3d(ji-1,jj,jk) & 125 & + e1v(ji,jj ) * vsd3d(ji,jj ,jk) & 126 & - e1v(ji,jj-1) * vsd3d(ji,jj-1,jk) ) * r1_e1e2t(ji,jj) 127 END DO 128 END DO 129 END DO 130 ! 131 IF( .NOT. AGRIF_Root() ) THEN 132 IF( nbondi == 1 .OR. nbondi == 2 ) ze3hdiv(nlci-1, : ,:) = 0._wp ! east 133 IF( nbondi == -1 .OR. nbondi == 2 ) ze3hdiv( 2 , : ,:) = 0._wp ! west 134 IF( nbondj == 1 .OR. nbondj == 2 ) ze3hdiv( : ,nlcj-1,:) = 0._wp ! north 135 IF( nbondj == -1 .OR. nbondj == 2 ) ze3hdiv( : , 2 ,:) = 0._wp ! south 136 ENDIF 137 ! 138 CALL lbc_lnk( ze3hdiv, 'T', 1. ) 139 ! 140 DO jk = jpkm1, 1, -1 ! integrate from the bottom the e3t * hor. divergence 141 wsd3d(:,:,jk) = wsd3d(:,:,jk+1) - e3t_n(:,:,jk) * ze3hdiv(:,:,jk) 142 END DO 143 #if defined key_bdy 144 IF( lk_bdy ) THEN 145 DO jk = 1, jpkm1 146 wsd3d(:,:,jk) = wsd3d(:,:,jk) * bdytmask(:,:) 147 END DO 148 ENDIF 149 #endif 150 CALL wrk_dealloc( jpi,jpj,jpk, ze3hdiv ) 151 ! 152 END SUBROUTINE sbc_stokes 153 154 SUBROUTINE sbc_qiao 155 !!--------------------------------------------------------------------- 156 !! *** ROUTINE sbc_qiao *** 157 !! 158 !! ** Purpose : Qiao formulation for wave enhanced turbulence 159 !! 2010 (DOI: 10.1007/s10236-010-0326) 160 !! 161 !! ** Method : - 162 !! ** action 163 !!--------------------------------------------------------------------- 164 INTEGER :: jj, ji 165 166 ! Calculate the module of the stokes drift on T grid 167 !------------------------------------------------- 168 DO jj = 1, jpj 169 DO ji = 1, jpi 170 tsd2d(ji,jj) = SQRT( zusd2dt(ji,jj) * zusd2dt(ji,jj) + zvsd2dt(ji,jj) * zvsd2dt(ji,jj) ) 171 END DO 172 END DO 173 ! 174 END SUBROUTINE sbc_qiao 175 50 176 SUBROUTINE sbc_wave( kt ) 51 177 !!--------------------------------------------------------------------- 52 !! *** ROUTINE sbc_ apr***53 !! 54 !! ** Purpose : read drag coefficientfrom wave model in netcdf files.178 !! *** ROUTINE sbc_wave *** 179 !! 180 !! ** Purpose : read wave parameters from wave model in netcdf files. 55 181 !! 56 182 !! ** Method : - Read namelist namsbc_wave 57 183 !! - Read Cd_n10 fields in netcdf files 58 184 !! - Read stokes drift 2d in netcdf files 59 !! - Read wave number in netcdf files 60 !! - Compute 3d stokes drift using monochromatic 61 !! ** action : 62 !!--------------------------------------------------------------------- 63 INTEGER, INTENT( in ) :: kt ! ocean time step 185 !! - Read wave number in netcdf files 186 !! - Compute 3d stokes drift using Breivik et al.,2014 187 !! formulation 188 !! ** action 189 !!--------------------------------------------------------------------- 190 USE zdf_oce, ONLY : ln_zdfqiao 191 192 INTEGER, INTENT( in ) :: kt ! ocean time step 64 193 ! 65 194 INTEGER :: ierror ! return error code 66 INTEGER :: ifpr , jj,ji,jk67 INTEGER :: ios ! Local integer output status for namelist read68 TYPE(FLD_N), DIMENSION(jpfld) :: slf_i ! array of namelist informations on the fields to read195 INTEGER :: ifpr 196 INTEGER :: ios ! Local integer output status for namelist read 197 ! 69 198 CHARACTER(len=100) :: cn_dir ! Root directory for location of drag coefficient files 70 TYPE(FLD_N) :: sn_cdg, sn_usd, sn_vsd, sn_wn ! informations about the fields to be read 71 REAL(wp), DIMENSION(:,:,:), POINTER :: zusd_t, zvsd_t, ze3hdiv ! 3D workspace 72 !! 73 NAMELIST/namsbc_wave/ sn_cdg, cn_dir, sn_usd, sn_vsd, sn_wn, ln_cdgw , ln_sdw 199 TYPE(FLD_N), ALLOCATABLE, DIMENSION(:) :: slf_i ! array of namelist informations on the fields to read 200 TYPE(FLD_N) :: sn_cdg, sn_usd, sn_vsd, & 201 & sn_swh, sn_wmp, sn_wnum, sn_tauoc ! informations about the fields to be read 202 !! 203 NAMELIST/namsbc_wave/ sn_cdg, cn_dir, sn_usd, sn_vsd, sn_swh, sn_wmp, sn_wnum, sn_tauoc 74 204 !!--------------------------------------------------------------------- 75 205 ! … … 80 210 READ ( numnam_ref, namsbc_wave, IOSTAT = ios, ERR = 901) 81 211 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namsbc_wave in reference namelist', lwp ) 82 !212 83 213 REWIND( numnam_cfg ) ! Namelist namsbc_wave in configuration namelist : File for drag coeff. from wave model 84 214 READ ( numnam_cfg, namsbc_wave, IOSTAT = ios, ERR = 902 ) … … 86 216 IF(lwm) WRITE ( numond, namsbc_wave ) 87 217 ! 88 IF(lwp) THEN ! Control print89 WRITE(numout,*) ' Namelist namsbc_wave : surface wave setting'90 WRITE(numout,*) ' wave drag coefficient ln_cdgw = ', ln_cdgw91 WRITE(numout,*) ' wave stokes drift ln_sdw = ', ln_sdw92 ENDIF93 !94 IF( .NOT.( ln_cdgw .OR. ln_sdw ) ) &95 & CALL ctl_warn( 'ln_sbcwave=T but nor drag coefficient (ln_cdgw=F) neither stokes drift activated (ln_sdw=F)' )96 IF( ln_cdgw .AND. .NOT.(ln_blk_mfs .OR. ln_blk_core) ) &97 & CALL ctl_stop( 'drag coefficient read from wave model definable only with mfs bulk formulae and core')98 !99 218 IF( ln_cdgw ) THEN 100 ALLOCATE( sf_cd(1), STAT=ierror ) !* allocate and fill sf_wave with sn_cdg 101 IF( ierror > 0 ) CALL ctl_stop( 'STOP', 'sbc_wave: unable to allocate sf_wave structure' ) 102 ! 103 ALLOCATE( sf_cd(1)%fnow(jpi,jpj,1) ) 104 IF( sn_cdg%ln_tint ) ALLOCATE( sf_cd(1)%fdta(jpi,jpj,1,2) ) 105 CALL fld_fill( sf_cd, (/ sn_cdg /), cn_dir, 'sbc_wave', 'Wave module ', 'namsbc_wave' ) 219 IF( .NOT. cpl_wdrag ) THEN 220 ALLOCATE( sf_cd(1), STAT=ierror ) !* allocate and fill sf_wave with sn_cdg 221 IF( ierror > 0 ) CALL ctl_stop( 'STOP', 'sbc_wave: unable to allocate sf_wave structure' ) 222 ! 223 ALLOCATE( sf_cd(1)%fnow(jpi,jpj,1) ) 224 IF( sn_cdg%ln_tint ) ALLOCATE( sf_cd(1)%fdta(jpi,jpj,1,2) ) 225 CALL fld_fill( sf_cd, (/ sn_cdg /), cn_dir, 'sbc_wave', 'Wave module ', 'namsbc_wave' ) 226 ENDIF 106 227 ALLOCATE( cdn_wave(jpi,jpj) ) 107 cdn_wave(:,:) = 0.0 108 ENDIF 228 ENDIF 229 230 IF( ln_tauoc ) THEN 231 IF( .NOT. cpl_wstrf ) THEN 232 ALLOCATE( sf_tauoc(1), STAT=ierror ) !* allocate and fill sf_wave with sn_tauoc 233 IF( ierror > 0 ) CALL ctl_stop( 'STOP', 'sbc_wave: unable to allocate sf_wave structure' ) 234 ! 235 ALLOCATE( sf_tauoc(1)%fnow(jpi,jpj,1) ) 236 IF( sn_tauoc%ln_tint ) ALLOCATE( sf_tauoc(1)%fdta(jpi,jpj,1,2) ) 237 CALL fld_fill( sf_tauoc, (/ sn_tauoc /), cn_dir, 'sbc_wave', 'Wave module', 'namsbc_wave' ) 238 ENDIF 239 ALLOCATE( tauoc_wave(jpi,jpj) ) 240 ENDIF 241 109 242 IF( ln_sdw ) THEN 110 slf_i(jp_usd) = sn_usd ; slf_i(jp_vsd) = sn_vsd; slf_i(jp_wn) = sn_wn 111 ALLOCATE( sf_sd(3), STAT=ierror ) !* allocate and fill sf_wave with sn_cdg 112 IF( ierror > 0 ) CALL ctl_stop( 'STOP', 'sbc_wave: unable to allocate sf_wave structure' ) 113 ! 114 DO ifpr= 1, jpfld 115 ALLOCATE( sf_sd(ifpr)%fnow(jpi,jpj,1) ) 116 IF( slf_i(ifpr)%ln_tint ) ALLOCATE( sf_sd(ifpr)%fdta(jpi,jpj,1,2) ) 117 END DO 118 CALL fld_fill( sf_sd, slf_i, cn_dir, 'sbc_wave', 'Wave module ', 'namsbc_wave' ) 119 ALLOCATE( usd2d(jpi,jpj) , vsd2d(jpi,jpj) , uwavenum(jpi,jpj) , vwavenum(jpi,jpj) ) 243 ! Find out how many fields have to be read from file if not coupled 244 jpfld=0 245 jp_usd=0; jp_vsd=0; jp_swh=0; jp_wmp=0 246 IF( .NOT. cpl_sdrftx ) THEN 247 jpfld=jpfld+1 248 jp_usd=jpfld 249 ENDIF 250 IF( .NOT. cpl_sdrfty ) THEN 251 jpfld=jpfld+1 252 jp_vsd=jpfld 253 ENDIF 254 IF( .NOT. cpl_hsig ) THEN 255 jpfld=jpfld+1 256 jp_swh=jpfld 257 ENDIF 258 IF( .NOT. cpl_wper ) THEN 259 jpfld=jpfld+1 260 jp_wmp=jpfld 261 ENDIF 262 263 ! Read from file only the non-coupled fields 264 IF( jpfld > 0 ) THEN 265 ALLOCATE( slf_i(jpfld) ) 266 IF( jp_usd > 0 ) slf_i(jp_usd) = sn_usd 267 IF( jp_vsd > 0 ) slf_i(jp_vsd) = sn_vsd 268 IF( jp_swh > 0 ) slf_i(jp_swh) = sn_swh 269 IF( jp_wmp > 0 ) slf_i(jp_wmp) = sn_wmp 270 ALLOCATE( sf_sd(jpfld), STAT=ierror ) !* allocate and fill sf_sd with stokes drift 271 IF( ierror > 0 ) CALL ctl_stop( 'STOP', 'sbc_wave: unable to allocate sf_wave structure' ) 272 ! 273 DO ifpr= 1, jpfld 274 ALLOCATE( sf_sd(ifpr)%fnow(jpi,jpj,1) ) 275 IF( slf_i(ifpr)%ln_tint ) ALLOCATE( sf_sd(ifpr)%fdta(jpi,jpj,1,2) ) 276 END DO 277 278 CALL fld_fill( sf_sd, slf_i, cn_dir, 'sbc_wave', 'Wave module ', 'namsbc_wave' ) 279 ENDIF 120 280 ALLOCATE( usd3d(jpi,jpj,jpk),vsd3d(jpi,jpj,jpk),wsd3d(jpi,jpj,jpk) ) 121 usd3d(:,:,:) = 0._wp ; usd2d(:,:) = 0._wp ; uwavenum(:,:) = 0._wp 122 vsd3d(:,:,:) = 0._wp ; vsd2d(:,:) = 0._wp ; vwavenum(:,:) = 0._wp 281 ALLOCATE( usd3dt(jpi,jpj,jpk),vsd3dt(jpi,jpj,jpk) ) 282 ALLOCATE( swh(jpi,jpj), wmp(jpi,jpj) ) 283 ALLOCATE( zusd2dt(jpi,jpj), zvsd2dt(jpi,jpj) ) 284 usd3d(:,:,:) = 0._wp 285 vsd3d(:,:,:) = 0._wp 123 286 wsd3d(:,:,:) = 0._wp 124 ENDIF 125 ENDIF 126 ! 127 IF( ln_cdgw ) THEN !== Neutral drag coefficient ==! 287 IF( ln_zdfqiao ) THEN !== Vertical mixing enhancement using Qiao,2010 ==! 288 IF( .NOT. cpl_wnum ) THEN 289 ALLOCATE( sf_wn(1), STAT=ierror ) !* allocate and fill sf_wave with sn_wnum 290 IF( ierror > 0 ) CALL ctl_stop( 'STOP', 'sbc_wave: unable toallocate sf_wave structure' ) 291 ALLOCATE( sf_wn(1)%fnow(jpi,jpj,1) ) 292 IF( sn_wnum%ln_tint ) ALLOCATE( sf_wn(1)%fdta(jpi,jpj,1,2) ) 293 CALL fld_fill( sf_wn, (/ sn_wnum /), cn_dir, 'sbc_wave', 'Wave module', 'namsbc_wave' ) 294 ENDIF 295 ALLOCATE( wnum(jpi,jpj),tsd2d(jpi,jpj) ) 296 ENDIF 297 ENDIF 298 ENDIF 299 ! 300 IF( ln_cdgw .AND. .NOT. cpl_wdrag ) THEN !== Neutral drag coefficient ==! 128 301 CALL fld_read( kt, nn_fsbc, sf_cd ) ! read from external forcing 129 302 cdn_wave(:,:) = sf_cd(1)%fnow(:,:,1) 130 303 ENDIF 131 ! 132 IF( ln_sdw ) THEN !== Computation of the 3d Stokes Drift ==! 304 305 IF( ln_tauoc .AND. .NOT. cpl_wstrf ) THEN !== Wave induced stress ==! 306 CALL fld_read( kt, nn_fsbc, sf_tauoc ) !* read wave norm stress from external forcing 307 tauoc_wave(:,:) = sf_tauoc(1)%fnow(:,:,1) 308 ENDIF 309 310 IF( ln_sdw ) THEN !== Computation of the 3d Stokes Drift ==! 133 311 ! 134 CALL wrk_alloc( jpi,jpj,jpk, zusd_t, zvsd_t, ze3hdiv ) 312 ! Read from file only if the field is not coupled 313 IF( jpfld > 0 ) THEN 314 CALL fld_read( kt, nn_fsbc, sf_sd ) !* read wave parameters from external forcing 315 IF( jp_swh > 0 ) swh(:,:) = sf_sd(jp_swh)%fnow(:,:,1) ! significant wave height 316 IF( jp_wmp > 0 ) wmp(:,:) = sf_sd(jp_wmp)%fnow(:,:,1) ! wave mean period 317 IF( jp_usd > 0 ) zusd2dt(:,:) = sf_sd(jp_usd)%fnow(:,:,1) ! 2D zonal Stokes Drift at T point 318 IF( jp_vsd > 0 ) zvsd2dt(:,:) = sf_sd(jp_vsd)%fnow(:,:,1) ! 2D meridional Stokes Drift at T point 319 ENDIF 135 320 ! 136 CALL fld_read( kt, nn_fsbc, sf_sd ) !* read drag coefficient from external forcing 321 ! Read also wave number if needed, so that it is available in coupling routines 322 IF( ln_zdfqiao .AND. .NOT. cpl_wnum ) THEN 323 CALL fld_read( kt, nn_fsbc, sf_wn ) !* read wave parameters from external forcing 324 wnum(:,:) = sf_wn(1)%fnow(:,:,1) 325 ENDIF 326 327 !== Computation of the 3d Stokes Drift according to Breivik et al.,2014 328 !(DOI: 10.1175/JPO-D-14-0020.1)==! 137 329 ! 138 DO jk = 1, jpkm1 !* distribute it on the vertical 139 zusd_t(:,:,jk) = sf_sd(jp_usd)%fnow(:,:,1) * EXP( -2._wp * sf_sd(jp_wn)%fnow(:,:,1) * gdept_n(:,:,jk) ) 140 zvsd_t(:,:,jk) = sf_sd(jp_vsd)%fnow(:,:,1) * EXP( -2._wp * sf_sd(jp_wn)%fnow(:,:,1) * gdept_n(:,:,jk) ) 141 END DO 142 DO jk = 1, jpkm1 !* interpolate the stokes drift from t-point to u- and v-points 143 DO jj = 1, jpjm1 144 DO ji = 1, jpim1 145 usd3d(ji,jj,jk) = 0.5_wp * ( zusd_t(ji ,jj,jk) + zusd_t(ji+1,jj,jk) ) * umask(ji,jj,jk) 146 vsd3d(ji,jj,jk) = 0.5_wp * ( zvsd_t(ji ,jj,jk) + zvsd_t(ji,jj+1,jk) ) * vmask(ji,jj,jk) 147 END DO 148 END DO 149 END DO 150 CALL lbc_lnk( usd3d(:,:,:), 'U', -1. ) 151 CALL lbc_lnk( vsd3d(:,:,:), 'V', -1. ) 152 ! 153 DO jk = 1, jpkm1 !* e3t * Horizontal divergence ==! 154 DO jj = 2, jpjm1 155 DO ji = fs_2, fs_jpim1 ! vector opt. 156 ze3hdiv(ji,jj,jk) = ( e2u(ji ,jj) * e3u_n(ji ,jj,jk) * usd3d(ji ,jj,jk) & 157 & - e2u(ji-1,jj) * e3u_n(ji-1,jj,jk) * usd3d(ji-1,jj,jk) & 158 & + e1v(ji,jj ) * e3v_n(ji,jj ,jk) * vsd3d(ji,jj ,jk) & 159 & - e1v(ji,jj-1) * e3v_n(ji,jj-1,jk) * vsd3d(ji,jj-1,jk) ) * r1_e1e2t(ji,jj) 160 END DO 161 END DO 162 IF( .NOT. AGRIF_Root() ) THEN 163 IF( nbondi == 1 .OR. nbondi == 2 ) ze3hdiv(nlci-1, : ,jk) = 0._wp ! east 164 IF( nbondi == -1 .OR. nbondi == 2 ) ze3hdiv( 2 , : ,jk) = 0._wp ! west 165 IF( nbondj == 1 .OR. nbondj == 2 ) ze3hdiv( : ,nlcj-1,jk) = 0._wp ! north 166 IF( nbondj == -1 .OR. nbondj == 2 ) ze3hdiv( : , 2 ,jk) = 0._wp ! south 167 ENDIF 168 END DO 169 CALL lbc_lnk( ze3hdiv, 'T', 1. ) 170 ! 171 DO jk = jpkm1, 1, -1 !* integrate from the bottom the e3t * hor. divergence 172 wsd3d(:,:,jk) = wsd3d(:,:,jk+1) - ze3hdiv(:,:,jk) 173 END DO 174 #if defined key_bdy 175 IF( lk_bdy ) THEN 176 DO jk = 1, jpkm1 177 wsd3d(:,:,jk) = wsd3d(:,:,jk) * bdytmask(:,:) 178 END DO 179 ENDIF 180 #endif 181 CALL wrk_dealloc( jpi,jpj,jpk, zusd_t, zvsd_t, ze3hdiv ) 182 ! 330 ! Calculate only if no necessary fields are coupled, if not calculate later after coupling 331 IF( jpfld == 4 ) THEN 332 CALL sbc_stokes() 333 IF( ln_zdfqiao .AND. .NOT. cpl_wnum ) THEN 334 CALL sbc_qiao() 335 ENDIF 336 ENDIF 183 337 ENDIF 184 338 ! -
branches/2016/dev_INGV_METO_merge_2016/NEMOGCM/NEMO/OPA_SRC/TRA/traadv.F90
r7382 r7383 9 9 !! 3.7 ! 2014-05 (G. Madec) Add 2nd/4th order cases for CEN and FCT schemes 10 10 !! - ! 2014-12 (G. Madec) suppression of cross land advection option 11 !! 3.6 ! 2015-06 (E. Clementi) Addition of Stokes drift in case of wave coupling 11 12 !!---------------------------------------------------------------------- 12 13 … … 35 36 USE wrk_nemo ! Memory Allocation 36 37 USE timing ! Timing 37 38 USE diaptr ! Poleward heat transport 38 USE sbcwave ! wave module 39 USE sbc_oce ! surface boundary condition: ocean 40 USE diaptr ! Poleward heat transport 39 41 40 42 IMPLICIT NONE … … 96 98 ! 97 99 ! ! set time step 100 zun(:,:,:) = 0.0 101 zvn(:,:,:) = 0.0 102 zwn(:,:,:) = 0.0 103 ! 98 104 IF( neuler == 0 .AND. kt == nit000 ) THEN ! at nit000 99 105 r2dt = rdt ! = rdt (restarting with Euler time stepping) … … 103 109 ! 104 110 ! !== effective transport ==! 105 DO jk = 1, jpkm1 106 zun(:,:,jk) = e2u (:,:) * e3u_n(:,:,jk) * un(:,:,jk) ! eulerian transport only 107 zvn(:,:,jk) = e1v (:,:) * e3v_n(:,:,jk) * vn(:,:,jk) 108 zwn(:,:,jk) = e1e2t(:,:) * wn(:,:,jk) 109 END DO 111 IF( ln_wave .AND. ln_sdw ) THEN 112 DO jk = 1, jpkm1 113 zun(:,:,jk) = e2u(:,:) * e3u_n(:,:,jk) * & 114 & ( un(:,:,jk) + usd3d(:,:,jk) ) ! eulerian transport + Stokes Drift 115 zvn(:,:,jk) = e1v(:,:) * e3v_n(:,:,jk) * & 116 & ( vn(:,:,jk) + vsd3d(:,:,jk) ) 117 zwn(:,:,jk) = e1e2t(:,:) * & 118 & ( wn(:,:,jk) + wsd3d(:,:,jk) ) 119 END DO 120 ELSE 121 DO jk = 1, jpkm1 122 zun(:,:,jk) = e2u (:,:) * e3u_n(:,:,jk) * un(:,:,jk) ! eulerian transport only 123 zvn(:,:,jk) = e1v (:,:) * e3v_n(:,:,jk) * vn(:,:,jk) 124 zwn(:,:,jk) = e1e2t(:,:) * wn(:,:,jk) 125 END DO 126 ENDIF 110 127 ! 111 128 IF( ln_vvl_ztilde .OR. ln_vvl_layer ) THEN ! add z-tilde and/or vvl corrections -
branches/2016/dev_INGV_METO_merge_2016/NEMOGCM/NEMO/OPA_SRC/ZDF/zdf_oce.F90
r5836 r7383 35 35 INTEGER , PUBLIC :: nn_npc !: non penetrative convective scheme call frequency 36 36 INTEGER , PUBLIC :: nn_npcp !: non penetrative convective scheme print frequency 37 LOGICAL , PUBLIC :: ln_zdfqiao !: Enhanced wave vertical mixing Qiao(2010) formulation flag 37 38 38 39 -
branches/2016/dev_INGV_METO_merge_2016/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfini.F90
r5836 r7383 51 51 INTEGER :: ioptio, ios ! local integers 52 52 !! 53 NAMELIST/namzdf/ rn_avm0, rn_avt0, nn_avb, nn_havtb, ln_zdfexp, nn_zdfexp, & 54 & ln_zdfevd, nn_evdm, rn_avevd, ln_zdfnpc, nn_npc, nn_npcp 53 NAMELIST/namzdf/ rn_avm0, rn_avt0, nn_avb, nn_havtb, ln_zdfexp, nn_zdfexp, & 54 & ln_zdfevd, nn_evdm, rn_avevd, ln_zdfnpc, nn_npc, nn_npcp, & 55 & ln_zdfqiao 55 56 !!---------------------------------------------------------------------- 56 57 … … 81 82 WRITE(numout,*) ' npc call frequency nn_npc = ', nn_npc 82 83 WRITE(numout,*) ' npc print frequency nn_npcp = ', nn_npcp 84 WRITE(numout,*) ' Qiao formulation flag ln_zdfqiao=', ln_zdfqiao 83 85 ENDIF 84 86 -
branches/2016/dev_INGV_METO_merge_2016/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfric.F90
r7048 r7383 205 205 DO jj = 2, jpjm1 206 206 DO ji = fs_2, fs_jpim1 207 IF( fsdept(ji,jj,jk) < ekm_dep(ji,jj) ) THEN207 IF( gdepw_n(ji,jj,jk) < ekm_dep(ji,jj) ) THEN 208 208 avmv(ji,jj,jk) = MAX( avmv(ji,jj,jk), rn_wvmix ) 209 209 avmu(ji,jj,jk) = MAX( avmu(ji,jj,jk), rn_wvmix ) -
branches/2016/dev_INGV_METO_merge_2016/NEMOGCM/NEMO/OPA_SRC/step.F90
r7382 r7383 26 26 !! 3.6 ! 2012-07 (J. Simeon, G. Madec. C. Ethe) Online coarsening of outputs 27 27 !! 3.6 ! 2014-04 (F. Roquet, G. Madec) New equations of state 28 !! 3.6 ! 2014-10 (E. Clementi, P. Oddo) Add Qiao vertical mixing in case of waves 28 29 !! 3.7 ! 2014-10 (G. Madec) LDF simplication 29 30 !! - ! 2014-12 (G. Madec) remove KPP scheme … … 73 74 !! -8- Outputs and diagnostics 74 75 !!---------------------------------------------------------------------- 75 INTEGER :: j k! dummy loop indice76 INTEGER :: ji,jj,jk ! dummy loop indice 76 77 INTEGER :: indic ! error indicator if < 0 77 78 INTEGER :: kcall ! optional integer argument (dom_vvl_sf_nxt) … … 128 129 CALL zdf_bfr( kstp ) ! bottom friction (if quadratic) 129 130 ! ! Vertical eddy viscosity and diffusivity coefficients 130 IF( lk_zdfric ) CALL zdf_ric( kstp ) ! Richardson number dependent Kz 131 IF( lk_zdftke ) CALL zdf_tke( kstp ) ! TKE closure scheme for Kz 132 IF( lk_zdfgls ) CALL zdf_gls( kstp ) ! GLS closure scheme for Kz 133 IF( lk_zdfcst ) THEN ! Constant Kz (reset avt, avm[uv] to the background value) 131 IF( lk_zdfric ) CALL zdf_ric ( kstp ) ! Richardson number dependent Kz 132 IF( lk_zdftke ) CALL zdf_tke ( kstp ) ! TKE closure scheme for Kz 133 IF( lk_zdfgls ) CALL zdf_gls ( kstp ) ! GLS closure scheme for Kz 134 IF( ln_zdfqiao ) CALL zdf_qiao( kstp ) ! Qiao vertical mixing 135 ! 136 IF( lk_zdfcst ) THEN ! Constant Kz (reset avt, avm[uv] to the background value) 134 137 avt (:,:,:) = rn_avt0 * wmask (:,:,:) 135 138 avmu(:,:,:) = rn_avm0 * wumask(:,:,:) … … 207 210 CALL dyn_adv ( kstp ) ! advection (vector or flux form) 208 211 CALL dyn_vor ( kstp ) ! vorticity term including Coriolis 212 IF( ln_wave .AND. ln_sdw .AND. ln_stcor) & 213 & CALL dyn_stcor ( kstp ) ! Stokes-Coriolis forcing 209 214 CALL dyn_ldf ( kstp ) ! lateral mixing 210 215 CALL dyn_hpg ( kstp ) ! horizontal gradient of Hydrostatic pressure -
branches/2016/dev_INGV_METO_merge_2016/NEMOGCM/NEMO/OPA_SRC/step_oce.F90
r6140 r7383 19 19 USE sbcapr ! surface boundary condition: atmospheric pressure 20 20 USE sbctide ! Tide initialisation 21 USE sbcwave ! Wave intialisation 21 22 22 23 USE traqsr ! solar radiation penetration (tra_qsr routine) … … 41 42 USE dynzdf ! vertical diffusion (dyn_zdf routine) 42 43 USE dynspg ! surface pressure gradient (dyn_spg routine) 44 USE dynstcor ! simp. form of Stokes-Coriolis 43 45 44 46 USE dynnxt ! time-stepping (dyn_nxt routine) … … 71 73 USE zdfric ! Richardson vertical mixing (zdf_ric routine) 72 74 USE zdfmxl ! Mixed-layer depth (zdf_mxl routine) 75 USE zdfqiao !Qiao module wave induced mixing (zdf_qiao routine) 73 76 74 77 USE step_diu ! Time stepping for diurnal sst
Note: See TracChangeset
for help on using the changeset viewer.