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 5945 for branches/NERC/dev_r5589_is_oce_cpl/NEMOGCM/NEMO/OPA_SRC/DOM/iscplhsb.F90 – NEMO

Ignore:
Timestamp:
2015-11-29T20:44:49+01:00 (8 years ago)
Author:
mathiot
Message:

ice sheet coupling: changes based on reviewer comments

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/NERC/dev_r5589_is_oce_cpl/NEMOGCM/NEMO/OPA_SRC/DOM/iscplhsb.F90

    r5920 r5945  
    7070      REAL(wp), DIMENSION(:), ALLOCATABLE :: zlon, zlat 
    7171      REAL(wp), DIMENSION(:), ALLOCATABLE :: zcorr_vol, zcorr_tem, zcorr_sal 
    72       INTEGER , DIMENSION(:), ALLOCATABLE :: ixpts, iypts, izpts, vnpts 
     72      INTEGER , DIMENSION(:), ALLOCATABLE :: ixpts, iypts, izpts, inpts 
    7373      INTEGER :: jpts, npts 
    7474 
     
    131131                       &    + e12t(jim1,jj  ) * tmask(jim1,jj  ,jk) + e12t(jip1,jj  ) * tmask(jip1,jj  ,jk) 
    132132 
    133                      IF ( zsum .NE. 0._wp ) THEN 
     133                     IF ( zsum /= 0._wp ) THEN 
    134134                        zjip1_ratio   = e12t(jip1,jj  ) * tmask(jip1,jj  ,jk) / zsum 
    135135                        zjim1_ratio   = e12t(jim1,jj  ) * tmask(jim1,jj  ,jk) / zsum 
     
    155155                        pts_flx (ji,jj,jk,jp_tem) = 0._wp 
    156156 
    157                      ELSE IF (zsum .EQ. 0._wp ) THEN 
     157                     ELSE IF (zsum == 0._wp ) THEN 
    158158                        ! case where we close a cell and no adjacent cell open 
    159159                        ! check if the cell beneath is wet 
    160                         IF ( tmask(ji,jj,jk+1) .EQ. 1._wp ) THEN 
     160                        IF ( tmask(ji,jj,jk+1) == 1._wp ) THEN 
    161161                           pvol_flx(ji,jj,jk+1)       =  pvol_flx(ji,jj,jk+1)        + pvol_flx(ji,jj,jk) 
    162162                           pts_flx (ji,jj,jk+1,jp_sal)=  pts_flx (ji,jj,jk+1,jp_sal) + pts_flx (ji,jj,jk,jp_sal) 
     
    169169                        ELSE 
    170170                        ! case no adjacent cell on the horizontal and on the vertical 
     171                           IF ( lwp ) THEN   ! JMM : cAution this warning may occur on any mpp subdomain but numout is only 
     172                                             ! open for narea== 1 (lwp=T) 
    171173                           WRITE(numout,*) 'W A R N I N G iscpl: no adjacent cell on the vertical and horizontal' 
    172174                           WRITE(numout,*) '                     ',mig(ji),' ',mjg(jj),' ',jk 
    173175                           WRITE(numout,*) '                     ',ji,' ',jj,' ',jk,' ',narea 
    174176                           WRITE(numout,*) ' we are now looking for the closest wet cell on the horizontal ' 
     177                           ENDIF 
    175178                        ! We deal with these points later. 
    176179                        END IF 
     
    188191      ! if no neighbour wet cell in case of 2close a cell", need to find the nearest wet point  
    189192      ! allocation and initialisation of the list of problematic point 
    190       ALLOCATE(vnpts(jpnij)) 
    191       vnpts(:)=0 
     193      ALLOCATE(inpts(jpnij)) 
     194      inpts(:)=0 
    192195 
    193196      ! fill narea location with the number of problematic point 
     
    197200               IF (     ptmask_b(ji,jj,jk) == 1._wp .AND. tmask(ji,jj,jk+1)  == 0._wp .AND. tmask_h(ji,jj) == 1._wp  & 
    198201                  .AND. SUM(tmask(ji-1:ji+1,jj,jk)) + SUM(tmask(ji,jj-1:jj+1,jk)) == 0._wp) THEN 
    199                   vnpts(narea) = vnpts(narea) + 1  
     202                  inpts(narea) = inpts(narea) + 1  
    200203               END IF 
    201204            END DO 
     
    204207 
    205208      ! build array of total problematic point on each cpu (share to each cpu) 
    206       CALL mpp_max(vnpts,jpnij)  
     209      CALL mpp_max(inpts,jpnij)  
    207210 
    208211      ! size of the new variable 
    209       npts  = SUM(vnpts)     
     212      npts  = SUM(inpts)     
    210213       
    211214      ! allocation of the coordinates, correction, index vector for the problematic points  
    212215      ALLOCATE(ixpts(npts), iypts(npts), izpts(npts), zcorr_vol(npts), zcorr_sal(npts), zcorr_tem(npts), zlon(npts), zlat(npts)) 
    213       ixpts(:) = -9999 ; iypts(:) = -9999 ; izpts(:) = -9999 ; zlon(:) = -1.0e20 ; zlat(:) = -1.0e20 
    214       zcorr_vol(:) = -1.0e20 
    215       zcorr_sal(:) = -1.0e20 
    216       zcorr_tem(:) = -1.0e20 
     216      ixpts(:) = -9999 ; iypts(:) = -9999 ; izpts(:) = -9999 ; zlon(:) = -1.0e20_wp ; zlat(:) = -1.0e20_wp 
     217      zcorr_vol(:) = -1.0e20_wp 
     218      zcorr_sal(:) = -1.0e20_wp 
     219      zcorr_tem(:) = -1.0e20_wp 
    217220 
    218221      ! fill new variable 
    219       jpts = SUM(vnpts(1:narea-1)) 
     222      jpts = SUM(inpts(1:narea-1)) 
    220223      DO jk = 1,jpk-1 
    221224         DO jj = 2,jpj-1 
     
    223226               IF (     ptmask_b(ji,jj,jk) == 1._wp .AND. tmask(ji,jj,jk+1)  == 0._wp .AND. tmask_h(ji,jj) == 1._wp  & 
    224227                  .AND. SUM(tmask(ji-1:ji+1,jj,jk)) + SUM(tmask(ji,jj-1:jj+1,jk)) == 0._wp) THEN 
    225                   jpts = jpts + 1  ! positioning in the vnpts vector for the area narea 
     228                  jpts = jpts + 1  ! positioning in the inpts vector for the area narea 
    226229                  ixpts(jpts) = ji           ; iypts(jpts) = jj ; izpts(jpts) = jk 
    227230                  zlon (jpts) = glamt(ji,jj) ; zlat (jpts) = gphit(ji,jj) 
     
    273276 
    274277      ! deallocate variables  
    275       DEALLOCATE(vnpts) 
     278      DEALLOCATE(inpts) 
    276279      DEALLOCATE(ixpts, iypts, izpts, zcorr_vol, zcorr_sal, zcorr_tem, zlon, zlat) 
    277280     
Note: See TracChangeset for help on using the changeset viewer.