Changeset 5396 for trunk/NEMOGCM
- Timestamp:
- 2015-06-10T14:59:48+02:00 (9 years ago)
- Location:
- trunk/NEMOGCM/NEMO/OPA_SRC/LDF
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/NEMOGCM/NEMO/OPA_SRC/LDF/ldfdyn_c2d.h90
r5040 r5396 140 140 !!---------------------------------------------------------------------- 141 141 USE ldftra_oce, ONLY: aht0 142 USE iom 142 143 ! 143 144 LOGICAL, INTENT (in) :: ld_print ! If true, output arrays on numout … … 150 151 CHARACTER (len=15) :: clexp 151 152 INTEGER, POINTER, DIMENSION(:,:) :: icof 152 INTEGER, ALLOCATABLE, DIMENSION(:,:) :: idata153 REAL(wp), DIMENSION(:,:), ALLOCATABLE :: ztemp2d ! temporary array to read ahmcoef file 153 154 !!---------------------------------------------------------------------- 154 155 ! … … 232 233 ! Read 2d integer array to specify western boundary increase in the 233 234 ! ===================== equatorial strip (20N-20S) defined at t-points 234 235 ALLOCATE( idata(jpidta,jpjdta), STAT=ierror )236 IF( ierror > 0 ) CALL ctl_stop( 'STOP', 'ldf_dyn_c2d_orca: unable to allocate idata array' )237 235 ! 238 CALL ctl_opn( inum, 'ahmcoef', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp ) 239 READ(inum,9101) clexp, iim, ijm 240 READ(inum,'(/)') 241 ifreq = 40 242 il1 = 1 243 DO jn = 1, jpidta/ifreq+1 244 READ(inum,'(/)') 245 il2 = MIN( jpidta, il1+ifreq-1 ) 246 READ(inum,9201) ( ii, ji = il1, il2, 5 ) 247 READ(inum,'(/)') 248 DO jj = jpjdta, 1, -1 249 READ(inum,9202) ij, ( idata(ji,jj), ji = il1, il2 ) 250 END DO 251 il1 = il1 + ifreq 252 END DO 253 254 DO jj = 1, nlcj 255 DO ji = 1, nlci 256 icof(ji,jj) = idata( mig(ji), mjg(jj) ) 257 END DO 258 END DO 259 DO jj = nlcj+1, jpj 260 DO ji = 1, nlci 261 icof(ji,jj) = icof(ji,nlcj) 262 END DO 263 END DO 264 DO jj = 1, jpj 265 DO ji = nlci+1, jpi 266 icof(ji,jj) = icof(nlci,jj) 267 END DO 268 END DO 269 270 9101 FORMAT(1x,a15,2i8) 271 9201 FORMAT(3x,13(i3,12x)) 272 9202 FORMAT(i3,41i3) 273 274 DEALLOCATE(idata) 236 ALLOCATE( ztemp2d(jpi,jpj) ) 237 ztemp2d(:,:) = 0. 238 CALL iom_open ( 'ahmcoef.nc', inum ) 239 CALL iom_get ( inum, jpdom_data, 'icof', ztemp2d) 240 icof(:,:) = NINT(ztemp2d(:,:)) 241 CALL iom_close( inum ) 242 DEALLOCATE(ztemp2d) 275 243 276 244 ! Set ahm1 and ahm2 ( T- and F- points) (used for laplacian operator) … … 380 348 CHARACTER (len=15) :: clexp 381 349 INTEGER, POINTER, DIMENSION(:,:) :: icof 382 INTEGER, ALLOCATABLE, DIMENSION(:,:) :: idata350 REAL(wp), DIMENSION(:,:), ALLOCATABLE :: ztemp2d ! temporary array to read ahmcoef file 383 351 !!---------------------------------------------------------------------- 384 352 ! 385 353 CALL wrk_alloc( jpi , jpj , icof ) 386 354 ! 387 388 355 IF(lwp) WRITE(numout,*) 389 356 IF(lwp) WRITE(numout,*) 'inildf: 2d eddy viscosity coefficient' … … 464 431 ! Read 2d integer array to specify western boundary increase in the 465 432 ! ===================== equatorial strip (20N-20S) defined at t-points 466 467 ALLOCATE( idata(jpidta,jpjdta), STAT=ierror ) 468 IF( ierror > 0 ) CALL ctl_stop( 'STOP', 'ldf_dyn_c2d_orca_R1: unable to allocate idata array' ) 469 ! 470 CALL ctl_opn( inum, 'ahmcoef', 'UNKNOWN', 'FORMATTED', 'SEQUENTIAL', & 471 & 1, numout, lwp ) 472 REWIND inum 473 READ(inum,9101) clexp, iim, ijm 474 READ(inum,'(/)') 475 ifreq = 40 476 il1 = 1 477 DO jn = 1, jpidta/ifreq+1 478 READ(inum,'(/)') 479 il2 = MIN( jpidta, il1+ifreq-1 ) 480 READ(inum,9201) ( ii, ji = il1, il2, 5 ) 481 READ(inum,'(/)') 482 DO jj = jpjdta, 1, -1 483 READ(inum,9202) ij, ( idata(ji,jj), ji = il1, il2 ) 484 END DO 485 il1 = il1 + ifreq 486 END DO 487 488 DO jj = 1, nlcj 489 DO ji = 1, nlci 490 icof(ji,jj) = idata( mig(ji), mjg(jj) ) 491 END DO 492 END DO 493 DO jj = nlcj+1, jpj 494 DO ji = 1, nlci 495 icof(ji,jj) = icof(ji,nlcj) 496 END DO 497 END DO 498 DO jj = 1, jpj 499 DO ji = nlci+1, jpi 500 icof(ji,jj) = icof(nlci,jj) 501 END DO 502 END DO 503 504 9101 FORMAT(1x,a15,2i8) 505 9201 FORMAT(3x,13(i3,12x)) 506 9202 FORMAT(i3,41i3) 507 508 DEALLOCATE(idata) 433 ALLOCATE( ztemp2d(jpi,jpj) ) 434 ztemp2d(:,:) = 0. 435 CALL iom_open ( 'ahmcoef.nc', inum ) 436 CALL iom_get ( inum, jpdom_data, 'icof', ztemp2d) 437 icof(:,:) = NINT(ztemp2d(:,:)) 438 CALL iom_close( inum ) 439 DEALLOCATE(ztemp2d) 509 440 510 441 ! Set ahm1 and ahm2 ( T- and F- points) (used for laplacian operator) -
trunk/NEMOGCM/NEMO/OPA_SRC/LDF/ldfdyn_c3d.h90
r4292 r5396 27 27 !!---------------------------------------------------------------------- 28 28 USE ldftra_oce, ONLY : aht0 29 USE iom 29 30 !! 30 31 LOGICAL, INTENT (in) :: ld_print ! If true, output arrays on numout … … 193 194 !!---------------------------------------------------------------------- 194 195 USE ldftra_oce, ONLY: aht0 196 USE iom 197 !RBB USE in_out_manager ! I/O manager 198 !RBB USE fldread ! read input fields 199 195 200 !! 196 201 LOGICAL, INTENT(in) :: ld_print ! If true, output arrays on numout … … 204 209 CHARACTER (len=15) :: clexp 205 210 INTEGER , POINTER, DIMENSION(:,:) :: icof 206 INTEGER , POINTER, DIMENSION(:,:) :: idata207 211 REAL(wp), POINTER, DIMENSION(: ) :: zcoef 208 212 REAL(wp), POINTER, DIMENSION(:,:) :: zahm0 213 ! 214 REAL(wp), DIMENSION(:,:), ALLOCATABLE :: ztemp2d ! temporary array to read ahmcoef file 209 215 !!---------------------------------------------------------------------- 210 216 ! 211 217 CALL wrk_alloc( jpi , jpj , icof ) 212 CALL wrk_alloc( jpidta, jpjdta, idata )213 218 CALL wrk_alloc( jpk , zcoef ) 214 219 CALL wrk_alloc( jpi , jpj , zahm0 ) … … 221 226 ! Read 2d integer array to specify western boundary increase in the 222 227 ! ===================== equatorial strip (20N-20S) defined at t-points 223 224 CALL ctl_opn( inum, 'ahmcoef', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp ) 225 READ(inum,9101) clexp, iim, ijm 226 READ(inum,'(/)') 227 ifreq = 40 228 il1 = 1 229 DO jn = 1, jpidta/ifreq+1 230 READ(inum,'(/)') 231 il2 = MIN( jpidta, il1+ifreq-1 ) 232 READ(inum,9201) ( ii, ji = il1, il2, 5 ) 233 READ(inum,'(/)') 234 DO jj = jpjdta, 1, -1 235 READ(inum,9202) ij, ( idata(ji,jj), ji = il1, il2 ) 236 END DO 237 il1 = il1 + ifreq 238 END DO 239 240 DO jj = 1, nlcj 241 DO ji = 1, nlci 242 icof(ji,jj) = idata( mig(ji), mjg(jj) ) 243 END DO 244 END DO 245 DO jj = nlcj+1, jpj 246 DO ji = 1, nlci 247 icof(ji,jj) = icof(ji,nlcj) 248 END DO 249 END DO 250 DO jj = 1, jpj 251 DO ji = nlci+1, jpi 252 icof(ji,jj) = icof(nlci,jj) 253 END DO 254 END DO 255 256 9101 FORMAT(1x,a15,2i8) 257 9201 FORMAT(3x,13(i3,12x)) 258 9202 FORMAT(i3,41i3) 259 228 ALLOCATE( ztemp2d(jpi,jpj) ) 229 ztemp2d(:,:) = 0. 230 CALL iom_open ( 'ahmcoef.nc', inum ) 231 CALL iom_get ( inum, jpdom_data, 'icof', ztemp2d) 232 icof(:,:) = NINT(ztemp2d(:,:)) 233 CALL iom_close( inum ) 234 DEALLOCATE(ztemp2d) 235 260 236 ! Set ahm1 and ahm2 261 237 ! ================= … … 455 431 ! 456 432 CALL wrk_dealloc( jpi , jpj , icof ) 457 CALL wrk_dealloc( jpidta, jpjdta, idata )458 433 CALL wrk_dealloc( jpk , zcoef ) 459 434 CALL wrk_dealloc( jpi , jpj , zahm0 )
Note: See TracChangeset
for help on using the changeset viewer.