Opened 4 years ago
Closed 3 years ago
#2588 closed Bug (fixed)
domain_cfg: various issues
Reported by: | mathiot | Owned by: | mathiot |
---|---|---|---|
Priority: | low | Milestone: | |
Component: | DOM | Version: | |
Severity: | minor | Keywords: | |
Cc: |
Description
Context
- out of bound in some configuration with isf (domisf.F90)
- dom_clo needs to be reactivated (domain.F90, see also #2503)
- dom_wri needs to be reactivated (dommsk.F90, see also #2503)
- restore proper computation of distance in domngb.F90 (see also #2503)
- glob_* function use tmask_i. However some call it before tmask_i is initialised. As these calls are only used for sanity check and print, I suggest to remove tmask_i from the function. (lib_fortran_generic.h90)
- initialised ln_read_cfg to False as it is used before the namelist bloc is read.
Analysis
...
Fix
-
domain.F90
76 76 ! !== Reference coordinate system ==! 77 77 ! 78 78 CALL dom_nam ! read namelist ( namrun, namdom ) 79 ! CALL dom_clo ! Closed seas and lake80 79 81 80 CALL dom_hgr ! Horizontal mesh 82 81 CALL dom_zgr( ik_top, ik_bot ) ! Vertical mesh and bathymetry 83 82 CALL dom_msk( ik_top, ik_bot ) ! Masks 83 IF ( ln_domclo ) CALL dom_clo ! Closed seas and lake 84 84 ! 85 !86 85 CALL dom_ctl ! print extrema of masked scale factors 87 86 ! 88 87 #if ! defined key_agrif -
domisf.F90
294 294 imisfdep = misfdep 295 295 zrisfdep = risfdep 296 296 WHERE ( mbathy(:,:) == 0 ) 297 imask(:,:) = 0297 imask(:,:) = jpk 298 298 imbathy(:,:) = jpk 299 299 END WHERE 300 300 DO jj = 2, jpjm1 … … 301 301 DO ji = 2, jpim1 302 302 IF( (misfdep(ji,jj) > 1) .AND. (mbathy(ji,jj) > 0) ) THEN 303 303 ! 304 ! what it should be 304 ! what it should be (1 = should be connected; >= jpk = should not be connected) 305 305 imskip1 = imask(ji,jj) * imask(ji+1,jj ) ! 1 = should be connected 306 306 imskim1 = imask(ji,jj) * imask(ji-1,jj ) ! 1 = should be connected 307 307 imskjp1 = imask(ji,jj) * imask(ji ,jj+1) ! 1 = should be connected 308 308 imskjm1 = imask(ji,jj) * imask(ji ,jj-1) ! 1 = should be connected 309 309 ! 310 ! what it is 310 ! what it is ? ( 1 = no effective connection; jpk = effective connection ) 311 311 imskip1_r=jpk ; imskim1_r=jpk; imskjp1_r=jpk; imskjm1_r=jpk 312 312 IF (misfdep(ji,jj) > imbathy(ji+1,jj )) imskip1_r=1.0 ! 1 = no effective connection 313 313 IF (misfdep(ji,jj) > imbathy(ji-1,jj )) imskim1_r=1.0 ! 1 = no effective connection … … 315 315 IF (misfdep(ji,jj) > imbathy(ji ,jj-1)) imskjm1_r=1.0 ! 1 = no effective connection 316 316 ! 317 317 ! defining level needed for connectivity 318 ! imskip1 * imskip1_r == 1 means connections need to be enforce 318 ! imskip1 * imskip1_r == 1 means connection need to be enforce 319 ! imskip1 * imskip1_r >= jpk means no connection need to be enforce 319 320 jk=MIN(imbathy(ji+1,jj ) * imskip1_r * imskip1, & 320 321 & imbathy(ji-1,jj ) * imskim1_r * imskim1, & 321 322 & imbathy(ji ,jj+1) * imskjp1_r * imskjp1, & 322 323 & imbathy(ji ,jj-1) * imskjm1_r * imskjm1, & 323 & jpk +1) ! add jpk in the MIN to avoid out of boundary later on324 & jpk ) ! add jpk in the MIN to avoid out of boundary later on 324 325 ! 325 326 ! if connectivity is OK or no connection needed (grounding line) or grounded, zmisfdep=misfdep 326 327 imisfdep(ji,jj)=MIN(misfdep(ji,jj),jk-1) … … 328 329 ! update isf draft if needed (need to be done here because next test is in meter and level) 329 330 IF ( imisfdep(ji,jj) < misfdep(ji,jj) ) THEN 330 331 jk = imisfdep(ji,jj) 332 PRINT *, jk, ji, jj, misfdep(ji,jj), narea 331 333 zrisfdep(ji,jj) = gdepw_1d(jk+1) - MIN( e3zps_min, e3t_1d(jk)*e3zps_rat ) 332 334 END IF 333 335 -
dommsk.F90
155 155 ENDIF 156 156 END DO 157 157 END DO 158 158 ELSE 159 159 DO jk = 1, jpk 160 160 DO jj = 1, jpj 161 161 DO ji = 1, jpi … … 293 293 ! User defined alteration of fmask (use to reduce ocean transport in specified straits) 294 294 ! -------------------------------- 295 295 ! 296 296 ! write mesh mask 297 IF ( nn_msh > 0 ) CALL dom_wri 298 ! 297 299 CALL usr_def_fmask( cp_cfg, jp_cfg, fmask ) 298 300 ! 299 301 END SUBROUTINE dom_msk -
domngb.F90
45 45 ! 46 46 INTEGER :: ik ! working level 47 47 INTEGER , DIMENSION(2) :: iloc 48 REAL(wp) :: zlon, zmini49 48 REAL(wp), DIMENSION(jpi,jpj) :: zglam, zgphi, zmask, zdist 50 49 !!-------------------------------------------------------------------- 51 50 ! … … 59 58 CASE DEFAULT ; zglam(:,:) = glamt(:,:) ; zgphi(:,:) = gphit(:,:) ; zmask(nldi:nlei,nldj:nlej) = tmask(nldi:nlei,nldj:nlej,ik) 60 59 END SELECT 61 60 62 zlon = MOD( plon + 720., 360. ) ! plon between 0 and 360 63 zglam(:,:) = MOD( zglam(:,:) + 720., 360. ) ! glam between 0 and 360 64 IF( zlon > 270. ) zlon = zlon - 360. ! zlon between -90 and 270 65 IF( zlon < 90. ) WHERE( zglam(:,:) > 180. ) zglam(:,:) = zglam(:,:) - 360. ! glam between -180 and 180 66 zglam(:,:) = zglam(:,:) - zlon 61 zdist = dist(plon, plat, zglam, zgphi) 67 62 68 63 IF( lk_mpp ) THEN 69 64 CALL mpp_minloc( 'domngb', zdist(:,:), zmask, rdist, iloc) -
domwri.F90
214 214 CALL lbc_lnk( 'domwri', puniq, cdgrd, 1. ) ! apply boundary conditions 215 215 lldbl(:,:,1) = puniq(:,:) == ztstref(:,:) ! check which values have been changed 216 216 ! 217 puniq(:,:) = 1. ! default definition 218 ! fill only the inner part of the cpu with llbl converted into real 219 puniq(nldi:nlei,nldj:nlej) = REAL( COUNT( lldbl(nldi:nlei,nldj:nlej,:), dim = 3 ) , wp ) 217 puniq(:,:) = REAL( COUNT( lldbl(:,:,:), dim = 3 ) , wp ) 220 218 ! 221 219 END SUBROUTINE dom_uniq 222 220 -
lib_fortran_generic.h90
116 116 ! 117 117 ipk = K_SIZE(ptab) ! 3rd dimension 118 118 ! 119 ztmp = ARRAY_OPERATION( ARRAY_IN(:,:,1) *tmask_i(:,:))119 ztmp = ARRAY_OPERATION( ARRAY_IN(:,:,1)) 120 120 DO jk = 2, ipk 121 ztmp = SCALAR_OPERATION(ztmp, ARRAY_OPERATION( ARRAY_IN(:,:,jk) *tmask_i(:,:)))121 ztmp = SCALAR_OPERATION(ztmp, ARRAY_OPERATION( ARRAY_IN(:,:,jk))) 122 122 ENDDO 123 123 124 124 CALL MPP_OPERATION( cdname, ztmp) -
par_oce.f90
27 27 !!---------------------------------------------------------------------- 28 28 !! namcfg namelist parameters 29 29 !!---------------------------------------------------------------------- 30 LOGICAL :: ln_read_cfg !: (=T) read the domain configuration file or (=F) not30 LOGICAL :: ln_read_cfg = .FALSE. !: (=T) read the domain configuration file or (=F) not 31 31 CHARACTER(lc) :: cn_domcfg !: filename the configuration file to be read 32 32 LOGICAL :: ln_write_cfg !: (=T) create the domain configuration file 33 33 CHARACTER(lc) :: cn_domcfg_out !: filename the configuration file to be read
Commit History (2)
Changeset | Author | Time | ChangeLog |
---|---|---|---|
14931 | jchanut | 2021-05-31T16:36:45+02:00 | |
14199 | mathiot | 2020-12-17T15:04:44+01:00 | ticket #2588: various bug in domain_cfg (undefined variable before use, isf, closed sea re-activated ...) |
Change History (6)
comment:1 Changed 4 years ago by clem
comment:2 Changed 4 years ago by mathiot
In 14199:
comment:3 Changed 4 years ago by mathiot
- Resolution set to fixed
- Status changed from new to closed
comment:4 Changed 3 years ago by mathiot
- Resolution fixed deleted
- Status changed from closed to reopened
ticket re-open: see #2643
comment:5 Changed 3 years ago by jchanut
In 14931:
comment:6 Changed 3 years ago by jchanut
- Resolution set to fixed
- Status changed from reopened to closed
Note: See
TracTickets for help on using
tickets.
Good points. It looks to me that it concerns both 4.0-HEAD and the trunk