Changeset 6140 for trunk/NEMOGCM/NEMO/TOP_SRC/trcsub.F90
- Timestamp:
- 2015-12-21T12:35:23+01:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/NEMOGCM/NEMO/TOP_SRC/trcsub.F90
r5930 r6140 40 40 PUBLIC trc_sub_ssh ! called by trc_stp to reset physics variables 41 41 42 !!* Module variables43 42 REAL(wp) :: r1_ndttrc ! 1 / nn_dttrc 44 43 REAL(wp) :: r1_ndttrcp1 ! 1 / (nn_dttrc+1) … … 48 47 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: uslp_tm , vslp_tm , wslpi_tm , wslpj_tm !: time mean 49 48 50 !! * Substitutions51 # include "domzgr_substitute.h90"52 49 !!---------------------------------------------------------------------- 53 50 !! NEMO/TOP 3.3 , NEMO Consortium (2010) … … 88 85 IF( MOD( kt , nn_dttrc ) /= 0 ) THEN 89 86 ! 90 un_tm (:,:,:) = un_tm (:,:,:) + un (:,:,:) * fse3u(:,:,:)91 vn_tm (:,:,:) = vn_tm (:,:,:) + vn (:,:,:) * fse3v(:,:,:)92 tsn_tm (:,:,:,jp_tem) = tsn_tm (:,:,:,jp_tem) + tsn (:,:,:,jp_tem) * fse3t(:,:,:)93 tsn_tm (:,:,:,jp_sal) = tsn_tm (:,:,:,jp_sal) + tsn (:,:,:,jp_sal) * fse3t(:,:,:)94 rhop_tm (:,:,:) = rhop_tm (:,:,:) + rhop (:,:,:) * fse3t(:,:,:)95 avt_tm (:,:,:) = avt_tm (:,:,:) + avt (:,:,:) * fse3w(:,:,:)96 # if defined key_zdfddm 97 avs_tm (:,:,:) = avs_tm (:,:,:) + avs (:,:,:) * fse3w(:,:,:)87 un_tm (:,:,:) = un_tm (:,:,:) + un (:,:,:) * e3u_n(:,:,:) 88 vn_tm (:,:,:) = vn_tm (:,:,:) + vn (:,:,:) * e3v_n(:,:,:) 89 tsn_tm (:,:,:,jp_tem) = tsn_tm (:,:,:,jp_tem) + tsn (:,:,:,jp_tem) * e3t_n(:,:,:) 90 tsn_tm (:,:,:,jp_sal) = tsn_tm (:,:,:,jp_sal) + tsn (:,:,:,jp_sal) * e3t_n(:,:,:) 91 rhop_tm (:,:,:) = rhop_tm (:,:,:) + rhop (:,:,:) * e3t_n(:,:,:) 92 avt_tm (:,:,:) = avt_tm (:,:,:) + avt (:,:,:) * e3w_n(:,:,:) 93 # if defined key_zdfddm 94 avs_tm (:,:,:) = avs_tm (:,:,:) + avs (:,:,:) * e3w_n(:,:,:) 98 95 # endif 99 96 IF( l_ldfslp ) THEN … … 165 162 ! 166 163 ! 2. Create averages and reassign variables 167 un_tm (:,:,:) = un_tm (:,:,:) + un (:,:,:) * fse3u(:,:,:)168 vn_tm (:,:,:) = vn_tm (:,:,:) + vn (:,:,:) * fse3v(:,:,:)169 tsn_tm (:,:,:,jp_tem) = tsn_tm (:,:,:,jp_tem) + tsn (:,:,:,jp_tem) * fse3t(:,:,:)170 tsn_tm (:,:,:,jp_sal) = tsn_tm (:,:,:,jp_sal) + tsn (:,:,:,jp_sal) * fse3t(:,:,:)171 rhop_tm (:,:,:) = rhop_tm (:,:,:) + rhop (:,:,:) * fse3t(:,:,:)172 avt_tm (:,:,:) = avt_tm (:,:,:) + avt (:,:,:) * fse3w(:,:,:)173 # if defined key_zdfddm 174 avs_tm (:,:,:) = avs_tm (:,:,:) + avs (:,:,:) * fse3w(:,:,:)164 un_tm (:,:,:) = un_tm (:,:,:) + un (:,:,:) * e3u_n(:,:,:) 165 vn_tm (:,:,:) = vn_tm (:,:,:) + vn (:,:,:) * e3v_n(:,:,:) 166 tsn_tm (:,:,:,jp_tem) = tsn_tm (:,:,:,jp_tem) + tsn (:,:,:,jp_tem) * e3t_n(:,:,:) 167 tsn_tm (:,:,:,jp_sal) = tsn_tm (:,:,:,jp_sal) + tsn (:,:,:,jp_sal) * e3t_n(:,:,:) 168 rhop_tm (:,:,:) = rhop_tm (:,:,:) + rhop (:,:,:) * e3t_n(:,:,:) 169 avt_tm (:,:,:) = avt_tm (:,:,:) + avt (:,:,:) * e3w_n(:,:,:) 170 # if defined key_zdfddm 171 avs_tm (:,:,:) = avs_tm (:,:,:) + avs (:,:,:) * e3w_n(:,:,:) 175 172 # endif 176 173 IF( l_ldfslp ) THEN … … 244 241 DO jj = 1, jpj 245 242 DO ji = 1, jpi 246 z1_ne3t = r1_ndttrcp1 / fse3t(ji,jj,jk)247 z1_ne3u = r1_ndttrcp1 / fse3u(ji,jj,jk)248 z1_ne3v = r1_ndttrcp1 / fse3v(ji,jj,jk)249 z1_ne3w = r1_ndttrcp1 / fse3w(ji,jj,jk)243 z1_ne3t = r1_ndttrcp1 / e3t_n(ji,jj,jk) 244 z1_ne3u = r1_ndttrcp1 / e3u_n(ji,jj,jk) 245 z1_ne3v = r1_ndttrcp1 / e3v_n(ji,jj,jk) 246 z1_ne3w = r1_ndttrcp1 / e3w_n(ji,jj,jk) 250 247 ! 251 248 un (ji,jj,jk) = un_tm (ji,jj,jk) * z1_ne3u … … 300 297 IF( ierr /= 0 ) CALL ctl_stop( 'STOP', 'top_sub_alloc : unable to allocate standard ocean arrays' ) 301 298 302 un_tm (:,:,:) = un (:,:,:) * fse3u(:,:,:)303 vn_tm (:,:,:) = vn (:,:,:) * fse3v(:,:,:)304 tsn_tm (:,:,:,jp_tem) = tsn (:,:,:,jp_tem) * fse3t(:,:,:)305 tsn_tm (:,:,:,jp_sal) = tsn (:,:,:,jp_sal) * fse3t(:,:,:)306 rhop_tm (:,:,:) = rhop (:,:,:) * fse3t(:,:,:)299 un_tm (:,:,:) = un (:,:,:) * e3u_n(:,:,:) 300 vn_tm (:,:,:) = vn (:,:,:) * e3v_n(:,:,:) 301 tsn_tm (:,:,:,jp_tem) = tsn (:,:,:,jp_tem) * e3t_n(:,:,:) 302 tsn_tm (:,:,:,jp_sal) = tsn (:,:,:,jp_sal) * e3t_n(:,:,:) 303 rhop_tm (:,:,:) = rhop (:,:,:) * e3t_n(:,:,:) 307 304 !!gm : BUG? ==>> for avt & avs I don't understand the division by e3w 308 avt_tm (:,:,:) = avt (:,:,:) * fse3w(:,:,:)309 # if defined key_zdfddm 310 avs_tm (:,:,:) = avs (:,:,:) * fse3w(:,:,:)305 avt_tm (:,:,:) = avt (:,:,:) * e3w_n(:,:,:) 306 # if defined key_zdfddm 307 avs_tm (:,:,:) = avs (:,:,:) * e3w_n(:,:,:) 311 308 # endif 312 309 IF( l_ldfslp ) THEN … … 400 397 ! 401 398 ! Start new averages 402 un_tm (:,:,:) = un (:,:,:) * fse3u(:,:,:)403 vn_tm (:,:,:) = vn (:,:,:) * fse3v(:,:,:)404 tsn_tm (:,:,:,jp_tem) = tsn (:,:,:,jp_tem) * fse3t(:,:,:)405 tsn_tm (:,:,:,jp_sal) = tsn (:,:,:,jp_sal) * fse3t(:,:,:)406 rhop_tm (:,:,:) = rhop (:,:,:) * fse3t(:,:,:)407 avt_tm (:,:,:) = avt (:,:,:) * fse3w(:,:,:)408 # if defined key_zdfddm 409 avs_tm (:,:,:) = avs (:,:,:) * fse3w(:,:,:)399 un_tm (:,:,:) = un (:,:,:) * e3u_n(:,:,:) 400 vn_tm (:,:,:) = vn (:,:,:) * e3v_n(:,:,:) 401 tsn_tm (:,:,:,jp_tem) = tsn (:,:,:,jp_tem) * e3t_n(:,:,:) 402 tsn_tm (:,:,:,jp_sal) = tsn (:,:,:,jp_sal) * e3t_n(:,:,:) 403 rhop_tm (:,:,:) = rhop (:,:,:) * e3t_n(:,:,:) 404 avt_tm (:,:,:) = avt (:,:,:) * e3w_n(:,:,:) 405 # if defined key_zdfddm 406 avs_tm (:,:,:) = avs (:,:,:) * e3w_n(:,:,:) 410 407 # endif 411 408 IF( l_ldfslp ) THEN … … 449 446 !! 450 447 !! ** Purpose : compute the after ssh (ssha), the now vertical velocity 451 !! and update the now vertical coordinate (l k_vvl=T).448 !! and update the now vertical coordinate (ln_linssh=F). 452 449 !! 453 450 !! ** Method : - Using the incompressibility hypothesis, the vertical … … 458 455 !! ** action : ssha : after sea surface height 459 456 !! wn : now vertical velocity 460 !! sshu_a, sshv_a, sshf_a : after sea surface height (l k_vvl=T)457 !! sshu_a, sshv_a, sshf_a : after sea surface height (ln_linssh=F) 461 458 !! 462 459 !! Reference : Leclair, M., and G. Madec, 2009, Ocean Modelling. 463 460 !!---------------------------------------------------------------------- 464 !465 461 INTEGER, INTENT(in) :: kt ! time step 466 462 ! … … 473 469 ! 474 470 ! Allocate temporary workspace 475 CALL wrk_alloc( jpi, jpj,zhdiv )471 CALL wrk_alloc( jpi,jpj, zhdiv ) 476 472 477 473 IF( kt == nittrc000 ) THEN … … 485 481 ENDIF 486 482 ! 483 !!gm BUG here ! hdivn will include the runoff divergence at the wrong timestep !!!! 487 484 CALL div_hor( kt ) ! Horizontal divergence & Relative vorticity 488 485 ! … … 495 492 zhdiv(:,:) = 0._wp 496 493 DO jk = 1, jpkm1 ! Horizontal divergence of barotropic transports 497 zhdiv(:,:) = zhdiv(:,:) + fse3t(:,:,jk) * hdivn(:,:,jk)494 zhdiv(:,:) = zhdiv(:,:) + e3t_n(:,:,jk) * hdivn(:,:,jk) 498 495 END DO 499 496 ! ! Sea surface elevation time stepping … … 502 499 z1_rau0 = 0.5 / rau0 503 500 ssha(:,:) = ( sshb(:,:) - z2dt * ( z1_rau0 * ( emp_b(:,:) + emp(:,:) ) + zhdiv(:,:) ) ) * tmask(:,:,1) 504 501 #if ! defined key_dynspg_ts 505 502 ! These lines are not necessary with time splitting since 506 503 ! boundary condition on sea level is set during ts loop … … 512 509 CALL lbc_lnk( ssha, 'T', 1. ) 513 510 #endif 514 511 #endif 512 ! 515 513 ! !------------------------------! 516 514 ! ! Now Vertical Velocity ! … … 518 516 z1_2dt = 1.e0 / z2dt 519 517 DO jk = jpkm1, 1, -1 ! integrate from the bottom the hor. divergence 520 ! - ML - need 3 lines here because replacement of fse3t by its expression yields too long lines otherwise521 wn(:,:,jk) = wn(:,:,jk+1) - fse3t_n(:,:,jk) * hdivn(:,:,jk) &522 & - ( fse3t_a(:,:,jk) - fse3t_b(:,:,jk) ) &518 ! - ML - need 3 lines here because replacement of e3t by its expression yields too long lines otherwise 519 wn(:,:,jk) = wn(:,:,jk+1) - e3t_n(:,:,jk) * hdivn(:,:,jk) & 520 & - ( e3t_a(:,:,jk) - e3t_b(:,:,jk) ) & 523 521 & * tmask(:,:,jk) * z1_2dt 524 522 #if defined key_bdy … … 526 524 #endif 527 525 END DO 528 529 ! 530 CALL wrk_dealloc( jpi, jpj, zhdiv ) 526 ! 527 CALL wrk_dealloc( jpi,jpj, zhdiv ) 531 528 ! 532 529 IF( nn_timing == 1 ) CALL timing_stop('trc_sub_ssh') 533 530 ! 534 531 END SUBROUTINE trc_sub_ssh 532 535 533 536 534 INTEGER FUNCTION trc_sub_alloc() … … 598 596 WRITE(*,*) 'trc_sub_ini: You should not have seen this print! error?', kt 599 597 END SUBROUTINE trc_sub_ini 600 601 598 #endif 602 599
Note: See TracChangeset
for help on using the changeset viewer.