Changeset 10965
- Timestamp:
- 2019-05-10T18:02:51+02:00 (5 years ago)
- Location:
- NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/OCE
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/OCE/C1D/step_c1d.F90
r10068 r10965 14 14 !!---------------------------------------------------------------------- 15 15 USE step_oce ! time stepping definition modules 16 USE step, ONLY : Nbb, Nnn, Naa, Nrhs ! time level indices 16 17 #if defined key_top 17 18 USE trcstp ! passive tracer time-stepping (trc_stp routine) … … 85 86 ! diagnostics and outputs (ua, va, ta, sa used as workspace) 86 87 !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 87 CALL dia_wri( kstp )! ocean model: outputs88 IF( lk_diahth ) CALL dia_hth( kstp )! Thermocline depth (20°C)88 CALL dia_wri( kstp, Nnn ) ! ocean model: outputs 89 IF( lk_diahth ) CALL dia_hth( kstp, Nnn ) ! Thermocline depth (20°C) 89 90 90 91 -
NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/OCE/DIA/dia25h.F90
r10641 r10965 39 39 CONTAINS 40 40 41 SUBROUTINE dia_25h_init 41 SUBROUTINE dia_25h_init( Kbb ) 42 42 !!--------------------------------------------------------------------------- 43 43 !! *** ROUTINE dia_25h_init *** … … 47 47 !! ** Method : Read namelist 48 48 !!--------------------------------------------------------------------------- 49 INTEGER, INTENT(in) :: Kbb ! Time level index 50 ! 49 51 INTEGER :: ios ! Local integer output status for namelist read 50 52 INTEGER :: ierror ! Local integer for memory allocation … … 95 97 ! ------------------------- ! 96 98 cnt_25h = 1 ! sets the first value of sum at timestep 1 (note - should strictly be at timestep zero so before values used where possible) 97 tn_25h (:,:,:) = ts b (:,:,:,jp_tem)98 sn_25h (:,:,:) = ts b (:,:,:,jp_sal)99 sshn_25h(:,:) = ssh b(:,:)100 un_25h (:,:,:) = u b (:,:,:)101 vn_25h (:,:,:) = v b (:,:,:)99 tn_25h (:,:,:) = ts (:,:,:,jp_tem,Kbb) 100 sn_25h (:,:,:) = ts (:,:,:,jp_sal,Kbb) 101 sshn_25h(:,:) = ssh(:,:,Kbb) 102 un_25h (:,:,:) = uu (:,:,:,Kbb) 103 vn_25h (:,:,:) = vv (:,:,:,Kbb) 102 104 avt_25h (:,:,:) = avt (:,:,:) 103 105 avm_25h (:,:,:) = avm (:,:,:) … … 116 118 117 119 118 SUBROUTINE dia_25h( kt )120 SUBROUTINE dia_25h( kt, Kmm ) 119 121 !!---------------------------------------------------------------------- 120 122 !! *** ROUTINE dia_25h *** … … 125 127 !!---------------------------------------------------------------------- 126 128 INTEGER, INTENT(in) :: kt ! ocean time-step index 129 INTEGER, INTENT(in) :: Kmm ! ocean time level index 127 130 !! 128 131 INTEGER :: ji, jj, jk … … 150 153 ! wn_25h could not be initialised in dia_25h_init, so we do it here instead 151 154 IF( kt == nn_it000 ) THEN 152 wn_25h(:,:,:) = w n(:,:,:)155 wn_25h(:,:,:) = ww(:,:,:) 153 156 ENDIF 154 157 … … 161 164 ENDIF 162 165 163 tn_25h (:,:,:) = tn_25h (:,:,:) + ts n (:,:,:,jp_tem)164 sn_25h (:,:,:) = sn_25h (:,:,:) + ts n (:,:,:,jp_sal)165 sshn_25h(:,:) = sshn_25h(:,:) + ssh n(:,:)166 un_25h (:,:,:) = un_25h (:,:,:) + u n (:,:,:)167 vn_25h (:,:,:) = vn_25h (:,:,:) + v n (:,:,:)168 wn_25h (:,:,:) = wn_25h (:,:,:) + w n(:,:,:)166 tn_25h (:,:,:) = tn_25h (:,:,:) + ts (:,:,:,jp_tem,Kmm) 167 sn_25h (:,:,:) = sn_25h (:,:,:) + ts (:,:,:,jp_sal,Kmm) 168 sshn_25h(:,:) = sshn_25h(:,:) + ssh(:,:,Kmm) 169 un_25h (:,:,:) = un_25h (:,:,:) + uu (:,:,:,Kmm) 170 vn_25h (:,:,:) = vn_25h (:,:,:) + vv (:,:,:,Kmm) 171 wn_25h (:,:,:) = wn_25h (:,:,:) + ww (:,:,:) 169 172 avt_25h (:,:,:) = avt_25h (:,:,:) + avt (:,:,:) 170 173 avm_25h (:,:,:) = avm_25h (:,:,:) + avm (:,:,:) … … 245 248 ! 246 249 ! After the write reset the values to cnt=1 and sum values equal current value 247 tn_25h (:,:,:) = ts n (:,:,:,jp_tem)248 sn_25h (:,:,:) = ts n (:,:,:,jp_sal)249 sshn_25h(:,:) = ssh n(:,:)250 un_25h (:,:,:) = u n (:,:,:)251 vn_25h (:,:,:) = v n (:,:,:)252 wn_25h (:,:,:) = w n(:,:,:)250 tn_25h (:,:,:) = ts (:,:,:,jp_tem,Kmm) 251 sn_25h (:,:,:) = ts (:,:,:,jp_sal,Kmm) 252 sshn_25h(:,:) = ssh(:,:,Kmm) 253 un_25h (:,:,:) = uu (:,:,:,Kmm) 254 vn_25h (:,:,:) = vv (:,:,:,Kmm) 255 wn_25h (:,:,:) = ww (:,:,:) 253 256 avt_25h (:,:,:) = avt (:,:,:) 254 257 avm_25h (:,:,:) = avm (:,:,:) -
NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/OCE/DIA/diaar5.F90
r10425 r10965 62 62 63 63 64 SUBROUTINE dia_ar5( kt )64 SUBROUTINE dia_ar5( kt, Kmm ) 65 65 !!---------------------------------------------------------------------- 66 66 !! *** ROUTINE dia_ar5 *** … … 70 70 ! 71 71 INTEGER, INTENT( in ) :: kt ! ocean time-step index 72 INTEGER, INTENT( in ) :: Kmm ! ocean time level index 72 73 ! 73 74 INTEGER :: ji, jj, jk ! dummy loop arguments … … 89 90 ALLOCATE( zrhd(jpi,jpj,jpk) , zrhop(jpi,jpj,jpk) ) 90 91 ALLOCATE( ztsn(jpi,jpj,jpk,jpts) ) 91 zarea_ssh(:,:) = area(:,:) * ssh n(:,:)92 zarea_ssh(:,:) = area(:,:) * ssh(:,:,Kmm) 92 93 ENDIF 93 94 ! … … 100 101 CALL iom_put( 'voltot', zvol ) 101 102 CALL iom_put( 'sshtot', zvolssh / area_tot ) 102 CALL iom_put( 'sshdyn', ssh n(:,:) - (zvolssh / area_tot) )103 CALL iom_put( 'sshdyn', ssh(:,:,Kmm) - (zvolssh / area_tot) ) 103 104 ! 104 105 ENDIF … … 106 107 IF( iom_use( 'botpres' ) .OR. iom_use( 'sshthster' ) .OR. iom_use( 'sshsteric' ) ) THEN 107 108 ! 108 ztsn(:,:,:,jp_tem) = ts n(:,:,:,jp_tem) ! thermosteric ssh109 ztsn(:,:,:,jp_tem) = ts(:,:,:,jp_tem,Kmm) ! thermosteric ssh 109 110 ztsn(:,:,:,jp_sal) = sn0(:,:,:) 110 CALL eos( ztsn, zrhd, gdept _n(:,:,:) ) ! now in situ density using initial salinity111 CALL eos( ztsn, zrhd, gdept(:,:,:,Kmm) ) ! now in situ density using initial salinity 111 112 ! 112 113 zbotpres(:,:) = 0._wp ! no atmospheric surface pressure, levitating sea-ice 113 114 DO jk = 1, jpkm1 114 zbotpres(:,:) = zbotpres(:,:) + e3t _n(:,:,jk) * zrhd(:,:,jk)115 zbotpres(:,:) = zbotpres(:,:) + e3t(:,:,jk,Kmm) * zrhd(:,:,jk) 115 116 END DO 116 117 IF( ln_linssh ) THEN … … 118 119 DO ji = 1, jpi 119 120 DO jj = 1, jpj 120 zbotpres(ji,jj) = zbotpres(ji,jj) + ssh n(ji,jj) * zrhd(ji,jj,mikt(ji,jj)) + riceload(ji,jj)121 zbotpres(ji,jj) = zbotpres(ji,jj) + ssh(ji,jj,Kmm) * zrhd(ji,jj,mikt(ji,jj)) + riceload(ji,jj) 121 122 END DO 122 123 END DO 123 124 ELSE 124 zbotpres(:,:) = zbotpres(:,:) + ssh n(:,:) * zrhd(:,:,1)125 zbotpres(:,:) = zbotpres(:,:) + ssh(:,:,Kmm) * zrhd(:,:,1) 125 126 END IF 126 127 !!gm … … 135 136 136 137 ! ! steric sea surface height 137 CALL eos( ts n, zrhd, zrhop, gdept_n(:,:,:) ) ! now in situ and potential density138 CALL eos( ts(:,:,:,:,Kmm), zrhd, zrhop, gdept(:,:,:,Kmm) ) ! now in situ and potential density 138 139 zrhop(:,:,jpk) = 0._wp 139 140 CALL iom_put( 'rhop', zrhop ) … … 141 142 zbotpres(:,:) = 0._wp ! no atmospheric surface pressure, levitating sea-ice 142 143 DO jk = 1, jpkm1 143 zbotpres(:,:) = zbotpres(:,:) + e3t _n(:,:,jk) * zrhd(:,:,jk)144 zbotpres(:,:) = zbotpres(:,:) + e3t(:,:,jk,Kmm) * zrhd(:,:,jk) 144 145 END DO 145 146 IF( ln_linssh ) THEN … … 147 148 DO ji = 1,jpi 148 149 DO jj = 1,jpj 149 zbotpres(ji,jj) = zbotpres(ji,jj) + ssh n(ji,jj) * zrhd(ji,jj,mikt(ji,jj)) + riceload(ji,jj)150 zbotpres(ji,jj) = zbotpres(ji,jj) + ssh(ji,jj,Kmm) * zrhd(ji,jj,mikt(ji,jj)) + riceload(ji,jj) 150 151 END DO 151 152 END DO 152 153 ELSE 153 zbotpres(:,:) = zbotpres(:,:) + ssh n(:,:) * zrhd(:,:,1)154 zbotpres(:,:) = zbotpres(:,:) + ssh(:,:,Kmm) * zrhd(:,:,1) 154 155 END IF 155 156 END IF … … 162 163 ! ! ocean bottom pressure 163 164 zztmp = rau0 * grav * 1.e-4_wp ! recover pressure from pressure anomaly and cover to dbar = 1.e4 Pa 164 zbotpres(:,:) = zztmp * ( zbotpres(:,:) + ssh n(:,:) + thick0(:,:) )165 zbotpres(:,:) = zztmp * ( zbotpres(:,:) + ssh(:,:,Kmm) + thick0(:,:) ) 165 166 CALL iom_put( 'botpres', zbotpres ) 166 167 ! … … 174 175 DO jj = 1, jpj 175 176 DO ji = 1, jpi 176 zztmp = area(ji,jj) * e3t _n(ji,jj,jk)177 ztemp = ztemp + zztmp * ts n(ji,jj,jk,jp_tem)178 zsal = zsal + zztmp * ts n(ji,jj,jk,jp_sal)177 zztmp = area(ji,jj) * e3t(ji,jj,jk,Kmm) 178 ztemp = ztemp + zztmp * ts(ji,jj,jk,jp_tem,Kmm) 179 zsal = zsal + zztmp * ts(ji,jj,jk,jp_sal,Kmm) 179 180 END DO 180 181 END DO … … 184 185 DO ji = 1, jpi 185 186 DO jj = 1, jpj 186 ztemp = ztemp + zarea_ssh(ji,jj) * ts n(ji,jj,mikt(ji,jj),jp_tem)187 zsal = zsal + zarea_ssh(ji,jj) * ts n(ji,jj,mikt(ji,jj),jp_sal)187 ztemp = ztemp + zarea_ssh(ji,jj) * ts(ji,jj,mikt(ji,jj),jp_tem,Kmm) 188 zsal = zsal + zarea_ssh(ji,jj) * ts(ji,jj,mikt(ji,jj),jp_sal,Kmm) 188 189 END DO 189 190 END DO 190 191 ELSE 191 ztemp = ztemp + SUM( zarea_ssh(:,:) * ts n(:,:,1,jp_tem) )192 zsal = zsal + SUM( zarea_ssh(:,:) * ts n(:,:,1,jp_sal) )192 ztemp = ztemp + SUM( zarea_ssh(:,:) * ts(:,:,1,jp_tem,Kmm) ) 193 zsal = zsal + SUM( zarea_ssh(:,:) * ts(:,:,1,jp_sal,Kmm) ) 193 194 END IF 194 195 ENDIF … … 219 220 DO ji = 1, jpi 220 221 IF( rn2(ji,jj,jk) > 0._wp ) THEN 221 zrw = ( gdepw _n(ji,jj,jk ) - gdept_n(ji,jj,jk) ) &222 & / ( gdept _n(ji,jj,jk-1) - gdept_n(ji,jj,jk) )222 zrw = ( gdepw(ji,jj,jk ,Kmm) - gdept(ji,jj,jk,Kmm) ) & 223 & / ( gdept(ji,jj,jk-1,Kmm) - gdept(ji,jj,jk,Kmm) ) 223 224 !!gm this can be reduced to : (depw-dept) / e3w (NB idem dans bn2 !) 224 ! zrw = ( gdept _n(ji,jj,jk) - gdepw_n(ji,jj,jk) ) / e3w_n(ji,jj,jk)225 ! zrw = ( gdept(ji,jj,jk,Kmm) - gdepw(ji,jj,jk,Kmm) ) / e3w(ji,jj,jk,Kmm) 225 226 !!gm end 226 227 ! … … 229 230 ! 230 231 zpe(ji, jj) = zpe(ji, jj) & 231 & - grav * ( avt(ji,jj,jk) * zaw * (ts n(ji,jj,jk-1,jp_tem) - tsn(ji,jj,jk,jp_tem) ) &232 & - avs(ji,jj,jk) * zbw * (ts n(ji,jj,jk-1,jp_sal) - tsn(ji,jj,jk,jp_sal) ) )232 & - grav * ( avt(ji,jj,jk) * zaw * (ts(ji,jj,jk-1,jp_tem,Kmm) - ts(ji,jj,jk,jp_tem,Kmm) ) & 233 & - avs(ji,jj,jk) * zbw * (ts(ji,jj,jk-1,jp_sal,Kmm) - ts(ji,jj,jk,jp_sal,Kmm) ) ) 233 234 ENDIF 234 235 END DO … … 239 240 DO ji = 1, jpi 240 241 DO jj = 1, jpj 241 zpe(ji,jj) = zpe(ji,jj) + avt(ji, jj, jk) * MIN(0._wp,rn2(ji, jj, jk)) * rau0 * e3w _n(ji, jj, jk)242 zpe(ji,jj) = zpe(ji,jj) + avt(ji, jj, jk) * MIN(0._wp,rn2(ji, jj, jk)) * rau0 * e3w(ji, jj, jk,Kmm) 242 243 END DO 243 244 END DO … … 261 262 262 263 263 SUBROUTINE dia_ar5_hst( ktra, cptr, pu a, pva)264 SUBROUTINE dia_ar5_hst( ktra, cptr, puflx, pvflx ) 264 265 !!---------------------------------------------------------------------- 265 266 !! *** ROUTINE dia_ar5_htr *** … … 270 271 INTEGER , INTENT(in ) :: ktra ! tracer index 271 272 CHARACTER(len=3) , INTENT(in) :: cptr ! transport type 'adv'/'ldf' 272 REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in) :: pu a ! 3D input arrayof advection/diffusion273 REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in) :: pv a ! 3D input arrayof advection/diffusion273 REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in) :: puflx ! u-flux of advection/diffusion 274 REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in) :: pvflx ! v-flux of advection/diffusion 274 275 ! 275 276 INTEGER :: ji, jj, jk … … 277 278 278 279 279 z2d(:,:) = pu a(:,:,1)280 z2d(:,:) = puflx(:,:,1) 280 281 DO jk = 1, jpkm1 281 282 DO jj = 2, jpjm1 282 283 DO ji = fs_2, fs_jpim1 ! vector opt. 283 z2d(ji,jj) = z2d(ji,jj) + pu a(ji,jj,jk)284 z2d(ji,jj) = z2d(ji,jj) + puflx(ji,jj,jk) 284 285 END DO 285 286 END DO … … 295 296 ENDIF 296 297 ! 297 z2d(:,:) = pv a(:,:,1)298 z2d(:,:) = pvflx(:,:,1) 298 299 DO jk = 1, jpkm1 299 300 DO jj = 2, jpjm1 300 301 DO ji = fs_2, fs_jpim1 ! vector opt. 301 z2d(ji,jj) = z2d(ji,jj) + pv a(ji,jj,jk)302 z2d(ji,jj) = z2d(ji,jj) + pvflx(ji,jj,jk) 302 303 END DO 303 304 END DO -
NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/OCE/DIA/diacfl.F90
r10425 r10965 45 45 CONTAINS 46 46 47 SUBROUTINE dia_cfl ( kt )47 SUBROUTINE dia_cfl ( kt, Kmm ) 48 48 !!---------------------------------------------------------------------- 49 49 !! *** ROUTINE dia_cfl *** … … 53 53 !!---------------------------------------------------------------------- 54 54 INTEGER, INTENT(in) :: kt ! ocean time-step index 55 INTEGER, INTENT(in) :: Kmm ! ocean time level index 55 56 ! 56 57 INTEGER :: ji, jj, jk ! dummy loop indices … … 71 72 DO jj = 1, jpj 72 73 DO ji = 1, fs_jpim1 ! vector opt. 73 zCu_cfl(ji,jj,jk) = ABS( u n(ji,jj,jk) ) * z2dt / e1u (ji,jj) ! for i-direction74 zCv_cfl(ji,jj,jk) = ABS( v n(ji,jj,jk) ) * z2dt / e2v (ji,jj) ! for j-direction75 zCw_cfl(ji,jj,jk) = ABS( w n(ji,jj,jk) ) * z2dt / e3w_n(ji,jj,jk) ! for k-direction74 zCu_cfl(ji,jj,jk) = ABS( uu(ji,jj,jk,Kmm) ) * z2dt / e1u (ji,jj) ! for i-direction 75 zCv_cfl(ji,jj,jk) = ABS( vv(ji,jj,jk,Kmm) ) * z2dt / e2v (ji,jj) ! for j-direction 76 zCw_cfl(ji,jj,jk) = ABS( ww(ji,jj,jk) ) * z2dt / e3w(ji,jj,jk,Kmm) ! for k-direction 76 77 END DO 77 78 END DO -
NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/OCE/DIA/diadct.F90
r10425 r10965 178 178 179 179 180 SUBROUTINE dia_dct( kt )180 SUBROUTINE dia_dct( kt, Kmm ) 181 181 !!--------------------------------------------------------------------- 182 182 !! *** ROUTINE diadct *** … … 195 195 !! Reinitialise all relevant arrays to zero 196 196 !!--------------------------------------------------------------------- 197 INTEGER, INTENT(in) :: kt 197 INTEGER, INTENT(in) :: kt ! ocean time step 198 INTEGER, INTENT(in) :: Kmm ! time level index 198 199 ! 199 200 INTEGER :: jsec ! loop on sections … … 235 236 236 237 !Compute transport through section 237 CALL transport( secs(jsec),lldebug,jsec)238 CALL transport(Kmm,secs(jsec),lldebug,jsec) 238 239 239 240 ENDDO … … 249 250 ! Sum over each class 250 251 DO jsec=1,nb_sec 251 CALL dia_dct_sum( secs(jsec),jsec)252 CALL dia_dct_sum(Kmm,secs(jsec),jsec) 252 253 ENDDO 253 254 … … 561 562 562 563 563 SUBROUTINE transport( sec,ld_debug,jsec)564 SUBROUTINE transport(Kmm,sec,ld_debug,jsec) 564 565 !!------------------------------------------------------------------------------------------- 565 566 !! *** ROUTINE transport *** … … 581 582 !! 582 583 !!------------------------------------------------------------------------------------------- 584 INTEGER ,INTENT(IN) :: Kmm ! time level index 583 585 TYPE(SECTION),INTENT(INOUT) :: sec 584 586 LOGICAL ,INTENT(IN) :: ld_debug … … 676 678 SELECT CASE( sec%direction(jseg) ) 677 679 CASE(0,1) 678 ztn = interp( k%I,k%J,jk,'V',tsn(:,:,:,jp_tem) )679 zsn = interp( k%I,k%J,jk,'V',tsn(:,:,:,jp_sal) )680 zrhop = interp( k%I,k%J,jk,'V',rhop)681 zrhoi = interp( k%I,k%J,jk,'V',rhd*rau0+rau0)682 zsshn = 0.5*( ssh n(k%I,k%J) + sshn(k%I,k%J+1) ) * vmask(k%I,k%J,1)680 ztn = interp(Kmm,k%I,k%J,jk,'V',ts(:,:,:,jp_tem,Kmm) ) 681 zsn = interp(Kmm,k%I,k%J,jk,'V',ts(:,:,:,jp_sal,Kmm) ) 682 zrhop = interp(Kmm,k%I,k%J,jk,'V',rhop) 683 zrhoi = interp(Kmm,k%I,k%J,jk,'V',rhd*rau0+rau0) 684 zsshn = 0.5*( ssh(k%I,k%J,Kmm) + ssh(k%I,k%J+1,Kmm) ) * vmask(k%I,k%J,1) 683 685 CASE(2,3) 684 ztn = interp( k%I,k%J,jk,'U',tsn(:,:,:,jp_tem) )685 zsn = interp( k%I,k%J,jk,'U',tsn(:,:,:,jp_sal) )686 zrhop = interp( k%I,k%J,jk,'U',rhop)687 zrhoi = interp( k%I,k%J,jk,'U',rhd*rau0+rau0)688 zsshn = 0.5*( ssh n(k%I,k%J) + sshn(k%I+1,k%J) ) * umask(k%I,k%J,1)686 ztn = interp(Kmm,k%I,k%J,jk,'U',ts(:,:,:,jp_tem,Kmm) ) 687 zsn = interp(Kmm,k%I,k%J,jk,'U',ts(:,:,:,jp_sal,Kmm) ) 688 zrhop = interp(Kmm,k%I,k%J,jk,'U',rhop) 689 zrhoi = interp(Kmm,k%I,k%J,jk,'U',rhd*rau0+rau0) 690 zsshn = 0.5*( ssh(k%I,k%J,Kmm) + ssh(k%I+1,k%J,Kmm) ) * umask(k%I,k%J,1) 689 691 END SELECT 690 692 ! 691 zdep= gdept _n(k%I,k%J,jk)693 zdep= gdept(k%I,k%J,jk,Kmm) 692 694 693 695 SELECT CASE( sec%direction(jseg) ) !compute velocity with the correct direction 694 696 CASE(0,1) 695 697 zumid=0._wp 696 zvmid=isgnv*v n(k%I,k%J,jk)*vmask(k%I,k%J,jk)698 zvmid=isgnv*vv(k%I,k%J,jk,Kmm)*vmask(k%I,k%J,jk) 697 699 CASE(2,3) 698 zumid=isgnu*u n(k%I,k%J,jk)*umask(k%I,k%J,jk)700 zumid=isgnu*uu(k%I,k%J,jk,Kmm)*umask(k%I,k%J,jk) 699 701 zvmid=0._wp 700 702 END SELECT … … 702 704 !zTnorm=transport through one cell; 703 705 !velocity* cell's length * cell's thickness 704 zTnorm = zumid*e2u(k%I,k%J) * e3u _n(k%I,k%J,jk) &705 & + zvmid*e1v(k%I,k%J) * e3v _n(k%I,k%J,jk)706 zTnorm = zumid*e2u(k%I,k%J) * e3u(k%I,k%J,jk,Kmm) & 707 & + zvmid*e1v(k%I,k%J) * e3v(k%I,k%J,jk,Kmm) 706 708 707 709 !!gm THIS is WRONG no transport due to ssh in linear free surface case !!!!! … … 768 770 769 771 770 SUBROUTINE dia_dct_sum( sec,jsec)772 SUBROUTINE dia_dct_sum(Kmm,sec,jsec) 771 773 !!------------------------------------------------------------- 772 774 !! Purpose: Average the transport over nn_dctwri time steps … … 787 789 !! 788 790 !!------------------------------------------------------------- 791 INTEGER ,INTENT(IN) :: Kmm ! time level index 789 792 TYPE(SECTION),INTENT(INOUT) :: sec 790 793 INTEGER ,INTENT(IN) :: jsec ! numeric identifier of section … … 848 851 SELECT CASE( sec%direction(jseg) ) 849 852 CASE(0,1) 850 ztn = interp( k%I,k%J,jk,'V',tsn(:,:,:,jp_tem) )851 zsn = interp( k%I,k%J,jk,'V',tsn(:,:,:,jp_sal) )852 zrhop = interp( k%I,k%J,jk,'V',rhop)853 zrhoi = interp( k%I,k%J,jk,'V',rhd*rau0+rau0)853 ztn = interp(Kmm,k%I,k%J,jk,'V',ts(:,:,:,jp_tem,Kmm) ) 854 zsn = interp(Kmm,k%I,k%J,jk,'V',ts(:,:,:,jp_sal,Kmm) ) 855 zrhop = interp(Kmm,k%I,k%J,jk,'V',rhop) 856 zrhoi = interp(Kmm,k%I,k%J,jk,'V',rhd*rau0+rau0) 854 857 855 858 CASE(2,3) 856 ztn = interp( k%I,k%J,jk,'U',tsn(:,:,:,jp_tem) )857 zsn = interp( k%I,k%J,jk,'U',tsn(:,:,:,jp_sal) )858 zrhop = interp( k%I,k%J,jk,'U',rhop)859 zrhoi = interp( k%I,k%J,jk,'U',rhd*rau0+rau0)860 zsshn = 0.5*( ssh n(k%I,k%J) + sshn(k%I+1,k%J) ) * umask(k%I,k%J,1)859 ztn = interp(Kmm,k%I,k%J,jk,'U',ts(:,:,:,jp_tem,Kmm) ) 860 zsn = interp(Kmm,k%I,k%J,jk,'U',ts(:,:,:,jp_sal,Kmm) ) 861 zrhop = interp(Kmm,k%I,k%J,jk,'U',rhop) 862 zrhoi = interp(Kmm,k%I,k%J,jk,'U',rhd*rau0+rau0) 863 zsshn = 0.5*( ssh(k%I,k%J,Kmm) + ssh(k%I+1,k%J,Kmm) ) * umask(k%I,k%J,1) 861 864 END SELECT 862 865 863 zdep= gdept _n(k%I,k%J,jk)866 zdep= gdept(k%I,k%J,jk,Kmm) 864 867 865 868 !------------------------------- … … 1104 1107 1105 1108 1106 FUNCTION interp( ki, kj, kk, cd_point, ptab)1109 FUNCTION interp(Kmm, ki, kj, kk, cd_point, ptab) 1107 1110 !!---------------------------------------------------------------------- 1108 1111 !! … … 1165 1168 !!---------------------------------------------------------------------- 1166 1169 !*arguments 1170 INTEGER, INTENT(IN) :: Kmm ! time level index 1167 1171 INTEGER, INTENT(IN) :: ki, kj, kk ! coordinate of point 1168 1172 CHARACTER(len=1), INTENT(IN) :: cd_point ! type of point (U, V) … … 1199 1203 IF( ln_sco )THEN ! s-coordinate case 1200 1204 1201 zdepu = ( gdept _n(ii1,ij1,kk) + gdept_n(ii2,ij2,kk) ) * 0.5_wp1202 zdep1 = gdept _n(ii1,ij1,kk) - zdepu1203 zdep2 = gdept _n(ii2,ij2,kk) - zdepu1205 zdepu = ( gdept(ii1,ij1,kk,Kmm) + gdept(ii2,ij2,kk,Kmm) ) * 0.5_wp 1206 zdep1 = gdept(ii1,ij1,kk,Kmm) - zdepu 1207 zdep2 = gdept(ii2,ij2,kk,Kmm) - zdepu 1204 1208 1205 1209 ! weights … … 1213 1217 ELSE ! full step or partial step case 1214 1218 1215 ze3t = e3t _n(ii2,ij2,kk) - e3t_n(ii1,ij1,kk)1216 zwgt1 = ( e3w _n(ii2,ij2,kk) - e3w_n(ii1,ij1,kk) ) / e3w_n(ii2,ij2,kk)1217 zwgt2 = ( e3w _n(ii1,ij1,kk) - e3w_n(ii2,ij2,kk) ) / e3w_n(ii1,ij1,kk)1219 ze3t = e3t(ii2,ij2,kk,Kmm) - e3t(ii1,ij1,kk,Kmm) 1220 zwgt1 = ( e3w(ii2,ij2,kk,Kmm) - e3w(ii1,ij1,kk,Kmm) ) / e3w(ii2,ij2,kk,Kmm) 1221 zwgt2 = ( e3w(ii1,ij1,kk,Kmm) - e3w(ii2,ij2,kk,Kmm) ) / e3w(ii1,ij1,kk,Kmm) 1218 1222 1219 1223 IF(kk .NE. 1)THEN … … 1253 1257 END SUBROUTINE dia_dct_init 1254 1258 1255 SUBROUTINE dia_dct( kt ) ! Dummy routine1259 SUBROUTINE dia_dct( kt, Kmm ) ! Dummy routine 1256 1260 IMPLICIT NONE 1257 1261 INTEGER, INTENT( in ) :: kt ! ocean time-step index 1262 INTEGER, INTENT( in ) :: Kmm ! ocean time level index 1258 1263 WRITE(*,*) 'dia_dct: You should not have seen this print! error?', kt 1259 1264 END SUBROUTINE dia_dct -
NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/OCE/DIA/diaharm.F90
r10425 r10965 162 162 163 163 164 SUBROUTINE dia_harm ( kt )164 SUBROUTINE dia_harm ( kt, Kmm ) 165 165 !!---------------------------------------------------------------------- 166 166 !! *** ROUTINE dia_harm *** … … 172 172 !!-------------------------------------------------------------------- 173 173 INTEGER, INTENT( IN ) :: kt 174 INTEGER, INTENT( IN ) :: Kmm ! time level index 174 175 ! 175 176 INTEGER :: ji, jj, jh, jc, nhc … … 194 195 DO ji = 1,jpi 195 196 ! Elevation 196 ana_temp(ji,jj,nhc,1) = ana_temp(ji,jj,nhc,1) + ztemp*ssh n(ji,jj)*ssmask (ji,jj)197 ana_temp(ji,jj,nhc,2) = ana_temp(ji,jj,nhc,2) + ztemp*u n_b(ji,jj)*ssumask(ji,jj)198 ana_temp(ji,jj,nhc,3) = ana_temp(ji,jj,nhc,3) + ztemp*v n_b(ji,jj)*ssvmask(ji,jj)197 ana_temp(ji,jj,nhc,1) = ana_temp(ji,jj,nhc,1) + ztemp*ssh(ji,jj,Kmm)*ssmask (ji,jj) 198 ana_temp(ji,jj,nhc,2) = ana_temp(ji,jj,nhc,2) + ztemp*uu_b(ji,jj,Kmm)*ssumask(ji,jj) 199 ana_temp(ji,jj,nhc,3) = ana_temp(ji,jj,nhc,3) + ztemp*vv_b(ji,jj,Kmm)*ssvmask(ji,jj) 199 200 END DO 200 201 END DO … … 521 522 LOGICAL, PUBLIC, PARAMETER :: lk_diaharm = .FALSE. 522 523 CONTAINS 523 SUBROUTINE dia_harm ( kt ) ! Empty routine524 SUBROUTINE dia_harm ( kt, Kmm ) ! Empty routine 524 525 INTEGER, INTENT( IN ) :: kt 526 INTEGER, INTENT( IN ) :: Kmm 525 527 WRITE(*,*) 'dia_harm: you should not have seen this print' 526 528 END SUBROUTINE dia_harm -
NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/OCE/DIA/diahsb.F90
r10425 r10965 58 58 CONTAINS 59 59 60 SUBROUTINE dia_hsb( kt )60 SUBROUTINE dia_hsb( kt, Kbb, Kmm ) 61 61 !!--------------------------------------------------------------------------- 62 62 !! *** ROUTINE dia_hsb *** … … 69 69 !! 70 70 !!--------------------------------------------------------------------------- 71 INTEGER, INTENT(in) :: kt ! ocean time-step index 71 INTEGER, INTENT(in) :: kt ! ocean time-step index 72 INTEGER, INTENT(in) :: Kbb, Kmm ! ocean time level indices 72 73 ! 73 74 INTEGER :: ji, jj, jk ! dummy loop indice … … 86 87 IF( ln_timing ) CALL timing_start('dia_hsb') 87 88 ! 88 ts n(:,:,:,1) = tsn(:,:,:,1) * tmask(:,:,:) ; tsb(:,:,:,1) = tsb(:,:,:,1) * tmask(:,:,:) ;89 ts n(:,:,:,2) = tsn(:,:,:,2) * tmask(:,:,:) ; tsb(:,:,:,2) = tsb(:,:,:,2) * tmask(:,:,:) ;89 ts(:,:,:,1,Kmm) = ts(:,:,:,1,Kmm) * tmask(:,:,:) ; ts(:,:,:,1,Kbb) = ts(:,:,:,1,Kbb) * tmask(:,:,:) ; 90 ts(:,:,:,2,Kmm) = ts(:,:,:,2,Kmm) * tmask(:,:,:) ; ts(:,:,:,2,Kbb) = ts(:,:,:,2,Kbb) * tmask(:,:,:) ; 90 91 ! ------------------------- ! 91 92 ! 1 - Trends due to forcing ! … … 108 109 DO ji=1,jpi 109 110 DO jj=1,jpj 110 z2d0(ji,jj) = surf(ji,jj) * w n(ji,jj,mikt(ji,jj)) * tsb(ji,jj,mikt(ji,jj),jp_tem)111 z2d1(ji,jj) = surf(ji,jj) * w n(ji,jj,mikt(ji,jj)) * tsb(ji,jj,mikt(ji,jj),jp_sal)111 z2d0(ji,jj) = surf(ji,jj) * ww(ji,jj,mikt(ji,jj)) * ts(ji,jj,mikt(ji,jj),jp_tem,Kbb) 112 z2d1(ji,jj) = surf(ji,jj) * ww(ji,jj,mikt(ji,jj)) * ts(ji,jj,mikt(ji,jj),jp_sal,Kbb) 112 113 END DO 113 114 END DO 114 115 ELSE 115 z2d0(:,:) = surf(:,:) * w n(:,:,1) * tsb(:,:,1,jp_tem)116 z2d1(:,:) = surf(:,:) * w n(:,:,1) * tsb(:,:,1,jp_sal)116 z2d0(:,:) = surf(:,:) * ww(:,:,1) * ts(:,:,1,jp_tem,Kbb) 117 z2d1(:,:) = surf(:,:) * ww(:,:,1) * ts(:,:,1,jp_sal,Kbb) 117 118 END IF 118 119 z_wn_trd_t = - glob_sum( 'diahsb', z2d0 ) … … 135 136 136 137 ! ! volume variation (calculated with ssh) 137 zdiff_v1 = glob_sum_full( 'diahsb', surf(:,:)*ssh n(:,:) - surf_ini(:,:)*ssh_ini(:,:) )138 zdiff_v1 = glob_sum_full( 'diahsb', surf(:,:)*ssh(:,:,Kmm) - surf_ini(:,:)*ssh_ini(:,:) ) 138 139 139 140 ! ! heat & salt content variation (associated with ssh) … … 142 143 DO ji = 1, jpi 143 144 DO jj = 1, jpj 144 z2d0(ji,jj) = surf(ji,jj) * ( ts n(ji,jj,mikt(ji,jj),jp_tem) * sshn(ji,jj) - ssh_hc_loc_ini(ji,jj) )145 z2d1(ji,jj) = surf(ji,jj) * ( ts n(ji,jj,mikt(ji,jj),jp_sal) * sshn(ji,jj) - ssh_sc_loc_ini(ji,jj) )145 z2d0(ji,jj) = surf(ji,jj) * ( ts(ji,jj,mikt(ji,jj),jp_tem,Kmm) * ssh(ji,jj,Kmm) - ssh_hc_loc_ini(ji,jj) ) 146 z2d1(ji,jj) = surf(ji,jj) * ( ts(ji,jj,mikt(ji,jj),jp_sal,Kmm) * ssh(ji,jj,Kmm) - ssh_sc_loc_ini(ji,jj) ) 146 147 END DO 147 148 END DO 148 149 ELSE ! no under ice-shelf seas 149 z2d0(:,:) = surf(:,:) * ( ts n(:,:,1,jp_tem) * sshn(:,:) - ssh_hc_loc_ini(:,:) )150 z2d1(:,:) = surf(:,:) * ( ts n(:,:,1,jp_sal) * sshn(:,:) - ssh_sc_loc_ini(:,:) )150 z2d0(:,:) = surf(:,:) * ( ts(:,:,1,jp_tem,Kmm) * ssh(:,:,Kmm) - ssh_hc_loc_ini(:,:) ) 151 z2d1(:,:) = surf(:,:) * ( ts(:,:,1,jp_sal,Kmm) * ssh(:,:,Kmm) - ssh_sc_loc_ini(:,:) ) 151 152 END IF 152 153 z_ssh_hc = glob_sum_full( 'diahsb', z2d0 ) … … 155 156 ! 156 157 DO jk = 1, jpkm1 ! volume variation (calculated with scale factors) 157 zwrk(:,:,jk) = ( surf(:,:)*e3t _n(:,:,jk) - surf_ini(:,:)*e3t_ini(:,:,jk) ) * tmask(:,:,jk)158 zwrk(:,:,jk) = ( surf(:,:)*e3t(:,:,jk,Kmm) - surf_ini(:,:)*e3t_ini(:,:,jk) ) * tmask(:,:,jk) 158 159 END DO 159 160 zdiff_v2 = glob_sum_full( 'diahsb', zwrk(:,:,:) ) 160 161 DO jk = 1, jpkm1 ! heat content variation 161 zwrk(:,:,jk) = ( surf(:,:)*e3t _n(:,:,jk)*tsn(:,:,jk,jp_tem) - surf_ini(:,:)*hc_loc_ini(:,:,jk) ) * tmask(:,:,jk)162 zwrk(:,:,jk) = ( surf(:,:)*e3t(:,:,jk,Kmm)*ts(:,:,jk,jp_tem,Kmm) - surf_ini(:,:)*hc_loc_ini(:,:,jk) ) * tmask(:,:,jk) 162 163 END DO 163 164 zdiff_hc = glob_sum_full( 'diahsb', zwrk(:,:,:) ) 164 165 DO jk = 1, jpkm1 ! salt content variation 165 zwrk(:,:,jk) = ( surf(:,:)*e3t _n(:,:,jk)*tsn(:,:,jk,jp_sal) - surf_ini(:,:)*sc_loc_ini(:,:,jk) ) * tmask(:,:,jk)166 zwrk(:,:,jk) = ( surf(:,:)*e3t(:,:,jk,Kmm)*ts(:,:,jk,jp_sal,Kmm) - surf_ini(:,:)*sc_loc_ini(:,:,jk) ) * tmask(:,:,jk) 166 167 END DO 167 168 zdiff_sc = glob_sum_full( 'diahsb', zwrk(:,:,:) ) … … 185 186 ! ----------------------- ! 186 187 DO jk = 1, jpkm1 ! total ocean volume (calculated with scale factors) 187 zwrk(:,:,jk) = surf(:,:) * e3t _n(:,:,jk) * tmask(:,:,jk)188 zwrk(:,:,jk) = surf(:,:) * e3t(:,:,jk,Kmm) * tmask(:,:,jk) 188 189 END DO 189 190 zvol_tot = glob_sum_full( 'diahsb', zwrk(:,:,:) ) … … 191 192 !!gm to be added ? 192 193 ! IF( ln_linssh ) THEN ! fixed volume, add the ssh contribution 193 ! zvol_tot = zvol_tot + glob_sum( 'diahsb', surf(:,:) * ssh n(:,:) )194 ! zvol_tot = zvol_tot + glob_sum( 'diahsb', surf(:,:) * ssh(:,:,Kmm) ) 194 195 ! ENDIF 195 196 !!gm end … … 233 234 ENDIF 234 235 ! 235 IF( lrst_oce ) CALL dia_hsb_rst( kt, 'WRITE' )236 IF( lrst_oce ) CALL dia_hsb_rst( kt, Kmm, 'WRITE' ) 236 237 ! 237 238 IF( ln_timing ) CALL timing_stop('dia_hsb') … … 240 241 241 242 242 SUBROUTINE dia_hsb_rst( kt, cdrw )243 SUBROUTINE dia_hsb_rst( kt, Kmm, cdrw ) 243 244 !!--------------------------------------------------------------------- 244 245 !! *** ROUTINE dia_hsb_rst *** … … 249 250 !!---------------------------------------------------------------------- 250 251 INTEGER , INTENT(in) :: kt ! ocean time-step 252 INTEGER , INTENT(in) :: Kmm ! ocean time level index 251 253 CHARACTER(len=*), INTENT(in) :: cdrw ! "READ"/"WRITE" flag 252 254 ! … … 281 283 IF(lwp) WRITE(numout,*) 282 284 surf_ini(:,:) = e1e2t(:,:) * tmask_i(:,:) ! initial ocean surface 283 ssh_ini(:,:) = ssh n(:,:) ! initial ssh285 ssh_ini(:,:) = ssh(:,:,Kmm) ! initial ssh 284 286 DO jk = 1, jpk 285 287 ! if ice sheet/oceqn coupling, need to mask ini variables here (mask could change at the next NEMO instance). 286 e3t_ini (:,:,jk) = e3t _n(:,:,jk) * tmask(:,:,jk) ! initial vertical scale factors287 hc_loc_ini(:,:,jk) = ts n(:,:,jk,jp_tem) * e3t_n(:,:,jk) * tmask(:,:,jk) ! initial heat content288 sc_loc_ini(:,:,jk) = ts n(:,:,jk,jp_sal) * e3t_n(:,:,jk) * tmask(:,:,jk) ! initial salt content288 e3t_ini (:,:,jk) = e3t(:,:,jk,Kmm) * tmask(:,:,jk) ! initial vertical scale factors 289 hc_loc_ini(:,:,jk) = ts(:,:,jk,jp_tem,Kmm) * e3t(:,:,jk,Kmm) * tmask(:,:,jk) ! initial heat content 290 sc_loc_ini(:,:,jk) = ts(:,:,jk,jp_sal,Kmm) * e3t(:,:,jk,Kmm) * tmask(:,:,jk) ! initial salt content 289 291 END DO 290 292 frc_v = 0._wp ! volume trend due to forcing … … 295 297 DO ji = 1, jpi 296 298 DO jj = 1, jpj 297 ssh_hc_loc_ini(ji,jj) = ts n(ji,jj,mikt(ji,jj),jp_tem) * sshn(ji,jj) ! initial heat content in ssh298 ssh_sc_loc_ini(ji,jj) = ts n(ji,jj,mikt(ji,jj),jp_sal) * sshn(ji,jj) ! initial salt content in ssh299 ssh_hc_loc_ini(ji,jj) = ts(ji,jj,mikt(ji,jj),jp_tem,Kmm) * ssh(ji,jj,Kmm) ! initial heat content in ssh 300 ssh_sc_loc_ini(ji,jj) = ts(ji,jj,mikt(ji,jj),jp_sal,Kmm) * ssh(ji,jj,Kmm) ! initial salt content in ssh 299 301 END DO 300 302 END DO 301 303 ELSE 302 ssh_hc_loc_ini(:,:) = ts n(:,:,1,jp_tem) * sshn(:,:) ! initial heat content in ssh303 ssh_sc_loc_ini(:,:) = ts n(:,:,1,jp_sal) * sshn(:,:) ! initial salt content in ssh304 ssh_hc_loc_ini(:,:) = ts(:,:,1,jp_tem,Kmm) * ssh(:,:,Kmm) ! initial heat content in ssh 305 ssh_sc_loc_ini(:,:) = ts(:,:,1,jp_sal,Kmm) * ssh(:,:,Kmm) ! initial salt content in ssh 304 306 END IF 305 307 frc_wn_t = 0._wp ! initial heat content misfit due to free surface … … 338 340 339 341 340 SUBROUTINE dia_hsb_init 342 SUBROUTINE dia_hsb_init( Kmm ) 341 343 !!--------------------------------------------------------------------------- 342 344 !! *** ROUTINE dia_hsb *** … … 350 352 !! - Compute coefficients for conversion 351 353 !!--------------------------------------------------------------------------- 354 INTEGER, INTENT(in) :: Kmm ! time level index 355 ! 352 356 INTEGER :: ierror, ios ! local integer 353 357 !! … … 417 421 ! 4 - initial conservation variables ! 418 422 ! ---------------------------------- ! 419 CALL dia_hsb_rst( nit000, 'READ' ) !* read or initialize all required files423 CALL dia_hsb_rst( nit000, Kmm, 'READ' ) !* read or initialize all required files 420 424 ! 421 425 END SUBROUTINE dia_hsb_init -
NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/OCE/DIA/diahth.F90
r10425 r10965 60 60 61 61 62 SUBROUTINE dia_hth( kt )62 SUBROUTINE dia_hth( kt, Kmm ) 63 63 !!--------------------------------------------------------------------- 64 64 !! *** ROUTINE dia_hth *** … … 81 81 !!------------------------------------------------------------------- 82 82 INTEGER, INTENT( in ) :: kt ! ocean time-step index 83 INTEGER, INTENT( in ) :: Kmm ! ocean time level index 83 84 !! 84 85 INTEGER :: ji, jj, jk ! dummy loop arguments … … 139 140 DO jj = 1, jpj 140 141 DO ji = 1, jpi 141 zztmp = gdepw _n(ji,jj,mbkt(ji,jj)+1)142 zztmp = gdepw(ji,jj,mbkt(ji,jj)+1,Kmm) 142 143 hth (ji,jj) = zztmp 143 144 zabs2 (ji,jj) = zztmp … … 150 151 DO jj = 1, jpj 151 152 DO ji = 1, jpi 152 zztmp = gdepw _n(ji,jj,mbkt(ji,jj)+1)153 zztmp = gdepw(ji,jj,mbkt(ji,jj)+1,Kmm) 153 154 zrho0_3(ji,jj) = zztmp 154 155 zrho0_1(ji,jj) = zztmp … … 162 163 DO ji = 1, jpi 163 164 IF( tmask(ji,jj,nla10) == 1. ) THEN 164 zu = 1779.50 + 11.250 * ts n(ji,jj,nla10,jp_tem) - 3.80 * tsn(ji,jj,nla10,jp_sal) &165 & - 0.0745 * ts n(ji,jj,nla10,jp_tem) * tsn(ji,jj,nla10,jp_tem) &166 & - 0.0100 * ts n(ji,jj,nla10,jp_tem) * tsn(ji,jj,nla10,jp_sal)167 zv = 5891.00 + 38.000 * ts n(ji,jj,nla10,jp_tem) + 3.00 * tsn(ji,jj,nla10,jp_sal) &168 & - 0.3750 * ts n(ji,jj,nla10,jp_tem) * tsn(ji,jj,nla10,jp_tem)169 zut = 11.25 - 0.149 * ts n(ji,jj,nla10,jp_tem) - 0.01 * tsn(ji,jj,nla10,jp_sal)170 zvt = 38.00 - 0.750 * ts n(ji,jj,nla10,jp_tem)165 zu = 1779.50 + 11.250 * ts(ji,jj,nla10,jp_tem,Kmm) - 3.80 * ts(ji,jj,nla10,jp_sal,Kmm) & 166 & - 0.0745 * ts(ji,jj,nla10,jp_tem,Kmm) * ts(ji,jj,nla10,jp_tem,Kmm) & 167 & - 0.0100 * ts(ji,jj,nla10,jp_tem,Kmm) * ts(ji,jj,nla10,jp_sal,Kmm) 168 zv = 5891.00 + 38.000 * ts(ji,jj,nla10,jp_tem,Kmm) + 3.00 * ts(ji,jj,nla10,jp_sal,Kmm) & 169 & - 0.3750 * ts(ji,jj,nla10,jp_tem,Kmm) * ts(ji,jj,nla10,jp_tem,Kmm) 170 zut = 11.25 - 0.149 * ts(ji,jj,nla10,jp_tem,Kmm) - 0.01 * ts(ji,jj,nla10,jp_sal,Kmm) 171 zvt = 38.00 - 0.750 * ts(ji,jj,nla10,jp_tem,Kmm) 171 172 zw = (zu + 0.698*zv) * (zu + 0.698*zv) 172 173 zdelr(ji,jj) = ztem2 * (1000.*(zut*zv - zvt*zu)/zw) … … 187 188 DO ji = 1, jpi 188 189 ! 189 zzdep = gdepw _n(ji,jj,jk)190 zztmp = ( ts n(ji,jj,jk-1,jp_tem) - tsn(ji,jj,jk,jp_tem) ) / zzdep * tmask(ji,jj,jk) ! vertical gradient of temperature (dT/dz)190 zzdep = gdepw(ji,jj,jk,Kmm) 191 zztmp = ( ts(ji,jj,jk-1,jp_tem,Kmm) - ts(ji,jj,jk,jp_tem,Kmm) ) / zzdep * tmask(ji,jj,jk) ! vertical gradient of temperature (dT/dz) 191 192 zzdep = zzdep * tmask(ji,jj,1) 192 193 … … 223 224 DO ji = 1, jpi 224 225 ! 225 zzdep = gdepw _n(ji,jj,jk) * tmask(ji,jj,1)226 zzdep = gdepw(ji,jj,jk,Kmm) * tmask(ji,jj,1) 226 227 ! 227 zztmp = ts n(ji,jj,nla10,jp_tem) - tsn(ji,jj,jk,jp_tem) ! - delta T(10m)228 zztmp = ts(ji,jj,nla10,jp_tem,Kmm) - ts(ji,jj,jk,jp_tem,Kmm) ! - delta T(10m) 228 229 IF( ABS(zztmp) > ztem2 ) zabs2 (ji,jj) = zzdep ! abs > 0.2 229 230 IF( zztmp > ztem2 ) ztm2 (ji,jj) = zzdep ! > 0.2 … … 257 258 DO jj = 1, jpj 258 259 DO ji = 1, jpi 259 zztmp = ts n(ji,jj,jk,jp_tem)260 zztmp = ts(ji,jj,jk,jp_tem,Kmm) 260 261 IF( zztmp >= 20. ) ik20(ji,jj) = jk 261 262 IF( zztmp >= 28. ) ik28(ji,jj) = jk … … 270 271 DO ji = 1, jpi 271 272 ! 272 zzdep = gdepw _n(ji,jj,mbkt(ji,jj)+1) ! depth of the oean bottom273 zzdep = gdepw(ji,jj,mbkt(ji,jj)+1,Kmm) ! depth of the oean bottom 273 274 ! 274 275 iid = ik20(ji,jj) 275 276 IF( iid /= 1 ) THEN 276 zztmp = gdept _n(ji,jj,iid) & ! linear interpolation277 & + ( gdept _n(ji,jj,iid+1) - gdept_n(ji,jj,iid) ) &278 & * ( 20.*tmask(ji,jj,iid+1) - ts n(ji,jj,iid,jp_tem) ) &279 & / ( ts n(ji,jj,iid+1,jp_tem) - tsn(ji,jj,iid,jp_tem) + (1.-tmask(ji,jj,1)) )277 zztmp = gdept(ji,jj,iid ,Kmm) & ! linear interpolation 278 & + ( gdept(ji,jj,iid+1,Kmm) - gdept(ji,jj,iid,Kmm) ) & 279 & * ( 20.*tmask(ji,jj,iid+1) - ts(ji,jj,iid,jp_tem,Kmm) ) & 280 & / ( ts(ji,jj,iid+1,jp_tem,Kmm) - ts(ji,jj,iid,jp_tem,Kmm) + (1.-tmask(ji,jj,1)) ) 280 281 hd20(ji,jj) = MIN( zztmp , zzdep) * tmask(ji,jj,1) ! bound by the ocean depth 281 282 ELSE … … 285 286 iid = ik28(ji,jj) 286 287 IF( iid /= 1 ) THEN 287 zztmp = gdept _n(ji,jj,iid) & ! linear interpolation288 & + ( gdept _n(ji,jj,iid+1) - gdept_n(ji,jj,iid) ) &289 & * ( 28.*tmask(ji,jj,iid+1) - ts n(ji,jj,iid,jp_tem) ) &290 & / ( ts n(ji,jj,iid+1,jp_tem) - tsn(ji,jj,iid,jp_tem) + (1.-tmask(ji,jj,1)) )288 zztmp = gdept(ji,jj,iid ,Kmm) & ! linear interpolation 289 & + ( gdept(ji,jj,iid+1,Kmm) - gdept(ji,jj,iid,Kmm) ) & 290 & * ( 28.*tmask(ji,jj,iid+1) - ts(ji,jj,iid,jp_tem,Kmm) ) & 291 & / ( ts(ji,jj,iid+1,jp_tem,Kmm) - ts(ji,jj,iid,jp_tem,Kmm) + (1.-tmask(ji,jj,1)) ) 291 292 hd28(ji,jj) = MIN( zztmp , zzdep ) * tmask(ji,jj,1) ! bound by the ocean depth 292 293 ELSE … … 311 312 END DO 312 313 ! surface boundary condition 313 IF( ln_linssh ) THEN ; zthick(:,:) = ssh n(:,:) ; htc3(:,:) = tsn(:,:,1,jp_tem) * sshn(:,:) * tmask(:,:,1)314 IF( ln_linssh ) THEN ; zthick(:,:) = ssh(:,:,Kmm) ; htc3(:,:) = ts(:,:,1,jp_tem,Kmm) * ssh(:,:,Kmm) * tmask(:,:,1) 314 315 ELSE ; zthick(:,:) = 0._wp ; htc3(:,:) = 0._wp 315 316 ENDIF 316 317 ! integration down to ilevel 317 318 DO jk = 1, ilevel 318 zthick(:,:) = zthick(:,:) + e3t _n(:,:,jk)319 htc3 (:,:) = htc3 (:,:) + e3t _n(:,:,jk) * tsn(:,:,jk,jp_tem) * tmask(:,:,jk)319 zthick(:,:) = zthick(:,:) + e3t(:,:,jk,Kmm) 320 htc3 (:,:) = htc3 (:,:) + e3t(:,:,jk,Kmm) * ts(:,:,jk,jp_tem,Kmm) * tmask(:,:,jk) 320 321 END DO 321 322 ! deepest layer … … 323 324 DO jj = 1, jpj 324 325 DO ji = 1, jpi 325 htc3(ji,jj) = htc3(ji,jj) + ts n(ji,jj,ilevel+1,jp_tem) &326 & * MIN( e3t _n(ji,jj,ilevel+1), zthick(ji,jj) ) * tmask(ji,jj,ilevel+1)326 htc3(ji,jj) = htc3(ji,jj) + ts(ji,jj,ilevel+1,jp_tem,Kmm) & 327 & * MIN( e3t(ji,jj,ilevel+1,Kmm), zthick(ji,jj) ) * tmask(ji,jj,ilevel+1) 327 328 END DO 328 329 END DO … … 342 343 LOGICAL , PUBLIC, PARAMETER :: lk_diahth = .FALSE. !: thermocline-20d depths flag 343 344 CONTAINS 344 SUBROUTINE dia_hth( kt ) ! Empty routine345 SUBROUTINE dia_hth( kt, Kmm ) ! Empty routine 345 346 IMPLICIT NONE 346 347 INTEGER, INTENT( in ) :: kt 348 INTEGER, INTENT( in ) :: Kmm 347 349 WRITE(*,*) 'dia_hth: You should not have seen this print! error?', kt 348 350 END SUBROUTINE dia_hth -
NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/OCE/DIA/diaptr.F90
r10425 r10965 71 71 CONTAINS 72 72 73 SUBROUTINE dia_ptr( pvtr )73 SUBROUTINE dia_ptr( Kmm, pvtr ) 74 74 !!---------------------------------------------------------------------- 75 75 !! *** ROUTINE dia_ptr *** 76 76 !!---------------------------------------------------------------------- 77 INTEGER , INTENT(in) :: Kmm ! time level index 77 78 REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in), OPTIONAL :: pvtr ! j-effective transport 78 79 ! … … 90 91 REAL(wp), DIMENSION(jpj,jpk,nptr) :: sjk , r1_sjk ! i-mean i-k-surface and its inverse 91 92 REAL(wp), DIMENSION(jpj,jpk,nptr) :: v_msf, sn_jk , tn_jk ! i-mean T and S, j-Stream-Function 92 REAL(wp), DIMENSION(jpi,jpj,jpk) :: zv n! 3D workspace93 REAL(wp), DIMENSION(jpi,jpj,jpk) :: zvv ! 3D workspace 93 94 94 95 … … 126 127 zmask(:,:,:) = 0._wp 127 128 zts(:,:,:,:) = 0._wp 128 zv n(:,:,:) = 0._wp129 zvv(:,:,:) = 0._wp 129 130 DO jk = 1, jpkm1 130 131 DO jj = 1, jpjm1 131 132 DO ji = 1, jpi 132 zvfc = e1v(ji,jj) * e3v _n(ji,jj,jk)133 zvfc = e1v(ji,jj) * e3v(ji,jj,jk,Kmm) 133 134 zmask(ji,jj,jk) = vmask(ji,jj,jk) * zvfc 134 zts(ji,jj,jk,jp_tem) = (ts n(ji,jj,jk,jp_tem)+tsn(ji,jj+1,jk,jp_tem)) * 0.5 * zvfc !Tracers averaged onto V grid135 zts(ji,jj,jk,jp_sal) = (ts n(ji,jj,jk,jp_sal)+tsn(ji,jj+1,jk,jp_sal)) * 0.5 * zvfc136 zv n(ji,jj,jk) = vn(ji,jj,jk) * zvfc135 zts(ji,jj,jk,jp_tem) = (ts(ji,jj,jk,jp_tem,Kmm)+ts(ji,jj+1,jk,jp_tem,Kmm)) * 0.5 * zvfc !Tracers averaged onto V grid 136 zts(ji,jj,jk,jp_sal) = (ts(ji,jj,jk,jp_sal,Kmm)+ts(ji,jj+1,jk,jp_sal,Kmm)) * 0.5 * zvfc 137 zvv(ji,jj,jk) = vv(ji,jj,jk,Kmm) * zvfc 137 138 ENDDO 138 139 ENDDO … … 147 148 tn_jk(:,:,1) = ptr_sjk( zts(:,:,:,jp_tem) ) * r1_sjk(:,:,1) 148 149 sn_jk(:,:,1) = ptr_sjk( zts(:,:,:,jp_sal) ) * r1_sjk(:,:,1) 149 v_msf(:,:,1) = ptr_sjk( zv n(:,:,:) )150 v_msf(:,:,1) = ptr_sjk( zvv(:,:,:) ) 150 151 151 152 htr_ove(:,1) = SUM( v_msf(:,:,1)*tn_jk(:,:,1) ,2 ) … … 173 174 tn_jk(:,:,jn) = ptr_sjk( zts(:,:,:,jp_tem), btmsk(:,:,jn) ) * r1_sjk(:,:,jn) 174 175 sn_jk(:,:,jn) = ptr_sjk( zts(:,:,:,jp_sal), btmsk(:,:,jn) ) * r1_sjk(:,:,jn) 175 v_msf(:,:,jn) = ptr_sjk( zv n(:,:,:), btmsk(:,:,jn) )176 v_msf(:,:,jn) = ptr_sjk( zvv(:,:,:), btmsk(:,:,jn) ) 176 177 htr_ove(:,jn) = SUM( v_msf(:,:,jn)*tn_jk(:,:,jn) ,2 ) 177 178 str_ove(:,jn) = SUM( v_msf(:,:,jn)*sn_jk(:,:,jn) ,2 ) … … 198 199 WHERE( sjk(:,1,1) /= 0._wp ) r1_sjk(:,1,1) = 1._wp / sjk(:,1,1) 199 200 200 vsum = ptr_sj( zv n(:,:,:), btmsk(:,:,1))201 vsum = ptr_sj( zvv(:,:,:), btmsk(:,:,1)) 201 202 tssum(:,jp_tem) = ptr_sj( zts(:,:,:,jp_tem), btmsk(:,:,1) ) 202 203 tssum(:,jp_sal) = ptr_sj( zts(:,:,:,jp_sal), btmsk(:,:,1) ) … … 220 221 r1_sjk(:,1,jn) = 0._wp 221 222 WHERE( sjk(:,1,jn) /= 0._wp ) r1_sjk(:,1,jn) = 1._wp / sjk(:,1,jn) 222 vsum = ptr_sj( zv n(:,:,:), btmsk(:,:,jn))223 vsum = ptr_sj( zvv(:,:,:), btmsk(:,:,jn)) 223 224 tssum(:,jp_tem) = ptr_sj( zts(:,:,:,jp_tem), btmsk(:,:,jn) ) 224 225 tssum(:,jp_sal) = ptr_sj( zts(:,:,:,jp_sal), btmsk(:,:,jn) ) … … 247 248 DO jj = 1, jpj 248 249 DO ji = 1, jpi 249 zsfc = e1t(ji,jj) * e3t _n(ji,jj,jk)250 zsfc = e1t(ji,jj) * e3t(ji,jj,jk,Kmm) 250 251 zmask(ji,jj,jk) = tmask(ji,jj,jk) * zsfc 251 zts(ji,jj,jk,jp_tem) = ts n(ji,jj,jk,jp_tem) * zsfc252 zts(ji,jj,jk,jp_sal) = ts n(ji,jj,jk,jp_sal) * zsfc252 zts(ji,jj,jk,jp_tem) = ts(ji,jj,jk,jp_tem,Kmm) * zsfc 253 zts(ji,jj,jk,jp_sal) = ts(ji,jj,jk,jp_sal,Kmm) * zsfc 253 254 END DO 254 255 END DO … … 459 460 460 461 461 SUBROUTINE dia_ptr_hst( ktra, cptr, pv a)462 SUBROUTINE dia_ptr_hst( ktra, cptr, pvflx ) 462 463 !!---------------------------------------------------------------------- 463 464 !! *** ROUTINE dia_ptr_hst *** … … 468 469 INTEGER , INTENT(in ) :: ktra ! tracer index 469 470 CHARACTER(len=3) , INTENT(in) :: cptr ! transport type 'adv'/'ldf'/'eiv' 470 REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in) :: pv a! 3D input array of advection/diffusion471 REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in) :: pvflx ! 3D input array of advection/diffusion 471 472 INTEGER :: jn ! 472 473 473 474 IF( cptr == 'adv' ) THEN 474 IF( ktra == jp_tem ) htr_adv(:,1) = ptr_sj( pv a(:,:,:))475 IF( ktra == jp_sal ) str_adv(:,1) = ptr_sj( pv a(:,:,:))475 IF( ktra == jp_tem ) htr_adv(:,1) = ptr_sj( pvflx ) 476 IF( ktra == jp_sal ) str_adv(:,1) = ptr_sj( pvflx ) 476 477 ENDIF 477 478 IF( cptr == 'ldf' ) THEN 478 IF( ktra == jp_tem ) htr_ldf(:,1) = ptr_sj( pv a(:,:,:))479 IF( ktra == jp_sal ) str_ldf(:,1) = ptr_sj( pv a(:,:,:))479 IF( ktra == jp_tem ) htr_ldf(:,1) = ptr_sj( pvflx ) 480 IF( ktra == jp_sal ) str_ldf(:,1) = ptr_sj( pvflx ) 480 481 ENDIF 481 482 IF( cptr == 'eiv' ) THEN 482 IF( ktra == jp_tem ) htr_eiv(:,1) = ptr_sj( pv a(:,:,:))483 IF( ktra == jp_sal ) str_eiv(:,1) = ptr_sj( pv a(:,:,:))483 IF( ktra == jp_tem ) htr_eiv(:,1) = ptr_sj( pvflx ) 484 IF( ktra == jp_sal ) str_eiv(:,1) = ptr_sj( pvflx ) 484 485 ENDIF 485 486 ! … … 489 490 IF( ktra == jp_tem ) THEN 490 491 DO jn = 2, nptr 491 htr_adv(:,jn) = ptr_sj( pv a(:,:,:), btmsk(:,:,jn) )492 htr_adv(:,jn) = ptr_sj( pvflx, btmsk(:,:,jn) ) 492 493 END DO 493 494 ENDIF 494 495 IF( ktra == jp_sal ) THEN 495 496 DO jn = 2, nptr 496 str_adv(:,jn) = ptr_sj( pv a(:,:,:), btmsk(:,:,jn) )497 str_adv(:,jn) = ptr_sj( pvflx, btmsk(:,:,jn) ) 497 498 END DO 498 499 ENDIF … … 501 502 IF( ktra == jp_tem ) THEN 502 503 DO jn = 2, nptr 503 htr_ldf(:,jn) = ptr_sj( pv a(:,:,:), btmsk(:,:,jn) )504 htr_ldf(:,jn) = ptr_sj( pvflx, btmsk(:,:,jn) ) 504 505 END DO 505 506 ENDIF 506 507 IF( ktra == jp_sal ) THEN 507 508 DO jn = 2, nptr 508 str_ldf(:,jn) = ptr_sj( pv a(:,:,:), btmsk(:,:,jn) )509 str_ldf(:,jn) = ptr_sj( pvflx, btmsk(:,:,jn) ) 509 510 END DO 510 511 ENDIF … … 513 514 IF( ktra == jp_tem ) THEN 514 515 DO jn = 2, nptr 515 htr_eiv(:,jn) = ptr_sj( pv a(:,:,:), btmsk(:,:,jn) )516 htr_eiv(:,jn) = ptr_sj( pvflx, btmsk(:,:,jn) ) 516 517 END DO 517 518 ENDIF 518 519 IF( ktra == jp_sal ) THEN 519 520 DO jn = 2, nptr 520 str_eiv(:,jn) = ptr_sj( pv a(:,:,:), btmsk(:,:,jn) )521 str_eiv(:,jn) = ptr_sj( pvflx, btmsk(:,:,jn) ) 521 522 END DO 522 523 ENDIF … … 554 555 555 556 556 FUNCTION ptr_sj_3d( pv a, pmsk ) RESULT ( p_fval )557 FUNCTION ptr_sj_3d( pvflx, pmsk ) RESULT ( p_fval ) 557 558 !!---------------------------------------------------------------------- 558 559 !! *** ROUTINE ptr_sj_3d *** … … 560 561 !! ** Purpose : i-k sum computation of a j-flux array 561 562 !! 562 !! ** Method : - i-k sum of pv ausing the interior 2D vmask (vmask_i).563 !! pv ais supposed to be a masked flux (i.e. * vmask*e1v*e3v)564 !! 565 !! ** Action : - p_fval: i-k-mean poleward flux of pv a566 !!---------------------------------------------------------------------- 567 REAL(wp), INTENT(in), DIMENSION(jpi,jpj,jpk) :: pv a! mask flux array at V-point563 !! ** Method : - i-k sum of pvflx using the interior 2D vmask (vmask_i). 564 !! pvflx is supposed to be a masked flux (i.e. * vmask*e1v*e3v) 565 !! 566 !! ** Action : - p_fval: i-k-mean poleward flux of pvflx 567 !!---------------------------------------------------------------------- 568 REAL(wp), INTENT(in), DIMENSION(jpi,jpj,jpk) :: pvflx ! mask flux array at V-point 568 569 REAL(wp), INTENT(in), DIMENSION(jpi,jpj), OPTIONAL :: pmsk ! Optional 2D basin mask 569 570 ! … … 581 582 DO jj = 2, jpjm1 582 583 DO ji = fs_2, fs_jpim1 ! Vector opt. 583 p_fval(jj) = p_fval(jj) + pv a(ji,jj,jk) * tmask_i(ji,jj) * pmsk(ji,jj)584 p_fval(jj) = p_fval(jj) + pvflx(ji,jj,jk) * tmask_i(ji,jj) * pmsk(ji,jj) 584 585 END DO 585 586 END DO … … 589 590 DO jj = 2, jpjm1 590 591 DO ji = fs_2, fs_jpim1 ! Vector opt. 591 p_fval(jj) = p_fval(jj) + pv a(ji,jj,jk) * tmask_i(ji,jj)592 p_fval(jj) = p_fval(jj) + pvflx(ji,jj,jk) * tmask_i(ji,jj) 592 593 END DO 593 594 END DO … … 601 602 602 603 603 FUNCTION ptr_sj_2d( pv a, pmsk ) RESULT ( p_fval )604 FUNCTION ptr_sj_2d( pvflx, pmsk ) RESULT ( p_fval ) 604 605 !!---------------------------------------------------------------------- 605 606 !! *** ROUTINE ptr_sj_2d *** 606 607 !! 607 !! ** Purpose : "zonal" and vertical sum computation of a i-flux array608 !! 609 !! ** Method : - i-k sum of pv ausing the interior 2D vmask (vmask_i).610 !! pv ais supposed to be a masked flux (i.e. * vmask*e1v*e3v)611 !! 612 !! ** Action : - p_fval: i-k-mean poleward flux of pv a613 !!---------------------------------------------------------------------- 614 REAL(wp) , INTENT(in), DIMENSION(jpi,jpj) :: pv a! mask flux array at V-point608 !! ** Purpose : "zonal" and vertical sum computation of a j-flux array 609 !! 610 !! ** Method : - i-k sum of pvflx using the interior 2D vmask (vmask_i). 611 !! pvflx is supposed to be a masked flux (i.e. * vmask*e1v*e3v) 612 !! 613 !! ** Action : - p_fval: i-k-mean poleward flux of pvflx 614 !!---------------------------------------------------------------------- 615 REAL(wp) , INTENT(in), DIMENSION(jpi,jpj) :: pvflx ! mask flux array at V-point 615 616 REAL(wp) , INTENT(in), DIMENSION(jpi,jpj), OPTIONAL :: pmsk ! Optional 2D basin mask 616 617 ! … … 627 628 DO jj = 2, jpjm1 628 629 DO ji = nldi, nlei ! No vector optimisation here. Better use a mask ? 629 p_fval(jj) = p_fval(jj) + pv a(ji,jj) * tmask_i(ji,jj) * pmsk(ji,jj)630 p_fval(jj) = p_fval(jj) + pvflx(ji,jj) * tmask_i(ji,jj) * pmsk(ji,jj) 630 631 END DO 631 632 END DO … … 633 634 DO jj = 2, jpjm1 634 635 DO ji = nldi, nlei ! No vector optimisation here. Better use a mask ? 635 p_fval(jj) = p_fval(jj) + pv a(ji,jj) * tmask_i(ji,jj)636 p_fval(jj) = p_fval(jj) + pvflx(ji,jj) * tmask_i(ji,jj) 636 637 END DO 637 638 END DO … … 644 645 645 646 646 FUNCTION ptr_sjk( p ta, pmsk ) RESULT ( p_fval )647 FUNCTION ptr_sjk( pfld, pmsk ) RESULT ( p_fval ) 647 648 !!---------------------------------------------------------------------- 648 649 !! *** ROUTINE ptr_sjk *** … … 650 651 !! ** Purpose : i-sum computation of an array 651 652 !! 652 !! ** Method : - i-sum of pva using the interior 2D vmask (vmask_i).653 !! 654 !! ** Action : - p_fval: i- mean poleward flux of pva653 !! ** Method : - i-sum of field using the interior 2D vmask (pmsk). 654 !! 655 !! ** Action : - p_fval: i-sum of masked field 655 656 !!---------------------------------------------------------------------- 656 657 !! 657 658 IMPLICIT none 658 REAL(wp) , INTENT(in), DIMENSION(jpi,jpj,jpk) :: p ta ! mask flux array at V-point659 REAL(wp) , INTENT(in), DIMENSION(jpi,jpj,jpk) :: pfld ! input field to be summed 659 660 REAL(wp) , INTENT(in), DIMENSION(jpi,jpj) , OPTIONAL :: pmsk ! Optional 2D basin mask 660 661 !! … … 678 679 !!gm here, use of tmask_i ==> no need of loop over nldi, nlei.... 679 680 DO ji = nldi, nlei ! No vector optimisation here. Better use a mask ? 680 p_fval(jj,jk) = p_fval(jj,jk) + p ta(ji,jj,jk) * pmsk(ji,jj)681 p_fval(jj,jk) = p_fval(jj,jk) + pfld(ji,jj,jk) * pmsk(ji,jj) 681 682 END DO 682 683 END DO … … 686 687 DO jj = 2, jpjm1 687 688 DO ji = nldi, nlei ! No vector optimisation here. Better use a mask ? 688 p_fval(jj,jk) = p_fval(jj,jk) + p ta(ji,jj,jk) * tmask_i(ji,jj)689 p_fval(jj,jk) = p_fval(jj,jk) + pfld(ji,jj,jk) * tmask_i(ji,jj) 689 690 END DO 690 691 END DO -
NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/OCE/DIA/diatmb.F90
r10499 r10965 94 94 95 95 96 SUBROUTINE dia_tmb 96 SUBROUTINE dia_tmb( Kmm ) 97 97 !!---------------------------------------------------------------------- 98 98 !! *** ROUTINE dia_tmb *** … … 103 103 !! 104 104 !!-------------------------------------------------------------------- 105 INTEGER, INTENT(in) :: Kmm ! time level index 106 ! 105 107 REAL(wp) :: zmdi =1.e+20 ! land value 106 108 REAL(wp), DIMENSION(jpi,jpj,3) :: zwtmb ! workspace 107 109 !!-------------------------------------------------------------------- 108 110 ! 109 CALL dia_calctmb( ts n(:,:,:,jp_tem), zwtmb )111 CALL dia_calctmb( ts(:,:,:,jp_tem,Kmm), zwtmb ) 110 112 !ssh already output but here we output it masked 111 113 IF( ll_wd ) THEN 112 CALL iom_put( "sshnmasked", (ssh n(:,:)+ssh_ref)*tmask(:,:,1) + zmdi*(1.0 - tmask(:,:,1)) )114 CALL iom_put( "sshnmasked", (ssh(:,:,Kmm)+ssh_ref)*tmask(:,:,1) + zmdi*(1.0 - tmask(:,:,1)) ) 113 115 ELSE 114 CALL iom_put( "sshnmasked", ssh n(:,:)*tmask(:,:,1) + zmdi*(1.0 - tmask(:,:,1)) )116 CALL iom_put( "sshnmasked", ssh(:,:,Kmm)*tmask(:,:,1) + zmdi*(1.0 - tmask(:,:,1)) ) 115 117 ENDIF 116 118 … … 119 121 CALL iom_put( "bot_temp" , zwtmb(:,:,3) ) ! tmb Temperature 120 122 ! 121 CALL dia_calctmb( ts n(:,:,:,jp_sal), zwtmb )123 CALL dia_calctmb( ts(:,:,:,jp_sal,Kmm), zwtmb ) 122 124 CALL iom_put( "top_sal" , zwtmb(:,:,1) ) ! tmb Salinity 123 125 CALL iom_put( "mid_sal" , zwtmb(:,:,2) ) ! tmb Salinity 124 126 CALL iom_put( "bot_sal" , zwtmb(:,:,3) ) ! tmb Salinity 125 127 ! 126 CALL dia_calctmb( u n(:,:,:), zwtmb )128 CALL dia_calctmb( uu(:,:,:,Kmm), zwtmb ) 127 129 CALL iom_put( "top_u" , zwtmb(:,:,1) ) ! tmb U Velocity 128 130 CALL iom_put( "mid_u" , zwtmb(:,:,2) ) ! tmb U Velocity 129 131 CALL iom_put( "bot_u" , zwtmb(:,:,3) ) ! tmb U Velocity 130 132 ! 131 CALL dia_calctmb( v n(:,:,:), zwtmb )133 CALL dia_calctmb( vv(:,:,:,Kmm), zwtmb ) 132 134 CALL iom_put( "top_v" , zwtmb(:,:,1) ) ! tmb V Velocity 133 135 CALL iom_put( "mid_v" , zwtmb(:,:,2) ) ! tmb V Velocity -
NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/OCE/DIA/diawri.F90
r10425 r10965 97 97 98 98 99 SUBROUTINE dia_wri( kt )99 SUBROUTINE dia_wri( kt, Kmm ) 100 100 !!--------------------------------------------------------------------- 101 101 !! *** ROUTINE dia_wri *** … … 107 107 !!---------------------------------------------------------------------- 108 108 INTEGER, INTENT( in ) :: kt ! ocean time-step index 109 INTEGER, INTENT( in ) :: Kmm ! ocean time level index 109 110 !! 110 111 INTEGER :: ji, jj, jk ! dummy loop indices … … 120 121 ! Output the initial state and forcings 121 122 IF( ninist == 1 ) THEN 122 CALL dia_wri_state( 'output.init' )123 CALL dia_wri_state( Kmm, 'output.init' ) 123 124 ninist = 0 124 125 ENDIF … … 129 130 CALL iom_put("e3v_0", e3v_0(:,:,:) ) 130 131 ! 131 CALL iom_put( "e3t" , e3t _n(:,:,:) )132 CALL iom_put( "e3u" , e3u _n(:,:,:) )133 CALL iom_put( "e3v" , e3v _n(:,:,:) )134 CALL iom_put( "e3w" , e3w _n(:,:,:) )132 CALL iom_put( "e3t" , e3t(:,:,:,Kmm) ) 133 CALL iom_put( "e3u" , e3u(:,:,:,Kmm) ) 134 CALL iom_put( "e3v" , e3v(:,:,:,Kmm) ) 135 CALL iom_put( "e3w" , e3w(:,:,:,Kmm) ) 135 136 IF( iom_use("e3tdef") ) & 136 CALL iom_put( "e3tdef" , ( ( e3t _n(:,:,:) - e3t_0(:,:,:) ) / e3t_0(:,:,:) * 100 * tmask(:,:,:) ) ** 2 )137 CALL iom_put( "e3tdef" , ( ( e3t(:,:,:,Kmm) - e3t_0(:,:,:) ) / e3t_0(:,:,:) * 100 * tmask(:,:,:) ) ** 2 ) 137 138 138 139 IF( ll_wd ) THEN 139 140 CALL iom_put( "ssh" , (sshn+ssh_ref)*tmask(:,:,1) ) ! sea surface height (brought back to the reference used for wetting and drying) 140 141 ELSE 141 CALL iom_put( "ssh" , ssh n) ! sea surface height142 CALL iom_put( "ssh" , ssh(:,:,Kmm) ) ! sea surface height 142 143 ENDIF 143 144 144 145 IF( iom_use("wetdep") ) & ! wet depth 145 CALL iom_put( "wetdep" , ht_0(:,:) + ssh n(:,:) )146 CALL iom_put( "wetdep" , ht_0(:,:) + ssh(:,:,Kmm) ) 146 147 147 CALL iom_put( "toce", ts n(:,:,:,jp_tem) ) ! 3D temperature148 CALL iom_put( "sst", ts n(:,:,1,jp_tem) ) ! surface temperature148 CALL iom_put( "toce", ts(:,:,:,jp_tem,Kmm) ) ! 3D temperature 149 CALL iom_put( "sst", ts(:,:,1,jp_tem,Kmm) ) ! surface temperature 149 150 IF ( iom_use("sbt") ) THEN 150 151 DO jj = 1, jpj 151 152 DO ji = 1, jpi 152 153 ikbot = mbkt(ji,jj) 153 z2d(ji,jj) = ts n(ji,jj,ikbot,jp_tem)154 z2d(ji,jj) = ts(ji,jj,ikbot,jp_tem,Kmm) 154 155 END DO 155 156 END DO … … 157 158 ENDIF 158 159 159 CALL iom_put( "soce", ts n(:,:,:,jp_sal) ) ! 3D salinity160 CALL iom_put( "sss", ts n(:,:,1,jp_sal) ) ! surface salinity160 CALL iom_put( "soce", ts(:,:,:,jp_sal,Kmm) ) ! 3D salinity 161 CALL iom_put( "sss", ts(:,:,1,jp_sal,Kmm) ) ! surface salinity 161 162 IF ( iom_use("sbs") ) THEN 162 163 DO jj = 1, jpj 163 164 DO ji = 1, jpi 164 165 ikbot = mbkt(ji,jj) 165 z2d(ji,jj) = ts n(ji,jj,ikbot,jp_sal)166 z2d(ji,jj) = ts(ji,jj,ikbot,jp_sal,Kmm) 166 167 END DO 167 168 END DO … … 174 175 DO jj = 2, jpjm1 175 176 DO ji = fs_2, fs_jpim1 ! vector opt. 176 zztmp2 = ( ( rCdU_bot(ji+1,jj)+rCdU_bot(ji ,jj) ) * u n(ji ,jj,mbku(ji ,jj)) )**2 &177 & + ( ( rCdU_bot(ji ,jj)+rCdU_bot(ji-1,jj) ) * u n(ji-1,jj,mbku(ji-1,jj)) )**2 &178 & + ( ( rCdU_bot(ji,jj+1)+rCdU_bot(ji,jj ) ) * v n(ji,jj ,mbkv(ji,jj )) )**2 &179 & + ( ( rCdU_bot(ji,jj )+rCdU_bot(ji,jj-1) ) * v n(ji,jj-1,mbkv(ji,jj-1)) )**2177 zztmp2 = ( ( rCdU_bot(ji+1,jj)+rCdU_bot(ji ,jj) ) * uu(ji ,jj,mbku(ji ,jj),Kmm) )**2 & 178 & + ( ( rCdU_bot(ji ,jj)+rCdU_bot(ji-1,jj) ) * uu(ji-1,jj,mbku(ji-1,jj),Kmm) )**2 & 179 & + ( ( rCdU_bot(ji,jj+1)+rCdU_bot(ji,jj ) ) * vv(ji,jj ,mbkv(ji,jj ),Kmm) )**2 & 180 & + ( ( rCdU_bot(ji,jj )+rCdU_bot(ji,jj-1) ) * vv(ji,jj-1,mbkv(ji,jj-1),Kmm) )**2 180 181 z2d(ji,jj) = zztmp * SQRT( zztmp2 ) * tmask(ji,jj,1) 181 182 ! … … 186 187 ENDIF 187 188 188 CALL iom_put( "uoce", u n(:,:,:) ) ! 3D i-current189 CALL iom_put( "ssu", u n(:,:,1) ) ! surface i-current189 CALL iom_put( "uoce", uu(:,:,:,Kmm) ) ! 3D i-current 190 CALL iom_put( "ssu", uu(:,:,1,Kmm) ) ! surface i-current 190 191 IF ( iom_use("sbu") ) THEN 191 192 DO jj = 1, jpj 192 193 DO ji = 1, jpi 193 194 ikbot = mbku(ji,jj) 194 z2d(ji,jj) = u n(ji,jj,ikbot)195 z2d(ji,jj) = uu(ji,jj,ikbot,Kmm) 195 196 END DO 196 197 END DO … … 198 199 ENDIF 199 200 200 CALL iom_put( "voce", v n(:,:,:) ) ! 3D j-current201 CALL iom_put( "ssv", v n(:,:,1) ) ! surface j-current201 CALL iom_put( "voce", vv(:,:,:,Kmm) ) ! 3D j-current 202 CALL iom_put( "ssv", vv(:,:,1,Kmm) ) ! surface j-current 202 203 IF ( iom_use("sbv") ) THEN 203 204 DO jj = 1, jpj 204 205 DO ji = 1, jpi 205 206 ikbot = mbkv(ji,jj) 206 z2d(ji,jj) = v n(ji,jj,ikbot)207 z2d(ji,jj) = vv(ji,jj,ikbot,Kmm) 207 208 END DO 208 209 END DO … … 210 211 ENDIF 211 212 212 CALL iom_put( "woce", w n) ! vertical velocity213 CALL iom_put( "woce", ww ) ! vertical velocity 213 214 IF( iom_use('w_masstr') .OR. iom_use('w_masstr2') ) THEN ! vertical mass transport & its square value 214 215 ! Caution: in the VVL case, it only correponds to the baroclinic mass transport. 215 216 z2d(:,:) = rau0 * e1e2t(:,:) 216 217 DO jk = 1, jpk 217 z3d(:,:,jk) = w n(:,:,jk) * z2d(:,:)218 z3d(:,:,jk) = ww(:,:,jk) * z2d(:,:) 218 219 END DO 219 220 CALL iom_put( "w_masstr" , z3d ) … … 231 232 DO jj = 2, jpjm1 ! sst gradient 232 233 DO ji = fs_2, fs_jpim1 ! vector opt. 233 zztmp = ts n(ji,jj,1,jp_tem)234 zztmpx = ( ts n(ji+1,jj,1,jp_tem) - zztmp ) * r1_e1u(ji,jj) + ( zztmp - tsn(ji-1,jj ,1,jp_tem) ) * r1_e1u(ji-1,jj)235 zztmpy = ( ts n(ji,jj+1,1,jp_tem) - zztmp ) * r1_e2v(ji,jj) + ( zztmp - tsn(ji ,jj-1,1,jp_tem) ) * r1_e2v(ji,jj-1)234 zztmp = ts(ji,jj,1,jp_tem,Kmm) 235 zztmpx = ( ts(ji+1,jj,1,jp_tem,Kmm) - zztmp ) * r1_e1u(ji,jj) + ( zztmp - ts(ji-1,jj ,1,jp_tem,Kmm) ) * r1_e1u(ji-1,jj) 236 zztmpy = ( ts(ji,jj+1,1,jp_tem,Kmm) - zztmp ) * r1_e2v(ji,jj) + ( zztmp - ts(ji ,jj-1,1,jp_tem,Kmm) ) * r1_e2v(ji,jj-1) 236 237 z2d(ji,jj) = 0.25 * ( zztmpx * zztmpx + zztmpy * zztmpy ) & 237 238 & * umask(ji,jj,1) * umask(ji-1,jj,1) * vmask(ji,jj,1) * umask(ji,jj-1,1) … … 250 251 DO jj = 1, jpj 251 252 DO ji = 1, jpi 252 z2d(ji,jj) = z2d(ji,jj) + e3t _n(ji,jj,jk) * tsn(ji,jj,jk,jp_tem) * tmask(ji,jj,jk)253 z2d(ji,jj) = z2d(ji,jj) + e3t(ji,jj,jk,Kmm) * ts(ji,jj,jk,jp_tem,Kmm) * tmask(ji,jj,jk) 253 254 END DO 254 255 END DO … … 262 263 DO jj = 1, jpj 263 264 DO ji = 1, jpi 264 z2d(ji,jj) = z2d(ji,jj) + e3t _n(ji,jj,jk) * tsn(ji,jj,jk,jp_sal) * tmask(ji,jj,jk)265 z2d(ji,jj) = z2d(ji,jj) + e3t(ji,jj,jk,Kmm) * ts(ji,jj,jk,jp_sal,Kmm) * tmask(ji,jj,jk) 265 266 END DO 266 267 END DO … … 274 275 DO jj = 2, jpjm1 275 276 DO ji = fs_2, fs_jpim1 ! vector opt. 276 zztmp = 0.25_wp * r1_e1e2t(ji,jj) / e3t _n(ji,jj,jk)277 z3d(ji,jj,jk) = zztmp * ( u n(ji-1,jj,jk)**2 * e2u(ji-1,jj) * e3u_n(ji-1,jj,jk) &278 & + u n(ji ,jj,jk)**2 * e2u(ji ,jj) * e3u_n(ji ,jj,jk) &279 & + v n(ji,jj-1,jk)**2 * e1v(ji,jj-1) * e3v_n(ji,jj-1,jk) &280 & + v n(ji,jj ,jk)**2 * e1v(ji,jj ) * e3v_n(ji,jj ,jk) )277 zztmp = 0.25_wp * r1_e1e2t(ji,jj) / e3t(ji,jj,jk,Kmm) 278 z3d(ji,jj,jk) = zztmp * ( uu(ji-1,jj,jk,Kmm)**2 * e2u(ji-1,jj) * e3u(ji-1,jj,jk,Kmm) & 279 & + uu(ji ,jj,jk,Kmm)**2 * e2u(ji ,jj) * e3u(ji ,jj,jk,Kmm) & 280 & + vv(ji,jj-1,jk,Kmm)**2 * e1v(ji,jj-1) * e3v(ji,jj-1,jk,Kmm) & 281 & + vv(ji,jj ,jk,Kmm)**2 * e1v(ji,jj ) * e3v(ji,jj ,jk,Kmm) ) 281 282 END DO 282 283 END DO … … 286 287 ENDIF 287 288 ! 288 CALL iom_put( "hdiv", hdiv n) ! Horizontal divergence289 CALL iom_put( "hdiv", hdiv ) ! Horizontal divergence 289 290 ! 290 291 IF( iom_use("u_masstr") .OR. iom_use("u_masstr_vint") .OR. iom_use("u_heattr") .OR. iom_use("u_salttr") ) THEN … … 292 293 z2d(:,:) = 0.e0 293 294 DO jk = 1, jpkm1 294 z3d(:,:,jk) = rau0 * u n(:,:,jk) * e2u(:,:) * e3u_n(:,:,jk) * umask(:,:,jk)295 z3d(:,:,jk) = rau0 * uu(:,:,jk,Kmm) * e2u(:,:) * e3u(:,:,jk,Kmm) * umask(:,:,jk) 295 296 z2d(:,:) = z2d(:,:) + z3d(:,:,jk) 296 297 END DO … … 304 305 DO jj = 2, jpjm1 305 306 DO ji = fs_2, fs_jpim1 ! vector opt. 306 z2d(ji,jj) = z2d(ji,jj) + z3d(ji,jj,jk) * ( ts n(ji,jj,jk,jp_tem) + tsn(ji+1,jj,jk,jp_tem) )307 z2d(ji,jj) = z2d(ji,jj) + z3d(ji,jj,jk) * ( ts(ji,jj,jk,jp_tem,Kmm) + ts(ji+1,jj,jk,jp_tem,Kmm) ) 307 308 END DO 308 309 END DO … … 317 318 DO jj = 2, jpjm1 318 319 DO ji = fs_2, fs_jpim1 ! vector opt. 319 z2d(ji,jj) = z2d(ji,jj) + z3d(ji,jj,jk) * ( ts n(ji,jj,jk,jp_sal) + tsn(ji+1,jj,jk,jp_sal) )320 z2d(ji,jj) = z2d(ji,jj) + z3d(ji,jj,jk) * ( ts(ji,jj,jk,jp_sal,Kmm) + ts(ji+1,jj,jk,jp_sal,Kmm) ) 320 321 END DO 321 322 END DO … … 329 330 z3d(:,:,jpk) = 0.e0 330 331 DO jk = 1, jpkm1 331 z3d(:,:,jk) = rau0 * v n(:,:,jk) * e1v(:,:) * e3v_n(:,:,jk) * vmask(:,:,jk)332 z3d(:,:,jk) = rau0 * vv(:,:,jk,Kmm) * e1v(:,:) * e3v(:,:,jk,Kmm) * vmask(:,:,jk) 332 333 END DO 333 334 CALL iom_put( "v_masstr", z3d ) ! mass transport in j-direction … … 339 340 DO jj = 2, jpjm1 340 341 DO ji = fs_2, fs_jpim1 ! vector opt. 341 z2d(ji,jj) = z2d(ji,jj) + z3d(ji,jj,jk) * ( ts n(ji,jj,jk,jp_tem) + tsn(ji,jj+1,jk,jp_tem) )342 z2d(ji,jj) = z2d(ji,jj) + z3d(ji,jj,jk) * ( ts(ji,jj,jk,jp_tem,Kmm) + ts(ji,jj+1,jk,jp_tem,Kmm) ) 342 343 END DO 343 344 END DO … … 352 353 DO jj = 2, jpjm1 353 354 DO ji = fs_2, fs_jpim1 ! vector opt. 354 z2d(ji,jj) = z2d(ji,jj) + z3d(ji,jj,jk) * ( ts n(ji,jj,jk,jp_sal) + tsn(ji,jj+1,jk,jp_sal) )355 z2d(ji,jj) = z2d(ji,jj) + z3d(ji,jj,jk) * ( ts(ji,jj,jk,jp_sal,Kmm) + ts(ji,jj+1,jk,jp_sal,Kmm) ) 355 356 END DO 356 357 END DO … … 365 366 DO jj = 2, jpjm1 366 367 DO ji = fs_2, fs_jpim1 ! vector opt. 367 z2d(ji,jj) = z2d(ji,jj) + e3t _n(ji,jj,jk) * tsn(ji,jj,jk,jp_tem)368 z2d(ji,jj) = z2d(ji,jj) + e3t(ji,jj,jk,Kmm) * ts(ji,jj,jk,jp_tem,Kmm) 368 369 END DO 369 370 END DO … … 377 378 DO jj = 2, jpjm1 378 379 DO ji = fs_2, fs_jpim1 ! vector opt. 379 z2d(ji,jj) = z2d(ji,jj) + e3t _n(ji,jj,jk) * tsn(ji,jj,jk,jp_sal)380 z2d(ji,jj) = z2d(ji,jj) + e3t(ji,jj,jk,Kmm) * ts(ji,jj,jk,jp_sal,Kmm) 380 381 END DO 381 382 END DO … … 388 389 ! 389 390 390 IF (ln_diatmb) CALL dia_tmb 391 IF (ln_diatmb) CALL dia_tmb( Kmm ) ! tmb values 391 392 392 IF (ln_dia25h) CALL dia_25h( kt )! 25h averaging393 IF (ln_dia25h) CALL dia_25h( kt, Kmm ) ! 25h averaging 393 394 394 395 IF( ln_timing ) CALL timing_stop('dia_wri') … … 416 417 417 418 418 SUBROUTINE dia_wri( kt )419 SUBROUTINE dia_wri( kt, Kmm ) 419 420 !!--------------------------------------------------------------------- 420 421 !! *** ROUTINE dia_wri *** … … 429 430 !!---------------------------------------------------------------------- 430 431 INTEGER, INTENT( in ) :: kt ! ocean time-step index 432 INTEGER, INTENT( in ) :: Kmm ! ocean time level index 431 433 ! 432 434 LOGICAL :: ll_print = .FALSE. ! =T print and flush numout … … 446 448 ! 447 449 IF( ninist == 1 ) THEN !== Output the initial state and forcings ==! 448 CALL dia_wri_state( 'output.init' )450 CALL dia_wri_state( Kmm, 'output.init' ) 449 451 ninist = 0 450 452 ENDIF … … 583 585 & jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout ) 584 586 IF( .NOT.ln_linssh ) THEN 585 CALL histdef( nid_T, "vovvle3t", "Level thickness" , "m" ,& ! e3t _n587 CALL histdef( nid_T, "vovvle3t", "Level thickness" , "m" ,& ! e3t(:,:,:,Kmm) 586 588 & jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout ) 587 CALL histdef( nid_T, "vovvldep", "T point depth" , "m" ,& ! e3t _n589 CALL histdef( nid_T, "vovvldep", "T point depth" , "m" ,& ! e3t(:,:,:,Kmm) 588 590 & jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout ) 589 CALL histdef( nid_T, "vovvldef", "Squared level deformation" , "%^2" ,& ! e3t _n591 CALL histdef( nid_T, "vovvldef", "Squared level deformation" , "%^2" ,& ! e3t(:,:,:,Kmm) 590 592 & jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout ) 591 593 ENDIF … … 604 606 & jpi, jpj, nh_T, 1 , 1, 1 , -99 , 32, clop, zsto, zout ) 605 607 IF( ln_linssh ) THEN 606 CALL histdef( nid_T, "sosst_cd", "Concentration/Dilution term on temperature" & ! emp * ts n(:,:,1,jp_tem)608 CALL histdef( nid_T, "sosst_cd", "Concentration/Dilution term on temperature" & ! emp * ts(:,:,1,jp_tem,Kmm) 607 609 & , "KgC/m2/s", & ! sosst_cd 608 610 & jpi, jpj, nh_T, 1 , 1, 1 , -99 , 32, clop, zsto, zout ) 609 CALL histdef( nid_T, "sosss_cd", "Concentration/Dilution term on salinity" & ! emp * ts n(:,:,1,jp_sal)611 CALL histdef( nid_T, "sosss_cd", "Concentration/Dilution term on salinity" & ! emp * ts(:,:,1,jp_sal,Kmm) 610 612 & , "KgPSU/m2/s",& ! sosss_cd 611 613 & jpi, jpj, nh_T, 1 , 1, 1 , -99 , 32, clop, zsto, zout ) … … 692 694 693 695 ! !!! nid_U : 3D 694 CALL histdef( nid_U, "vozocrtx", "Zonal Current" , "m/s" , & ! u n696 CALL histdef( nid_U, "vozocrtx", "Zonal Current" , "m/s" , & ! uu(:,:,:,Kmm) 695 697 & jpi, jpj, nh_U, ipk, 1, ipk, nz_U, 32, clop, zsto, zout ) 696 698 IF( ln_wave .AND. ln_sdw) THEN … … 705 707 706 708 ! !!! nid_V : 3D 707 CALL histdef( nid_V, "vomecrty", "Meridional Current" , "m/s" , & ! v n709 CALL histdef( nid_V, "vomecrty", "Meridional Current" , "m/s" , & ! vv(:,:,:,Kmm) 708 710 & jpi, jpj, nh_V, ipk, 1, ipk, nz_V, 32, clop, zsto, zout ) 709 711 IF( ln_wave .AND. ln_sdw) THEN … … 718 720 719 721 ! !!! nid_W : 3D 720 CALL histdef( nid_W, "vovecrtz", "Vertical Velocity" , "m/s" , & ! w n722 CALL histdef( nid_W, "vovecrtz", "Vertical Velocity" , "m/s" , & ! ww 721 723 & jpi, jpj, nh_W, ipk, 1, ipk, nz_W, 32, clop, zsto, zout ) 722 724 CALL histdef( nid_W, "votkeavt", "Vertical Eddy Diffusivity" , "m2/s" , & ! avt … … 756 758 757 759 IF( .NOT.ln_linssh ) THEN 758 CALL histwrite( nid_T, "votemper", it, ts n(:,:,:,jp_tem) * e3t_n(:,:,:) , ndim_T , ndex_T ) ! heat content759 CALL histwrite( nid_T, "vosaline", it, ts n(:,:,:,jp_sal) * e3t_n(:,:,:) , ndim_T , ndex_T ) ! salt content760 CALL histwrite( nid_T, "sosstsst", it, ts n(:,:,1,jp_tem) * e3t_n(:,:,1) , ndim_hT, ndex_hT ) ! sea surface heat content761 CALL histwrite( nid_T, "sosaline", it, ts n(:,:,1,jp_sal) * e3t_n(:,:,1) , ndim_hT, ndex_hT ) ! sea surface salinity content760 CALL histwrite( nid_T, "votemper", it, ts(:,:,:,jp_tem,Kmm) * e3t(:,:,:,Kmm) , ndim_T , ndex_T ) ! heat content 761 CALL histwrite( nid_T, "vosaline", it, ts(:,:,:,jp_sal,Kmm) * e3t(:,:,:,Kmm) , ndim_T , ndex_T ) ! salt content 762 CALL histwrite( nid_T, "sosstsst", it, ts(:,:,1,jp_tem,Kmm) * e3t(:,:,1,Kmm) , ndim_hT, ndex_hT ) ! sea surface heat content 763 CALL histwrite( nid_T, "sosaline", it, ts(:,:,1,jp_sal,Kmm) * e3t(:,:,1,Kmm) , ndim_hT, ndex_hT ) ! sea surface salinity content 762 764 ELSE 763 CALL histwrite( nid_T, "votemper", it, ts n(:,:,:,jp_tem) , ndim_T , ndex_T ) ! temperature764 CALL histwrite( nid_T, "vosaline", it, ts n(:,:,:,jp_sal) , ndim_T , ndex_T ) ! salinity765 CALL histwrite( nid_T, "sosstsst", it, ts n(:,:,1,jp_tem) , ndim_hT, ndex_hT ) ! sea surface temperature766 CALL histwrite( nid_T, "sosaline", it, ts n(:,:,1,jp_sal) , ndim_hT, ndex_hT ) ! sea surface salinity765 CALL histwrite( nid_T, "votemper", it, ts(:,:,:,jp_tem,Kmm) , ndim_T , ndex_T ) ! temperature 766 CALL histwrite( nid_T, "vosaline", it, ts(:,:,:,jp_sal,Kmm) , ndim_T , ndex_T ) ! salinity 767 CALL histwrite( nid_T, "sosstsst", it, ts(:,:,1,jp_tem,Kmm) , ndim_hT, ndex_hT ) ! sea surface temperature 768 CALL histwrite( nid_T, "sosaline", it, ts(:,:,1,jp_sal,Kmm) , ndim_hT, ndex_hT ) ! sea surface salinity 767 769 ENDIF 768 770 IF( .NOT.ln_linssh ) THEN 769 zw3d(:,:,:) = ( ( e3t _n(:,:,:) - e3t_0(:,:,:) ) / e3t_0(:,:,:) * 100 * tmask(:,:,:) ) ** 2770 CALL histwrite( nid_T, "vovvle3t", it, e3t _n (:,:,:) , ndim_T , ndex_T ) ! level thickness771 CALL histwrite( nid_T, "vovvldep", it, gdept _n(:,:,:) , ndim_T , ndex_T ) ! t-point depth771 zw3d(:,:,:) = ( ( e3t(:,:,:,Kmm) - e3t_0(:,:,:) ) / e3t_0(:,:,:) * 100 * tmask(:,:,:) ) ** 2 772 CALL histwrite( nid_T, "vovvle3t", it, e3t (:,:,:,Kmm) , ndim_T , ndex_T ) ! level thickness 773 CALL histwrite( nid_T, "vovvldep", it, gdept(:,:,:,Kmm) , ndim_T , ndex_T ) ! t-point depth 772 774 CALL histwrite( nid_T, "vovvldef", it, zw3d , ndim_T , ndex_T ) ! level thickness deformation 773 775 ENDIF 774 CALL histwrite( nid_T, "sossheig", it, ssh n, ndim_hT, ndex_hT ) ! sea surface height776 CALL histwrite( nid_T, "sossheig", it, ssh(:,:,Kmm) , ndim_hT, ndex_hT ) ! sea surface height 775 777 CALL histwrite( nid_T, "sowaflup", it, ( emp-rnf ) , ndim_hT, ndex_hT ) ! upward water flux 776 778 CALL histwrite( nid_T, "sorunoff", it, rnf , ndim_hT, ndex_hT ) ! river runoffs … … 779 781 ! in linear free surface case) 780 782 IF( ln_linssh ) THEN 781 zw2d(:,:) = emp (:,:) * ts n(:,:,1,jp_tem)783 zw2d(:,:) = emp (:,:) * ts(:,:,1,jp_tem,Kmm) 782 784 CALL histwrite( nid_T, "sosst_cd", it, zw2d, ndim_hT, ndex_hT ) ! c/d term on sst 783 zw2d(:,:) = emp (:,:) * ts n(:,:,1,jp_sal)785 zw2d(:,:) = emp (:,:) * ts(:,:,1,jp_sal,Kmm) 784 786 CALL histwrite( nid_T, "sosss_cd", it, zw2d, ndim_hT, ndex_hT ) ! c/d term on sss 785 787 ENDIF … … 817 819 CALL histwrite( nid_T, "sohefldp", it, qrp , ndim_hT, ndex_hT ) ! heat flux damping 818 820 CALL histwrite( nid_T, "sowafldp", it, erp , ndim_hT, ndex_hT ) ! freshwater flux damping 819 IF( ln_ssr ) zw2d(:,:) = erp(:,:) * ts n(:,:,1,jp_sal) * tmask(:,:,1)821 IF( ln_ssr ) zw2d(:,:) = erp(:,:) * ts(:,:,1,jp_sal,Kmm) * tmask(:,:,1) 820 822 CALL histwrite( nid_T, "sosafldp", it, zw2d , ndim_hT, ndex_hT ) ! salt flux damping 821 823 ENDIF … … 823 825 CALL histwrite( nid_T, "sohefldp", it, qrp , ndim_hT, ndex_hT ) ! heat flux damping 824 826 CALL histwrite( nid_T, "sowafldp", it, erp , ndim_hT, ndex_hT ) ! freshwater flux damping 825 IF( ln_ssr ) zw2d(:,:) = erp(:,:) * ts n(:,:,1,jp_sal) * tmask(:,:,1)827 IF( ln_ssr ) zw2d(:,:) = erp(:,:) * ts(:,:,1,jp_sal,Kmm) * tmask(:,:,1) 826 828 CALL histwrite( nid_T, "sosafldp", it, zw2d , ndim_hT, ndex_hT ) ! salt flux damping 827 829 ENDIF … … 836 838 #endif 837 839 838 CALL histwrite( nid_U, "vozocrtx", it, u n, ndim_U , ndex_U ) ! i-current840 CALL histwrite( nid_U, "vozocrtx", it, uu(:,:,:,Kmm) , ndim_U , ndex_U ) ! i-current 839 841 CALL histwrite( nid_U, "sozotaux", it, utau , ndim_hU, ndex_hU ) ! i-wind stress 840 842 841 CALL histwrite( nid_V, "vomecrty", it, v n, ndim_V , ndex_V ) ! j-current843 CALL histwrite( nid_V, "vomecrty", it, vv(:,:,:,Kmm) , ndim_V , ndex_V ) ! j-current 842 844 CALL histwrite( nid_V, "sometauy", it, vtau , ndim_hV, ndex_hV ) ! j-wind stress 843 845 844 CALL histwrite( nid_W, "vovecrtz", it, w n, ndim_T, ndex_T ) ! vert. current846 CALL histwrite( nid_W, "vovecrtz", it, ww , ndim_T, ndex_T ) ! vert. current 845 847 CALL histwrite( nid_W, "votkeavt", it, avt , ndim_T, ndex_T ) ! T vert. eddy diff. coef. 846 848 CALL histwrite( nid_W, "votkeavm", it, avm , ndim_T, ndex_T ) ! T vert. eddy visc. coef. … … 869 871 #endif 870 872 871 SUBROUTINE dia_wri_state( cdfile_name )873 SUBROUTINE dia_wri_state( Kmm, cdfile_name ) 872 874 !!--------------------------------------------------------------------- 873 875 !! *** ROUTINE dia_wri_state *** … … 882 884 !! File 'output.abort.nc' is created in case of abnormal job end 883 885 !!---------------------------------------------------------------------- 886 INTEGER , INTENT( in ) :: Kmm ! time level index 884 887 CHARACTER (len=* ), INTENT( in ) :: cdfile_name ! name of the file created 885 888 !! … … 898 901 #endif 899 902 900 CALL iom_rstput( 0, 0, inum, 'votemper', ts n(:,:,:,jp_tem) ) ! now temperature901 CALL iom_rstput( 0, 0, inum, 'vosaline', ts n(:,:,:,jp_sal) ) ! now salinity902 CALL iom_rstput( 0, 0, inum, 'sossheig', ssh n) ! sea surface height903 CALL iom_rstput( 0, 0, inum, 'vozocrtx', u n) ! now i-velocity904 CALL iom_rstput( 0, 0, inum, 'vomecrty', v n) ! now j-velocity905 CALL iom_rstput( 0, 0, inum, 'vovecrtz', w n) ! now k-velocity903 CALL iom_rstput( 0, 0, inum, 'votemper', ts(:,:,:,jp_tem,Kmm) ) ! now temperature 904 CALL iom_rstput( 0, 0, inum, 'vosaline', ts(:,:,:,jp_sal,Kmm) ) ! now salinity 905 CALL iom_rstput( 0, 0, inum, 'sossheig', ssh(:,:,Kmm) ) ! sea surface height 906 CALL iom_rstput( 0, 0, inum, 'vozocrtx', uu(:,:,:,Kmm) ) ! now i-velocity 907 CALL iom_rstput( 0, 0, inum, 'vomecrty', vv(:,:,:,Kmm) ) ! now j-velocity 908 CALL iom_rstput( 0, 0, inum, 'vovecrtz', ww ) ! now k-velocity 906 909 IF( ALLOCATED(ahtu) ) THEN 907 910 CALL iom_rstput( 0, 0, inum, 'ahtu', ahtu ) ! aht at u-point … … 919 922 CALL iom_rstput( 0, 0, inum, 'sometauy', vtau ) ! j-wind stress 920 923 IF( .NOT.ln_linssh ) THEN 921 CALL iom_rstput( 0, 0, inum, 'vovvldep', gdept _n) ! T-cell depth922 CALL iom_rstput( 0, 0, inum, 'vovvle3t', e3t _n) ! T-cell thickness924 CALL iom_rstput( 0, 0, inum, 'vovvldep', gdept(:,:,:,Kmm) ) ! T-cell depth 925 CALL iom_rstput( 0, 0, inum, 'vovvle3t', e3t(:,:,:,Kmm) ) ! T-cell thickness 923 926 END IF 924 927 IF( ln_wave .AND. ln_sdw ) THEN -
NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/OCE/TRA/traadv.F90
r10954 r10965 136 136 ! 137 137 !!gm ??? 138 IF( ln_diaptr ) CALL dia_ptr( zvv )! diagnose the effective MSF138 IF( ln_diaptr ) CALL dia_ptr( Kmm, zvv ) ! diagnose the effective MSF 139 139 !!gm ??? 140 140 ! -
NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/OCE/nemogcm.F90
r10954 r10965 489 489 CALL dia_ptr_init ! Poleward TRansports initialization 490 490 IF( lk_diadct ) CALL dia_dct_init ! Sections tranports 491 CALL dia_hsb_init ! heat content, salt content and volume budgets491 CALL dia_hsb_init( Nnn ) ! heat content, salt content and volume budgets 492 492 CALL trd_init( Nnn ) ! Mixed-layer/Vorticity/Integral constraints trends 493 493 CALL dia_obs_init( Nnn ) ! Initialize observational data 494 494 CALL dia_tmb_init ! TMB outputs 495 CALL dia_25h_init ! 25h mean outputs495 CALL dia_25h_init( Nbb ) ! 25h mean outputs 496 496 IF( ln_diaobs ) CALL dia_obs( nit000-1, Nnn ) ! Observation operator for restart 497 497 -
NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/OCE/step.F90
r10957 r10965 219 219 !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 220 220 IF( lk_floats ) CALL flo_stp ( kstp ) ! drifting Floats 221 IF( ln_diacfl ) CALL dia_cfl ( kstp )! Courant number diagnostics222 IF( lk_diahth ) CALL dia_hth ( kstp )! Thermocline depth (20 degres isotherm depth)223 IF( lk_diadct ) CALL dia_dct ( kstp )! Transports224 CALL dia_ar5 ( kstp )! ar5 diag225 IF( lk_diaharm ) CALL dia_harm( kstp )! Tidal harmonic analysis226 CALL dia_wri ( kstp )! ocean model: outputs221 IF( ln_diacfl ) CALL dia_cfl ( kstp, Nnn ) ! Courant number diagnostics 222 IF( lk_diahth ) CALL dia_hth ( kstp, Nnn ) ! Thermocline depth (20 degres isotherm depth) 223 IF( lk_diadct ) CALL dia_dct ( kstp, Nnn ) ! Transports 224 CALL dia_ar5 ( kstp, Nnn ) ! ar5 diag 225 IF( lk_diaharm ) CALL dia_harm( kstp, Nnn ) ! Tidal harmonic analysis 226 CALL dia_wri ( kstp, Nnn ) ! ocean model: outputs 227 227 ! 228 228 IF( ln_crs ) CALL crs_fld ( kstp ) ! ocean model: online field coarsening & output … … 259 259 260 260 !!gm : why CALL to dia_ptr has been moved here??? (use trends info?) 261 IF( ln_diaptr ) CALL dia_ptr ! Poleward adv/ldf TRansports diagnostics261 IF( ln_diaptr ) CALL dia_ptr( Nnn ) ! Poleward adv/ldf TRansports diagnostics 262 262 !!gm 263 263 CALL tra_zdf( kstp, Nbb, Nnn, Nrhs, ts, Naa ) ! vert. mixing & after tracer ==> after … … 286 286 IF(.NOT.ln_linssh) CALL dom_vvl_sf_swp( kstp ) ! swap of vertical scale factors 287 287 ! 288 IF( ln_diahsb ) CALL dia_hsb ( kstp ) ! - ML - global conservation diagnostics288 IF( ln_diahsb ) CALL dia_hsb ( kstp, Nbb, Nnn ) ! - ML - global conservation diagnostics 289 289 290 290 !!gm : This does not only concern the dynamics ==>>> add a new title … … 309 309 ! Control 310 310 !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 311 CALL stp_ctl ( kstp, indic )311 CALL stp_ctl ( kstp, Nnn, indic ) 312 312 313 313 IF( kstp == nit000 ) THEN ! 1st time step only -
NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/OCE/stpctl.F90
r10570 r10965 42 42 CONTAINS 43 43 44 SUBROUTINE stp_ctl( kt, kindic )44 SUBROUTINE stp_ctl( kt, Kmm, kindic ) 45 45 !!---------------------------------------------------------------------- 46 46 !! *** ROUTINE stp_ctl *** … … 60 60 !!---------------------------------------------------------------------- 61 61 INTEGER, INTENT(in ) :: kt ! ocean time-step index 62 INTEGER, INTENT(in ) :: Kmm ! ocean time level index 62 63 INTEGER, INTENT(inout) :: kindic ! error indicator 63 64 !! … … 111 112 ! !== test of extrema ==! 112 113 IF( ll_wd ) THEN 113 zmax(1) = MAXVAL( ABS( ssh n(:,:) + ssh_ref*tmask(:,:,1) ) ) ! ssh max114 zmax(1) = MAXVAL( ABS( ssh(:,:,Kmm) + ssh_ref*tmask(:,:,1) ) ) ! ssh max 114 115 ELSE 115 zmax(1) = MAXVAL( ABS( ssh n(:,:) ) ) ! ssh max116 zmax(1) = MAXVAL( ABS( ssh(:,:,Kmm) ) ) ! ssh max 116 117 ENDIF 117 zmax(2) = MAXVAL( ABS( u n(:,:,:) ) ) ! velocity max (zonal only)118 zmax(3) = MAXVAL( -ts n(:,:,:,jp_sal) , mask = tmask(:,:,:) == 1._wp ) ! minus salinity max119 zmax(4) = MAXVAL( ts n(:,:,:,jp_sal) , mask = tmask(:,:,:) == 1._wp ) ! salinity max120 zmax(5) = MAXVAL( -ts n(:,:,:,jp_tem) , mask = tmask(:,:,:) == 1._wp ) ! minus temperature max121 zmax(6) = MAXVAL( ts n(:,:,:,jp_tem) , mask = tmask(:,:,:) == 1._wp ) ! temperature max118 zmax(2) = MAXVAL( ABS( uu(:,:,:,Kmm) ) ) ! velocity max (zonal only) 119 zmax(3) = MAXVAL( -ts(:,:,:,jp_sal,Kmm) , mask = tmask(:,:,:) == 1._wp ) ! minus salinity max 120 zmax(4) = MAXVAL( ts(:,:,:,jp_sal,Kmm) , mask = tmask(:,:,:) == 1._wp ) ! salinity max 121 zmax(5) = MAXVAL( -ts(:,:,:,jp_tem,Kmm) , mask = tmask(:,:,:) == 1._wp ) ! minus temperature max 122 zmax(6) = MAXVAL( ts(:,:,:,jp_tem,Kmm) , mask = tmask(:,:,:) == 1._wp ) ! temperature max 122 123 zmax(7) = REAL( nstop , wp ) ! stop indicator 123 124 IF( ln_zad_Aimp ) THEN … … 155 156 & ISNAN( zmax(1) + zmax(2) + zmax(3) ) ) ) THEN ! NaN encounter in the tests 156 157 IF( lk_mpp .AND. ln_ctl ) THEN 157 CALL mpp_maxloc( 'stpctl', ABS(ssh n) , ssmask(:,:) , zzz, ih )158 CALL mpp_maxloc( 'stpctl', ABS(u n) , umask (:,:,:), zzz, iu )159 CALL mpp_minloc( 'stpctl', ts n(:,:,:,jp_sal), tmask (:,:,:), zzz, is1 )160 CALL mpp_maxloc( 'stpctl', ts n(:,:,:,jp_sal), tmask (:,:,:), zzz, is2 )158 CALL mpp_maxloc( 'stpctl', ABS(ssh(:,:,Kmm)) , ssmask(:,:) , zzz, ih ) 159 CALL mpp_maxloc( 'stpctl', ABS(uu(:,:,:,Kmm)) , umask (:,:,:), zzz, iu ) 160 CALL mpp_minloc( 'stpctl', ts(:,:,:,jp_sal,Kmm), tmask (:,:,:), zzz, is1 ) 161 CALL mpp_maxloc( 'stpctl', ts(:,:,:,jp_sal,Kmm), tmask (:,:,:), zzz, is2 ) 161 162 ELSE 162 ih(:) = MAXLOC( ABS( ssh n(:,:) ) ) + (/ nimpp - 1, njmpp - 1 /)163 iu(:) = MAXLOC( ABS( u n (:,:,:) ) ) + (/ nimpp - 1, njmpp - 1, 0 /)164 is1(:) = MINLOC( ts n(:,:,:,jp_sal), mask = tmask(:,:,:) == 1._wp ) + (/ nimpp - 1, njmpp - 1, 0 /)165 is2(:) = MAXLOC( ts n(:,:,:,jp_sal), mask = tmask(:,:,:) == 1._wp ) + (/ nimpp - 1, njmpp - 1, 0 /)163 ih(:) = MAXLOC( ABS( ssh(:,:,Kmm) ) ) + (/ nimpp - 1, njmpp - 1 /) 164 iu(:) = MAXLOC( ABS( uu (:,:,:,Kmm) ) ) + (/ nimpp - 1, njmpp - 1, 0 /) 165 is1(:) = MINLOC( ts(:,:,:,jp_sal,Kmm), mask = tmask(:,:,:) == 1._wp ) + (/ nimpp - 1, njmpp - 1, 0 /) 166 is2(:) = MAXLOC( ts(:,:,:,jp_sal,Kmm), mask = tmask(:,:,:) == 1._wp ) + (/ nimpp - 1, njmpp - 1, 0 /) 166 167 ENDIF 167 168 … … 173 174 WRITE(ctmp6,*) ' ===> output of last computed fields in output.abort.nc file' 174 175 175 CALL dia_wri_state( 'output.abort' ) ! create an output.abort file176 CALL dia_wri_state( Kmm, 'output.abort' ) ! create an output.abort file 176 177 177 178 IF( .NOT. ln_ctl ) THEN
Note: See TracChangeset
for help on using the changeset viewer.