- Timestamp:
- 2020-03-23T22:16:19+01:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/branches/2020/dev_r12377_KERNEL-06_techene_e3/src/OCE/TRA/tranpc.F90
r12377 r12590 35 35 !! * Substitutions 36 36 # include "do_loop_substitute.h90" 37 # include "domzgr_substitute.h90" 37 38 !!---------------------------------------------------------------------- 38 39 !! NEMO/OCE 4.0 , NEMO Consortium (2018) … … 71 72 REAL(wp), DIMENSION( jpk ) :: zvn2 ! vertical profile of N2 at 1 given point... 72 73 REAL(wp), DIMENSION( jpk,jpts) :: zvts, zvab ! vertical profile of T & S , and alpha & betaat 1 given point 73 REAL(wp), DIMENSION(jpi,jpj,jpk ) :: zn2 ! N^2 74 REAL(wp), DIMENSION(jpi,jpj,jpk ) :: zn2 ! N^2 74 75 REAL(wp), DIMENSION(jpi,jpj,jpk,jpts) :: zab ! alpha and beta 75 76 REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) :: ztrdt, ztrds ! 3D workspace … … 86 87 IF( l_trdtra ) THEN !* Save initial after fields 87 88 ALLOCATE( ztrdt(jpi,jpj,jpk) , ztrds(jpi,jpj,jpk) ) 88 ztrdt(:,:,:) = pts(:,:,:,jp_tem,Kaa) 89 ztrdt(:,:,:) = pts(:,:,:,jp_tem,Kaa) 89 90 ztrds(:,:,:) = pts(:,:,:,jp_sal,Kaa) 90 91 ENDIF … … 92 93 IF( l_LB_debug ) THEN 93 94 ! Location of 1 known convection site to follow what's happening in the water column 94 ilc1 = 45 ; jlc1 = 3 ; ! ORCA2 4x4, Antarctic coast, more than 2 unstable portions in the water column... 95 ilc1 = 45 ; jlc1 = 3 ; ! ORCA2 4x4, Antarctic coast, more than 2 unstable portions in the water column... 95 96 nncpu = 1 ; ! the CPU domain contains the convection spot 96 klc1 = mbkt(ilc1,jlc1) ! bottom of the ocean for debug point... 97 klc1 = mbkt(ilc1,jlc1) ! bottom of the ocean for debug point... 97 98 ENDIF 98 99 ! … … 105 106 ! 106 107 IF( tmask(ji,jj,2) == 1 ) THEN ! At least 2 ocean points 107 ! ! consider one ocean column 108 ! ! consider one ocean column 108 109 zvts(:,jp_tem) = pts(ji,jj,:,jp_tem,Kaa) ! temperature 109 110 zvts(:,jp_sal) = pts(ji,jj,:,jp_sal,Kaa) ! salinity 110 111 ! 111 zvab(:,jp_tem) = zab(ji,jj,:,jp_tem) ! Alpha 112 zvab(:,jp_sal) = zab(ji,jj,:,jp_sal) ! Beta 113 zvn2(:) = zn2(ji,jj,:) ! N^2 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 114 115 ! 115 116 IF( l_LB_debug ) THEN !LB debug: … … 117 118 IF( ( ji == ilc1 ).AND.( jj == jlc1 ) ) lp_monitor_point = .TRUE. 118 119 ! writing only if on CPU domain where conv region is: 119 lp_monitor_point = (narea == nncpu).AND.lp_monitor_point 120 lp_monitor_point = (narea == nncpu).AND.lp_monitor_point 120 121 ENDIF !LB debug end 121 122 ! … … 129 130 ! 130 131 jiter = jiter + 1 131 ! 132 ! 132 133 IF( jiter >= 400 ) EXIT 133 134 ! … … 144 145 ilayer = ilayer + 1 ! yet another instable portion of the water column found.... 145 146 ! 146 IF( lp_monitor_point ) THEN 147 IF( lp_monitor_point ) THEN 147 148 WRITE(numout,*) 148 149 IF( ilayer == 1 .AND. jiter == 1 ) THEN ! first time a column is spoted with an instability … … 159 160 ENDIF 160 161 ! 161 IF( jiter == 1 ) inpcc = inpcc + 1 162 IF( jiter == 1 ) inpcc = inpcc + 1 162 163 ! 163 164 IF( lp_monitor_point ) WRITE(numout, *) 'Negative N2 at ikp =',ikp,' for layer #', ilayer … … 184 185 zsum_beta = 0._wp 185 186 zsum_z = 0._wp 186 187 187 188 DO jk = ikup, ikbot ! Inside the instable (and overlying neutral) portion of the column 188 189 ! … … 193 194 zsum_beta = zsum_beta + zvab(jk,jp_sal)*zdz 194 195 zsum_z = zsum_z + zdz 195 ! 196 ! 196 197 IF( jk == ikbot ) EXIT ! avoid array-index overshoot in case ikbot = jpk, cause we're calling jk+1 next line 197 198 !! EXIT when we have reached the last layer that is instable (N2<0) or neutral (N2=0): 198 199 IF( zvn2(jk+1) > zn2_zero ) EXIT 199 200 END DO 200 201 201 202 ikdown = jk ! for the current unstable layer, ikdown is the deepest point with a negative or neutral N2 202 203 IF( ikup == ikdown ) CALL ctl_stop( 'tra_npc : PROBLEM #2') … … 224 225 zvab(jk,jp_sal) = zbeta 225 226 END DO 226 227 227 228 228 229 !! Updating N2 in the relvant portion of the water column 229 230 !! Temperature, Salinity, Alpha and Beta have been homogenized in the unstable portion 230 231 !! => Need to re-compute N2! will use Alpha and Beta! 231 232 232 233 ikup = MAX(2,ikup) ! ikup can never be 1 ! 233 234 ik_low = MIN(ikdown+1,ikbot) ! we must go 1 point deeper than ikdown! 234 235 235 236 DO jk = ikup, ik_low ! we must go 1 point deeper than ikdown! 236 237 … … 252 253 253 254 END DO 254 255 255 256 ikp = MIN(ikdown+1,ikbot) 256 257 257 258 258 259 ENDIF !IF( zvn2(ikp) < 0. ) … … 264 265 265 266 IF( ikp /= ikbot ) CALL ctl_stop( 'tra_npc : PROBLEM #3') 266 267 267 268 ! ******* At this stage ikp == ikbot ! ******* 268 269 269 270 IF( ilayer > 0 ) THEN !! least an unstable layer has been found 270 271 !
Note: See TracChangeset
for help on using the changeset viewer.