Opened 3 months ago

Closed 3 months ago

#1913 closed Bug (fixed)

Compilation issue due to typo in diaar5

Reported by: Nicolas MARTIN Owned by: nemo
Priority: minor Milestone:
Component: OPA Version: nemo_v3_6_STABLE
Keywords: Cc:

Description

Context


ORCA1_LIM3_PISCES cfg. monitored by trusting tool is down since 27th of May with rev. 8084.
The follow-up of ORCA2_LIM_PISCES cfg. didn't detect an issue.

Analysis


Compilation stops and complains about [ZPE] variable not declared, actually 'pe' is declared and initialised but it is 'zpe' which is used in the loop.

Extract of diaar5.F90

         zpe(:,:) = 0._wp
         IF( lk_zdfddm ) THEN
            DO jk = 2, jpk
               DO jj = 1, jpj
                  DO ji = 1, jpi
                     IF( rn2(ji,jj,jk) > 0._wp ) THEN
                        zrw =   ( fsdepw(ji,jj,jk  ) - fsdept(ji,jj,jk) )   &
                           &  / ( fsdept(ji,jj,jk-1) - fsdept(ji,jj,jk) )
                        !
                        zaw = rab_n(ji,jj,jk,jp_tem) * (1. - zrw) + rab_n(ji,jj,jk-1,jp_tem)* zrw
                        zbw = rab_n(ji,jj,jk,jp_sal) * (1. - zrw) + rab_n(ji,jj,jk-1,jp_sal)* zrw
                        !
                        zpe(ji, jj) = zpe(ji, jj)            &
                           &        -  grav * (    avt(ji,jj,jk) * zaw * (tsn(ji,jj,jk-1,jp_tem) - tsn(ji,jj,jk,jp_tem) )  &
                           &                   - fsavs(ji,jj,jk) * zbw * (tsn(ji,jj,jk-1,jp_sal) - tsn(ji,jj,jk,jp_sal) ) )
                     ENDIF
                  END DO
               END DO
             END DO
          ELSE
            DO jk = 1, jpk
               DO ji = 1, jpi
                  DO jj = 1, jpj
                     zpe(ji,jj) = zpe(ji,jj) + avt(ji, jj, jk) * MIN(0._wp,rn2(ji, jj, jk)) * rau0 * fse3w(ji, jj, jk)
                  END DO
               END DO
            END DO
         ENDIF
         CALL lbc_lnk(zpe, 'T', 1._wp)         
         CALL iom_put( 'tnpeo', zpe  )
      ENDIF



Fix


Correct the typos

Index: NEMO/OPA_SRC/DIA/diaar5.F90
===================================================================
--- NEMO/OPA_SRC/DIA/diaar5.F90 (revision 8186)
+++ NEMO/OPA_SRC/DIA/diaar5.F90 (working copy)
@@ -80,7 +80,7 @@
       REAL(wp) ::   zaw, zbw, zrw
       !
       REAL(wp), POINTER, DIMENSION(:,:)     :: zarea_ssh , zbotpres       ! 2D workspace 
-      REAL(wp), POINTER, DIMENSION(:,:)     :: pe                         ! 2D workspace 
+      REAL(wp), POINTER, DIMENSION(:,:)     :: zpe                         ! 2D workspace 
       REAL(wp), POINTER, DIMENSION(:,:,:)   :: zrhd , zrhop               ! 3D workspace
       REAL(wp), POINTER, DIMENSION(:,:,:,:) :: ztsn                       ! 4D workspace
       !!--------------------------------------------------------------------
@@ -90,7 +90,7 @@
       !initialisation
       IF( kt == nit000 )     CALL dia_ar5_init
  
-      CALL wrk_alloc( jpi , jpj              , zarea_ssh , zbotpres, pe )
+      CALL wrk_alloc( jpi , jpj              , zarea_ssh , zbotpres, zpe )
       CALL wrk_alloc( jpi , jpj , jpk        , zrhd      , zrhop    )
       CALL wrk_alloc( jpi , jpj , jpk , jpts , ztsn                 )
 
@@ -205,7 +205,7 @@
       ! Work done against stratification by vertical mixing
       ! Exclude points where rn2 is negative as convection kicks in here and
       ! work is not being done against stratification
-         pe(:,:) = 0._wp
+         zpe(:,:) = 0._wp
          IF( lk_zdfddm ) THEN
             DO jk = 2, jpk
                DO jj = 1, jpj
@@ -233,11 +233,11 @@
                END DO
             END DO
          ENDIF
-         CALL lbc_lnk(pe, 'T', 1._wp)         
-         CALL iom_put( 'tnpeo', pe )
+         CALL lbc_lnk(zpe, 'T', 1._wp)         
+         CALL iom_put( 'tnpeo', zpe )
       ENDIF
       !
-      CALL wrk_dealloc( jpi , jpj              , zarea_ssh , zbotpres, pe )
+      CALL wrk_dealloc( jpi , jpj              , zarea_ssh , zbotpres, zpe )
       CALL wrk_dealloc( jpi , jpj , jpk        , zrhd      , zrhop    )
       CALL wrk_dealloc( jpi , jpj , jpk , jpts , ztsn                 )
       !

Commit History (1)

ChangesetAuthorTimeChangeLog
8187nicolasmartin2017-06-19T15:46:10+02:00

Fix for typos in diaar5.F90 [close #1913]

Change History (1)

comment:1 Changed 3 months ago by Nicolas MARTIN

  • Resolution set to fixed
  • Status changed from new to closed

Fix in r8187

Note: See TracTickets for help on using tickets.