Ignore:
Timestamp:
Jan 26, 2019 6:57:21 PM (3 years ago)
Author:
knoop
Message:

Added module switch for user_module.
User module is enabled as soon as the user_parameters namelist is found.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/SOURCE/user_module.f90

    r3700 r3701  
    9494    INTEGER(iwp) ::  user_idummy     !<
    9595   
    96     LOGICAL ::  user_defined_namelist_found = .FALSE.   !<
     96    LOGICAL ::  user_module_enabled = .FALSE.   !<
    9797   
    9898    REAL(wp) ::  user_rdummy   !<
     
    108108    SAVE
    109109
    110 !    PRIVATE
     110    PRIVATE
    111111
    112112!
     
    118118       user_check_data_output_pr, &
    119119       user_check_data_output, &
     120       user_define_netcdf_grid, &
    120121       user_init, &
    121122       user_header, &
     
    128129       user_rrd_local, &
    129130       user_wrd_global, &
    130        user_wrd_local
     131       user_wrd_local, &
     132       user_last_actions
    131133
    132134!
    133135!- Public parameters, constants and initial values
    134 !   PUBLIC &
    135 !      user_module_enabled
     136   PUBLIC &
     137      user_module_enabled
    136138
    137139    INTERFACE user_parin
     
    154156       MODULE PROCEDURE user_check_data_output
    155157    END INTERFACE user_check_data_output
     158
     159    INTERFACE user_define_netcdf_grid
     160       MODULE PROCEDURE user_define_netcdf_grid
     161    END INTERFACE user_define_netcdf_grid
     162   
    156163
    157164    INTERFACE user_init
     
    200207    END INTERFACE user_wrd_local
    201208
     209    INTERFACE user_last_actions
     210       MODULE PROCEDURE user_last_actions
     211    END INTERFACE user_last_actions
     212
    202213
    203214 CONTAINS
     
    218229
    219230
    220     NAMELIST /userpar/  data_output_pr_user, data_output_user, region,         &
    221                         data_output_masks_user
    222                         
    223                         
    224     NAMELIST /user_parameters/  data_output_pr_user, data_output_user, region, &
    225                         data_output_masks_user
     231    NAMELIST /user_parameters/  &
     232       user_module_enabled, &
     233       data_output_pr_user, &
     234       data_output_user, &
     235      region, &
     236       data_output_masks_user
    226237
    227238!
     
    244255    BACKSPACE ( 11 )
    245256
    246 !
     257!-- Set default module switch to true
     258    user_module_enabled = .TRUE.
     259
    247260!-- Read user-defined namelist
    248261    READ ( 11, user_parameters, ERR = 10 )
    249262
    250     user_defined_namelist_found = .TRUE.
    251 
    252     GOTO 14
     263    GOTO 12
    253264
    25426510  BACKSPACE( 11 )
     
    256267    CALL parin_fail_message( 'user_parameters', line )
    257268
    258 12  REWIND ( 11 )
    259 
    260     line = ' '
    261     DO WHILE ( INDEX( line, '&userpar' ) == 0 )
    262        READ ( 11, '(A)', END=14 )  line
    263     ENDDO
    264     BACKSPACE ( 11 )
    265 
    266 !
    267 !-- Read user-defined namelist
    268     READ ( 11, userpar, ERR = 13, END = 14 )
    269 
    270     message_string = 'namelist userpar is deprecated and will be ' //          &
    271                      'removed in near future. &Please use namelist ' //        &
    272                      'user_parameters instead'
    273     CALL message( 'user_parin', 'PA0487', 0, 1, 0, 6, 0 )
    274 
    275     user_defined_namelist_found = .TRUE.
    276 
    277     GOTO 14
    278 
    279 13  BACKSPACE( 11 )
    280     READ( 11 , '(A)') line
    281     CALL parin_fail_message( 'userpar', line )
    282 
    283 14  CONTINUE
     26912  CONTINUE
    284270
    285271!
    286272!-- Determine the number of user-defined profiles and append them to the
    287273!-- standard data output (data_output_pr)
    288     IF ( user_defined_namelist_found )  THEN
     274    IF ( user_module_enabled )  THEN
    289275       IF ( data_output_pr_user(1) /= ' ' )  THEN
    290276          i = 1
     
    301287       ENDIF
    302288    ENDIF
    303  
    304     RETURN
     289
    305290
    306291 END SUBROUTINE user_parin
     
    526511!-- If no user-defined variables are read from the namelist-file, no
    527512!-- information will be printed.
    528     IF ( .NOT. user_defined_namelist_found )  THEN
     513    IF ( .NOT. user_module_enabled )  THEN
    529514       WRITE ( io, 100 )
    530515       RETURN
Note: See TracChangeset for help on using the changeset viewer.