- Timestamp:
- 2020-12-02T16:32:24+01:00 (4 years ago)
- Location:
- NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/src/OCE/DOM
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/src/OCE/DOM/daymod.F90
r13558 r14017 19 19 !! ----------- WARNING ----------- 20 20 !! ------------------------------- 21 !! sbcmod assume that the time step is dividing the number of second of 22 !! in a day, i.e. ===> MOD( rday, rn_Dt ) == 0 21 !! sbcmod assume that the time step is dividing the number of second of 22 !! in a day, i.e. ===> MOD( rday, rn_Dt ) == 0 23 23 !! except when user defined forcing is used (see sbcmod.F90) 24 24 !!---------------------------------------------------------------------- … … 84 84 lrst_oce = .NOT. l_offline ! force definition of offline 85 85 IF( lrst_oce ) CALL day_rst( nit000, 'READ' ) 86 86 87 87 ! set the calandar from ndastp (read in restart file and namelist) 88 88 nyear = ndastp / 10000 … … 94 94 isecrst = ( nhour * NINT(rhhmm) + nminute ) * NINT(rmmss) 95 95 96 CALL ymds2ju( nyear, nmonth, nday, REAL(isecrst,wp), fjulday ) 96 CALL ymds2ju( nyear, nmonth, nday, REAL(isecrst,wp), fjulday ) 97 97 IF( ABS(fjulday - REAL(NINT(fjulday),wp)) < 0.1 / rday ) fjulday = REAL(NINT(fjulday),wp) ! avoid truncation error 98 98 IF( nhour*NINT(rhhmm*rmmss) + nminute*NINT(rmmss) - ndt05 .LT. 0 ) fjulday = fjulday+1. ! move back to the day at nit000 (and not at nit000 - 1) … … 124 124 IF( isecrst - ndt05 .GT. 0 ) THEN 125 125 ! 1 timestep before current middle of first time step is still the same day 126 nsec_year = (nday_year-1) * nsecd + isecrst - ndt05 127 nsec_month = (nday-1) * nsecd + isecrst - ndt05 126 nsec_year = (nday_year-1) * nsecd + isecrst - ndt05 127 nsec_month = (nday-1) * nsecd + isecrst - ndt05 128 128 ELSE 129 ! 1 time step before the middle of the first time step is the previous day 130 nsec_year = nday_year * nsecd + isecrst - ndt05 131 nsec_month = nday * nsecd + isecrst - ndt05 129 ! 1 time step before the middle of the first time step is the previous day 130 nsec_year = nday_year * nsecd + isecrst - ndt05 131 nsec_month = nday * nsecd + isecrst - ndt05 132 132 ENDIF 133 133 nsec_monday = imonday * nsecd + isecrst - ndt05 134 nsec_day = isecrst - ndt05 134 nsec_day = isecrst - ndt05 135 135 IF( nsec_day .LT. 0 ) nsec_day = nsec_day + nsecd 136 136 IF( nsec_monday .LT. 0 ) nsec_monday = nsec_monday + nsecd*7 … … 144 144 nsec000_1jan000 = nsec1jan000 + nsec_year + ndt05 145 145 nsecend_1jan000 = nsec000_1jan000 + ndt * ( nitend - nit000 + 1 ) 146 146 147 147 ! Up to now, calendar parameters are related to the end of previous run (nit000-1) 148 148 ! call day to set the calendar parameters at the begining of the current simulaton. needed by iom_init 149 149 CALL day( nit000 ) 150 150 ! 151 IF( lwxios ) THEN152 ! define variables in restart file when writing with XIOS153 CALL iom_set_rstw_var_active('kt')154 CALL iom_set_rstw_var_active('ndastp')155 CALL iom_set_rstw_var_active('adatrj')156 CALL iom_set_rstw_var_active('ntime')157 ENDIF158 159 151 END SUBROUTINE day_init 160 152 … … 324 316 325 317 IF( TRIM(cdrw) == 'READ' ) THEN 326 327 318 IF( iom_varid( numror, 'kt', ldstop = .FALSE. ) > 0 ) THEN 328 319 ! Get Calendar informations 329 CALL iom_get( numror, 'kt', zkt , ldxios = lrxios) ! last time-step of previous run320 CALL iom_get( numror, 'kt', zkt ) ! last time-step of previous run 330 321 IF(lwp) THEN 331 322 WRITE(numout,*) ' *** Info read in restart : ' … … 346 337 IF ( nrstdt == 2 ) THEN 347 338 ! read the parameters corresponding to nit000 - 1 (last time step of previous run) 348 CALL iom_get( numror, 'ndastp', zndastp , ldxios = lrxios)339 CALL iom_get( numror, 'ndastp', zndastp ) 349 340 ndastp = NINT( zndastp ) 350 CALL iom_get( numror, 'adatrj', adatrj , ldxios = lrxios)351 CALL iom_get( numror, 'ntime' , ktime , ldxios = lrxios)341 CALL iom_get( numror, 'adatrj', adatrj ) 342 CALL iom_get( numror, 'ntime' , ktime ) 352 343 nn_time0 = NINT(ktime) 353 344 ! calculate start time in hours and minutes 354 345 zdayfrac = adatrj - REAL(INT(adatrj), wp) 355 ksecs = NINT(zdayfrac * rday) ! Nearest second to catch rounding errors in adatrj 346 ksecs = NINT(zdayfrac * rday) ! Nearest second to catch rounding errors in adatrj 356 347 ihour = ksecs / NINT( rhhmm*rmmss ) 357 348 iminute = ksecs / NINT(rmmss) - ihour*NINT(rhhmm) 358 349 359 350 ! Add to nn_time0 360 351 nhour = nn_time0 / 100 361 352 nminute = ( nn_time0 - nhour * 100 ) 362 353 nminute = nminute + iminute 363 354 364 355 IF( nminute >= NINT(rhhmm) ) THEN 365 356 nminute = nminute - NINT(rhhmm) … … 370 361 nhour = nhour - NINT(rjjhh) 371 362 adatrj = adatrj + 1. 372 ENDIF 363 ENDIF 373 364 nn_time0 = nhour * 100 + nminute 374 adatrj = REAL(INT(adatrj), wp) ! adatrj set to integer as nn_time0 updated 365 adatrj = REAL(INT(adatrj), wp) ! adatrj set to integer as nn_time0 updated 375 366 ELSE 376 367 ! parameters corresponding to nit000 - 1 (as we start the step loop with a call to day) … … 410 401 ENDIF 411 402 ! calendar control 412 IF( lwxios ) CALL iom_swap( cwxios_context ) 413 CALL iom_rstput( kt, nitrst, numrow, 'kt' , REAL( kt , wp) , ldxios = lwxios ) ! time-step 414 CALL iom_rstput( kt, nitrst, numrow, 'ndastp' , REAL( ndastp, wp) , ldxios = lwxios ) ! date 415 CALL iom_rstput( kt, nitrst, numrow, 'adatrj' , adatrj , ldxios = lwxios ) ! number of elapsed days since 403 CALL iom_rstput( kt, nitrst, numrow, 'kt' , REAL( kt , wp) ) ! time-step 404 CALL iom_rstput( kt, nitrst, numrow, 'ndastp' , REAL( ndastp, wp) ) ! date 405 CALL iom_rstput( kt, nitrst, numrow, 'adatrj' , adatrj ) ! number of elapsed days since 416 406 ! ! the begining of the run [s] 417 CALL iom_rstput( kt, nitrst, numrow, 'ntime' , REAL( nn_time0, wp), ldxios = lwxios ) ! time 418 IF( lwxios ) CALL iom_swap( cxios_context ) 407 CALL iom_rstput( kt, nitrst, numrow, 'ntime' , REAL( nn_time0, wp) ) ! time 419 408 ENDIF 420 409 ! -
NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/src/OCE/DOM/dom_oce.F90
r13557 r14017 4 4 !! ** Purpose : Define in memory all the ocean space domain variables 5 5 !!====================================================================== 6 !! History : 1.0 ! 2005-10 (A. Beckmann, G. Madec) reactivate s-coordinate 6 !! History : 1.0 ! 2005-10 (A. Beckmann, G. Madec) reactivate s-coordinate 7 7 !! 3.3 ! 2010-11 (G. Madec) add mbk. arrays associated to the deepest ocean level 8 8 !! 3.4 ! 2011-01 (A. R. Porter, STFC Daresbury) dynamical allocation … … 72 72 ! ! = 6 cyclic East-West AND North fold F-point pivot 73 73 ! ! = 7 bi-cyclic East-West AND North-South 74 LOGICAL, PUBLIC :: l_Iperio, l_Jperio ! should we explicitely take care I/J periodicity 74 LOGICAL, PUBLIC :: l_Iperio, l_Jperio ! should we explicitely take care I/J periodicity 75 76 ! Tiling namelist 77 LOGICAL, PUBLIC :: ln_tile 78 INTEGER :: nn_ltile_i, nn_ltile_j 79 80 ! Domain tiling (all tiles) 81 INTEGER, PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: ntsi_a !: start of internal part of tile domain 82 INTEGER, PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: ntsj_a ! 83 INTEGER, PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: ntei_a !: end of internal part of tile domain 84 INTEGER, PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: ntej_a ! 75 85 76 86 ! !: domain MPP decomposition parameters … … 81 91 INTEGER, ALLOCATABLE, PUBLIC :: nbondi_bdy(:) !: mark i-direction local boundaries for BDY open boundaries 82 92 INTEGER, ALLOCATABLE, PUBLIC :: nbondj_bdy(:) !: mark j-direction local boundaries for BDY open boundaries 83 INTEGER, ALLOCATABLE, PUBLIC :: nbondi_bdy_b(:) !: mark i-direction of neighbours local boundaries for BDY open boundaries 84 INTEGER, ALLOCATABLE, PUBLIC :: nbondj_bdy_b(:) !: mark j-direction of neighbours local boundaries for BDY open boundaries 93 INTEGER, ALLOCATABLE, PUBLIC :: nbondi_bdy_b(:) !: mark i-direction of neighbours local boundaries for BDY open boundaries 94 INTEGER, ALLOCATABLE, PUBLIC :: nbondj_bdy_b(:) !: mark j-direction of neighbours local boundaries for BDY open boundaries 85 95 86 96 INTEGER, PUBLIC :: npolj !: north fold mark (0, 3 or 4) 87 97 INTEGER, PUBLIC :: noea, nowe !: index of the local neighboring processors in 88 98 INTEGER, PUBLIC :: noso, nono !: east, west, south and north directions 99 INTEGER, PUBLIC :: nones, nonws !: north-east, north-west directions for sending 100 INTEGER, PUBLIC :: noses, nosws !: south-east, south-west directions for sending 101 INTEGER, PUBLIC :: noner, nonwr !: north-east, north-west directions for receiving 102 INTEGER, PUBLIC :: noser, noswr !: south-east, south-west directions for receiving 89 103 INTEGER, PUBLIC :: nidom !: ??? 90 104 … … 128 142 LOGICAL, PUBLIC :: ln_zps !: z-coordinate - partial step 129 143 LOGICAL, PUBLIC :: ln_sco !: s-coordinate or hybrid z-s coordinate 130 LOGICAL, PUBLIC :: ln_isfcav !: presence of ISF 144 LOGICAL, PUBLIC :: ln_isfcav !: presence of ISF 131 145 ! ! reference scale factors 132 146 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: e3t_0 !: t- vert. scale factor [m] … … 152 166 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: gde3w_0 !: w- depth (sum of e3w) [m] 153 167 ! ! time-dependent depths of cells 154 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: gdept, gdepw 155 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: gde3w 156 168 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: gdept, gdepw 169 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: gde3w 170 157 171 ! ! reference heights of ocean water column and its inverse 158 172 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: ht_0, r1_ht_0 !: t-depth [m] and [1/m] … … 168 182 169 183 INTEGER, PUBLIC :: nla10 !: deepest W level Above ~10m (nlb10 - 1) 170 INTEGER, PUBLIC :: nlb10 !: shallowest W level Bellow ~10m (nla10 + 1) 184 INTEGER, PUBLIC :: nlb10 !: shallowest W level Bellow ~10m (nla10 + 1) 171 185 172 186 !! 1D reference vertical coordinate … … 208 222 INTEGER , PUBLIC :: nsec_monday !: seconds between 00h of the last Monday and half of the current time step 209 223 INTEGER , PUBLIC :: nsec_day !: seconds between 00h of the current day and half of the current time step 210 REAL(wp), PUBLIC :: fjulday !: current julian day 224 REAL(wp), PUBLIC :: fjulday !: current julian day 211 225 REAL(wp), PUBLIC :: fjulstartyear !: first day of the current year in julian days 212 226 REAL(wp), PUBLIC :: adatrj !: number of elapsed days since the begining of the whole simulation … … 236 250 !!---------------------------------------------------------------------- 237 251 !! NEMO/OCE 4.0 , NEMO Consortium (2018) 238 !! $Id$ 252 !! $Id$ 239 253 !! Software governed by the CeCILL license (see ./LICENSE) 240 254 !!---------------------------------------------------------------------- … … 254 268 255 269 CHARACTER(len=3) FUNCTION Agrif_CFixed() 256 Agrif_CFixed = '0' 270 Agrif_CFixed = '0' 257 271 END FUNCTION Agrif_CFixed 258 272 #endif … … 296 310 ALLOCATE( e3t(jpi,jpj,jpk,jpt) , e3u (jpi,jpj,jpk,jpt) , e3v (jpi,jpj,jpk,jpt) , e3f(jpi,jpj,jpk) , & 297 311 & e3w(jpi,jpj,jpk,jpt) , e3uw(jpi,jpj,jpk,jpt) , e3vw(jpi,jpj,jpk,jpt) , STAT=ierr(ii) ) 298 #endif 312 #endif 299 313 ! 300 314 ii = ii+1 301 315 ALLOCATE( r3t (jpi,jpj,jpt) , r3u (jpi,jpj,jpt) , r3v (jpi,jpj,jpt) , r3f (jpi,jpj) , & 302 & r3t_f(jpi,jpj) , r3u_f(jpi,jpj) , r3v_f(jpi,jpj) , STAT=ierr(ii) ) 316 & r3t_f(jpi,jpj) , r3u_f(jpi,jpj) , r3v_f(jpi,jpj) , STAT=ierr(ii) ) 303 317 ! 304 318 ii = ii+1 … … 317 331 ! 318 332 ii = ii+1 319 ALLOCATE( risfdep(jpi,jpj) , bathy(jpi,jpj) , STAT=ierr(ii) ) 333 ALLOCATE( risfdep(jpi,jpj) , bathy(jpi,jpj) , STAT=ierr(ii) ) 320 334 ! 321 335 ii = ii+1 … … 323 337 ! 324 338 ii = ii+1 325 ALLOCATE( tmask_i(jpi,jpj) , tmask_h(jpi,jpj) , & 339 ALLOCATE( tmask_i(jpi,jpj) , tmask_h(jpi,jpj) , & 326 340 & ssmask (jpi,jpj) , ssumask(jpi,jpj) , ssvmask(jpi,jpj) , ssfmask(jpi,jpj) , & 327 341 & mbkt (jpi,jpj) , mbku (jpi,jpj) , mbkv (jpi,jpj) , STAT=ierr(ii) ) … … 331 345 ! 332 346 ii = ii+1 333 ALLOCATE( tmask(jpi,jpj,jpk) , umask(jpi,jpj,jpk) , & 347 ALLOCATE( tmask(jpi,jpj,jpk) , umask(jpi,jpj,jpk) , & 334 348 & vmask(jpi,jpj,jpk) , fmask(jpi,jpj,jpk) , STAT=ierr(ii) ) 335 349 ! -
NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/src/OCE/DOM/domain.F90
r13558 r14017 6 6 !! History : OPA ! 1990-10 (C. Levy - G. Madec) Original code 7 7 !! ! 1992-01 (M. Imbard) insert time step initialization 8 !! ! 1996-06 (G. Madec) generalized vertical coordinate 8 !! ! 1996-06 (G. Madec) generalized vertical coordinate 9 9 !! ! 1997-02 (G. Madec) creation of domwri.F 10 10 !! ! 2001-05 (E.Durand - G. Madec) insert closed sea … … 17 17 !! 4.x ! 2020-02 (G. Madec, S. Techene) introduce ssh to h0 ratio 18 18 !!---------------------------------------------------------------------- 19 19 20 20 !!---------------------------------------------------------------------- 21 21 !! dom_init : initialize the space and time domain … … 45 45 USE closea , ONLY : dom_clo ! closed seas 46 46 ! 47 USE prtctl ! Print control (prt_ctl_info routine) 47 48 USE in_out_manager ! I/O manager 48 49 USE iom ! I/O library … … 55 56 PUBLIC dom_init ! called by nemogcm.F90 56 57 PUBLIC domain_cfg ! called by nemogcm.F90 58 PUBLIC dom_tile ! called by step.F90 57 59 58 60 !!------------------------------------------------------------------------- … … 63 65 CONTAINS 64 66 65 SUBROUTINE dom_init( Kbb, Kmm, Kaa , cdstr)67 SUBROUTINE dom_init( Kbb, Kmm, Kaa ) 66 68 !!---------------------------------------------------------------------- 67 69 !! *** ROUTINE dom_init *** 68 !! 69 !! ** Purpose : Domain initialization. Call the routines that are 70 !! required to create the arrays which define the space 70 !! 71 !! ** Purpose : Domain initialization. Call the routines that are 72 !! required to create the arrays which define the space 71 73 !! and time domain of the ocean model. 72 74 !! … … 79 81 !!---------------------------------------------------------------------- 80 82 INTEGER , INTENT(in) :: Kbb, Kmm, Kaa ! ocean time level indices 81 CHARACTER (len=*), INTENT(in) :: cdstr ! model: NEMO or SAS. Determines core restart variables82 83 ! 83 84 INTEGER :: ji, jj, jk, jt ! dummy loop indices 84 85 INTEGER :: iconf = 0 ! local integers 85 CHARACTER (len=64) :: cform = "(A12, 3(A13, I7))" 86 CHARACTER (len=64) :: cform = "(A12, 3(A13, I7))" 86 87 INTEGER , DIMENSION(jpi,jpj) :: ik_top , ik_bot ! top and bottom ocean level 87 88 REAL(wp), DIMENSION(jpi,jpj) :: z1_hu_0, z1_hv_0 … … 120 121 WRITE(numout,*) ' cn_cfg = ', TRIM( cn_cfg ), ' nn_cfg = ', nn_cfg 121 122 ENDIF 123 nn_wxios = 0 124 ln_xios_read = .FALSE. 122 125 ! 123 126 ! !== Reference coordinate system ==! 124 127 ! 125 CALL dom_glo ! global domain versus local domain 126 CALL dom_nam ! read namelist ( namrun, namdom ) 127 ! 128 IF( lwxios ) THEN 129 !define names for restart write and set core output (restart.F90) 130 CALL iom_set_rst_vars(rst_wfields) 131 CALL iom_set_rstw_core(cdstr) 132 ENDIF 133 !reset namelist for SAS 134 IF(cdstr == 'SAS') THEN 135 IF(lrxios) THEN 136 IF(lwp) write(numout,*) 'Disable reading restart file using XIOS for SAS' 137 lrxios = .FALSE. 138 ENDIF 139 ENDIF 128 CALL dom_glo ! global domain versus local domain 129 CALL dom_nam ! read namelist ( namrun, namdom ) 130 CALL dom_tile( ntsi, ntsj, ntei, ntej ) ! Tile domain 131 140 132 ! 141 133 CALL dom_hgr ! Horizontal mesh … … 224 216 WRITE(numout,*) 'dom_init : ==>>> END of domain initialization' 225 217 WRITE(numout,*) '~~~~~~~~' 226 WRITE(numout,*) 218 WRITE(numout,*) 227 219 ENDIF 228 220 ! … … 236 228 !! ** Purpose : initialization of global domain <--> local domain indices 237 229 !! 238 !! ** Method : 230 !! ** Method : 239 231 !! 240 232 !! ** Action : - mig , mjg : local domain indices ==> global domain, including halos, indices … … 255 247 ! 256 248 mig0(:) = mig(:) - nn_hls 257 mjg0(:) = mjg(:) - nn_hls 258 ! WARNING: to keep compatibility with the trunk that was including periodocity into the input data, 249 mjg0(:) = mjg(:) - nn_hls 250 ! WARNING: to keep compatibility with the trunk that was including periodocity into the input data, 259 251 ! we must define mig0 and mjg0 as bellow. 260 252 ! Once we decide to forget trunk compatibility, we must simply define mig0 and mjg0 as: … … 263 255 ! 264 256 ! ! global domain, including halos, indices ==> local domain indices 265 ! ! (return (m.0,m.1)=(1,0) if data domain gridpoint is to the west/south of the 266 ! ! local domain, or (m.0,m.1)=(jp.+1,jp.) to the east/north of local domain. 257 ! ! (return (m.0,m.1)=(1,0) if data domain gridpoint is to the west/south of the 258 ! ! local domain, or (m.0,m.1)=(jp.+1,jp.) to the east/north of local domain. 267 259 DO ji = 1, jpiglo 268 260 mi0(ji) = MAX( 1 , MIN( ji - nimpp + 1, jpi+1 ) ) … … 285 277 286 278 279 SUBROUTINE dom_tile( ktsi, ktsj, ktei, ktej, ktile ) 280 !!---------------------------------------------------------------------- 281 !! *** ROUTINE dom_tile *** 282 !! 283 !! ** Purpose : Set tile domain variables 284 !! 285 !! ** Action : - ktsi, ktsj : start of internal part of domain 286 !! - ktei, ktej : end of internal part of domain 287 !! - ntile : current tile number 288 !! - nijtile : total number of tiles 289 !!---------------------------------------------------------------------- 290 INTEGER, INTENT(out) :: ktsi, ktsj, ktei, ktej ! Tile domain indices 291 INTEGER, INTENT(in), OPTIONAL :: ktile ! Tile number 292 INTEGER :: jt ! dummy loop argument 293 INTEGER :: iitile, ijtile ! Local integers 294 CHARACTER (len=11) :: charout 295 !!---------------------------------------------------------------------- 296 IF( PRESENT(ktile) .AND. ln_tile ) THEN 297 ntile = ktile ! Set domain indices for tile 298 ktsi = ntsi_a(ktile) 299 ktsj = ntsj_a(ktile) 300 ktei = ntei_a(ktile) 301 ktej = ntej_a(ktile) 302 303 IF(sn_cfctl%l_prtctl) THEN 304 WRITE(charout, FMT="('ntile =', I4)") ktile 305 CALL prt_ctl_info( charout ) 306 ENDIF 307 ELSE 308 ntile = 0 ! Initialise to full domain 309 nijtile = 1 310 ktsi = Nis0 311 ktsj = Njs0 312 ktei = Nie0 313 ktej = Nje0 314 315 IF( ln_tile ) THEN ! Calculate tile domain indices 316 iitile = Ni_0 / nn_ltile_i ! Number of tiles 317 ijtile = Nj_0 / nn_ltile_j 318 IF( MOD( Ni_0, nn_ltile_i ) /= 0 ) iitile = iitile + 1 319 IF( MOD( Nj_0, nn_ltile_j ) /= 0 ) ijtile = ijtile + 1 320 321 nijtile = iitile * ijtile 322 ALLOCATE( ntsi_a(0:nijtile), ntsj_a(0:nijtile), ntei_a(0:nijtile), ntej_a(0:nijtile) ) 323 324 ntsi_a(0) = ktsi ! Full domain 325 ntsj_a(0) = ktsj 326 ntei_a(0) = ktei 327 ntej_a(0) = ktej 328 329 DO jt = 1, nijtile ! Tile domains 330 ntsi_a(jt) = Nis0 + nn_ltile_i * MOD(jt - 1, iitile) 331 ntsj_a(jt) = Njs0 + nn_ltile_j * ((jt - 1) / iitile) 332 ntei_a(jt) = MIN(ntsi_a(jt) + nn_ltile_i - 1, Nie0) 333 ntej_a(jt) = MIN(ntsj_a(jt) + nn_ltile_j - 1, Nje0) 334 ENDDO 335 ENDIF 336 337 IF(lwp) THEN ! control print 338 WRITE(numout,*) 339 WRITE(numout,*) 'dom_tile : Domain tiling decomposition' 340 WRITE(numout,*) '~~~~~~~~' 341 IF( ln_tile ) THEN 342 WRITE(numout,*) iitile, 'tiles in i' 343 WRITE(numout,*) ' Starting indices' 344 WRITE(numout,*) ' ', (ntsi_a(jt), jt=1, iitile) 345 WRITE(numout,*) ' Ending indices' 346 WRITE(numout,*) ' ', (ntei_a(jt), jt=1, iitile) 347 WRITE(numout,*) ijtile, 'tiles in j' 348 WRITE(numout,*) ' Starting indices' 349 WRITE(numout,*) ' ', (ntsj_a(jt), jt=1, nijtile, iitile) 350 WRITE(numout,*) ' Ending indices' 351 WRITE(numout,*) ' ', (ntej_a(jt), jt=1, nijtile, iitile) 352 ELSE 353 WRITE(numout,*) 'No domain tiling' 354 WRITE(numout,*) ' i indices =', ktsi, ':', ktei 355 WRITE(numout,*) ' j indices =', ktsj, ':', ktej 356 ENDIF 357 ENDIF 358 ENDIF 359 END SUBROUTINE dom_tile 360 361 287 362 SUBROUTINE dom_nam 288 363 !!---------------------------------------------------------------------- 289 364 !! *** ROUTINE dom_nam *** 290 !! 365 !! 291 366 !! ** Purpose : read domaine namelists and print the variables. 292 367 !! 293 368 !! ** input : - namrun namelist 294 369 !! - namdom namelist 370 !! - namtile namelist 295 371 !! - namnc4 namelist ! "key_netcdf4" only 296 372 !!---------------------------------------------------------------------- … … 305 381 & ln_cfmeta, ln_xios_read, nn_wxios 306 382 NAMELIST/namdom/ ln_linssh, rn_Dt, rn_atfp, ln_crs, ln_meshmask 383 NAMELIST/namtile/ ln_tile, nn_ltile_i, nn_ltile_j 307 384 #if defined key_netcdf4 308 385 NAMELIST/namnc4/ nn_nchunks_i, nn_nchunks_j, nn_nchunks_k, ln_nc4zip … … 377 454 l_1st_euler = ln_1st_euler 378 455 IF( .NOT. l_1st_euler .AND. .NOT. ln_rstart ) THEN 379 IF(lwp) WRITE(numout,*) 456 IF(lwp) WRITE(numout,*) 380 457 IF(lwp) WRITE(numout,*)' ==>>> Start from rest (ln_rstart=F)' 381 IF(lwp) WRITE(numout,*)' an Euler initial time step is used : l_1st_euler is forced to .true. ' 458 IF(lwp) WRITE(numout,*)' an Euler initial time step is used : l_1st_euler is forced to .true. ' 382 459 l_1st_euler = .true. 383 460 ENDIF … … 403 480 IF(lwp) WRITE(numout,*) 404 481 SELECT CASE ( nleapy ) ! Choose calendar for IOIPSL 405 CASE ( 1 ) 482 CASE ( 1 ) 406 483 CALL ioconf_calendar('gregorian') 407 484 IF(lwp) WRITE(numout,*) ' ==>>> The IOIPSL calendar is "gregorian", i.e. leap year' … … 441 518 r1_Dt = 1._wp / rDt 442 519 520 READ ( numnam_ref, namtile, IOSTAT = ios, ERR = 905 ) 521 905 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtile in reference namelist' ) 522 READ ( numnam_cfg, namtile, IOSTAT = ios, ERR = 906 ) 523 906 IF( ios > 0 ) CALL ctl_nam ( ios , 'namtile in configuration namelist' ) 524 IF(lwm) WRITE( numond, namtile ) 525 526 IF(lwp) THEN 527 WRITE(numout,*) 528 WRITE(numout,*) ' Namelist : namtile --- Domain tiling decomposition' 529 WRITE(numout,*) ' Tiling (T) or not (F) ln_tile = ', ln_tile 530 WRITE(numout,*) ' Length of tile in i nn_ltile_i = ', nn_ltile_i 531 WRITE(numout,*) ' Length of tile in j nn_ltile_j = ', nn_ltile_j 532 WRITE(numout,*) 533 IF( ln_tile ) THEN 534 WRITE(numout,*) ' The domain will be decomposed into tiles of size', nn_ltile_i, 'x', nn_ltile_j 535 ELSE 536 WRITE(numout,*) ' Domain tiling will NOT be used' 537 ENDIF 538 ENDIF 539 443 540 IF( TRIM(Agrif_CFixed()) == '0' ) THEN 444 541 lrxios = ln_xios_read.AND.ln_rstart 445 !set output file type for XIOS based on NEMO namelist 446 IF (nn_wxios > 0) lwxios = .TRUE. 542 !set output file type for XIOS based on NEMO namelist 543 IF (nn_wxios > 0) lwxios = .TRUE. 447 544 nxioso = nn_wxios 448 545 ENDIF … … 522 619 !!---------------------------------------------------------------------- 523 620 !! *** ROUTINE dom_nam *** 524 !! 621 !! 525 622 !! ** Purpose : read the domain size in domain configuration file 526 623 !! … … 529 626 CHARACTER(len=*) , INTENT(out) :: cd_cfg ! configuration name 530 627 INTEGER , INTENT(out) :: kk_cfg ! configuration resolution 531 INTEGER , INTENT(out) :: kpi, kpj, kpk ! global domain sizes 532 INTEGER , INTENT(out) :: kperio ! lateral global domain b.c. 628 INTEGER , INTENT(out) :: kpi, kpj, kpk ! global domain sizes 629 INTEGER , INTENT(out) :: kperio ! lateral global domain b.c. 533 630 ! 534 631 INTEGER :: inum ! local integer … … 562 659 cd_cfg = 'UNKNOWN' 563 660 kk_cfg = -9999999 564 !- or they may be present as global attributes 565 !- (netcdf only) 661 !- or they may be present as global attributes 662 !- (netcdf only) 566 663 CALL iom_getatt( inum, 'cn_cfg', cd_cfg ) ! returns ! if not found 567 664 CALL iom_getatt( inum, 'nn_cfg', kk_cfg ) ! returns -999 if not found … … 585 682 WRITE(numout,*) ' type of global domain lateral boundary jperio = ', kperio 586 683 ENDIF 587 ! 684 ! 588 685 END SUBROUTINE domain_cfg 589 590 686 687 591 688 SUBROUTINE cfg_write 592 689 !!---------------------------------------------------------------------- 593 690 !! *** ROUTINE cfg_write *** 594 !! 595 !! ** Purpose : Create the "cn_domcfg_out" file, a NetCDF file which 596 !! contains all the ocean domain informations required to 691 !! 692 !! ** Purpose : Create the "cn_domcfg_out" file, a NetCDF file which 693 !! contains all the ocean domain informations required to 597 694 !! define an ocean configuration. 598 695 !! … … 600 697 !! ocean configuration. 601 698 !! 602 !! ** output file : domcfg_out.nc : domain size, characteristics, horizontal 699 !! ** output file : domcfg_out.nc : domain size, characteristics, horizontal 603 700 !! mesh, Coriolis parameter, and vertical scale factors 604 701 !! NB: also contain ORCA family information … … 617 714 ! ! create 'domcfg_out.nc' file ! 618 715 ! ! ============================= ! 619 ! 716 ! 620 717 clnam = cn_domcfg_out ! filename (configuration information) 621 CALL iom_open( TRIM(clnam), inum, ldwrt = .TRUE. ) 718 CALL iom_open( TRIM(clnam), inum, ldwrt = .TRUE. ) 622 719 ! 623 720 ! !== ORCA family specificities ==! 624 721 IF( TRIM(cn_cfg) == "orca" .OR. TRIM(cn_cfg) == "ORCA" ) THEN 625 722 CALL iom_rstput( 0, 0, inum, 'ORCA' , 1._wp , ktype = jp_i4 ) 626 CALL iom_rstput( 0, 0, inum, 'ORCA_index', REAL( nn_cfg, wp), ktype = jp_i4 ) 723 CALL iom_rstput( 0, 0, inum, 'ORCA_index', REAL( nn_cfg, wp), ktype = jp_i4 ) 627 724 ENDIF 628 725 ! … … 646 743 CALL iom_rstput( 0, 0, inum, 'glamv', glamv, ktype = jp_r8 ) 647 744 CALL iom_rstput( 0, 0, inum, 'glamf', glamf, ktype = jp_r8 ) 648 ! 745 ! 649 746 CALL iom_rstput( 0, 0, inum, 'gphit', gphit, ktype = jp_r8 ) ! longitude 650 747 CALL iom_rstput( 0, 0, inum, 'gphiu', gphiu, ktype = jp_r8 ) 651 748 CALL iom_rstput( 0, 0, inum, 'gphiv', gphiv, ktype = jp_r8 ) 652 749 CALL iom_rstput( 0, 0, inum, 'gphif', gphif, ktype = jp_r8 ) 653 ! 750 ! 654 751 CALL iom_rstput( 0, 0, inum, 'e1t' , e1t , ktype = jp_r8 ) ! i-scale factors (e1.) 655 752 CALL iom_rstput( 0, 0, inum, 'e1u' , e1u , ktype = jp_r8 ) … … 666 763 ! 667 764 ! !== vertical mesh ==! 668 ! 765 ! 669 766 CALL iom_rstput( 0, 0, inum, 'e3t_1d' , e3t_1d , ktype = jp_r8 ) ! reference 1D-coordinate 670 767 CALL iom_rstput( 0, 0, inum, 'e3w_1d' , e3w_1d , ktype = jp_r8 ) … … 677 774 CALL iom_rstput( 0, 0, inum, 'e3uw_0' , e3uw_0 , ktype = jp_r8 ) 678 775 CALL iom_rstput( 0, 0, inum, 'e3vw_0' , e3vw_0 , ktype = jp_r8 ) 679 ! 776 ! 680 777 ! !== wet top and bottom level ==! (caution: multiplied by ssmask) 681 778 ! … … 697 794 ! 698 795 ! ! ============================ 699 ! ! close the files 796 ! ! close the files 700 797 ! ! ============================ 701 798 CALL iom_close( inum ) -
NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/src/OCE/DOM/domqco.F90
r13295 r14017 91 91 ! 92 92 CALL dom_qco_zgr(Kbb, Kmm, Kaa) ! interpolation scale factor, depth and water column 93 !94 ! IF(lwxios) THEN ! define variables in restart file when writing with XIOS95 ! CALL iom_set_rstw_var_active('e3t_b')96 ! CALL iom_set_rstw_var_active('e3t_n')97 ! ENDIF98 93 ! 99 94 END SUBROUTINE dom_qco_init … … 217 212 ! 218 213 IF( MIN( id1, id2 ) > 0 ) THEN ! all required arrays exist 219 CALL iom_get( numror, jpdom_auto, 'sshb' , ssh(:,:,Kbb) , ldxios = lrxios)220 CALL iom_get( numror, jpdom_auto, 'sshn' , ssh(:,:,Kmm) , ldxios = lrxios)214 CALL iom_get( numror, jpdom_auto, 'sshb' , ssh(:,:,Kbb) ) 215 CALL iom_get( numror, jpdom_auto, 'sshn' , ssh(:,:,Kmm) ) 221 216 ! needed to restart if land processor not computed 222 217 IF(lwp) write(numout,*) 'qe_rst_read : ssh(:,:,Kbb) and ssh(:,:,Kmm) found in restart files' … … 232 227 IF(lwp) write(numout,*) 'sshn set equal to sshb.' 233 228 IF(lwp) write(numout,*) 'neuler is forced to 0' 234 CALL iom_get( numror, jpdom_auto, 'sshb', ssh(:,:,Kbb) , ldxios = lrxios)229 CALL iom_get( numror, jpdom_auto, 'sshb', ssh(:,:,Kbb) ) 235 230 ssh(:,:,Kmm) = ssh(:,:,Kbb) 236 231 l_1st_euler = .TRUE. … … 239 234 IF(lwp) write(numout,*) 'sshb set equal to sshn.' 240 235 IF(lwp) write(numout,*) 'neuler is forced to 0' 241 CALL iom_get( numror, jpdom_auto, 'sshn', ssh(:,:,Kmm) , ldxios = lrxios)236 CALL iom_get( numror, jpdom_auto, 'sshn', ssh(:,:,Kmm) ) 242 237 ssh(:,:,Kbb) = ssh(:,:,Kmm) 243 238 l_1st_euler = .TRUE. -
NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/src/OCE/DOM/domutl.F90
r13458 r14017 21 21 PRIVATE 22 22 23 INTERFACE is_tile 24 MODULE PROCEDURE is_tile_2d, is_tile_3d, is_tile_4d 25 END INTERFACE is_tile 26 23 27 PUBLIC dom_ngb ! routine called in iom.F90 module 24 28 PUBLIC dom_uniq ! Called by dommsk and domwri 29 PUBLIC is_tile 25 30 26 31 !!---------------------------------------------------------------------- 27 32 !! NEMO/OCE 4.2 , NEMO Consortium (2020) 28 !! $Id$ 33 !! $Id$ 29 34 !! Software governed by the CeCILL license (see ./LICENSE) 30 35 !!---------------------------------------------------------------------- … … 37 42 !! ** Purpose : find the closest grid point from a given lon/lat position 38 43 !! 39 !! ** Method : look for minimum distance in cylindrical projection 44 !! ** Method : look for minimum distance in cylindrical projection 40 45 !! -> not good if located at too high latitude... 41 46 !!---------------------------------------------------------------------- … … 81 86 !!---------------------------------------------------------------------- 82 87 !! *** ROUTINE dom_uniq *** 83 !! 88 !! 84 89 !! ** Purpose : identify unique point of a grid (TUVF) 85 90 !! … … 87 92 !! 2) check which elements have been changed 88 93 !!---------------------------------------------------------------------- 89 CHARACTER(len=1) , INTENT(in ) :: cdgrd ! 90 REAL(wp), DIMENSION(:,:), INTENT(inout) :: puniq ! 94 CHARACTER(len=1) , INTENT(in ) :: cdgrd ! 95 REAL(wp), DIMENSION(:,:), INTENT(inout) :: puniq ! 91 96 ! 92 97 REAL(wp) :: zshift ! shift value link to the process number … … 96 101 !!---------------------------------------------------------------------- 97 102 ! 98 ! build an array with different values for each element 103 ! build an array with different values for each element 99 104 ! in mpp: make sure that these values are different even between process 100 105 ! -> apply a shift value according to the process number … … 104 109 puniq(:,:) = ztstref(:,:) ! default definition 105 110 CALL lbc_lnk( 'domwri', puniq, cdgrd, 1. ) ! apply boundary conditions 106 lluniq(:,:,1) = puniq(:,:) == ztstref(:,:) ! check which values have not been changed 111 lluniq(:,:,1) = puniq(:,:) == ztstref(:,:) ! check which values have not been changed 107 112 ! 108 113 puniq(:,:) = REAL( COUNT( lluniq(:,:,:), dim = 3 ), wp ) 109 114 ! 110 115 END SUBROUTINE dom_uniq 111 116 117 118 FUNCTION is_tile_2d( pt ) 119 !! 120 REAL(wp), DIMENSION(:,:), INTENT(in) :: pt 121 INTEGER :: is_tile_2d 122 !! 123 IF( ln_tile .AND. (SIZE(pt, 1) < jpi .OR. SIZE(pt, 2) < jpj) ) THEN 124 is_tile_2d = 1 125 ELSE 126 is_tile_2d = 0 127 ENDIF 128 END FUNCTION is_tile_2d 129 130 131 FUNCTION is_tile_3d( pt ) 132 !! 133 REAL(wp), DIMENSION(:,:,:), INTENT(in) :: pt 134 INTEGER :: is_tile_3d 135 !! 136 IF( ln_tile .AND. (SIZE(pt, 1) < jpi .OR. SIZE(pt, 2) < jpj) ) THEN 137 is_tile_3d = 1 138 ELSE 139 is_tile_3d = 0 140 ENDIF 141 END FUNCTION is_tile_3d 142 143 144 FUNCTION is_tile_4d( pt ) 145 !! 146 REAL(wp), DIMENSION(:,:,:,:), INTENT(in) :: pt 147 INTEGER :: is_tile_4d 148 !! 149 IF( ln_tile .AND. (SIZE(pt, 1) < jpi .OR. SIZE(pt, 2) < jpj) ) THEN 150 is_tile_4d = 1 151 ELSE 152 is_tile_4d = 0 153 ENDIF 154 END FUNCTION is_tile_4d 155 112 156 !!====================================================================== 113 157 END MODULE domutl -
NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/src/OCE/DOM/domvvl.F90
r13497 r14017 2 2 !!====================================================================== 3 3 !! *** MODULE domvvl *** 4 !! Ocean : 4 !! Ocean : 5 5 !!====================================================================== 6 6 !! History : 2.0 ! 2006-06 (B. Levier, L. Marie) original code … … 58 58 !! Default key Old management of time varying vertical coordinate 59 59 !!---------------------------------------------------------------------- 60 60 61 61 !!---------------------------------------------------------------------- 62 62 !! dom_vvl_init : define initial vertical scale factors, depths and column thickness … … 73 73 PUBLIC dom_vvl_sf_update ! called by step.F90 74 74 PUBLIC dom_vvl_interpol ! called by dynnxt.F90 75 75 76 76 !! * Substitutions 77 77 # include "do_loop_substitute.h90" … … 109 109 !!---------------------------------------------------------------------- 110 110 !! *** ROUTINE dom_vvl_init *** 111 !! 111 !! 112 112 !! ** Purpose : Initialization of all scale factors, depths 113 113 !! and water column heights … … 118 118 !! ** Action : - e3t_(n/b) and tilde_e3t_(n/b) 119 119 !! - Regrid: e3[u/v](:,:,:,Kmm) 120 !! e3[u/v](:,:,:,Kmm) 121 !! e3w(:,:,:,Kmm) 120 !! e3[u/v](:,:,:,Kmm) 121 !! e3w(:,:,:,Kmm) 122 122 !! e3[u/v]w_b 123 !! e3[u/v]w_n 123 !! e3[u/v]w_n 124 124 !! gdept(:,:,:,Kmm), gdepw(:,:,:,Kmm) and gde3w 125 125 !! - h(t/u/v)_0 … … 151 151 !!---------------------------------------------------------------------- 152 152 !! *** ROUTINE dom_vvl_init *** 153 !! 154 !! ** Purpose : Interpolation of all scale factors, 153 !! 154 !! ** Purpose : Interpolation of all scale factors, 155 155 !! depths and water column heights 156 156 !! … … 159 159 !! ** Action : - e3t_(n/b) and tilde_e3t_(n/b) 160 160 !! - Regrid: e3(u/v)_n 161 !! e3(u/v)_b 162 !! e3w_n 163 !! e3(u/v)w_b 164 !! e3(u/v)w_n 161 !! e3(u/v)_b 162 !! e3w_n 163 !! e3(u/v)w_b 164 !! e3(u/v)w_n 165 165 !! gdept_n, gdepw_n and gde3w_n 166 166 !! - h(t/u/v)_0 … … 180 180 CALL dom_vvl_interpol( e3t(:,:,:,Kbb), e3u(:,:,:,Kbb), 'U' ) ! from T to U 181 181 CALL dom_vvl_interpol( e3t(:,:,:,Kmm), e3u(:,:,:,Kmm), 'U' ) 182 CALL dom_vvl_interpol( e3t(:,:,:,Kbb), e3v(:,:,:,Kbb), 'V' ) ! from T to V 182 CALL dom_vvl_interpol( e3t(:,:,:,Kbb), e3v(:,:,:,Kbb), 'V' ) ! from T to V 183 183 CALL dom_vvl_interpol( e3t(:,:,:,Kmm), e3v(:,:,:,Kmm), 'V' ) 184 184 CALL dom_vvl_interpol( e3u(:,:,:,Kmm), e3f(:,:,:), 'F' ) ! from U to F 185 ! ! Vertical interpolation of e3t,u,v 185 ! ! Vertical interpolation of e3t,u,v 186 186 CALL dom_vvl_interpol( e3t(:,:,:,Kmm), e3w (:,:,:,Kmm), 'W' ) ! from T to W 187 187 CALL dom_vvl_interpol( e3t(:,:,:,Kbb), e3w (:,:,:,Kbb), 'W' ) … … 205 205 ! zcoef = tmask - wmask ! 0 everywhere tmask = wmask, ie everywhere expect at jk = mikt 206 206 ! ! 1 everywhere from mbkt to mikt + 1 or 1 (if no isf) 207 ! ! 0.5 where jk = mikt 207 ! ! 0.5 where jk = mikt 208 208 !!gm ??????? BUG ? gdept(:,:,:,Kmm) as well as gde3w does not include the thickness of ISF ?? 209 209 zcoef = ( tmask(ji,jj,jk) - wmask(ji,jj,jk) ) 210 210 gdepw(ji,jj,jk,Kmm) = gdepw(ji,jj,jk-1,Kmm) + e3t(ji,jj,jk-1,Kmm) 211 211 gdept(ji,jj,jk,Kmm) = zcoef * ( gdepw(ji,jj,jk ,Kmm) + 0.5 * e3w(ji,jj,jk,Kmm)) & 212 & + (1-zcoef) * ( gdept(ji,jj,jk-1,Kmm) + e3w(ji,jj,jk,Kmm)) 212 & + (1-zcoef) * ( gdept(ji,jj,jk-1,Kmm) + e3w(ji,jj,jk,Kmm)) 213 213 gde3w(ji,jj,jk) = gdept(ji,jj,jk,Kmm) - ssh(ji,jj,Kmm) 214 214 gdepw(ji,jj,jk,Kbb) = gdepw(ji,jj,jk-1,Kbb) + e3t(ji,jj,jk-1,Kbb) 215 215 gdept(ji,jj,jk,Kbb) = zcoef * ( gdepw(ji,jj,jk ,Kbb) + 0.5 * e3w(ji,jj,jk,Kbb)) & 216 & + (1-zcoef) * ( gdept(ji,jj,jk-1,Kbb) + e3w(ji,jj,jk,Kbb)) 216 & + (1-zcoef) * ( gdept(ji,jj,jk-1,Kbb) + e3w(ji,jj,jk,Kbb)) 217 217 END_3D 218 218 ! … … 273 273 IF( cn_cfg == "orca" .OR. cn_cfg == "ORCA" ) THEN 274 274 IF( nn_cfg == 3 ) THEN ! ORCA2: Suppress ztilde in the Foxe Basin for ORCA2 275 ii0 = 103 + nn_hls - 1 ; ii1 = 111 + nn_hls - 1 275 ii0 = 103 + nn_hls - 1 ; ii1 = 111 + nn_hls - 1 276 276 ij0 = 128 + nn_hls ; ij1 = 135 + nn_hls 277 277 frq_rst_e3t( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) = 0.0_wp … … 282 282 ENDIF 283 283 ! 284 IF(lwxios) THEN285 ! define variables in restart file when writing with XIOS286 CALL iom_set_rstw_var_active('e3t_b')287 CALL iom_set_rstw_var_active('e3t_n')288 ! ! ----------------------- !289 IF( ln_vvl_ztilde .OR. ln_vvl_layer ) THEN ! z_tilde and layer cases !290 ! ! ----------------------- !291 CALL iom_set_rstw_var_active('tilde_e3t_b')292 CALL iom_set_rstw_var_active('tilde_e3t_n')293 END IF294 ! ! -------------!295 IF( ln_vvl_ztilde ) THEN ! z_tilde case !296 ! ! ------------ !297 CALL iom_set_rstw_var_active('hdiv_lf')298 ENDIF299 !300 ENDIF301 !302 284 END SUBROUTINE dom_vvl_zgr 303 285 304 286 305 SUBROUTINE dom_vvl_sf_nxt( kt, Kbb, Kmm, Kaa, kcall ) 287 SUBROUTINE dom_vvl_sf_nxt( kt, Kbb, Kmm, Kaa, kcall ) 306 288 !!---------------------------------------------------------------------- 307 289 !! *** ROUTINE dom_vvl_sf_nxt *** 308 !! 290 !! 309 291 !! ** Purpose : - compute the after scale factors used in tra_zdf, dynnxt, 310 292 !! tranxt and dynspg routines 311 293 !! 312 294 !! ** Method : - z_star case: Repartition of ssh INCREMENT proportionnaly to the level thickness. 313 !! - z_tilde_case: after scale factor increment = 295 !! - z_tilde_case: after scale factor increment = 314 296 !! high frequency part of horizontal divergence 315 297 !! + retsoring towards the background grid … … 319 301 !! 320 302 !! ** Action : - hdiv_lf : restoring towards full baroclinic divergence in z_tilde case 321 !! - tilde_e3t_a: after increment of vertical scale factor 303 !! - tilde_e3t_a: after increment of vertical scale factor 322 304 !! in z_tilde case 323 305 !! - e3(t/u/v)_a … … 423 405 un_td(ji,jj,jk) = rn_ahe3 * umask(ji,jj,jk) * e2_e1u(ji,jj) & 424 406 & * ( tilde_e3t_b(ji,jj,jk) - tilde_e3t_b(ji+1,jj ,jk) ) 425 vn_td(ji,jj,jk) = rn_ahe3 * vmask(ji,jj,jk) * e1_e2v(ji,jj) & 407 vn_td(ji,jj,jk) = rn_ahe3 * vmask(ji,jj,jk) * e1_e2v(ji,jj) & 426 408 & * ( tilde_e3t_b(ji,jj,jk) - tilde_e3t_b(ji ,jj+1,jk) ) 427 409 zwu(ji,jj) = zwu(ji,jj) + un_td(ji,jj,jk) … … 440 422 ! (stored for tracer advction and continuity equation) 441 423 CALL lbc_lnk_multi( 'domvvl', un_td , 'U' , -1._wp, vn_td , 'V' , -1._wp) 442 443 424 ! 4 - Time stepping of baroclinic scale factors 444 425 ! --------------------------------------------- … … 469 450 WRITE(numout, *) 'at i, j, k=', ijk_max 470 451 WRITE(numout, *) 'MIN( tilde_e3t_a(:,:,:) / e3t_0(:,:,:) ) =', z_tmin 471 WRITE(numout, *) 'at i, j, k=', ijk_min 452 WRITE(numout, *) 'at i, j, k=', ijk_min 472 453 CALL ctl_stop( 'STOP', 'MAX( ABS( tilde_e3t_a(:,:,: ) ) / e3t_0(:,:,:) ) too high') 473 454 ENDIF … … 585 566 !!---------------------------------------------------------------------- 586 567 !! *** ROUTINE dom_vvl_sf_update *** 587 !! 588 !! ** Purpose : for z tilde case: compute time filter and swap of scale factors 568 !! 569 !! ** Purpose : for z tilde case: compute time filter and swap of scale factors 589 570 !! compute all depths and related variables for next time step 590 571 !! write outputs and restart file … … 596 577 !! ** Action : - tilde_e3t_(b/n) ready for next time step 597 578 !! - Recompute: 598 !! e3(u/v)_b 599 !! e3w(:,:,:,Kmm) 600 !! e3(u/v)w_b 601 !! e3(u/v)w_n 579 !! e3(u/v)_b 580 !! e3w(:,:,:,Kmm) 581 !! e3(u/v)w_b 582 !! e3(u/v)w_n 602 583 !! gdept(:,:,:,Kmm), gdepw(:,:,:,Kmm) and gde3w 603 584 !! h(u/v) and h(u/v)r … … 630 611 tilde_e3t_b(:,:,:) = tilde_e3t_n(:,:,:) 631 612 ELSE 632 tilde_e3t_b(:,:,:) = tilde_e3t_n(:,:,:) & 613 tilde_e3t_b(:,:,:) = tilde_e3t_n(:,:,:) & 633 614 & + rn_atfp * ( tilde_e3t_b(:,:,:) - 2.0_wp * tilde_e3t_n(:,:,:) + tilde_e3t_a(:,:,:) ) 634 615 ENDIF … … 642 623 ! - ML - e3u(:,:,:,Kbb) and e3v(:,:,:,Kbb) are already computed in dynnxt 643 624 ! - JC - hu(:,:,:,Kbb), hv(:,:,:,:,Kbb), hur_b, hvr_b also 644 625 645 626 CALL dom_vvl_interpol( e3u(:,:,:,Kmm), e3f(:,:,:), 'F' ) 646 627 647 628 ! Vertical scale factor interpolations 648 629 CALL dom_vvl_interpol( e3t(:,:,:,Kmm), e3w(:,:,:,Kmm), 'W' ) … … 663 644 gdepw(ji,jj,jk,Kmm) = gdepw(ji,jj,jk-1,Kmm) + e3t(ji,jj,jk-1,Kmm) 664 645 gdept(ji,jj,jk,Kmm) = zcoef * ( gdepw(ji,jj,jk ,Kmm) + 0.5 * e3w(ji,jj,jk,Kmm) ) & 665 & + (1-zcoef) * ( gdept(ji,jj,jk-1,Kmm) + e3w(ji,jj,jk,Kmm) ) 646 & + (1-zcoef) * ( gdept(ji,jj,jk-1,Kmm) + e3w(ji,jj,jk,Kmm) ) 666 647 gde3w(ji,jj,jk) = gdept(ji,jj,jk,Kmm) - ssh(ji,jj,Kmm) 667 648 END_3D … … 782 763 !!--------------------------------------------------------------------- 783 764 !! *** ROUTINE dom_vvl_rst *** 784 !! 765 !! 785 766 !! ** Purpose : Read or write VVL file in restart file 786 767 !! … … 799 780 !!---------------------------------------------------------------------- 800 781 ! 801 IF( TRIM(cdrw) == 'READ' ) THEN ! Read/initialise 782 IF( TRIM(cdrw) == 'READ' ) THEN ! Read/initialise 802 783 ! ! =============== 803 784 IF( ln_rstart ) THEN !* Read the restart file 804 785 CALL rst_read_open ! open the restart file if necessary 805 CALL iom_get( numror, jpdom_auto, 'sshn' , ssh(:,:,Kmm) , ldxios = lrxios)786 CALL iom_get( numror, jpdom_auto, 'sshn' , ssh(:,:,Kmm) ) 806 787 ! 807 788 id1 = iom_varid( numror, 'e3t_b', ldstop = .FALSE. ) … … 816 797 ! 817 798 IF( MIN( id1, id2 ) > 0 ) THEN ! all required arrays exist 818 CALL iom_get( numror, jpdom_auto, 'e3t_b', e3t(:,:,:,Kbb) , ldxios = lrxios)819 CALL iom_get( numror, jpdom_auto, 'e3t_n', e3t(:,:,:,Kmm) , ldxios = lrxios)820 ! needed to restart if land processor not computed 799 CALL iom_get( numror, jpdom_auto, 'e3t_b', e3t(:,:,:,Kbb) ) 800 CALL iom_get( numror, jpdom_auto, 'e3t_n', e3t(:,:,:,Kmm) ) 801 ! needed to restart if land processor not computed 821 802 IF(lwp) write(numout,*) 'dom_vvl_rst : e3t(:,:,:,Kbb) and e3t(:,:,:,Kmm) found in restart files' 822 WHERE ( tmask(:,:,:) == 0.0_wp ) 803 WHERE ( tmask(:,:,:) == 0.0_wp ) 823 804 e3t(:,:,:,Kmm) = e3t_0(:,:,:) 824 805 e3t(:,:,:,Kbb) = e3t_0(:,:,:) … … 831 812 IF(lwp) write(numout,*) 'e3t_n set equal to e3t_b.' 832 813 IF(lwp) write(numout,*) 'l_1st_euler is forced to true' 833 CALL iom_get( numror, jpdom_auto, 'e3t_b', e3t(:,:,:,Kbb) , ldxios = lrxios)814 CALL iom_get( numror, jpdom_auto, 'e3t_b', e3t(:,:,:,Kbb) ) 834 815 e3t(:,:,:,Kmm) = e3t(:,:,:,Kbb) 835 816 l_1st_euler = .true. … … 838 819 IF(lwp) write(numout,*) 'e3t_b set equal to e3t_n.' 839 820 IF(lwp) write(numout,*) 'l_1st_euler is forced to true' 840 CALL iom_get( numror, jpdom_auto, 'e3t_n', e3t(:,:,:,Kmm) , ldxios = lrxios)821 CALL iom_get( numror, jpdom_auto, 'e3t_n', e3t(:,:,:,Kmm) ) 841 822 e3t(:,:,:,Kbb) = e3t(:,:,:,Kmm) 842 823 l_1st_euler = .true. … … 863 844 ! ! ----------------------- ! 864 845 IF( MIN( id3, id4 ) > 0 ) THEN ! all required arrays exist 865 CALL iom_get( numror, jpdom_auto, 'tilde_e3t_b', tilde_e3t_b(:,:,:) , ldxios = lrxios)866 CALL iom_get( numror, jpdom_auto, 'tilde_e3t_n', tilde_e3t_n(:,:,:) , ldxios = lrxios)846 CALL iom_get( numror, jpdom_auto, 'tilde_e3t_b', tilde_e3t_b(:,:,:) ) 847 CALL iom_get( numror, jpdom_auto, 'tilde_e3t_n', tilde_e3t_n(:,:,:) ) 867 848 ELSE ! one at least array is missing 868 849 tilde_e3t_b(:,:,:) = 0.0_wp … … 873 854 ! ! ------------ ! 874 855 IF( id5 > 0 ) THEN ! required array exists 875 CALL iom_get( numror, jpdom_auto, 'hdiv_lf', hdiv_lf(:,:,:) , ldxios = lrxios)856 CALL iom_get( numror, jpdom_auto, 'hdiv_lf', hdiv_lf(:,:,:) ) 876 857 ELSE ! array is missing 877 858 hdiv_lf(:,:,:) = 0.0_wp … … 883 864 ! 884 865 885 IF( ll_wd ) THEN ! MJB ll_wd edits start here - these are essential 866 IF( ll_wd ) THEN ! MJB ll_wd edits start here - these are essential 886 867 ! 887 868 IF( cn_cfg == 'wad' ) THEN … … 946 927 ! ! =================== 947 928 IF(lwp) WRITE(numout,*) '---- dom_vvl_rst ----' 948 IF( lwxios ) CALL iom_swap( cwxios_context )949 929 ! ! --------- ! 950 930 ! ! all cases ! 951 931 ! ! --------- ! 952 CALL iom_rstput( kt, nitrst, numrow, 'e3t_b', e3t(:,:,:,Kbb) , ldxios = lwxios)953 CALL iom_rstput( kt, nitrst, numrow, 'e3t_n', e3t(:,:,:,Kmm) , ldxios = lwxios)932 CALL iom_rstput( kt, nitrst, numrow, 'e3t_b', e3t(:,:,:,Kbb) ) 933 CALL iom_rstput( kt, nitrst, numrow, 'e3t_n', e3t(:,:,:,Kmm) ) 954 934 ! ! ----------------------- ! 955 935 IF( ln_vvl_ztilde .OR. ln_vvl_layer ) THEN ! z_tilde and layer cases ! 956 936 ! ! ----------------------- ! 957 CALL iom_rstput( kt, nitrst, numrow, 'tilde_e3t_b', tilde_e3t_b(:,:,:) , ldxios = lwxios)958 CALL iom_rstput( kt, nitrst, numrow, 'tilde_e3t_n', tilde_e3t_n(:,:,:) , ldxios = lwxios)937 CALL iom_rstput( kt, nitrst, numrow, 'tilde_e3t_b', tilde_e3t_b(:,:,:)) 938 CALL iom_rstput( kt, nitrst, numrow, 'tilde_e3t_n', tilde_e3t_n(:,:,:)) 959 939 END IF 960 ! ! -------------! 940 ! ! -------------! 961 941 IF( ln_vvl_ztilde ) THEN ! z_tilde case ! 962 942 ! ! ------------ ! 963 CALL iom_rstput( kt, nitrst, numrow, 'hdiv_lf', hdiv_lf(:,:,:) , ldxios = lwxios)943 CALL iom_rstput( kt, nitrst, numrow, 'hdiv_lf', hdiv_lf(:,:,:)) 964 944 ENDIF 965 945 ! 966 IF( lwxios ) CALL iom_swap( cxios_context )967 946 ENDIF 968 947 ! … … 973 952 !!--------------------------------------------------------------------- 974 953 !! *** ROUTINE dom_vvl_ctl *** 975 !! 954 !! 976 955 !! ** Purpose : Control the consistency between namelist options 977 956 !! for vertical coordinate … … 982 961 & ln_vvl_zstar_at_eqtor , rn_ahe3 , rn_rst_e3t , & 983 962 & rn_lf_cutoff , rn_zdef_max , ln_vvl_dbg ! not yet implemented: ln_vvl_kepe 984 !!---------------------------------------------------------------------- 963 !!---------------------------------------------------------------------- 985 964 ! 986 965 READ ( numnam_ref, nam_vvl, IOSTAT = ios, ERR = 901) -
NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/src/OCE/DOM/dtatsd.F90
r13497 r14017 6 6 !! History : OPA ! 1991-03 () Original code 7 7 !! - ! 1992-07 (M. Imbard) 8 !! 8.0 ! 1999-10 (M.A. Foujols, M. Imbard) NetCDF FORMAT 9 !! NEMO 1.0 ! 2002-06 (G. Madec) F90: Free form and module 8 !! 8.0 ! 1999-10 (M.A. Foujols, M. Imbard) NetCDF FORMAT 9 !! NEMO 1.0 ! 2002-06 (G. Madec) F90: Free form and module 10 10 !! 3.3 ! 2010-10 (C. Bricaud, S. Masson) use of fldread 11 11 !! 3.4 ! 2010-11 (G. Madec, C. Ethe) Merge of dtatem and dtasal + remove CPP keys … … 18 18 USE phycst ! physical constants 19 19 USE dom_oce ! ocean space and time domain 20 USE domain, ONLY : dom_tile 20 21 USE fldread ! read input fields 21 22 ! … … 39 40 !!---------------------------------------------------------------------- 40 41 !! NEMO/OCE 4.0 , NEMO Consortium (2018) 41 !! $Id$ 42 !! $Id$ 42 43 !! Software governed by the CeCILL license (see ./LICENSE) 43 44 !!---------------------------------------------------------------------- … … 47 48 !!---------------------------------------------------------------------- 48 49 !! *** ROUTINE dta_tsd_init *** 49 !! 50 !! ** Purpose : initialisation of T & S input data 51 !! 50 !! 51 !! ** Purpose : initialisation of T & S input data 52 !! 52 53 !! ** Method : - Read namtsd namelist 53 !! - allocates T & S data structure 54 !! - allocates T & S data structure 54 55 !!---------------------------------------------------------------------- 55 56 LOGICAL, INTENT(in), OPTIONAL :: ld_tradmp ! force the initialization when tradp is used … … 74 75 75 76 IF( PRESENT( ld_tradmp ) ) ln_tsd_dmp = .TRUE. ! forces the initialization when tradmp is used 76 77 77 78 IF(lwp) THEN ! control print 78 79 WRITE(numout,*) … … 123 124 !!---------------------------------------------------------------------- 124 125 !! *** ROUTINE dta_tsd *** 125 !! 126 !! 126 127 !! ** Purpose : provides T and S data at kt 127 !! 128 !! 128 129 !! ** Method : - call fldread routine 129 !! - ORCA_R2: add some hand made alteration to read data 130 !! - ORCA_R2: add some hand made alteration to read data 130 131 !! - 'key_orca_lev10' interpolates on 10 times more levels 131 132 !! - s- or mixed z-s coordinate: vertical interpolation on model mesh … … 135 136 !! ** Action : ptsd T-S data on medl mesh and interpolated at time-step kt 136 137 !!---------------------------------------------------------------------- 137 INTEGER 138 REAL(wp), DIMENSION( jpi,jpj,jpk,jpts), INTENT( out) :: ptsd ! T & S data138 INTEGER , INTENT(in ) :: kt ! ocean time-step 139 REAL(wp), DIMENSION(A2D(nn_hls),jpk,jpts), INTENT( out) :: ptsd ! T & S data 139 140 ! 140 141 INTEGER :: ji, jj, jk, jl, jkk ! dummy loop indicies 141 142 INTEGER :: ik, il0, il1, ii0, ii1, ij0, ij1 ! local integers 143 INTEGER :: itile 142 144 REAL(wp):: zl, zi ! local scalars 143 145 REAL(wp), DIMENSION(jpk) :: ztp, zsp ! 1D workspace 144 146 !!---------------------------------------------------------------------- 145 147 ! 146 CALL fld_read( kt, 1, sf_tsd ) !== read T & S data at kt time step ==! 148 IF( ntile == 0 .OR. ntile == 1 ) THEN ! Do only for the full domain 149 itile = ntile 150 IF( ln_tile ) CALL dom_tile( ntsi, ntsj, ntei, ntej, ktile = 0 ) ! Use full domain 151 CALL fld_read( kt, 1, sf_tsd ) !== read T & S data at kt time step ==! 147 152 ! 148 153 ! 149 154 !!gm This should be removed from the code ===>>>> T & S files has to be changed 150 ! 151 ! !== ORCA_R2 configuration and T & S damping ==! 152 IF( cn_cfg == "orca" .OR. cn_cfg == "ORCA" ) THEN 153 IF( nn_cfg == 2 .AND. ln_tsd_dmp ) THEN ! some hand made alterations 154 ! 155 ij0 = 101 + nn_hls ; ij1 = 109 + nn_hls ! Reduced T & S in the Alboran Sea 156 ii0 = 141 + nn_hls - 1 ; ii1 = 155 + nn_hls - 1 157 DO jj = mj0(ij0), mj1(ij1) 158 DO ji = mi0(ii0), mi1(ii1) 159 sf_tsd(jp_tem)%fnow(ji,jj,13:13) = sf_tsd(jp_tem)%fnow(ji,jj,13:13) - 0.20_wp 160 sf_tsd(jp_tem)%fnow(ji,jj,14:15) = sf_tsd(jp_tem)%fnow(ji,jj,14:15) - 0.35_wp 161 sf_tsd(jp_tem)%fnow(ji,jj,16:25) = sf_tsd(jp_tem)%fnow(ji,jj,16:25) - 0.40_wp 162 ! 163 sf_tsd(jp_sal)%fnow(ji,jj,13:13) = sf_tsd(jp_sal)%fnow(ji,jj,13:13) - 0.15_wp 164 sf_tsd(jp_sal)%fnow(ji,jj,14:15) = sf_tsd(jp_sal)%fnow(ji,jj,14:15) - 0.25_wp 165 sf_tsd(jp_sal)%fnow(ji,jj,16:17) = sf_tsd(jp_sal)%fnow(ji,jj,16:17) - 0.30_wp 166 sf_tsd(jp_sal)%fnow(ji,jj,18:25) = sf_tsd(jp_sal)%fnow(ji,jj,18:25) - 0.35_wp 155 ! 156 ! !== ORCA_R2 configuration and T & S damping ==! 157 IF( cn_cfg == "orca" .OR. cn_cfg == "ORCA" ) THEN 158 IF( nn_cfg == 2 .AND. ln_tsd_dmp ) THEN ! some hand made alterations 159 ! 160 ij0 = 101 + nn_hls ; ij1 = 109 + nn_hls ! Reduced T & S in the Alboran Sea 161 ii0 = 141 + nn_hls - 1 ; ii1 = 155 + nn_hls - 1 162 DO jj = mj0(ij0), mj1(ij1) 163 DO ji = mi0(ii0), mi1(ii1) 164 sf_tsd(jp_tem)%fnow(ji,jj,13:13) = sf_tsd(jp_tem)%fnow(ji,jj,13:13) - 0.20_wp 165 sf_tsd(jp_tem)%fnow(ji,jj,14:15) = sf_tsd(jp_tem)%fnow(ji,jj,14:15) - 0.35_wp 166 sf_tsd(jp_tem)%fnow(ji,jj,16:25) = sf_tsd(jp_tem)%fnow(ji,jj,16:25) - 0.40_wp 167 ! 168 sf_tsd(jp_sal)%fnow(ji,jj,13:13) = sf_tsd(jp_sal)%fnow(ji,jj,13:13) - 0.15_wp 169 sf_tsd(jp_sal)%fnow(ji,jj,14:15) = sf_tsd(jp_sal)%fnow(ji,jj,14:15) - 0.25_wp 170 sf_tsd(jp_sal)%fnow(ji,jj,16:17) = sf_tsd(jp_sal)%fnow(ji,jj,16:17) - 0.30_wp 171 sf_tsd(jp_sal)%fnow(ji,jj,18:25) = sf_tsd(jp_sal)%fnow(ji,jj,18:25) - 0.35_wp 172 END DO 167 173 END DO 168 END DO 169 ij0 = 87 + nn_hls ; ij1 = 96 + nn_hls ! Reduced temperature in Red Sea 170 ii0 = 148 + nn_hls - 1 ; ii1 = 160 + nn_hls - 1 171 sf_tsd(jp_tem)%fnow( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) , 4:10 ) = 7.0_wp 172 sf_tsd(jp_tem)%fnow( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) , 11:13 ) = 6.5_wp 173 sf_tsd(jp_tem)%fnow( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) , 14:20 ) = 6.0_wp 174 ENDIF 175 ENDIF 174 ij0 = 87 + nn_hls ; ij1 = 96 + nn_hls ! Reduced temperature in Red Sea 175 ii0 = 148 + nn_hls - 1 ; ii1 = 160 + nn_hls - 1 176 sf_tsd(jp_tem)%fnow( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) , 4:10 ) = 7.0_wp 177 sf_tsd(jp_tem)%fnow( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) , 11:13 ) = 6.5_wp 178 sf_tsd(jp_tem)%fnow( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) , 14:20 ) = 6.0_wp 179 ENDIF 180 ENDIF 176 181 !!gm end 177 ! 178 ptsd(:,:,:,jp_tem) = sf_tsd(jp_tem)%fnow(:,:,:) ! NO mask 179 ptsd(:,:,:,jp_sal) = sf_tsd(jp_sal)%fnow(:,:,:) 182 IF( ln_tile ) CALL dom_tile( ntsi, ntsj, ntei, ntej, ktile = itile ) ! Revert to tile domain 183 ENDIF 184 ! 185 DO_3D( nn_hls, nn_hls, nn_hls, nn_hls, 1, jpk ) 186 ptsd(ji,jj,jk,jp_tem) = sf_tsd(jp_tem)%fnow(ji,jj,jk) ! NO mask 187 ptsd(ji,jj,jk,jp_sal) = sf_tsd(jp_sal)%fnow(ji,jj,jk) 188 END_3D 180 189 ! 181 190 IF( ln_sco ) THEN !== s- or mixed s-zps-coordinate ==! 182 191 ! 183 IF( kt == nit000 .AND. lwp )THEN 184 WRITE(numout,*) 185 WRITE(numout,*) 'dta_tsd: interpolates T & S data onto the s- or mixed s-z-coordinate mesh' 186 ENDIF 187 ! 188 DO_2D( 1, 1, 1, 1 ) ! vertical interpolation of T & S 192 IF( ntile == 0 .OR. ntile == 1 ) THEN ! Do only on the first tile 193 IF( kt == nit000 .AND. lwp )THEN 194 WRITE(numout,*) 195 WRITE(numout,*) 'dta_tsd: interpolates T & S data onto the s- or mixed s-z-coordinate mesh' 196 ENDIF 197 ENDIF 198 ! 199 ! NOTE: [tiling-comms-merge] This fix was necessary to take out tra_adv lbc_lnk statements in the zps case, but did not work in the zco case 200 DO_2D( nn_hls, nn_hls, nn_hls, nn_hls ) ! vertical interpolation of T & S 189 201 DO jk = 1, jpk ! determines the intepolated T-S profiles at each (i,j) points 190 202 zl = gdept_0(ji,jj,jk) … … 199 211 IF( (zl-gdept_1d(jkk)) * (zl-gdept_1d(jkk+1)) <= 0._wp ) THEN 200 212 zi = ( zl - gdept_1d(jkk) ) / (gdept_1d(jkk+1)-gdept_1d(jkk)) 201 ztp(jk) = ptsd(ji,jj,jkk,jp_tem) + ( ptsd(ji,jj,jkk+1,jp_tem) - ptsd(ji,jj,jkk,jp_tem) ) * zi 213 ztp(jk) = ptsd(ji,jj,jkk,jp_tem) + ( ptsd(ji,jj,jkk+1,jp_tem) - ptsd(ji,jj,jkk,jp_tem) ) * zi 202 214 zsp(jk) = ptsd(ji,jj,jkk,jp_sal) + ( ptsd(ji,jj,jkk+1,jp_sal) - ptsd(ji,jj,jkk,jp_sal) ) * zi 203 215 ENDIF … … 212 224 ptsd(ji,jj,jpk,jp_sal) = 0._wp 213 225 END_2D 214 ! 226 ! 215 227 ELSE !== z- or zps- coordinate ==! 216 ! 217 ptsd(:,:,:,jp_tem) = ptsd(:,:,:,jp_tem) * tmask(:,:,:) ! Mask 218 ptsd(:,:,:,jp_sal) = ptsd(:,:,:,jp_sal) * tmask(:,:,:) 228 ! 229 DO_3D( nn_hls, nn_hls, nn_hls, nn_hls, 1, jpk ) 230 ptsd(ji,jj,jk,jp_tem) = ptsd(ji,jj,jk,jp_tem) * tmask(ji,jj,jk) ! Mask 231 ptsd(ji,jj,jk,jp_sal) = ptsd(ji,jj,jk,jp_sal) * tmask(ji,jj,jk) 232 END_3D 219 233 ! 220 234 IF( ln_zps ) THEN ! zps-coordinate (partial steps) interpolation at the last ocean level 221 DO_2D( 1, 1, 1, 1 ) 222 ik = mbkt(ji,jj) 235 ! NOTE: [tiling-comms-merge] This fix was necessary to take out tra_adv lbc_lnk statements in the zps case 236 DO_2D( nn_hls, nn_hls, nn_hls, nn_hls ) 237 ik = mbkt(ji,jj) 223 238 IF( ik > 1 ) THEN 224 239 zl = ( gdept_1d(ik) - gdept_0(ji,jj,ik) ) / ( gdept_1d(ik) - gdept_1d(ik-1) ) … … 228 243 ik = mikt(ji,jj) 229 244 IF( ik > 1 ) THEN 230 zl = ( gdept_0(ji,jj,ik) - gdept_1d(ik) ) / ( gdept_1d(ik+1) - gdept_1d(ik) ) 245 zl = ( gdept_0(ji,jj,ik) - gdept_1d(ik) ) / ( gdept_1d(ik+1) - gdept_1d(ik) ) 231 246 ptsd(ji,jj,ik,jp_tem) = (1.-zl) * ptsd(ji,jj,ik,jp_tem) + zl * ptsd(ji,jj,ik+1,jp_tem) 232 247 ptsd(ji,jj,ik,jp_sal) = (1.-zl) * ptsd(ji,jj,ik,jp_sal) + zl * ptsd(ji,jj,ik+1,jp_sal) … … 237 252 ENDIF 238 253 ! 239 IF( .NOT.ln_tsd_dmp ) THEN !== deallocate T & S structure ==! 254 IF( .NOT.ln_tsd_dmp ) THEN !== deallocate T & S structure ==! 240 255 ! (data used only for initialisation) 241 256 IF(lwp) WRITE(numout,*) 'dta_tsd: deallocte T & S arrays as they are only use to initialize the run'
Note: See TracChangeset
for help on using the changeset viewer.