@@ -31,13 +31,13 @@ module ice_transport_remap
3131
3232 use ice_kinds_mod
3333 use ice_blocks, only: nx_block, ny_block
34- use ice_communicate, only: my_task, ice_barrier
34+ use ice_communicate, only: my_task
3535 use ice_constants, only: c0, c1, c2, c12, p333, p4, p5, p6, &
3636 eps13, eps16, &
3737 field_loc_center, field_type_scalar, &
3838 field_loc_NEcorner, field_type_vector
3939 use ice_domain_size, only: max_blocks, ncat
40- use ice_fileunits, only: nu_diag, flush_fileunit
40+ use ice_fileunits, only: nu_diag
4141 use ice_exit, only: abort_ice
4242 use icepack_intfc, only: icepack_warnings_flush, icepack_warnings_aborted
4343 use icepack_intfc, only: icepack_query_parameters
@@ -381,127 +381,57 @@ subroutine horizontal_remap (dt, ntrace, &
381381 ilo,ihi,jlo,jhi,&! beginning and end of physical domain
382382 n, m ! ice category, tracer indices
383383
384- ! tcraig, the intel 20.0.1 compiler generates a segfault when entering this subroutine
385- ! at runtime.
386- ! This is probably a compiler bug and a workaround is to allocate the temporary data
387- ! rather than define it statically. Initial results don't show any slowdown, but
388- ! to keep the issue highlighted, an ifdef was created as a workaround.
389-
390- #ifdef INTEL20_WORKAROUND
391- integer (kind= int_kind), dimension (:,:), allocatable :: &
392- #else
393384 integer (kind= int_kind), dimension (0 :ncat,max_blocks) :: &
394- #endif
395385 icellsnc ! number of cells with ice
396386
397- #ifdef INTEL20_WORKAROUND
398- integer (kind= int_kind), dimension (:,:), allocatable :: &
399- #else
400387 integer (kind= int_kind), dimension (nx_block* ny_block,0 :ncat) :: &
401- #endif
402388 indxinc, indxjnc ! compressed i/j indices
403389
404- #ifdef INTEL20_WORKAROUND
405- real (kind= dbl_kind), dimension (:,:), allocatable :: &
406- #else
407390 real (kind= dbl_kind), dimension (nx_block,ny_block) :: &
408- #endif
409391 edgearea_e ,&! area of departure regions for east edges
410392 edgearea_n ! area of departure regions for north edges
411393
412- #ifdef INTEL20_WORKAROUND
413- real (kind= dbl_kind), dimension (:,:,:), allocatable :: &
414- #else
415394 real (kind= dbl_kind), dimension (nx_block,ny_block,max_blocks) :: &
416- #endif
417395 dpx ,&! x coordinates of departure points at cell corners
418396 dpy ! y coordinates of departure points at cell corners
419397
420- #ifdef INTEL20_WORKAROUND
421- real (kind= dbl_kind), dimension (:,:,:,:), allocatable :: &
422- #else
423398 real (kind= dbl_kind), dimension (nx_block,ny_block,0 :ncat,max_blocks) :: &
424- #endif
425399 mc ,&! mass at geometric center of cell
426400 mx, my ! limited derivative of mass wrt x and y
427401
428- #ifdef INTEL20_WORKAROUND
429- real (kind= dbl_kind), dimension (:,:,:), allocatable :: &
430- #else
431402 real (kind= dbl_kind), dimension (nx_block,ny_block,0 :ncat) :: &
432- #endif
433403 mmask ! = 1. if mass is present, = 0. otherwise
434404
435- #ifdef INTEL20_WORKAROUND
436- real (kind= dbl_kind), dimension (:,:,:,:,:), allocatable :: &
437- #else
438405 real (kind= dbl_kind), dimension (nx_block,ny_block,ntrace,ncat,max_blocks) :: &
439- #endif
440406 tc ,&! tracer values at geometric center of cell
441407 tx, ty ! limited derivative of tracer wrt x and y
442408
443- #ifdef INTEL20_WORKAROUND
444- real (kind= dbl_kind), dimension (:,:,:,:), allocatable :: &
445- #else
446409 real (kind= dbl_kind), dimension (nx_block,ny_block,ntrace,ncat) :: &
447- #endif
448410 tmask ! = 1. if tracer is present, = 0. otherwise
449411
450- #ifdef INTEL20_WORKAROUND
451- real (kind= dbl_kind), dimension (:,:,:), allocatable :: &
452- #else
453412 real (kind= dbl_kind), dimension (nx_block,ny_block,0 :ncat) :: &
454- #endif
455413 mflxe, mflxn ! mass transports across E and N cell edges
456414
457- #ifdef INTEL20_WORKAROUND
458- real (kind= dbl_kind), dimension (:,:,:,:), allocatable :: &
459- #else
460415 real (kind= dbl_kind), dimension (nx_block,ny_block,ntrace,ncat) :: &
461- #endif
462416 mtflxe, mtflxn ! mass*tracer transports across E and N cell edges
463417
464- #ifdef INTEL20_WORKAROUND
465- real (kind= dbl_kind), dimension (:,:,:), allocatable :: &
466- #else
467418 real (kind= dbl_kind), dimension (nx_block,ny_block,ngroups) :: &
468- #endif
469419 triarea ! area of east-edge departure triangle
470420
471- #ifdef INTEL20_WORKAROUND
472- real (kind= dbl_kind), dimension (:,:,:,:), allocatable :: &
473- #else
474421 real (kind= dbl_kind), dimension (nx_block,ny_block,0 :nvert,ngroups) :: &
475- #endif
476422 xp, yp ! x and y coordinates of special triangle points
477423 ! (need 4 points for triangle integrals)
478- #ifdef INTEL20_WORKAROUND
479- integer (kind= int_kind), dimension (:,:,:), allocatable :: &
480- #else
481424 integer (kind= int_kind), dimension (nx_block,ny_block,ngroups) :: &
482- #endif
483425 iflux ,&! i index of cell contributing transport
484426 jflux ! j index of cell contributing transport
485427
486- #ifdef INTEL20_WORKAROUND
487- integer (kind= int_kind), dimension (:,:), allocatable :: &
488- #else
489428 integer (kind= int_kind), dimension (ngroups,max_blocks) :: &
490- #endif
491429 icellsng ! number of cells with ice
492430
493- #ifdef INTEL20_WORKAROUND
494- integer (kind= int_kind), dimension (:,:), allocatable :: &
495- #else
496431 integer (kind= int_kind), dimension (nx_block* ny_block,ngroups) :: &
497- #endif
498432 indxing, indxjng ! compressed i/j indices
499433
500- #ifdef INTEL20_WORKAROUND
501- integer (kind= int_kind), dimension (:,:,:), allocatable :: &
502- #else
503434 integer (kind= int_kind), dimension (nx_block,ny_block,max_blocks) :: &
504- #endif
505435 halomask ! temporary mask for fast halo updates
506436
507437 logical (kind= log_kind) :: &
@@ -525,37 +455,6 @@ subroutine horizontal_remap (dt, ntrace, &
525455!- --! Remap the open water area (without tracers).
526456!- --!-------------------------------------------------------------------
527457
528- #ifdef INTEL20_WORKAROUND
529- allocate (icellsnc(0 :ncat,max_blocks))
530- allocate (indxinc(nx_block* ny_block,0 :ncat))
531- allocate (indxjnc(nx_block* ny_block,0 :ncat))
532- allocate (edgearea_e(nx_block,ny_block))
533- allocate (edgearea_n(nx_block,ny_block))
534- allocate (dpx(nx_block,ny_block,max_blocks))
535- allocate (dpy(nx_block,ny_block,max_blocks))
536- allocate (mc(nx_block,ny_block,0 :ncat,max_blocks))
537- allocate (mx(nx_block,ny_block,0 :ncat,max_blocks))
538- allocate (my(nx_block,ny_block,0 :ncat,max_blocks))
539- allocate (mmask(nx_block,ny_block,0 :ncat))
540- allocate (tc(nx_block,ny_block,ntrace,ncat,max_blocks))
541- allocate (tx(nx_block,ny_block,ntrace,ncat,max_blocks))
542- allocate (ty(nx_block,ny_block,ntrace,ncat,max_blocks))
543- allocate (tmask(nx_block,ny_block,ntrace,ncat))
544- allocate (mflxe(nx_block,ny_block,0 :ncat))
545- allocate (mflxn(nx_block,ny_block,0 :ncat))
546- allocate (mtflxe(nx_block,ny_block,ntrace,ncat))
547- allocate (mtflxn(nx_block,ny_block,ntrace,ncat))
548- allocate (triarea(nx_block,ny_block,ngroups))
549- allocate (xp(nx_block,ny_block,0 :nvert,ngroups))
550- allocate (yp(nx_block,ny_block,0 :nvert,ngroups))
551- allocate (iflux(nx_block,ny_block,ngroups))
552- allocate (jflux(nx_block,ny_block,ngroups))
553- allocate (icellsng(ngroups,max_blocks))
554- allocate (indxing(nx_block* ny_block,ngroups))
555- allocate (indxjng(nx_block* ny_block,ngroups))
556- allocate (halomask(nx_block,ny_block,max_blocks))
557- #endif
558-
559458 !- -- tcraig, tcx, this omp loop leads to a seg fault in gnu
560459 !- -- need to check private variables and debug further
561460 ! $TCXOMP PARALLEL DO PRIVATE(iblk,ilo,ihi,jlo,jhi,this_block,n,m, &
@@ -948,37 +847,6 @@ subroutine horizontal_remap (dt, ntrace, &
948847 enddo ! iblk
949848 ! $TCXOMP END PARALLEL DO
950849
951- #ifdef INTEL20_WORKAROUND
952- deallocate (icellsnc)
953- deallocate (indxinc)
954- deallocate (indxjnc)
955- deallocate (edgearea_e)
956- deallocate (edgearea_n)
957- deallocate (dpx)
958- deallocate (dpy)
959- deallocate (mc)
960- deallocate (mx)
961- deallocate (my)
962- deallocate (mmask)
963- deallocate (tc)
964- deallocate (tx)
965- deallocate (ty)
966- deallocate (tmask)
967- deallocate (mflxe)
968- deallocate (mflxn)
969- deallocate (mtflxe)
970- deallocate (mtflxn)
971- deallocate (triarea)
972- deallocate (xp)
973- deallocate (yp)
974- deallocate (iflux)
975- deallocate (jflux)
976- deallocate (icellsng)
977- deallocate (indxing)
978- deallocate (indxjng)
979- deallocate (halomask)
980- #endif
981-
982850 end subroutine horizontal_remap
983851
984852! =======================================================================
0 commit comments