Changeset 14789 for NEMO/branches/2021/dev_r13747_HPC-11_mcastril_HPDAonline_DiagGPU/src/OCE/TRA/tranpc.F90
- Timestamp:
- 2021-05-05T13:18:04+02:00 (3 years ago)
- Location:
- NEMO/branches/2021/dev_r13747_HPC-11_mcastril_HPDAonline_DiagGPU
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/branches/2021/dev_r13747_HPC-11_mcastril_HPDAonline_DiagGPU
- Property svn:externals
-
old new 3 3 ^/utils/build/mk@HEAD mk 4 4 ^/utils/tools@HEAD tools 5 ^/vendors/AGRIF/dev _r12970_AGRIF_CMEMSext/AGRIF5 ^/vendors/AGRIF/dev@HEAD ext/AGRIF 6 6 ^/vendors/FCM@HEAD ext/FCM 7 7 ^/vendors/IOIPSL@HEAD ext/IOIPSL 8 ^/vendors/PPR@HEAD ext/PPR 8 9 9 10 # SETTE 10 ^/utils/CI/sette@1 3559sette11 ^/utils/CI/sette@14244 sette
-
- Property svn:externals
-
NEMO/branches/2021/dev_r13747_HPC-11_mcastril_HPDAonline_DiagGPU/src/OCE/TRA/tranpc.F90
r13497 r14789 17 17 USE oce ! ocean dynamics and active tracers 18 18 USE dom_oce ! ocean space and time domain 19 ! TEMP: [tiling] This change not necessary after extra haloes development (lbc_lnk removed) 20 USE domtile 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.e-14_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 point74 REAL(wp), DIMENSION( jpi,jpj,jpk ) :: zn2 ! N^275 REAL(wp), DIMENSION( jpi,jpj,jpk,jpts) :: zab! alpha and beta75 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(A2D(nn_hls),jpk ) :: zn2 ! N^2 78 REAL(wp), DIMENSION(A2D(nn_hls),jpk,jpts) :: zab ! alpha and beta 76 79 REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) :: ztrdt, ztrds ! 3D workspace 77 80 ! 78 81 LOGICAL, PARAMETER :: l_LB_debug = .FALSE. ! set to true if you want to follow what is 79 82 INTEGER :: ilc1, jlc1, klc1, nncpu ! actually happening in a water column at point "ilc1, jlc1" 83 INTEGER :: isi, isj, iei, iej 80 84 LOGICAL :: lp_monitor_point = .FALSE. ! in CPU domain "nncpu" 81 85 !!---------------------------------------------------------------------- … … 87 91 IF( l_trdtra ) THEN !* Save initial after fields 88 92 ALLOCATE( ztrdt(jpi,jpj,jpk) , ztrds(jpi,jpj,jpk) ) 89 ztrdt(:,:,:) = pts(:,:,:,jp_tem,Kaa) 93 ztrdt(:,:,:) = pts(:,:,:,jp_tem,Kaa) 90 94 ztrds(:,:,:) = pts(:,:,:,jp_sal,Kaa) 91 95 ENDIF … … 93 97 IF( l_LB_debug ) THEN 94 98 ! Location of 1 known convection site to follow what's happening in the water column 95 ilc1 = 45 ; jlc1 = 3 ; ! ORCA2 4x4, Antarctic coast, more than 2 unstable portions in the water column... 99 ilc1 = 45 ; jlc1 = 3 ; ! ORCA2 4x4, Antarctic coast, more than 2 unstable portions in the water column... 96 100 nncpu = 1 ; ! the CPU domain contains the convection spot 97 klc1 = mbkt(ilc1,jlc1) ! bottom of the ocean for debug point... 101 klc1 = mbkt(ilc1,jlc1) ! bottom of the ocean for debug point... 98 102 ENDIF 99 103 ! … … 101 105 CALL bn2 ( pts(:,:,:,:,Kaa), zab, zn2, Kmm ) ! after Brunt-Vaisala (given on W-points) 102 106 ! 103 inpcc = 0 104 ! 105 DO_2D( 0, 0, 0, 0 ) ! interior column only 107 IF( ntile == 0 .OR. ntile == 1 ) nnpcc = 0 ! Do only on the first tile 108 ! 109 IF( ntsi == Nis0 ) THEN ; isi = nn_hls ; ELSE ; isi = 0 ; ENDIF ! Avoid double-counting when using tiling 110 IF( ntsj == Njs0 ) THEN ; isj = nn_hls ; ELSE ; isj = 0 ; ENDIF 111 IF( ntei == Nie0 ) THEN ; iei = nn_hls ; ELSE ; iei = 0 ; ENDIF 112 IF( ntej == Nje0 ) THEN ; iej = nn_hls ; ELSE ; iej = 0 ; ENDIF 113 ! 114 DO_2D( isi, iei, isj, iej ) ! interior column only 106 115 ! 107 116 IF( tmask(ji,jj,2) == 1 ) THEN ! At least 2 ocean points 108 ! ! consider one ocean column 117 ! ! consider one ocean column 109 118 zvts(:,jp_tem) = pts(ji,jj,:,jp_tem,Kaa) ! temperature 110 119 zvts(:,jp_sal) = pts(ji,jj,:,jp_sal,Kaa) ! salinity 111 120 ! 112 zvab(:,jp_tem) = zab(ji,jj,:,jp_tem) ! Alpha 113 zvab(:,jp_sal) = zab(ji,jj,:,jp_sal) ! Beta 114 zvn2(:) = zn2(ji,jj,:) ! N^2 121 zvab(:,jp_tem) = zab(ji,jj,:,jp_tem) ! Alpha 122 zvab(:,jp_sal) = zab(ji,jj,:,jp_sal) ! Beta 123 zvn2(:) = zn2(ji,jj,:) ! N^2 115 124 ! 116 125 IF( l_LB_debug ) THEN !LB debug: … … 118 127 IF( ( ji == ilc1 ).AND.( jj == jlc1 ) ) lp_monitor_point = .TRUE. 119 128 ! writing only if on CPU domain where conv region is: 120 lp_monitor_point = (narea == nncpu).AND.lp_monitor_point 129 lp_monitor_point = (narea == nncpu).AND.lp_monitor_point 121 130 ENDIF !LB debug end 122 131 ! … … 130 139 ! 131 140 jiter = jiter + 1 132 ! 141 ! 133 142 IF( jiter >= 400 ) EXIT 134 143 ! … … 145 154 ilayer = ilayer + 1 ! yet another instable portion of the water column found.... 146 155 ! 147 IF( lp_monitor_point ) THEN 156 IF( lp_monitor_point ) THEN 148 157 WRITE(numout,*) 149 158 IF( ilayer == 1 .AND. jiter == 1 ) THEN ! first time a column is spoted with an instability … … 160 169 ENDIF 161 170 ! 162 IF( jiter == 1 ) inpcc = inpcc + 1171 IF( jiter == 1 ) nnpcc = nnpcc + 1 163 172 ! 164 173 IF( lp_monitor_point ) WRITE(numout, *) 'Negative N2 at ikp =',ikp,' for layer #', ilayer … … 185 194 zsum_beta = 0._wp 186 195 zsum_z = 0._wp 187 196 188 197 DO jk = ikup, ikbot ! Inside the instable (and overlying neutral) portion of the column 189 198 ! … … 194 203 zsum_beta = zsum_beta + zvab(jk,jp_sal)*zdz 195 204 zsum_z = zsum_z + zdz 196 ! 205 ! 197 206 IF( jk == ikbot ) EXIT ! avoid array-index overshoot in case ikbot = jpk, cause we're calling jk+1 next line 198 207 !! EXIT when we have reached the last layer that is instable (N2<0) or neutral (N2=0): 199 208 IF( zvn2(jk+1) > zn2_zero ) EXIT 200 209 END DO 201 210 202 211 ikdown = jk ! for the current unstable layer, ikdown is the deepest point with a negative or neutral N2 203 212 IF( ikup == ikdown ) CALL ctl_stop( 'tra_npc : PROBLEM #2') … … 225 234 zvab(jk,jp_sal) = zbeta 226 235 END DO 227 228 236 237 229 238 !! Updating N2 in the relvant portion of the water column 230 239 !! Temperature, Salinity, Alpha and Beta have been homogenized in the unstable portion 231 240 !! => Need to re-compute N2! will use Alpha and Beta! 232 241 233 242 ikup = MAX(2,ikup) ! ikup can never be 1 ! 234 243 ik_low = MIN(ikdown+1,ikbot) ! we must go 1 point deeper than ikdown! 235 244 236 245 DO jk = ikup, ik_low ! we must go 1 point deeper than ikdown! 237 246 … … 253 262 254 263 END DO 255 264 256 265 ikp = MIN(ikdown+1,ikbot) 257 266 258 267 259 268 ENDIF !IF( zvn2(ikp) < 0. ) … … 265 274 266 275 IF( ikp /= ikbot ) CALL ctl_stop( 'tra_npc : PROBLEM #3') 267 276 268 277 ! ******* At this stage ikp == ikbot ! ******* 269 278 270 279 IF( ilayer > 0 ) THEN !! least an unstable layer has been found 271 280 ! … … 310 319 ENDIF 311 320 ! 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 ) THEN315 WRITE(numout,*) 'Exiting tra_npc , kt = ',kt,', => numb. of statically instable water-columns: ', inpcc316 WRITE(numout,*)321 IF( ntile == 0 .OR. ntile == nijtile ) THEN ! Do only for the full domain 322 IF( lwp .AND. l_LB_debug ) THEN 323 WRITE(numout,*) 'Exiting tra_npc , kt = ',kt,', => numb. of statically instable water-columns: ', nnpcc 324 WRITE(numout,*) 325 ENDIF 317 326 ENDIF 318 327 !
Note: See TracChangeset
for help on using the changeset viewer.