Changeset 13517
 Timestamp:
 20200924T20:42:25+02:00 (4 months ago)
 Location:
 NEMO/branches/2020/dev_r13383_HPC02_Daley_Tiling/src/OCE
 Files:

 3 edited
Legend:
 Unmodified
 Added
 Removed

NEMO/branches/2020/dev_r13383_HPC02_Daley_Tiling/src/OCE/TRA/tranpc.F90
r13295 r13517 17 17 USE oce ! ocean dynamics and active tracers 18 18 USE dom_oce ! ocean space and time domain 19 ! TEMP: This change not necessary after trd_tra is tiled and extra haloes development (lbc_lnk removed) 20 USE domain, ONLY : dom_tile 19 21 USE phycst ! physical constants 20 22 USE zdf_oce ! ocean vertical physics … … 32 34 33 35 PUBLIC tra_npc ! routine called by step.F90 36 37 INTEGER :: nnpcc ! number of statically instable water column 34 38 35 39 !! * Substitutions … … 64 68 ! 65 69 INTEGER :: ji, jj, jk ! dummy loop indices 66 INTEGER :: inpcc ! number of statically instable water column67 70 INTEGER :: jiter, ikbot, ikp, ikup, ikdown, ilayer, ik_low ! local integers 68 71 LOGICAL :: l_bottom_reached, l_column_treated … … 70 73 REAL(wp) :: zsa, zbeta, zsum_sali, zsum_beta, zbw, zrw, z1_rDt 71 74 REAL(wp), PARAMETER :: zn2_zero = 1.e14_wp ! acceptance criteria for neutrality (N2==0) 72 REAL(wp), DIMENSION( jpk ) :: zvn2 ! vertical profile of N2 at 1 given point... 73 REAL(wp), DIMENSION( jpk,jpts) :: zvts, zvab ! vertical profile of T & S , and alpha & betaat 1 given point 74 REAL(wp), DIMENSION(jpi,jpj,jpk ) :: zn2 ! N^2 75 REAL(wp), DIMENSION(jpi,jpj,jpk,jpts) :: zab ! alpha and beta 76 REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) :: ztrdt, ztrds ! 3D workspace 75 REAL(wp), DIMENSION( jpk ) :: zvn2 ! vertical profile of N2 at 1 given point... 76 REAL(wp), DIMENSION( jpk,jpts) :: zvts, zvab ! vertical profile of T & S , and alpha & betaat 1 given point 77 REAL(wp), DIMENSION(ST_2D(nn_hls),jpk ) :: zn2 ! N^2 78 REAL(wp), DIMENSION(ST_2D(nn_hls),jpk,jpts) :: zab ! alpha and beta 79 ! TEMP: This change not necessary after trd_tra is tiled 80 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: ztrdt, ztrds ! 3D workspace 77 81 ! 78 82 LOGICAL, PARAMETER :: l_LB_debug = .FALSE. ! set to true if you want to follow what is … … 82 86 ! 83 87 IF( ln_timing ) CALL timing_start('tra_npc') 88 89 IF( l_trdtra ) THEN 90 IF( ntile == 0 .OR. ntile == 1 ) THEN ! Do only on the first tile 91 ! TEMP: This can be ST_2D(nn_hls) after trd_tra is tiled 92 ALLOCATE( ztrdt(jpi,jpj,jpk), ztrds(jpi,jpj,jpk) ) 93 ENDIF 94 ENDIF 84 95 ! 85 96 IF( MOD( kt, nn_npc ) == 0 ) THEN 86 97 ! 87 98 IF( l_trdtra ) THEN !* Save initial after fields 88 ALLOCATE( ztrdt(jpi,jpj,jpk) , ztrds(jpi,jpj,jpk) ) 89 ztrdt(:,:,:) = pts(:,:,:,jp_tem,Kaa) 90 ztrds(:,:,:) = pts(:,:,:,jp_sal,Kaa) 91 ENDIF 92 ! 99 DO_3D( 0, 0, 0, 0, 1, jpk ) 100 ztrdt(ji,jj,jk) = pts(ji,jj,jk,jp_tem,Kaa) 101 ztrds(ji,jj,jk) = pts(ji,jj,jk,jp_sal,Kaa) 102 END_3D 103 ENDIF 104 ! 105 ! TODO: NOT TESTED requires ORCA2 93 106 IF( l_LB_debug ) THEN 94 107 ! Location of 1 known convection site to follow what's happening in the water column … … 101 114 CALL bn2 ( pts(:,:,:,:,Kaa), zab, zn2, Kmm ) ! after BruntVaisala (given on Wpoints) 102 115 ! 103 inpcc = 0116 IF( ntile == 0 .OR. ntile == 1 ) nnpcc = 0 ! Do only on the first tile 104 117 ! 105 118 DO_2D( 0, 0, 0, 0 ) … … 160 173 ENDIF 161 174 ! 162 IF( jiter == 1 ) inpcc = inpcc + 1175 IF( jiter == 1 ) nnpcc = nnpcc + 1 163 176 ! 164 177 IF( lp_monitor_point ) WRITE(numout, *) 'Negative N2 at ikp =',ikp,' for layer #', ilayer … … 301 314 END_2D 302 315 ! 303 IF( l_trdtra ) THEN ! send the Non penetrative mixing trends for diagnostic 316 ! TEMP: These changes not necessary after trd_tra is tiled and extra haloes development (lbc_lnk removed) 317 IF( l_trdtra ) THEN 304 318 z1_rDt = 1._wp / (2._wp * rn_Dt) 305 ztrdt(:,:,:) = ( pts(:,:,:,jp_tem,Kaa)  ztrdt(:,:,:) ) * z1_rDt 306 ztrds(:,:,:) = ( pts(:,:,:,jp_sal,Kaa)  ztrds(:,:,:) ) * z1_rDt 307 CALL trd_tra( kt, Kmm, Krhs, 'TRA', jp_tem, jptra_npc, ztrdt ) 308 CALL trd_tra( kt, Kmm, Krhs, 'TRA', jp_sal, jptra_npc, ztrds ) 309 DEALLOCATE( ztrdt, ztrds ) 310 ENDIF 311 ! 312 CALL lbc_lnk_multi( 'tranpc', pts(:,:,:,jp_tem,Kaa), 'T', 1.0_wp, pts(:,:,:,jp_sal,Kaa), 'T', 1.0_wp ) 313 ! 314 IF( lwp .AND. l_LB_debug ) THEN 315 WRITE(numout,*) 'Exiting tra_npc , kt = ',kt,', => numb. of statically instable watercolumns: ', inpcc 316 WRITE(numout,*) 319 320 DO_3D( 0, 0, 0, 0, 1, jpk ) 321 ztrdt(ji,jj,jk) = ( pts(ji,jj,jk,jp_tem,Kaa)  ztrdt(ji,jj,jk) ) * z1_rDt 322 ztrds(ji,jj,jk) = ( pts(ji,jj,jk,jp_sal,Kaa)  ztrds(ji,jj,jk) ) * z1_rDt 323 END_3D 324 ENDIF 325 326 IF( ntile == 0 .OR. ntile == nijtile ) THEN ! Do only for the full domain 327 IF( ln_tile ) CALL dom_tile( ntsi, ntsj, ntei, ntej, ktile = 0 ) ! Use full domain 328 329 IF( l_trdtra ) THEN ! send the Non penetrative mixing trends for diagnostic 330 ! TODO: TO BE TILED trd_tra 331 CALL trd_tra( kt, Kmm, Krhs, 'TRA', jp_tem, jptra_npc, ztrdt ) 332 CALL trd_tra( kt, Kmm, Krhs, 'TRA', jp_sal, jptra_npc, ztrds ) 333 DEALLOCATE( ztrdt, ztrds ) 334 ENDIF 335 336 IF( ln_tile ) CALL dom_tile( ntsi, ntsj, ntei, ntej, ktile = nijtile ) ! Revert to tile domain 337 ! 338 CALL lbc_lnk_multi( 'tranpc', pts(:,:,:,jp_tem,Kaa), 'T', 1.0_wp, pts(:,:,:,jp_sal,Kaa), 'T', 1.0_wp ) 339 ! 340 IF( lwp .AND. l_LB_debug ) THEN 341 WRITE(numout,*) 'Exiting tra_npc , kt = ',kt,', => numb. of statically instable watercolumns: ', nnpcc 342 WRITE(numout,*) 343 ENDIF 317 344 ENDIF 318 345 ! 
NEMO/branches/2020/dev_r13383_HPC02_Daley_Tiling/src/OCE/TRA/trazdf.F90
r13295 r13517 14 14 USE oce ! ocean dynamics and tracers variables 15 15 USE dom_oce ! ocean space and time domain variables 16 ! TEMP: This change not necessary after trd_tra is tiled 17 USE domain, ONLY : dom_tile 16 18 USE domvvl ! variable volume 17 19 USE phycst ! physical constant … … 55 57 REAL(wp), DIMENSION(jpi,jpj,jpk,jpts,jpt), INTENT(inout) :: pts ! active tracers and RHS of tracer equation 56 58 ! 57 INTEGER :: jk ! Dummy loop indices 58 REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: ztrdt, ztrds ! 3D workspace 59 INTEGER :: ji, jj, jk ! Dummy loop indices 60 ! TEMP: This change not necessary after trd_tra is tiled 61 REAL(wp), DIMENSION(:,:,:), ALLOCATABLE, SAVE :: ztrdt, ztrds ! 3D workspace 59 62 !! 60 63 ! … … 62 65 ! 63 66 IF( kt == nit000 ) THEN 64 IF(lwp)WRITE(numout,*) 65 IF(lwp)WRITE(numout,*) 'tra_zdf : implicit vertical mixing on T & S' 66 IF(lwp)WRITE(numout,*) '~~~~~~~ ' 67 IF( ntile == 0 .OR. ntile == 1 ) THEN ! Do only on the first tile 68 IF(lwp)WRITE(numout,*) 69 IF(lwp)WRITE(numout,*) 'tra_zdf : implicit vertical mixing on T & S' 70 IF(lwp)WRITE(numout,*) '~~~~~~~ ' 71 ENDIF 67 72 ENDIF 68 73 ! 69 74 IF( l_trdtra ) THEN !* Save ta and sa trends 70 ALLOCATE( ztrdt(jpi,jpj,jpk) , ztrds(jpi,jpj,jpk) ) 71 ztrdt(:,:,:) = pts(:,:,:,jp_tem,Kaa) 72 ztrds(:,:,:) = pts(:,:,:,jp_sal,Kaa) 75 IF( ntile == 0 .OR. ntile == 1 ) THEN ! Do only on the first tile 76 ! TEMP: This can be ST_2D(nn_hls) after trd_tra is tiled 77 ALLOCATE( ztrdt(jpi,jpj,jpk), ztrds(jpi,jpj,jpk) ) 78 ENDIF 79 80 DO_3D( 0, 0, 0, 0, 1, jpk ) 81 ztrdt(ji,jj,jk) = pts(ji,jj,jk,jp_tem,Kaa) 82 ztrds(ji,jj,jk) = pts(ji,jj,jk,jp_sal,Kaa) 83 END_3D 73 84 ENDIF 74 85 ! … … 80 91 ! JMM avoid negative salinities near river outlet ! Ugly fix 81 92 ! JMM : restore negative salinities to small salinities: 82 WHERE( pts( :,:,:,jp_sal,Kaa) < 0._wp ) pts(:,:,:,jp_sal,Kaa) = 0.1_wp93 WHERE( pts(ST_2D(0),:,jp_sal,Kaa) < 0._wp ) pts(ST_2D(0),:,jp_sal,Kaa) = 0.1_wp 83 94 !!gm 84 95 96 ! TEMP: These changes not necessary after trd_tra is tiled 85 97 IF( l_trdtra ) THEN ! save the vertical diffusive trends for further diagnostics 86 DO jk = 1, jpkm1 87 ztrdt(:,:,jk) = ( ( pts(:,:,jk,jp_tem,Kaa)*e3t(:,:,jk,Kaa) & 88 &  pts(:,:,jk,jp_tem,Kbb)*e3t(:,:,jk,Kbb) ) & 89 & / ( e3t(:,:,jk,Kmm)*rDt ) ) & 90 &  ztrdt(:,:,jk) 91 ztrds(:,:,jk) = ( ( pts(:,:,jk,jp_sal,Kaa)*e3t(:,:,jk,Kaa) & 92 &  pts(:,:,jk,jp_sal,Kbb)*e3t(:,:,jk,Kbb) ) & 93 & / ( e3t(:,:,jk,Kmm)*rDt ) ) & 94 &  ztrds(:,:,jk) 95 END DO 96 !!gm this should be moved in trdtra.F90 and done on all trends 97 CALL lbc_lnk_multi( 'trazdf', ztrdt, 'T', 1.0_wp , ztrds, 'T', 1.0_wp ) 98 !!gm 99 CALL trd_tra( kt, Kmm, Krhs, 'TRA', jp_tem, jptra_zdf, ztrdt ) 100 CALL trd_tra( kt, Kmm, Krhs, 'TRA', jp_sal, jptra_zdf, ztrds ) 101 DEALLOCATE( ztrdt , ztrds ) 98 DO_3D( 0, 0, 0, 0, 1, jpk ) 99 ztrdt(ji,jj,jk) = ( ( pts(ji,jj,jk,jp_tem,Kaa)*e3t(ji,jj,jk,Kaa)  pts(ji,jj,jk,jp_tem,Kbb)*e3t(ji,jj,jk,Kbb) ) & 100 & / (e3t(ji,jj,jk,Kmm)*rDt) )  ztrdt(ji,jj,jk) 101 ztrds(ji,jj,jk) = ( ( pts(ji,jj,jk,jp_sal,Kaa)*e3t(ji,jj,jk,Kaa)  pts(ji,jj,jk,jp_sal,Kbb)*e3t(ji,jj,jk,Kbb) ) & 102 & / (e3t(ji,jj,jk,Kmm)*rDt) )  ztrds(ji,jj,jk) 103 END_3D 104 105 IF( ntile == 0 .OR. ntile == nijtile ) THEN ! Do only for the full domain 106 IF( ln_tile ) CALL dom_tile( ntsi, ntsj, ntei, ntej, ktile = 0 ) ! Use full domain 107 108 ! TODO: TO BE TILED trd_tra 109 CALL trd_tra( kt, Kmm, Krhs, 'TRA', jp_tem, jptra_zdf, ztrdt ) 110 CALL trd_tra( kt, Kmm, Krhs, 'TRA', jp_sal, jptra_zdf, ztrds ) 111 DEALLOCATE( ztrdt , ztrds ) 112 113 IF( ln_tile ) CALL dom_tile( ntsi, ntsj, ntei, ntej, ktile = nijtile ) ! Revert to tile domain 114 ENDIF 102 115 ENDIF 103 116 ! ! print mean trends (used for debugging) … … 140 153 INTEGER :: ji, jj, jk, jn ! dummy loop indices 141 154 REAL(wp) :: zrhs, zzwi, zzws ! local scalars 142 REAL(wp), DIMENSION( jpi,jpj,jpk) :: zwi, zwt, zwd, zws155 REAL(wp), DIMENSION(ST_2D(nn_hls),jpk) :: zwi, zwt, zwd, zws 143 156 !! 144 157 ! … … 154 167 ! 155 168 ! vertical mixing coef.: avt for temperature, avs for salinity and passive tracers 156 IF( cdtype == 'TRA' .AND. jn == jp_tem ) THEN ; zwt(:,:,2:jpk) = avt(:,:,2:jpk) 157 ELSE ; zwt(:,:,2:jpk) = avs(:,:,2:jpk) 169 IF( cdtype == 'TRA' .AND. jn == jp_tem ) THEN 170 DO_3D( 1, 1, 1, 1, 2, jpk ) 171 zwt(ji,jj,jk) = avt(ji,jj,jk) 172 END_3D 173 ELSE 174 DO_3D( 1, 1, 1, 1, 2, jpk ) 175 zwt(ji,jj,jk) = avs(ji,jj,jk) 176 END_3D 158 177 ENDIF 159 178 zwt(:,:,1) = 0._wp … … 222 241 END_2D 223 242 DO_3D( 0, 0, 0, 0, 2, jpkm1 ) 224 zrhs = e3t(ji,jj,jk,Kbb) * pt(ji,jj,jk,jn,Kbb) & 243 zrhs = e3t(ji,jj,jk,Kbb) * pt(ji,jj,jk,jn,Kbb) & 225 244 & + p2dt * e3t(ji,jj,jk,Kmm) * pt(ji,jj,jk,jn,Krhs) ! zrhs=right hand side 226 245 pt(ji,jj,jk,jn,Kaa) = zrhs  zwi(ji,jj,jk) / zwt(ji,jj,jk1) * pt(ji,jj,jk1,jn,Kaa) 
NEMO/branches/2020/dev_r13383_HPC02_Daley_Tiling/src/OCE/ZDF/zdfosm.F90
r13295 r13517 44 44 ! uses ww from previous time step (which is now wb) to calculate hbl 45 45 USE dom_oce ! ocean space and time domain 46 ! TEMP: This change not necessary after trd_tra is tiled 47 USE domain, ONLY : dom_tile 46 48 USE zdf_oce ! ocean vertical physics 47 49 USE sbc_oce ! surface boundary condition: ocean … … 1496 1498 !! 1497 1499 IF( TRIM(cdrw) == 'WRITE') THEN !* Write hbli into the restart file, then return 1500 IF( ntile /= 0 .AND. ntile /= nijtile ) RETURN ! Do only on the last tile 1501 1498 1502 IF(lwp) WRITE(numout,*) ' osmrst ' 1499 1503 CALL iom_rstput( kt, nitrst, numrow, 'wn' , ww , ldxios = lwxios ) … … 1541 1545 !! ** Method : ??? 1542 1546 !! 1543 REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: ztrdt, ztrds ! 3D workspace 1547 ! TEMP: This change not necessary after trd_tra is tiled 1548 REAL(wp), DIMENSION(:,:,:), ALLOCATABLE, SAVE :: ztrdt, ztrds ! 3D workspace 1544 1549 !! 1545 1550 INTEGER , INTENT(in) :: kt ! time step index … … 1550 1555 ! 1551 1556 IF( kt == nit000 ) THEN 1552 IF(lwp) WRITE(numout,*) 1553 IF(lwp) WRITE(numout,*) 'tra_osm : OSM nonlocal tracer fluxes' 1554 IF(lwp) WRITE(numout,*) '~~~~~~~ ' 1557 IF( ntile == 0 .OR. ntile == 1 ) THEN ! Do only on the first tile 1558 IF(lwp) WRITE(numout,*) 1559 IF(lwp) WRITE(numout,*) 'tra_osm : OSM nonlocal tracer fluxes' 1560 IF(lwp) WRITE(numout,*) '~~~~~~~ ' 1561 ENDIF 1555 1562 ENDIF 1556 1563 1557 1564 IF( l_trdtra ) THEN !* Save ta and sa trends 1558 ALLOCATE( ztrdt(jpi,jpj,jpk) ) ; ztrdt(:,:,:) = pts(:,:,:,jp_tem,Krhs) 1559 ALLOCATE( ztrds(jpi,jpj,jpk) ) ; ztrds(:,:,:) = pts(:,:,:,jp_sal,Krhs) 1565 IF( ntile == 0 .OR. ntile == 1 ) THEN ! Do only on the first tile 1566 ! TEMP: This can be ST_2D(nn_hls) after trd_tra is tiled 1567 ALLOCATE( ztrdt(jpi,jpj,jpk), ztrds(jpi,jpj,jpk) ) 1568 ENDIF 1569 1570 DO_3D( 0, 0, 0, 0, 1, jpk ) 1571 ztrdt(ji,jj,jk) = pts(ji,jj,jk,jp_tem,Krhs) 1572 ztrds(ji,jj,jk) = pts(ji,jj,jk,jp_sal,Krhs) 1573 END_3D 1560 1574 ENDIF 1561 1575 … … 1570 1584 END_3D 1571 1585 1572 1586 ! TEMP: These changes not necessary after trd_tra is tiled 1573 1587 ! save the nonlocal tracer flux trends for diagnostic 1574 1588 IF( l_trdtra ) THEN 1575 ztrdt(:,:,:) = pts(:,:,:,jp_tem,Krhs)  ztrdt(:,:,:) 1576 ztrds(:,:,:) = pts(:,:,:,jp_sal,Krhs)  ztrds(:,:,:) 1589 DO_3D( 0, 0, 0, 0, 1, jpk ) 1590 ztrdt(ji,jj,jk) = pts(ji,jj,jk,jp_tem,Krhs)  ztrdt(ji,jj,jk) 1591 ztrds(ji,jj,jk) = pts(ji,jj,jk,jp_sal,Krhs)  ztrds(ji,jj,jk) 1592 END_3D 1593 1594 IF( ntile == 0 .OR. ntile == nijtile ) THEN ! Do only for the full domain 1595 IF( ln_tile ) CALL dom_tile( ntsi, ntsj, ntei, ntej, ktile = 0 ) ! Use full domain 1596 1577 1597 !!bug gm jpttdzdf ==> jpttosm 1578 CALL trd_tra( kt, Kmm, Krhs, 'TRA', jp_tem, jptra_zdf, ztrdt ) 1579 CALL trd_tra( kt, Kmm, Krhs, 'TRA', jp_sal, jptra_zdf, ztrds ) 1580 DEALLOCATE( ztrdt ) ; DEALLOCATE( ztrds ) 1598 ! TODO: TO BE TILED trd_tra 1599 CALL trd_tra( kt, Kmm, Krhs, 'TRA', jp_tem, jptra_zdf, ztrdt ) 1600 CALL trd_tra( kt, Kmm, Krhs, 'TRA', jp_sal, jptra_zdf, ztrds ) 1601 DEALLOCATE( ztrdt ) ; DEALLOCATE( ztrds ) 1602 1603 IF( ln_tile ) CALL dom_tile( ntsi, ntsj, ntei, ntej, ktile = nijtile ) ! Revert to tile domain 1604 ENDIF 1581 1605 ENDIF 1582 1606
Note: See TracChangeset
for help on using the changeset viewer.