New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Changeset 3019 for branches – NEMO

Changeset 3019 for branches


Ignore:
Timestamp:
2011-10-28T10:55:06+02:00 (13 years ago)
Author:
edblockley
Message:

5th commit for rebuild branch; Fixing a small bug in the rebuild to ensure that the rebuild dimension no.s are properly set when the names are specified in the namelist. Also changing indimlens to SHARED rather than PRIVATE for OMP loops to satisfy certain compilers. see ticket:#871

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2011/dev_r2802_UKMET3_rebuild/NEMOGCM/TOOLS/REBUILD_NEMO/src/rebuild_nemo.f90

    r2898 r3019  
    237237         ENDIF 
    238238      ELSE ! l_findDims = false 
    239          IF( TRIM(dimname) == TRIM(dims(1))) dimlen = global_sizes(1) 
    240          IF( TRIM(dimname) == TRIM(dims(2))) dimlen = global_sizes(2) 
     239         IF( TRIM(dimname) == TRIM(dims(1))) THEN 
     240            dimlen = global_sizes(1) 
     241            rebuild_dims(1) = idim 
     242         ENDIF 
     243         IF( rbdims > 1 .AND. TRIM(dimname) == TRIM(dims(2))) THEN 
     244            dimlen = global_sizes(2) 
     245            rebuild_dims(2) = idim 
     246         ENDIF 
    241247      ENDIF 
    242248 
     
    565571!$OMP  PARALLEL DO DEFAULT(NONE)                                                          & 
    566572!$OMP& PRIVATE(ifile,ncid,xtype,start_pos,local_sizes,InMin,InMax,natts,                  & 
    567 !$OMP&         ndims,attid,attname,dimids,indimlens,idim,dimname,dimlen,unlimitedDimId,   & 
     573!$OMP&         ndims,attid,attname,dimids,idim,dimname,dimlen,unlimitedDimId,             & 
    568574!$OMP&         halo_start,halo_end,idomain,jdomain,rdomain,di,dj,dr,                      & 
    569575!$OMP&         localdata_1d_i2,localdata_1d_i4,localdata_1d_sp,localdata_1d_dp,           & 
     
    572578!$OMP&         localdata_4d_i2,localdata_4d_i4,localdata_4d_sp,localdata_4d_dp,           & 
    573579!$OMP&         localdata_1d_i1,localdata_2d_i1,localdata_3d_i1,localdata_4d_i1)           & 
    574 !$OMP& SHARED(jv,nvars,varname,filenames,ValMin,ValMax,outdimlens,rbdims,                 & 
     580!$OMP& SHARED(jv,nvars,varname,filenames,ValMin,ValMax,indimlens,outdimlens,rbdims,       & 
    575581!$OMP&        ndomain,outid,chunksize,istop,l_valid,nthreads,inncids,rebuild_dims,        & 
    576582!$OMP&        globaldata_1d_i2,globaldata_1d_i4,globaldata_1d_sp,globaldata_1d_dp,        & 
     
    590596            CALL check_nf90( nf90_inquire_variable( ncid, jv, varname, xtype, ndims, dimids, natts ), istop ) 
    591597            CALL check_nf90( nf90_inquire( ncid, unlimitedDimId = unlimitedDimId ), istop ) 
    592             DO idim = 1, ndims 
    593                CALL check_nf90( nf90_inquire_dimension( ncid, idim, dimname, dimlen ), istop ) 
    594                indimlens(idim) = dimlen     
    595             END DO 
    596598!$OMP END CRITICAL 
    597599 
     
    934936 
    935937            IF( nthreads == 1 .AND. istop /= nf90_noerr )  THEN 
    936                WRITE(numerr,*) '*** NEMO rebuild failed with ', istop,' ERRORS! ***' 
     938               WRITE(numerr,*) '*** NEMO rebuild failed! ***' 
    937939               STOP 
    938940            ENDIF 
     
    943945!3.6 Abort if any of the OMP threads failed 
    944946         IF( istop /= nf90_noerr )  THEN 
    945             WRITE(numerr,*) '*** NEMO rebuild failed with ', istop,' ERRORS! ***' 
     947            WRITE(numerr,*) '*** NEMO rebuild failed! ***' 
    946948            STOP 
    947949         ENDIF 
Note: See TracChangeset for help on using the changeset viewer.