Ignore:
Timestamp:
May 13, 2016, 8:46:39 AM (9 years ago)
Author:
Ehouarn Millour
Message:

Some bug fixes in slab model to run in parallel.
FC

File:
1 edited

Legend:

Unmodified
Added
Removed
  • LMDZ5/trunk/libf/phylmd/limit_slab.F90

    r2344 r2514  
    4242  lmt_pas = NINT(86400./dtime)
    4343 
     44! Initialize saved variables
     45     IF (.NOT. ALLOCATED(bils_save)) THEN
     46        ALLOCATE(bils_save(klon), diff_sst_save(klon), diff_siv_save(klon), stat=ierr)
     47        IF (ierr /= 0) CALL abort_physic('limit_slab', 'pb in allocation',1)
     48     END IF
     49
    4450  ! F. Codron 5/14: add defaults for bils, diff_sst (0)
    4551  IF (MOD(itime-1, lmt_pas) == 0) THEN   ! time to read
    46      !$OMP MASTER  ! Only master thread
     52!$OMP MASTER  ! Only master thread
    4753     IF (is_mpi_root) THEN ! Only master processus
    4854        print*,'in limit_slab time to read, itime=',itime
     
    5359        ierr = NF90_OPEN ('limit_slab.nc', NF90_NOWRITE, nid)
    5460        IF (ierr /= NF90_NOERR) THEN
     61            PRINT *,'LIMIT_SLAB file not found'
    5562            read_bils=.FALSE.
    5663            read_sst=.FALSE.
     
    112119        ierr = NF90_CLOSE(nid)
    113120        IF (ierr /= NF90_NOERR) CALL abort_physic(modname,'Pb when closing file', 1)
    114         END IF ! Read File
     121        END IF ! Read File 
    115122        IF (read_sst) THEN
    116123! Calculate difference in temperature between this day and one ahead
     
    128135
    129136!$OMP END MASTER
     137!$OMP BARRIER
    130138       
    131      IF (.NOT. ALLOCATED(bils_save)) THEN
    132         ALLOCATE(bils_save(klon), diff_sst_save(klon), diff_siv_save(klon), stat=ierr)
    133         IF (ierr /= 0) CALL abort_physic('limit_slab', 'pb in allocation',1)
    134      END IF
    135 
     139! Send fields to all processes
    136140! Give default values if needed
     141     CALL bcast(read_bils)
     142     CALL bcast(read_sst)
     143     CALL bcast(read_siv)
     144     PRINT *,'limit_slab sst',read_sst,'siv',read_siv,'qflux',read_bils
    137145     IF (read_bils) THEN
    138146         CALL Scatter(bils_glo, bils_save)
     
    156164  diff_sst(:) = diff_sst_save(:)
    157165  diff_siv(:) = diff_siv_save(:)
     166! For Debug purpose
     167!  PRINT *,'limit_slab sst',MINVAL(diff_sst(:)),MAXVAL(diff_sst(:))
     168!  PRINT *,'limit_slab siv',MINVAL(diff_siv(:)),MAXVAL(diff_siv(:))
     169!  PRINT *,'limit_slab bils',MINVAL(lmt_bils(:)),MAXVAL(lmt_bils(:))
    158170
    159  
    160171END SUBROUTINE limit_slab
Note: See TracChangeset for help on using the changeset viewer.