Changeset 11909


Ignore:
Timestamp:
2019-11-14T21:31:36+01:00 (2 months ago)
Author:
smueller
Message:

Detachment of the context-definition closure from subroutine iom_init of module iom to enable additional context definition outside subroutine iom_init (ticket #2175).

The closure of the context definition is now available in the new public subroutine iom_init_closedef of module iom. By default, this subroutine is called by subroutine iom_init, so that the default behaviour of iom_init remains unchanged. Optionally, subroutine iom_init can now be made to keep the context definition open by setting the optional argument ld_closedef to .FALSE.; this enables continued definition of the context until subroutine iom_init_closedef is explicitly called.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2019/dev_r11879_ENHANCE-05_SimonM-Harmonic_Analysis/src/OCE/IOM/iom.F90

    r11554 r11909  
    5656   LOGICAL, PUBLIC, PARAMETER ::   lk_iomput = .FALSE.       !: iom_put flag 
    5757#endif 
    58    PUBLIC iom_init, iom_swap, iom_open, iom_close, iom_setkt, iom_varid, iom_get 
     58   PUBLIC iom_init, iom_init_closedef, iom_swap, iom_open, iom_close, iom_setkt, iom_varid, iom_get 
    5959   PUBLIC iom_chkatt, iom_getatt, iom_putatt, iom_getszuld, iom_rstput, iom_delay_rst, iom_put 
    60    PUBLIC iom_use, iom_context_finalize, iom_miss_val 
     60   PUBLIC iom_use, iom_context_finalize, iom_update_file_name, iom_miss_val 
    6161 
    6262   PRIVATE iom_rp0d, iom_rp1d, iom_rp2d, iom_rp3d 
     
    6565#if defined key_iomput 
    6666   PRIVATE iom_set_domain_attr, iom_set_axis_attr, iom_set_field_attr, iom_set_file_attr, iom_get_file_attr, iom_set_grid_attr 
    67    PRIVATE set_grid, set_grid_bounds, set_scalar, set_xmlatt, set_mooring, iom_update_file_name, iom_sdate 
     67   PRIVATE set_grid, set_grid_bounds, set_scalar, set_xmlatt, set_mooring, iom_sdate 
    6868   PRIVATE iom_set_rst_context, iom_set_rstw_active, iom_set_rstr_active 
    6969# endif 
     
    9393CONTAINS 
    9494 
    95    SUBROUTINE iom_init( cdname, fname, ld_tmppatch )  
     95   SUBROUTINE iom_init( cdname, fname, ld_tmppatch, ld_closedef )  
    9696      !!---------------------------------------------------------------------- 
    9797      !!                     ***  ROUTINE   *** 
     
    103103      CHARACTER(len=*), OPTIONAL, INTENT(in)  :: fname 
    104104      LOGICAL         , OPTIONAL, INTENT(in)  :: ld_tmppatch 
     105      LOGICAL         , OPTIONAL, INTENT(in)  :: ld_closedef 
    105106#if defined key_iomput 
    106107      ! 
     
    115116      INTEGER ::   nldi_save, nlei_save    !:      and close boundaries in output files 
    116117      INTEGER ::   nldj_save, nlej_save    !: 
     118      LOGICAL ::   ll_closedef = .TRUE. 
    117119      !!---------------------------------------------------------------------- 
    118120      ! 
     
    129131         IF( njmpp + jpj - 1 == jpjglo ) nlej = jpj 
    130132      ENDIF 
     133      IF ( PRESENT(ld_closedef) ) ll_closedef = ld_closedef 
    131134      ! 
    132135      ALLOCATE( zt_bnds(2,jpk), zw_bnds(2,jpk) ) 
     
    243246      ENDIF 
    244247      ! 
    245       ! end file definition 
     248      ! set time step length 
    246249      dtime%second = rdt 
    247250      CALL xios_set_timestep( dtime ) 
    248       CALL xios_close_context_definition() 
    249       CALL xios_update_calendar( 0 ) 
     251      ! 
     252      ! conditional closure of context definition 
     253      IF ( ll_closedef ) CALL iom_init_closedef 
    250254      ! 
    251255      DEALLOCATE( zt_bnds, zw_bnds ) 
     
    258262      ! 
    259263   END SUBROUTINE iom_init 
     264 
     265   SUBROUTINE iom_init_closedef 
     266      !!---------------------------------------------------------------------- 
     267      !!            ***  SUBROUTINE iom_init_closedef  *** 
     268      !!---------------------------------------------------------------------- 
     269      !! 
     270      !! ** Purpose : Closure of context definition 
     271      !! 
     272      !!---------------------------------------------------------------------- 
     273 
     274      CALL xios_close_context_definition() 
     275      CALL xios_update_calendar( 0 ) 
     276 
     277   END SUBROUTINE iom_init_closedef 
    260278 
    261279   SUBROUTINE iom_set_rstw_var_active(field) 
Note: See TracChangeset for help on using the changeset viewer.