Changeset 6914 for branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/CONFIG/OVERFLOW/MY_SRC/usrdef_zgr.F90
- Timestamp:
- 2016-09-06T13:27:38+02:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/CONFIG/OVERFLOW/MY_SRC/usrdef_zgr.F90
r6906 r6914 2 2 !!============================================================================== 3 3 !! *** MODULE usrdef_zgr *** 4 !! 5 !! === OVERFLOW case === 6 !! 4 7 !! Ocean domain : user defined vertical coordinate system 5 !!6 !! === OVERFLOW case ===7 !!8 8 !!============================================================================== 9 !! History : 4.0 ! 2016-08 (G. Madec) Original code 10 !!---------------------------------------------------------------------- 11 12 !!---------------------------------------------------------------------- 13 !! usr_def_zgr : user defined vertical coordinate system (required) 14 !! zgr_z1d : reference 1D z-coordinate 15 !! zgr_zps : 3D vertical coordinate in z-partial cell coordinate 9 !! History : 4.0 ! 2016-08 (G. Madec, S. Flavoni) Original code 10 !!---------------------------------------------------------------------- 11 12 !!---------------------------------------------------------------------- 13 !! usr_def_zgr : user defined vertical coordinate system (required) 14 !! zgr_z1d : reference 1D z-coordinate 16 15 !!--------------------------------------------------------------------- 17 USE oce 18 USE dom_oce 19 USE dom_oce , ONLY: nimpp, njmpp! ocean space and time domain20 USE dom_oce 21 USE usrdef_nam 16 USE oce ! ocean variables 17 USE dom_oce , ONLY: ln_zco, ln_zps, ln_sco ! ocean space and time domain 18 USE dom_oce , ONLY: mi0, mi1, nimpp, njmpp ! ocean space and time domain 19 USE dom_oce , ONLY: glamt ! ocean space and time domain 20 USE usrdef_nam ! User defined : namelist variables 22 21 ! 23 USE in_out_manager 24 USE lbclnk 25 USE lib_mpp 26 USE wrk_nemo 27 USE timing 22 USE in_out_manager ! I/O manager 23 USE lbclnk ! ocean lateral boundary conditions (or mpp link) 24 USE lib_mpp ! distributed memory computing library 25 USE wrk_nemo ! Memory allocation 26 USE timing ! Timing 28 27 29 28 IMPLICIT NONE … … 70 69 ! 71 70 IF(lwp) WRITE(numout,*) 72 IF(lwp) WRITE(numout,*) 'usr_def_zgr : OVERFLOW configuration (z -coordinate closed box ocean without cavities)'71 IF(lwp) WRITE(numout,*) 'usr_def_zgr : OVERFLOW configuration (z(ps)- or s-coordinate closed box ocean without cavities)' 73 72 IF(lwp) WRITE(numout,*) '~~~~~~~~~~~' 74 73 ! … … 86 85 ! 87 86 ! western continental shelf (500m deep) and eastern deep ocean (2000m deep) 87 ! (set through the jpk and jpi (see userdef_nam.F90)) 88 88 ! with a hyperbolic tangent transition centered at 40km 89 89 ! NB: here glamt is in kilometers … … 91 91 zht(:,:) = + ( 500. + 0.5 * 1500. * ( 1.0 + tanh( (glamt(:,:) - 40.) / 7. ) ) ) 92 92 ! 93 ! at u-point: recompute from glamu (see usrdef_hgr.F90) to avoid the masking when using lbc_lnk 94 zfact = rn_dx * 1.e-3 ! conversion in km 95 DO ji = 1, jpi 96 zhu(ji,:) = + ( 500. + 0.5 * 1500. * ( 1.0 + tanh( ( zfact * REAL( ji-1 + nimpp-1 , wp ) - 40.) / 7. ) ) ) 97 END DO 98 ! 93 ! at u-point: averaging zht 94 DO ji = 1, jpim1 95 zhu(ji,:) = 0.5_wp * ( zht(ji,:) + zht(ji+1,:) ) 96 END DO 97 CALL lbc_lnk( zhu, 'U', 1. ) ! boundary condition: this mask the surrouding grid-points 98 ! ! ==>>> set by hand non-zero value on first/last columns & rows 99 DO ji = mi0(1), mi1(1) ! first row of global domain only 100 zhu(ji,2) = zht(1,2) 101 END DO 102 DO ji = mi0(jpi), mi1(jpi) ! last row of global domain only 103 zhu(ji,2) = zht(jpi,2) 104 END DO 105 zhu(:,1) = zhu(:,2) 106 zhu(:,3) = zhu(:,2) 107 ! 99 108 CALL zgr_z1d( pdept_1d, pdepw_1d, pe3t_1d , pe3w_1d ) ! Reference z-coordinate system 100 109 ! … … 105 114 ! the ocean basin surrounded by land (1 grid-point) set through lbc_lnk call as jperio=0 106 115 z2d(:,:) = 1._wp ! surface ocean is the 1st level 107 CALL lbc_lnk( z2d, 'T', 1. ) ! closed basin 108 k_top(:,:) = z2d(:,:)116 CALL lbc_lnk( z2d, 'T', 1. ) ! closed basin since jperio = 0 (see userdef_nam.F90) 117 k_top(:,:) = NINT( z2d(:,:) ) 109 118 ! 110 119 ! … … 162 171 k_bot(:,:) = jpkm1 163 172 DO jk = jpkm1, 1, -1 164 WHERE( zht(:,:) < =pdepw_1d(jk) + ze3min ) k_bot(:,:) = jk-1173 WHERE( zht(:,:) < pdepw_1d(jk) + ze3min ) k_bot(:,:) = jk-1 165 174 END DO 166 175 ! … … 180 189 DO ji = 1, jpi 181 190 ik = k_bot(ji,jj) 182 IF( ik /= jpkm1 ) THEN ! last level ==> ref 1d z-coordinate183 191 pdepw(ji,jj,ik+1) = MIN( zht(ji,jj) , pdepw_1d(ik+1) ) 184 192 pe3t (ji,jj,ik ) = pdepw(ji,jj,ik+1) - pdepw(ji,jj,ik) 185 pe3t (ji,jj,ik+1) = pe3t (ji,jj,ik )193 pe3t (ji,jj,ik+1) = pe3t (ji,jj,ik ) 186 194 ! 187 pdept(ji,jj,ik ) = pdep t(ji,jj,ik-1) + pe3t(ji,jj,ik) * 0.5_wp188 p e3w (ji,jj,ik+1) = pdepw(ji,jj,ik+1) - pdepw(ji,jj,ik)189 ENDIF195 pdept(ji,jj,ik ) = pdepw(ji,jj,ik ) + pe3t (ji,jj,ik ) * 0.5_wp 196 pdept(ji,jj,ik+1) = pdepw(ji,jj,ik+1) + pe3t (ji,jj,ik+1) * 0.5_wp 197 pe3w (ji,jj,ik+1) = pdept(ji,jj,ik+1) - pdept(ji,jj,ik) ! = pe3t (ji,jj,ik ) 190 198 END DO 191 199 END DO … … 194 202 pe3u (:,:,:) = pe3t(:,:,:) ! HERE OVERFLOW configuration : 195 203 pe3v (:,:,:) = pe3t(:,:,:) ! e3 increases with i-index and identical with j-index 196 pe3f (:,:,:) = pe3t(:,:,:) ! so e3 minimum of (i,i+1) points is (i) point (idem in j-direction)197 pe3uw(:,:,:) = pe3w(:,:,:) ! 204 pe3f (:,:,:) = pe3t(:,:,:) ! so e3 minimum of (i,i+1) points is (i) point 205 pe3uw(:,:,:) = pe3w(:,:,:) ! in j-direction e3v=e3t and e3f=e3v 198 206 pe3vw(:,:,:) = pe3w(:,:,:) ! ==>> no need of lbc_lnk calls 199 207 !
Note: See TracChangeset
for help on using the changeset viewer.