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 15513 for NEMO/branches/2021 – NEMO

Changeset 15513 for NEMO/branches/2021


Ignore:
Timestamp:
2021-11-15T18:31:29+01:00 (3 years ago)
Author:
techene
Message:

#2605 RK3 : correct dia_ptr initialisation and add a switch for diags/trends logicals

Location:
NEMO/branches/2021/dev_r14318_RK3_stage1/src/OCE
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2021/dev_r14318_RK3_stage1/src/OCE/DIA/diaptr.F90

    r14229 r15513  
    4242 
    4343   PUBLIC   dia_ptr        ! call in step module 
     44   PUBLIC   dia_ptr_init   ! call in stprk3 module 
    4445   PUBLIC   dia_ptr_hst    ! called from tra_ldf/tra_adv routines 
    4546 
     
    8283      IF( ln_timing )   CALL timing_start('dia_ptr') 
    8384 
     85#if ! defined key_RK3 
    8486      IF( kt == nit000 .AND. ll_init )   CALL dia_ptr_init    ! -> will define l_diaptr and nbasin 
     87#endif 
    8588      ! 
    8689      IF( l_diaptr ) THEN 
  • NEMO/branches/2021/dev_r14318_RK3_stage1/src/OCE/stprk3.F90

    r14949 r15513  
    2323   USE stp2d          ! external mode solver 
    2424   USE dynspg_ts, ONLY: un_adv, vn_adv   ! updated Kmm barotropic transport 
     25   USE trd_oce        ! trends: ocean variables 
     26   USE diaptr 
     27   USE ldftra 
    2528 
    2629   IMPLICIT NONE 
     
    9295                             CALL iom_init( cxios_context, ld_closedef=.FALSE. )   ! for model grid (including possible AGRIF zoom) 
    9396         IF( lk_diamlr   )   CALL dia_mlr_iom_init    ! with additional setup for multiple-linear-regression analysis 
     97                             CALL dia_ptr_init        ! called here since it uses iom_use 
    9498                             CALL iom_init_closedef 
    9599         IF( ln_crs      )   CALL iom_init( TRIM(cxios_context)//"_crs" )  ! for coarse grid 
     
    188192      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    189193 
     194      CALL rk3_dia( kstp, 0 )                          ! Diagnostics switched off for stage 1 & 2 
     195      ! 
    190196      ! Stage 1 : 
    191197      CALL stp_RK3_stg( 1, kstp, Nbb, Nbb, Nrhs, Naa ) 
     
    199205      ! 
    200206      ! Stage 3 : 
     207      CALL rk3_dia( kstp, 1 )                          ! Diagnostics switched on for stage 3 
     208      ! 
    201209      CALL stp_RK3_stg( 3, kstp, Nbb, Nnn, Nrhs, Naa ) 
    202210      ! 
     
    337345   END SUBROUTINE mlf_baro_corr 
    338346 
     347 
     348   SUBROUTINE rk3_dia( kstp, kswitch ) 
     349      !!---------------------------------------------------------------------- 
     350      !!---------------------------------------------------------------------- 
     351      INTEGER, INTENT(in) ::   kstp      ! ocean time-step index 
     352      INTEGER, INTENT(in) ::   kswitch   ! on/off = 1/0 
     353      !! 
     354      LOGICAL, SAVE ::   ll_trddyn, ll_trdtrc, ll_trdtra  ! call trd at stage 3 only 
     355      LOGICAL, SAVE ::   ll_diaptr, ll_ldfeiv_dia 
     356      !!---------------------------------------------------------------------- 
     357      ! 
     358      IF( kstp == nit000 ) THEN   ! save diagnotic logical 
     359         ll_trdtra = l_trdtra 
     360         ll_trdtrc = l_trdtrc 
     361         ll_trddyn = l_trddyn 
     362         ll_diaptr = l_diaptr 
     363         ll_ldfeiv_dia = l_ldfeiv_dia 
     364      ENDIF 
     365      ! 
     366      SELECT CASE( kswitch )  
     367      CASE ( 1 )                ! diagnostic activated (on) 
     368         l_trdtra = ll_trdtra 
     369         l_trdtrc = ll_trdtrc 
     370         l_trddyn = ll_trddyn 
     371         l_diaptr = ll_diaptr 
     372         l_ldfeiv_dia = ll_ldfeiv_dia 
     373      CASE ( 0 )                ! diagnostic desactivated (off) 
     374         l_trdtra  = .FALSE. 
     375         l_trdtrc  = .FALSE. 
     376         l_trddyn  = .FALSE. 
     377         l_diaptr  = .FALSE. 
     378         l_ldfeiv_dia  = .FALSE. 
     379      END SELECT 
     380      ! 
     381   END SUBROUTINE rk3_dia 
     382 
    339383#else 
    340384   !!---------------------------------------------------------------------- 
Note: See TracChangeset for help on using the changeset viewer.