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.
2019WP/ENHANCE-04_AndrewC-reporting (diff) – NEMO

Changes between Version 8 and Version 9 of 2019WP/ENHANCE-04_AndrewC-reporting


Ignore:
Timestamp:
2019-01-17T13:32:32+01:00 (5 years ago)
Author:
acc
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • 2019WP/ENHANCE-04_AndrewC-reporting

    v8 v9  
    1313 
    1414== Preview  
    15 '''(version 2 following initial preview by Sebastien ( see his comments below))''' 
     15'''(version 3 following initial preview by Sebastien ( see his comments below) and tidying up of the existing nn_verbose_level settings to control the icebergs.stat files)''' 
    1616{{{#!box help 
    1717[[Include(wiki:Developers/DevProcess#preview_)]] 
     
    2727mpp.top.output_XXX     <---- correct this to 4-digits for consistency 
    2828EMPave.dat_XXXX        <---- These are all identical, suppress writing to write-master only 
    29 icebergs.stat_XXXX 
     29icebergs.stat_XXXX     <---- These should already be controlled by the nn_verbose_level variable; tidy up  
     30                             and ensure silent running with nn_verbose_level=0 
    3031}}} 
    3132and possibly others depending on runtime options. One of the 2019 NEMO workplan entries (ENHANCE-04_AndrewC-reporting) plans to introduce more control over the choice of output created but it may be best to introduce the basic structure prior to the v4.0 release. Below is a summary of the overall plans and what can be implemented immediately if there is consensus. 
     
    38394. TOP/prtctl_trc.F90 TOP/trcini.F90 TOP/trcstp.F90 
    39405. OCE/LBC/mppini.F90  OCE/SBC/sbcfwb.F90 
    40 6. sette/sette.sh 
     416. Tidy up icb modules so that the existing nn_verbose_level parameter can be used to turn off icebergs.stat files 
     427. sette/sette.sh 
    4143}}} 
    4244 
     
    5355* l_runstat, l_trcstat            Activates production of global stats files. Only a single file of each of these is ever produced. 
    5456* l_oceout, l_layout              Normal operation is to produce a single version of each of these. If true then a version for each area is produced 
    55 * l_mppout, l_mpptrc, l_icbstat   Suppressed if false, otherwise produce a version for each area. 
     57* l_mppout, l_mpptrc              Suppressed if false, otherwise produce a version for each area. 
    5658* procmin, procmax, procincr      Allow subsetting of areas when producing output in the previous two categories. Default values will ensure all areas report. 
    5759* ptimincr                        Timestep increment for outputting of time step status information less frequently (affects run.stat, tracer.stat and time.step only) 
     
    6163Index: OCE/IOM/in_out_manager.F90 
    6264=================================================================== 
    63 --- OCE/IOM/in_out_manager.F90  (revision 10530) 
     65--- OCE/IOM/in_out_manager.F90  (revision 10539) 
    6466+++ OCE/IOM/in_out_manager.F90  (working copy) 
    65 @@ -99,6 +99,27 @@ 
     67@@ -99,6 +99,26 @@ 
    6668    !!                    output monitoring 
    6769    !!---------------------------------------------------------------------- 
     
    7880+      LOGICAL :: l_mppout  = .FALSE.  !: Produce/do not produce mpp.output_XXXX files (T/F) 
    7981+      LOGICAL :: l_mpptop  = .FALSE.  !: Produce/do not produce mpp.top.output_XXXX files (T/F) 
    80 +      LOGICAL :: l_icbstat = .FALSE.  !: Produce/do not produce icebergs.stat_XXXX files (T/F) 
    8182+                                      !  Optional subsetting of processor report files 
    8283+                                      !  Default settings of 0/1000000/1 should ensure all areas report. 
     
    9293    INTEGER ::   nn_print         !: level of print (0 no print) 
    9394 
    94 Index: cfgs/SHARED/namelist_ref 
    95 =================================================================== 
    96 --- cfgs/SHARED/namelist_ref    (revision 10530) 
    97 +++ cfgs/SHARED/namelist_ref    (working copy) 
    98 @@ -1303,7 +1303,19 @@ 
     95Index: ../cfgs/SHARED/namelist_ref 
     96=================================================================== 
     97--- ../cfgs/SHARED/namelist_ref (revision 10537) 
     98+++ ../cfgs/SHARED/namelist_ref (working copy) 
     99@@ -1303,7 +1303,18 @@ 
    99100 !----------------------------------------------------------------------- 
    100101 &namctl        !   Control prints                                       (default: OFF) 
     
    109110+       sn_cfctl%l_mppout  = .FALSE. ! 
    110111+       sn_cfctl%l_mpptop  = .FALSE. ! 
    111 +       sn_cfctl%l_icbstat = .FALSE. ! 
    112112+       sn_cfctl%procmin   = 0       ! Minimum area number for reporting [default:0] 
    113113+       sn_cfctl%procmax   = 1000000 ! Maximum area number for reporting [default:1000000] 
     
    127127Index: OCE/nemogcm.F90 
    128128=================================================================== 
    129 --- OCE/nemogcm.F90     (revision 10530) 
     129--- OCE/nemogcm.F90     (revision 10539) 
    130130+++ OCE/nemogcm.F90     (working copy) 
    131131@@ -256,8 +256,8 @@ 
     
    159159       lwp = (narea == 1) .OR. ln_ctl                        ! control of all listing output print 
    160160  
    161 @@ -503,6 +515,18 @@ 
     161@@ -503,6 +515,17 @@ 
    162162          WRITE(numout,*) '~~~~~~~~' 
    163163          WRITE(numout,*) '   Namelist namctl' 
     
    170170+         WRITE(numout,*) '                              sn_cfctl%l_mppout  = ', sn_cfctl%l_mppout 
    171171+         WRITE(numout,*) '                              sn_cfctl%l_mpptop  = ', sn_cfctl%l_mpptop 
    172 +         WRITE(numout,*) '                              sn_cfctl%l_icbstat = ', sn_cfctl%l_icbstat 
    173172+         WRITE(numout,*) '                              sn_cfctl%procmin   = ', sn_cfctl%procmin   
    174173+         WRITE(numout,*) '                              sn_cfctl%procmax   = ', sn_cfctl%procmax   
     
    178177          WRITE(numout,*) '      Start i indice for SUM control  nn_ictls   = ', nn_ictls 
    179178          WRITE(numout,*) '      End i indice for SUM control    nn_ictle   = ', nn_ictle 
    180 @@ -649,6 +673,34 @@ 
     179@@ -649,6 +672,33 @@ 
    181180       ! 
    182181    END SUBROUTINE nemo_alloc 
     
    207206+      sn_cfctl%l_mppout  = setto 
    208207+      sn_cfctl%l_mpptop  = setto 
    209 +      sn_cfctl%l_icbstat = setto 
    210208+   END SUBROUTINE nemo_set_cfctl 
    211209+ 
     
    428426             CLOSE( inum ) 
    429427}}} 
    430  
    431 ''' 6. sette/sette.sh ''' 
     428''' 6. Tidy up icb modules so that the existing nn_verbose_level parameter can be used to turn off icebergs.stat files ''' 
     429 
     430The icb modules already contain their own mechanism for controlling the verbosity of the icebergs.stat file reporting. This is done via the nn_verbose_level name list parameter which is set to a default value of 1. Output is minimal for nn_verbose_level=0 but is not switched off completely. Thus the icebergs.stat files are always created even when not required. This is particularly annoying at larger processor counts. Only a little work is required to ensure that nn_verbose_level=0 runs silently and does not create the unwanted files: 
     431 
     432{{{ 
     433Changes required in: 
     434OCE/ICB/icbdia.F90 
     435OCE/ICB/icbdyn.F90 
     436OCE/ICB/icbini.F90 
     437OCE/ICB/icblbc.F90 
     438OCE/ICB/icbstp.F90 
     439OCE/ICB/icbutl.F90 
     440}}} 
     441{{{#!diff 
     442Index: OCE/ICB/icbdia.F90 
     443=================================================================== 
     444--- OCE/ICB/icbdia.F90  (revision 10539) 
     445+++ OCE/ICB/icbdia.F90  (working copy) 
     446@@ -326,8 +326,10 @@ 
     447             CALL report_consistant( 'bot interface','kg','sent',calving_out_net, & 
     448                &                    'returned',calving_ret_net) 
     449          ENDIF 
     450-         WRITE( numicb, '("calved by class = ",i6,20(",",i6))') (nbergs_calved_by_class(ik),ik=1,nclasses) 
     451-         IF( nspeeding_tickets > 0 )   WRITE( numicb, '("speeding tickets issued = ",i6)') nspeeding_tickets 
     452+         IF (nn_verbose_level > 0) THEN 
     453+            WRITE( numicb, '("calved by class = ",i6,20(",",i6))') (nbergs_calved_by_class(ik),ik=1,nclasses) 
     454+            IF( nspeeding_tickets > 0 )   WRITE( numicb, '("speeding tickets issued = ",i6)') nspeeding_tickets 
     455+         ENDIF 
     456          ! 
     457          nbergs_start              = nbergs_end 
     458          stored_start              = stored_end 
     459@@ -436,11 +438,13 @@ 
     460       IF( kt == nit000 ) THEN 
     461          stored_start = SUM( berg_grid%stored_ice(:,:,:) ) 
     462          CALL mpp_sum( 'icbdia', stored_start ) 
     463-         WRITE(numicb,'(a,es13.6,a)')   'icb_dia_income: initial stored mass=',stored_start,' kg' 
     464          ! 
     465          stored_heat_start = SUM( berg_grid%stored_heat(:,:) ) 
     466          CALL mpp_sum( 'icbdia', stored_heat_start ) 
     467-         WRITE(numicb,'(a,es13.6,a)')    'icb_dia_income: initial stored heat=',stored_heat_start,' J' 
     468+         IF (nn_verbose_level > 0) THEN 
     469+            WRITE(numicb,'(a,es13.6,a)')   'icb_dia_income: initial stored mass=',stored_start,' kg' 
     470+            WRITE(numicb,'(a,es13.6,a)')   'icb_dia_income: initial stored heat=',stored_heat_start,' J' 
     471+         ENDIF 
     472       ENDIF 
     473       ! 
     474       calving_rcv_net = calving_rcv_net + SUM( berg_grid%calving(:,:) ) * berg_dt 
     475@@ -514,6 +518,7 @@ 
     476       INTEGER,       INTENT(in), OPTIONAL :: kbergs 
     477       !!---------------------------------------------------------------------- 
     478       ! 
     479+      IF (nn_verbose_level == 0) RETURN 
     480       IF( PRESENT(kbergs) ) THEN 
     481          WRITE(numicb,100) cd_budgetstr // ' state:',                                    & 
     482             &              cd_startstr  // ' start',  pstartval,         cd_budgetunits, & 
     483@@ -538,6 +543,7 @@ 
     484       REAL(wp),      INTENT(in) :: pstartval, pendval 
     485       !!---------------------------------------------------------------------- 
     486       ! 
     487+      IF (nn_verbose_level == 0) RETURN 
     488       WRITE(numicb,200) cd_budgetstr // ' check:',                 & 
     489          &              cd_startstr,    pstartval, cd_budgetunits, & 
     490          &              cd_endstr,      pendval,   cd_budgetunits, & 
     491@@ -557,6 +563,7 @@ 
     492       REAL(wp) ::   zval 
     493       !!---------------------------------------------------------------------- 
     494       ! 
     495+      IF (nn_verbose_level == 0) RETURN 
     496       zval = ( ( pendval - pstartval ) - ( pinval - poutval ) ) /   & 
     497          &   MAX( 1.e-30, MAX( ABS( pendval - pstartval ) , ABS( pinval - poutval ) ) ) 
     498          ! 
     499@@ -577,6 +584,7 @@ 
     500       INTEGER      , INTENT(in) ::   pstartval, pendval 
     501       !!---------------------------------------------------------------------- 
     502       ! 
     503+      IF (nn_verbose_level == 0) RETURN 
     504       WRITE(numicb,100) cd_budgetstr // ' state:',           & 
     505          &              cd_startstr  // ' start', pstartval, & 
     506          &              cd_endstr    // ' end',   pendval,   & 
     507@@ -594,6 +602,7 @@ 
     508       INTEGER,       INTENT(in) :: pinval, poutval, pstartval, pendval 
     509       !!---------------------------------------------------------------------- 
     510       ! 
     511+      IF (nn_verbose_level == 0) RETURN 
     512       WRITE(numicb,200) cd_budgetstr // ' budget:', & 
     513          &              cd_instr     // ' in',      pinval, & 
     514          &              cd_outstr    // ' out',     poutval, & 
     515Index: OCE/ICB/icbdyn.F90 
     516=================================================================== 
     517--- OCE/ICB/icbdyn.F90  (revision 10539) 
     518+++ OCE/ICB/icbdyn.F90  (working copy) 
     519@@ -370,10 +370,12 @@ 
     520          ENDIF 
     521       ENDIF 
     522       !                                      ! check the speed and acceleration limits 
     523-      IF( ABS( zuveln ) > pp_vel_lim   .OR. ABS( zvveln ) > pp_vel_lim   )   & 
     524-         WRITE(numicb,'("pe=",i3,x,a)') narea,'Dump triggered by excessive velocity' 
     525-      IF( ABS( pax    ) > pp_accel_lim .OR. ABS( pay    ) > pp_accel_lim )   & 
     526-         WRITE(numicb,'("pe=",i3,x,a)') narea,'Dump triggered by excessive acceleration' 
     527+      IF (nn_verbose_level > 0) THEN 
     528+         IF( ABS( zuveln ) > pp_vel_lim   .OR. ABS( zvveln ) > pp_vel_lim   )   & 
     529+            WRITE(numicb,'("pe=",i3,x,a)') narea,'Dump triggered by excessive velocity' 
     530+         IF( ABS( pax    ) > pp_accel_lim .OR. ABS( pay    ) > pp_accel_lim )   & 
     531+            WRITE(numicb,'("pe=",i3,x,a)') narea,'Dump triggered by excessive acceleration' 
     532+      ENDIF 
     533       ! 
     534    END SUBROUTINE icb_accel 
     535  
     536Index: OCE/ICB/icbini.F90 
     537=================================================================== 
     538--- OCE/ICB/icbini.F90  (revision 10539) 
     539+++ OCE/ICB/icbini.F90  (working copy) 
     540@@ -77,7 +77,9 @@ 
     541       !                          ! open ascii output file or files for iceberg status information 
     542       !                          ! note that we choose to do this on all processors since we cannot 
     543       !                          ! predict where icebergs will be ahead of time 
     544-      CALL ctl_opn( numicb, 'icebergs.stat', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, narea ) 
     545+      IF( nn_verbose_level > 0) THEN 
     546+         CALL ctl_opn( numicb, 'icebergs.stat', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, narea ) 
     547+      ENDIF 
     548  
     549       ! set parameters (mostly from namelist) 
     550       ! 
     551@@ -240,8 +242,10 @@ 
     552          ENDIF 
     553          CALL iom_close( inum )                                     ! close file 
     554          ! 
     555-         WRITE(numicb,*) 
     556-         WRITE(numicb,*) '          calving read in a file' 
     557+         IF( nn_verbose_level > 0) THEN 
     558+            WRITE(numicb,*) 
     559+            WRITE(numicb,*) '          calving read in a file' 
     560+         ENDIF 
     561          ALLOCATE( sf_icb(1), STAT=istat1 )         ! Create sf_icb structure (calving) 
     562          ALLOCATE( sf_icb(1)%fnow(jpi,jpj,1), STAT=istat2 ) 
     563          ALLOCATE( sf_icb(1)%fdta(jpi,jpj,1,2), STAT=istat3 ) 
     564@@ -335,7 +339,9 @@ 
     565       ! 
     566       ibergs = icb_utl_count() 
     567       CALL mpp_sum('icbini', ibergs) 
     568-      WRITE(numicb,'(a,i6,a)') 'diamonds, icb_ini_gen: ',ibergs,' were generated' 
     569+      IF( nn_verbose_level > 0) THEN 
     570+         WRITE(numicb,'(a,i6,a)') 'diamonds, icb_ini_gen: ',ibergs,' were generated' 
     571+      ENDIF 
     572       ! 
     573    END SUBROUTINE icb_ini_gen 
     574  
     575Index: OCE/ICB/icblbc.F90 
     576=================================================================== 
     577--- OCE/ICB/icblbc.F90  (revision 10539) 
     578+++ OCE/ICB/icblbc.F90  (working copy) 
     579@@ -639,7 +639,7 @@ 
     580     
     581             zsbergs(0) = narea 
     582             zsbergs(1) = nicbfldnsend(jn) 
     583-            !IF ( nicbfldnsend(jn) .GT. 0) write(numicb,*) 'ICB sending ',nicbfldnsend(jn),' to ', ifldproc 
     584+            !IF ( nicbfldnsend(jn) .GT. 0 .AND. nn_verbose_level > 0 ) write(numicb,*) 'ICB sending ',nicbfldnsend(jn),' to ', ifldproc 
     585             CALL mppsend( 21, zsbergs(0:1), 2, ifldproc-1, nicbfldreq(jn)) 
     586          ENDIF 
     587          ! 
     588@@ -655,10 +655,10 @@ 
     589             DO jjn = 1,jpni 
     590              IF( nicbfldproc(jjn) .eq. INT(znbergs(1)) ) EXIT 
     591             END DO 
     592-            IF( jjn .GT. jpni ) write(numicb,*) 'ICB ERROR' 
     593+            IF( jjn .GT. jpni .AND. nn_verbose_level > 0 ) write(numicb,*) 'ICB ERROR' 
     594             nicbfldexpect(jjn) = INT( znbergs(2) ) 
     595-            !IF ( nicbfldexpect(jjn) .GT. 0) write(numicb,*) 'ICB expecting ',nicbfldexpect(jjn),' from ', nicbfldproc(jjn) 
     596-            !CALL FLUSH(numicb) 
     597+            !IF ( nicbfldexpect(jjn) .GT. 0 .AND. nn_verbose_level > 0 ) write(numicb,*) 'ICB expecting ',nicbfldexpect(jjn),' from ', nicbfldproc(jjn) 
     598+            !IF (nn_verbose_level > 0) CALL FLUSH(numicb) 
     599          ENDIF 
     600          ! 
     601       END DO 
     602@@ -910,7 +910,7 @@ 
     603             DEALLOCATE(old) 
     604          ENDIF 
     605          old => new 
     606-        !WRITE( numicb,*) 'icb_increase_ibuffer',narea,' increased to',inew_size 
     607+         !IF (nn_verbose_level > 0) WRITE( numicb,*) 'icb_increase_ibuffer',narea,' increased to',inew_size 
     608       ENDIF 
     609       ! 
     610    END SUBROUTINE icb_increase_ibuffer 
     611Index: OCE/ICB/icbstp.F90 
     612=================================================================== 
     613--- OCE/ICB/icbstp.F90  (revision 10539) 
     614+++ OCE/ICB/icbstp.F90  (working copy) 
     615@@ -162,8 +162,10 @@ 
     616  
     617       IF(lwp) WRITE(numout,'(a,i6)') 'icebergs: icb_end complete', narea 
     618       ! 
     619-      CALL flush( numicb ) 
     620-      CLOSE( numicb ) 
     621+      IF( nn_verbose_level > 0 ) THEN 
     622+         CALL flush( numicb ) 
     623+         CLOSE( numicb ) 
     624+      ENDIF 
     625       ! 
     626    END SUBROUTINE icb_end 
     627  
     628Index: OCE/ICB/icbutl.F90 
     629=================================================================== 
     630--- OCE/ICB/icbutl.F90  (revision 10539) 
     631+++ OCE/ICB/icbutl.F90  (working copy) 
     632@@ -624,6 +624,7 @@ 
     633       INTEGER                :: kt      ! timestep number 
     634       !!---------------------------------------------------------------------- 
     635       ! 
     636+      IF (nn_verbose_level == 0) RETURN 
     637       pt => berg%current_point 
     638       WRITE(numicb, 9200) kt, berg%number(1), & 
     639                    pt%xi, pt%yj, pt%lon, pt%lat, pt%uvel, pt%vvel,  & 
     640@@ -648,6 +649,7 @@ 
     641       TYPE(iceberg), POINTER :: this 
     642       !!---------------------------------------------------------------------- 
     643       ! 
     644+      IF (nn_verbose_level == 0) RETURN 
     645       this => first_berg 
     646       IF( ASSOCIATED(this) ) THEN 
     647          WRITE(numicb,'(a," pe=(",i3,")")' ) cd_label, narea 
     648}}} 
     649 
     650''' 7. sette/sette.sh ''' 
    432651 
    433652Finally, once implemented, these changes allow SETTE tests to be run without creating the full set of multiple output files. It is simply a case of replacing all ln_ctl settings like so: 
     
    447666+    set_namelist namelist_cfg sn_cfctl%l_runstat .true. 
    448667+    set_namelist namelist_cfg sn_cfctl%l_trcstat .true. 
     668+    set_namelist namelist_cfg nn_verbose_level 0 
    449669     set_namelist namelist_cfg ln_use_calving .true. 
    450670     set_namelist namelist_cfg ln_wave .true.