Changeset 4579 for palm/trunk/SOURCE


Ignore:
Timestamp:
Jun 25, 2020 8:05:07 PM (4 years ago)
Author:
gronemeier
Message:

corrected formatting to follow PALM coding standard (data_output_module, data_output_binary_module, data_output_netcdf4_module)

Location:
palm/trunk/SOURCE
Files:
3 edited

Legend:

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

    r4577 r4579  
    1919! Current revisions:
    2020! ------------------
    21 ! 
    22 ! 
     21!
     22!
    2323! Former revisions:
    2424! -----------------
    2525! $Id$
     26! corrected formatting to follow PALM coding standard
     27!
     28! 4577 2020-06-25 09:53:58Z raasch
    2629! further re-formatting to follow the PALM coding standard
    2730!
     
    192195
    193196    CHARACTER(LEN=charlen)             ::  bin_filename = ''  !< actual name of binary file
    194     CHARACTER(LEN=7)                   ::  my_rank_char       !< string containing value of my_rank with leading zeros
    195 
    196197    CHARACTER(LEN=charlen), INTENT(IN) ::  file_name          !< name of file
    197198    CHARACTER(LEN=*),       INTENT(IN) ::  mode               !< operation mode
    198 
     199    CHARACTER(LEN=7)                   ::  my_rank_char       !< string containing value of my_rank with leading zeros
     200
     201    INTEGER, INTENT(OUT) ::  file_id       !< file ID
    199202    INTEGER              ::  my_rank       !< MPI rank of local processor
    200203    INTEGER              ::  nranks        !< number of MPI ranks participating in output
    201 
    202     INTEGER, INTENT(OUT) ::  file_id       !< file ID
    203204    INTEGER, INTENT(OUT) ::  return_value  !< return value
    204205
     
    250251          ENDIF
    251252
    252           OPEN( config_file_unit, FILE=TRIM( config_file_name ) // TRIM( file_suffix ),          &
     253          OPEN( config_file_unit, FILE=TRIM( config_file_name ) // TRIM( file_suffix ),            &
    253254                FORM='UNFORMATTED', STATUS='NEW', IOSTAT=return_value )
    254255
     
    352353    CHARACTER(LEN=*), PARAMETER ::  routine_name = 'binary_write_attribute'  !< name of this routine
    353354
    354     CHARACTER(LEN=charlen)                       ::  attribute_type        !< data type of attribute
    355     CHARACTER(LEN=charlen)                       ::  output_string         !< output string
    356 
    357     CHARACTER(LEN=charlen), INTENT(IN)           ::  attribute_name        !< name of attribute
    358     CHARACTER(LEN=charlen), INTENT(IN), OPTIONAL ::  value_char            !< value of attribute
    359 
     355    CHARACTER(LEN=charlen), INTENT(IN)           ::  attribute_name  !< name of attribute
     356    CHARACTER(LEN=charlen)                       ::  attribute_type  !< data type of attribute
     357    CHARACTER(LEN=charlen)                       ::  output_string   !< output string
     358    CHARACTER(LEN=charlen), INTENT(IN), OPTIONAL ::  value_char      !< value of attribute
    360359
    361360    INTEGER, INTENT(IN)  ::  file_id       !< file ID
     361    INTEGER, INTENT(OUT) ::  return_value  !< return value
    362362    INTEGER, INTENT(IN)  ::  variable_id   !< variable ID
    363 
    364     INTEGER, INTENT(OUT) ::  return_value  !< return value
    365363
    366364    INTEGER(KIND=1), INTENT(IN), OPTIONAL ::  value_int8   !< value of attribute
     
    427425    CHARACTER(LEN=*), PARAMETER ::  routine_name = 'binary_init_dimension'  !< name of this routine
    428426
    429     CHARACTER(LEN=charlen)             ::  output_string   !< output string
    430 
    431427    CHARACTER(LEN=charlen), INTENT(IN) ::  dimension_name  !< name of dimension
    432428    CHARACTER(LEN=charlen), INTENT(IN) ::  dimension_type  !< data type of dimension
    433429    CHARACTER(LEN=*),       INTENT(IN) ::  mode            !< operation mode
    434 
     430    CHARACTER(LEN=charlen)             ::  output_string   !< output string
     431
     432    INTEGER, INTENT(OUT) ::  dimension_id      !< dimension ID
    435433    INTEGER, INTENT(IN)  ::  dimension_length  !< length of dimension
    436434    INTEGER, INTENT(IN)  ::  file_id           !< file ID
    437 
    438     INTEGER, INTENT(OUT) ::  dimension_id      !< dimension ID
    439435    INTEGER, INTENT(OUT) ::  return_value      !< return value
    440436    INTEGER, INTENT(OUT) ::  variable_id       !< variable ID
     
    461457!
    462458!-- Define variable associated with dimension
    463     CALL binary_init_variable( mode, file_id, variable_id, dimension_name, dimension_type,        &
    464                                 (/ dimension_id /), is_global=.TRUE., return_value=return_value )
     459    CALL binary_init_variable( mode, file_id, variable_id, dimension_name, dimension_type,         &
     460                               (/ dimension_id /), is_global=.TRUE., return_value=return_value )
    465461    IF ( return_value /= 0 )  THEN
    466462       CALL internal_message( 'error', routine_name //                                             &
     
    477473 SUBROUTINE binary_init_variable( mode, file_id, variable_id, variable_name, variable_type,        &
    478474                                  dimension_ids, is_global, return_value )
     475
    479476    CHARACTER(LEN=*), PARAMETER ::  routine_name = 'binary_init_variable'  !< name of this routine
    480477
     
    815812
    816813       WRITE( temp_string, * ) file_id
    817        CALL internal_message( 'debug', routine_name // &
     814       CALL internal_message( 'debug', routine_name //                                             &
    818815                              ': close file (file_id=' // TRIM( temp_string ) // ')' )
    819816
     
    821818       IF ( return_value /= 0 )  THEN
    822819          WRITE( temp_string, * ) file_id
    823           CALL internal_message( 'error', routine_name // &
     820          CALL internal_message( 'error', routine_name //                                          &
    824821                                 ': cannot close file (file_id=' // TRIM( temp_string ) // ')' )
    825822       ENDIF
  • palm/trunk/SOURCE/data_output_module.f90

    r4577 r4579  
    1919! Current revisions:
    2020! ------------------
    21 ! 
    22 ! 
     21!
     22!
    2323! Former revisions:
    2424! -----------------
    2525! $Id$
     26! corrected formatting to follow PALM coding standard
     27!
     28! 4577 2020-06-25 09:53:58Z raasch
    2629! file re-formatted to follow the PALM coding standard
    2730!
     
    115118       CHARACTER(LEN=charlen)                            ::  data_type = ''       !< data type
    116119       CHARACTER(LEN=charlen)                            ::  name                 !< variable name
    117        CHARACTER(LEN=charlen), DIMENSION(:), ALLOCATABLE ::  dimension_names      !< list of
    118                                                                                   !< dimension names used by variable
    119120       INTEGER                                           ::  id = no_id           !< id within file
    120        LOGICAL                                           ::  is_global = .FALSE.  !< true if global
    121                                                                                   !< variable
    122        INTEGER,                DIMENSION(:), ALLOCATABLE ::  dimension_ids        !< list of
    123                                                                                   !< dimension ids used by variable
    124        TYPE(attribute_type),   DIMENSION(:), ALLOCATABLE ::  attributes           !< list of
    125                                                                                   !< attributes
     121       LOGICAL                                           ::  is_global = .FALSE.  !< true if global variable
     122       CHARACTER(LEN=charlen), DIMENSION(:), ALLOCATABLE ::  dimension_names      !< list of dimension names used by variable
     123       INTEGER,                DIMENSION(:), ALLOCATABLE ::  dimension_ids        !< list of dimension ids used by variable
     124       TYPE(attribute_type),   DIMENSION(:), ALLOCATABLE ::  attributes           !< list of attributes
    126125    END TYPE variable_type
    127126
     
    129128       CHARACTER(LEN=charlen)                     ::  data_type = ''        !< data type
    130129       CHARACTER(LEN=charlen)                     ::  name                  !< dimension name
    131        INTEGER                                    ::  id = no_id            !< dimension id within
    132                                                                             !< file
     130       INTEGER                                    ::  id = no_id            !< dimension id within file
    133131       INTEGER                                    ::  length                !< length of dimension
    134        INTEGER                                    ::  length_mask           !< length of masked
    135                                                                             !< dimension
    136        INTEGER                                    ::  variable_id = no_id   !< associated variable
    137                                                                             !< id within file
     132       INTEGER                                    ::  length_mask           !< length of masked dimension
     133       INTEGER                                    ::  variable_id = no_id   !< associated variable id within file
    138134       LOGICAL                                    ::  is_masked = .FALSE.   !< true if masked
    139        INTEGER,         DIMENSION(2)              ::  bounds                !< lower and upper bound
    140                                                                             !< of dimension
    141        INTEGER,         DIMENSION(:), ALLOCATABLE ::  masked_indices        !< list of masked
    142                                                                             !< indices of dimension
    143        INTEGER(KIND=1), DIMENSION(:), ALLOCATABLE ::  masked_values_int8    !< masked dimension
    144                                                                             !< values if 16bit integer
    145        INTEGER(KIND=2), DIMENSION(:), ALLOCATABLE ::  masked_values_int16   !< masked dimension
    146                                                                             !< values if 16bit integer
    147        INTEGER(KIND=4), DIMENSION(:), ALLOCATABLE ::  masked_values_int32   !< masked dimension
    148                                                                             !< values if 32bit integer
    149        INTEGER(iwp),    DIMENSION(:), ALLOCATABLE ::  masked_values_intwp   !< masked dimension
    150                                                                             !< values if working-precision int
    151        INTEGER(KIND=1), DIMENSION(:), ALLOCATABLE ::  values_int8           !< dimension values if
    152                                                                             !< 16bit integer
    153        INTEGER(KIND=2), DIMENSION(:), ALLOCATABLE ::  values_int16          !< dimension values if
    154                                                                             !< 16bit integer
    155        INTEGER(KIND=4), DIMENSION(:), ALLOCATABLE ::  values_int32          !< dimension values if
    156                                                                             !< 32bit integer
    157        INTEGER(iwp),    DIMENSION(:), ALLOCATABLE ::  values_intwp          !< dimension values if
    158                                                                             !< working-precision integer
     135       INTEGER,         DIMENSION(2)              ::  bounds                !< lower and upper bound of dimension
     136       INTEGER,         DIMENSION(:), ALLOCATABLE ::  masked_indices        !< list of masked indices of dimension
     137       INTEGER(KIND=1), DIMENSION(:), ALLOCATABLE ::  masked_values_int8    !< masked dimension values if 16bit integer
     138       INTEGER(KIND=2), DIMENSION(:), ALLOCATABLE ::  masked_values_int16   !< masked dimension values if 16bit integer
     139       INTEGER(KIND=4), DIMENSION(:), ALLOCATABLE ::  masked_values_int32   !< masked dimension values if 32bit integer
     140       INTEGER(iwp),    DIMENSION(:), ALLOCATABLE ::  masked_values_intwp   !< masked dimension values if working-precision int
     141       INTEGER(KIND=1), DIMENSION(:), ALLOCATABLE ::  values_int8           !< dimension values if 16bit integer
     142       INTEGER(KIND=2), DIMENSION(:), ALLOCATABLE ::  values_int16          !< dimension values if 16bit integer
     143       INTEGER(KIND=4), DIMENSION(:), ALLOCATABLE ::  values_int32          !< dimension values if 32bit integer
     144       INTEGER(iwp),    DIMENSION(:), ALLOCATABLE ::  values_intwp          !< dimension values if working-precision integer
    159145       LOGICAL,         DIMENSION(:), ALLOCATABLE ::  mask                  !< mask
    160        REAL(KIND=4),    DIMENSION(:), ALLOCATABLE ::  masked_values_real32  !< masked dimension
    161                                                                             !< values if 32bit real
    162        REAL(KIND=8),    DIMENSION(:), ALLOCATABLE ::  masked_values_real64  !< masked dimension
    163                                                                             !< values if 64bit real
    164        REAL(wp),        DIMENSION(:), ALLOCATABLE ::  masked_values_realwp  !< masked dimension
    165                                                                             !< values if working-precision real
    166        REAL(KIND=4),    DIMENSION(:), ALLOCATABLE ::  values_real32         !< dimension values if
    167                                                                             !< 32bit real
    168        REAL(KIND=8),    DIMENSION(:), ALLOCATABLE ::  values_real64         !< dimension values if
    169                                                                             !< 64bit real
    170        REAL(wp),        DIMENSION(:), ALLOCATABLE ::  values_realwp         !< dimension values if
    171                                                                             !< working-precision real
     146       REAL(KIND=4),    DIMENSION(:), ALLOCATABLE ::  masked_values_real32  !< masked dimension values if 32bit real
     147       REAL(KIND=8),    DIMENSION(:), ALLOCATABLE ::  masked_values_real64  !< masked dimension values if 64bit real
     148       REAL(wp),        DIMENSION(:), ALLOCATABLE ::  masked_values_realwp  !< masked dimension values if working-precision real
     149       REAL(KIND=4),    DIMENSION(:), ALLOCATABLE ::  values_real32         !< dimension values if 32bit real
     150       REAL(KIND=8),    DIMENSION(:), ALLOCATABLE ::  values_real64         !< dimension values if 64bit real
     151       REAL(wp),        DIMENSION(:), ALLOCATABLE ::  values_realwp         !< dimension values if working-precision real
    172152       TYPE(attribute_type), DIMENSION(:), ALLOCATABLE ::  attributes       !< list of attributes
    173153    END TYPE dimension_type
     
    256236    END INTERFACE dom_database_debug_output
    257237
    258     PUBLIC &
    259        dom_init, &
    260        dom_def_file, &
    261        dom_def_dim, &
    262        dom_def_var, &
    263        dom_def_att, &
    264        dom_def_end, &
    265        dom_write_var, &
    266        dom_finalize_output, &
    267        dom_get_error_message, &
    268        dom_database_debug_output
     238    PUBLIC                                                                                         &
     239       dom_database_debug_output,                                                                  &
     240       dom_def_att,                                                                                &
     241       dom_def_dim,                                                                                &
     242       dom_def_end,                                                                                &
     243       dom_def_file,                                                                              &
     244       dom_def_var,                                                                                &
     245       dom_finalize_output,                                                                        &
     246       dom_get_error_message,                                                                      &
     247       dom_init,                                                                                  &
     248       dom_write_var
    269249
    270250 CONTAINS
     
    281261!> prevents that multiple groups try to open and write to the same output file.
    282262!--------------------------------------------------------------------------------------------------!
    283  SUBROUTINE dom_init( file_suffix_of_output_group, mpi_comm_of_output_group, master_output_rank, &
     263 SUBROUTINE dom_init( file_suffix_of_output_group, mpi_comm_of_output_group, master_output_rank,   &
    284264                      program_debug_output_unit, debug_output )
    285265
     
    304284    print_debug_output = debug_output
    305285
    306     CALL binary_init_module( output_file_suffix, output_group_comm, master_rank, &
     286    CALL binary_init_module( output_file_suffix, output_group_comm, master_rank,                   &
    307287                             debug_output_unit, debug_output, no_id )
    308288
    309     CALL netcdf4_init_module( output_file_suffix, output_group_comm, master_rank, &
     289    CALL netcdf4_init_module( output_file_suffix, output_group_comm, master_rank,                  &
    310290                             debug_output_unit, debug_output, no_id )
    311291
     
    350330          IF ( files(f)%name == TRIM( file_name ) )  THEN
    351331             return_value = 1
    352              CALL internal_message( 'error', routine_name // &
    353                      ': file "' // TRIM( file_name ) // '" already exists' )
     332             CALL internal_message( 'error', routine_name //                                       &
     333                                    ': file "' // TRIM( file_name ) // '" already exists' )
    354334             EXIT
    355335          ENDIF
     
    405385!> @todo Convert given values into selected output_type.
    406386!--------------------------------------------------------------------------------------------------!
    407  FUNCTION dom_def_dim( file_name, dimension_name, output_type, bounds,        &
    408                        values_int8, values_int16, values_int32, values_intwp, &
    409                        values_real32, values_real64, values_realwp,           &
    410                        mask ) RESULT( return_value )
     387 FUNCTION dom_def_dim( file_name, dimension_name, output_type, bounds,                             &
     388                       values_int8, values_int16, values_int32, values_intwp,                      &
     389                       values_real32, values_real64, values_realwp,                                &
     390                       mask )                                                                      &
     391             RESULT( return_value )
    411392
    412393    CHARACTER(LEN=*), PARAMETER ::  routine_name = 'dom_def_dim'  !< name of this routine
     
    982963!>                   value=' and this part was appended', append=.TRUE. )
    983964!--------------------------------------------------------------------------------------------------!
    984  FUNCTION dom_def_att_char( file_name, variable_name, attribute_name, value, append ) &
     965 FUNCTION dom_def_att_char( file_name, variable_name, attribute_name, value, append )              &
    985966             RESULT( return_value )
     967
     968    ! CHARACTER(LEN=*), PARAMETER ::  routine_name = 'dom_def_att_char'  !< name of routine
    986969
    987970    CHARACTER(LEN=*),      INTENT(IN)           ::  attribute_name          !< name of attribute
     
    990973    CHARACTER(LEN=*),      INTENT(IN), OPTIONAL ::  variable_name           !< name of variable
    991974    CHARACTER(LEN=charlen)                      ::  variable_name_internal  !< internal copy of variable_name
    992 
    993     ! CHARACTER(LEN=*), PARAMETER ::  routine_name = 'dom_def_att_char'  !< name of routine
    994975
    995976    INTEGER ::  return_value  !< return value
     
    15631544!--------------------------------------------------------------------------------------------------!
    15641545 FUNCTION dom_write_var( file_name, variable_name, bounds_start, bounds_end,                       &
    1565              values_char_0d,   values_char_1d,   values_char_2d,   values_char_3d,                 &
    1566              values_int8_0d,   values_int8_1d,   values_int8_2d,   values_int8_3d,                 &
    1567              values_int16_0d,  values_int16_1d,  values_int16_2d,  values_int16_3d,                &
    1568              values_int32_0d,  values_int32_1d,  values_int32_2d,  values_int32_3d,                &
    1569              values_intwp_0d,  values_intwp_1d,  values_intwp_2d,  values_intwp_3d,                &
    1570              values_real32_0d, values_real32_1d, values_real32_2d, values_real32_3d,               &
    1571              values_real64_0d, values_real64_1d, values_real64_2d, values_real64_3d,               &
    1572              values_realwp_0d, values_realwp_1d, values_realwp_2d, values_realwp_3d                &
    1573              ) RESULT( return_value )
     1546                         values_char_0d,   values_char_1d,   values_char_2d,   values_char_3d,     &
     1547                         values_int8_0d,   values_int8_1d,   values_int8_2d,   values_int8_3d,     &
     1548                         values_int16_0d,  values_int16_1d,  values_int16_2d,  values_int16_3d,    &
     1549                         values_int32_0d,  values_int32_1d,  values_int32_2d,  values_int32_3d,    &
     1550                         values_intwp_0d,  values_intwp_1d,  values_intwp_2d,  values_intwp_3d,    &
     1551                         values_real32_0d, values_real32_1d, values_real32_2d, values_real32_3d,   &
     1552                         values_real64_0d, values_real64_1d, values_real64_2d, values_real64_3d,   &
     1553                         values_realwp_0d, values_realwp_1d, values_realwp_2d, values_realwp_3d )  &
     1554             RESULT( return_value )
    15741555
    15751556    CHARACTER(LEN=*), PARAMETER ::  routine_name = 'dom_write_var'  !< name of routine
     
    17781759       ELSEIF ( PRESENT( values_char_2d ) )  THEN
    17791760          IF ( do_output ) THEN
    1780              ALLOCATE( values_char_2d_resorted(0:value_counts(1)-1,0:value_counts(2)-1) )
     1761             ALLOCATE( values_char_2d_resorted(0:value_counts(1)-1,                                &
     1762                                               0:value_counts(2)-1) )
    17811763             !$OMP PARALLEL PRIVATE (i,j)
    17821764             !$OMP DO
     
    18351817       ELSEIF ( PRESENT( values_int8_2d ) )  THEN
    18361818          IF ( do_output ) THEN
    1837              ALLOCATE( values_int8_2d_resorted(0:value_counts(1)-1,0:value_counts(2)-1) )
     1819             ALLOCATE( values_int8_2d_resorted(0:value_counts(1)-1,                                &
     1820                                               0:value_counts(2)-1) )
    18381821             !$OMP PARALLEL PRIVATE (i,j)
    18391822             !$OMP DO
     
    18921875       ELSEIF ( PRESENT( values_int16_2d ) )  THEN
    18931876          IF ( do_output ) THEN
    1894              ALLOCATE( values_int16_2d_resorted(0:value_counts(1)-1,0:value_counts(2)-1) )
     1877             ALLOCATE( values_int16_2d_resorted(0:value_counts(1)-1,                               &
     1878                                                0:value_counts(2)-1) )
    18951879             !$OMP PARALLEL PRIVATE (i,j)
    18961880             !$OMP DO
     
    19491933       ELSEIF ( PRESENT( values_int32_2d ) )  THEN
    19501934          IF ( do_output ) THEN
    1951              ALLOCATE( values_int32_2d_resorted(0:value_counts(1)-1,0:value_counts(2)-1) )
     1935             ALLOCATE( values_int32_2d_resorted(0:value_counts(1)-1,                               &
     1936                                                0:value_counts(2)-1) )
    19521937             !$OMP PARALLEL PRIVATE (i,j)
    19531938             !$OMP DO
     
    20061991       ELSEIF ( PRESENT( values_intwp_2d ) )  THEN
    20071992          IF ( do_output ) THEN
    2008              ALLOCATE( values_intwp_2d_resorted(0:value_counts(1)-1,0:value_counts(2)-1) )
     1993             ALLOCATE( values_intwp_2d_resorted(0:value_counts(1)-1,                               &
     1994                                                0:value_counts(2)-1) )
    20091995             !$OMP PARALLEL PRIVATE (i,j)
    20101996             !$OMP DO
     
    20632049       ELSEIF ( PRESENT( values_real32_2d ) )  THEN
    20642050          IF ( do_output ) THEN
    2065              ALLOCATE( values_real32_2d_resorted(0:value_counts(1)-1,0:value_counts(2)-1) )
     2051             ALLOCATE( values_real32_2d_resorted(0:value_counts(1)-1,                              &
     2052                                                 0:value_counts(2)-1) )
    20662053             !$OMP PARALLEL PRIVATE (i,j)
    20672054             !$OMP DO
     
    21202107       ELSEIF ( PRESENT( values_real64_2d ) )  THEN
    21212108          IF ( do_output ) THEN
    2122              ALLOCATE( values_real64_2d_resorted(0:value_counts(1)-1,0:value_counts(2)-1) )
     2109             ALLOCATE( values_real64_2d_resorted(0:value_counts(1)-1,                              &
     2110                                                 0:value_counts(2)-1) )
    21232111             !$OMP PARALLEL PRIVATE (i,j)
    21242112             !$OMP DO
     
    21772165       ELSEIF ( PRESENT( values_realwp_2d ) )  THEN
    21782166          IF ( do_output ) THEN
    2179              ALLOCATE( values_realwp_2d_resorted(0:value_counts(1)-1,0:value_counts(2)-1) )
     2167             ALLOCATE( values_realwp_2d_resorted(0:value_counts(1)-1,                              &
     2168                                                 0:value_counts(2)-1) )
    21802169             !$OMP PARALLEL PRIVATE (i,j)
    21812170             !$OMP DO
     
    26492638!> @todo Try to combine similar code parts and shorten routine.
    26502639!--------------------------------------------------------------------------------------------------!
    2651  FUNCTION save_attribute_in_database( file_name, variable_name, attribute, append ) &
     2640 FUNCTION save_attribute_in_database( file_name, variable_name, attribute, append )                &
    26522641             RESULT( return_value )
    26532642
     
    27072696!--                      Append existing string attribute
    27082697                         files(f)%attributes(a)%value_char =                                       &
    2709                                                       TRIM( files(f)%attributes(a)%value_char ) // &
    2710                                                       TRIM( attribute%value_char )
     2698                            TRIM( files(f)%attributes(a)%value_char ) //                          &
     2699                            TRIM( attribute%value_char )
    27112700                      ELSE
    27122701                         files(f)%attributes(a) = attribute
     
    27562745!--                      Check if attribute already exists
    27572746                         DO  a = 1, natts
    2758                             IF ( files(f)%dimensions(d)%attributes(a)%name == attribute%name ) &
     2747                            IF ( files(f)%dimensions(d)%attributes(a)%name == attribute%name )     &
    27592748                            THEN
    27602749                               IF ( append )  THEN
     
    30813070!--          Initialize masked dimension
    30823071             CALL init_file_dimension( file%format, file%id, file%name,                            &
    3083                                        file%dimensions(d)%id, file%dimensions(d)%name,             &
    3084                                        file%dimensions(d)%data_type, file%dimensions(d)%length_mask,&
    3085                                        file%dimensions(d)%variable_id, return_value )
     3072                                     file%dimensions(d)%id, file%dimensions(d)%name,               &
     3073                                     file%dimensions(d)%data_type, file%dimensions(d)%length_mask, &
     3074                                     file%dimensions(d)%variable_id, return_value )
    30863075
    30873076          ENDIF
     
    31053094!--    Save dimension IDs for variables wihtin database
    31063095       IF ( return_value == 0 )                                                                    &
    3107           CALL collect_dimesion_ids_for_variables( file%name, file%variables, file%dimensions, &
     3096          CALL collect_dimesion_ids_for_variables( file%name, file%variables, file%dimensions,     &
    31083097                                                   return_value )
    31093098!
     
    32303219    output_return_value = 0
    32313220
    3232     temp_string = '(file "' // TRIM( file_name ) // &
     3221    temp_string = '(file "' // TRIM( file_name ) //                                                &
    32333222                  '", variable "' // TRIM( variable_name ) // '")'
    32343223
     
    32573246    IF ( output_return_value /= 0 )  THEN
    32583247       return_value = output_return_value
    3259        CALL internal_message( 'error', routine_name // &
     3248       CALL internal_message( 'error', routine_name //                                             &
    32603249                              ': error while defining variable ' // TRIM( temp_string ) )
    32613250    ENDIF
     
    32683257!> Write attribute to file.
    32693258!--------------------------------------------------------------------------------------------------!
    3270  FUNCTION write_attribute( file_format, file_id, file_name, variable_id, variable_name, attribute )&
    3271     RESULT( return_value )
     3259 FUNCTION write_attribute( file_format, file_id, file_name,                                        &
     3260                           variable_id, variable_name, attribute )                                 &
     3261             RESULT( return_value )
    32723262
    32733263    CHARACTER(LEN=*), PARAMETER ::  routine_name = 'write_attribute'  !< file format chosen for file
     
    34093399    CHARACTER(LEN=*), PARAMETER ::  routine_name = 'collect_dimesion_ids_for_variables'  !< file format chosen for file
    34103400
    3411     CHARACTER(LEN=*), INTENT(IN) ::  file_name !< name of file
     3401    CHARACTER(LEN=*), INTENT(IN) ::  file_name  !< name of file
    34123402
    34133403    INTEGER              ::  d             !< loop index
     
    34183408    INTEGER, INTENT(OUT) ::  return_value  !< return value
    34193409
    3420     LOGICAL ::  found = .FALSE. !< true if dimension required by variable was found in dimension list
     3410    LOGICAL ::  found = .FALSE.  !< true if dimension required by variable was found in dimension list
    34213411
    34223412    TYPE(dimension_type), DIMENSION(:), INTENT(IN) ::  dimensions  !< list of dimensions in file
     
    37473737 SUBROUTINE dom_database_debug_output
    37483738
     3739    CHARACTER(LEN=*), PARAMETER ::  routine_name = 'dom_database_debug_output'  !< name of this routine
    37493740    CHARACTER(LEN=*), PARAMETER ::  separation_string = '---'                   !< string separating blocks in output
    3750     CHARACTER(LEN=*), PARAMETER ::  routine_name = 'dom_database_debug_output'  !< name of this routine
    37513741
    37523742    INTEGER, PARAMETER ::  indent_depth = 3        !< space per indentation
    37533743    INTEGER, PARAMETER ::  max_keyname_length = 6  !< length of longest key name
    37543744
    3755     CHARACTER(LEN=50)           ::  write_format1                               !< format for write statements
    3756 
    3757     INTEGER            ::  f                       !< loop index
    3758     INTEGER            ::  indent_level            !< indentation level
    3759     INTEGER            ::  natts                   !< number of attributes
    3760     INTEGER            ::  ndims                   !< number of dimensions
    3761     INTEGER            ::  nvars                   !< number of variables
     3745    CHARACTER(LEN=50) ::  write_format1  !< format for write statements
     3746
     3747    INTEGER ::  f             !< loop index
     3748    INTEGER ::  indent_level  !< indentation level
     3749    INTEGER ::  natts         !< number of attributes
     3750    INTEGER ::  ndims         !< number of dimensions
     3751    INTEGER ::  nvars         !< number of variables
    37623752
    37633753
     
    38203810       CHARACTER(LEN=50) ::  write_format2  !< format for write statements
    38213811
    3822        INTEGER             ::  i                       !< loop index
    3823        INTEGER, INTENT(IN) ::  indent_level            !< indentation level
    3824        INTEGER             ::  nelement                !< number of elements to print
     3812       INTEGER             ::  i             !< loop index
     3813       INTEGER, INTENT(IN) ::  indent_level  !< indentation level
     3814       INTEGER             ::  nelement      !< number of elements to print
    38253815
    38263816       TYPE(attribute_type), DIMENSION(:), INTENT(IN) ::  attributes  !< list of attributes
     
    38803870       CHARACTER(LEN=50) ::  write_format2  !< format for write statements
    38813871
    3882        INTEGER             ::  i                        !< loop index
    3883        INTEGER, INTENT(IN) ::  indent_level             !< indentation level
    3884        INTEGER             ::  j                        !< loop index
    3885        INTEGER             ::  nelement                 !< number of elements to print
     3872       INTEGER             ::  i             !< loop index
     3873       INTEGER, INTENT(IN) ::  indent_level  !< indentation level
     3874       INTEGER             ::  j             !< loop index
     3875       INTEGER             ::  nelement      !< number of elements to print
    38863876
    38873877       LOGICAL ::  is_masked  !< true if dimension is masked
     
    40954085       CHARACTER(LEN=50) ::  write_format2  !< format for write statements
    40964086
    4097        INTEGER             ::  i                        !< loop index
    4098        INTEGER, INTENT(IN) ::  indent_level             !< indentation level
    4099        INTEGER             ::  j                        !< loop index
    4100        INTEGER             ::  nelement                 !< number of elements to print
     4087       INTEGER             ::  i             !< loop index
     4088       INTEGER, INTENT(IN) ::  indent_level  !< indentation level
     4089       INTEGER             ::  j             !< loop index
     4090       INTEGER             ::  nelement      !< number of elements to print
    41014091
    41024092       TYPE(variable_type), DIMENSION(:), INTENT(IN) ::  variables  !< list of variables
  • palm/trunk/SOURCE/data_output_netcdf4_module.f90

    r4577 r4579  
    1919! Current revisions:
    2020! ------------------
    21 ! 
    22 ! 
     21!
     22!
    2323! Former revisions:
    2424! -----------------
    2525! $Id$
     26! corrected formatting to follow PALM coding standard
     27!
     28! 4577 2020-06-25 09:53:58Z raasch
    2629! file re-formatted to follow the PALM coding standard
    2730!
     
    213216#endif
    214217
    215        IF ( return_value == 0 )  &
     218       IF ( return_value == 0 )                                                                    &
    216219          nc_stat = NF90_CREATE( TRIM( file_name ) // TRIM( file_suffix ),                         &
    217220                                 IOR( NF90_NOCLOBBER, NF90_NETCDF4 ), file_id )
     
    272275    CHARACTER(LEN=*), INTENT(IN), OPTIONAL ::  value_char      !< value of attribute
    273276
    274     INTEGER ::  nc_stat    !< netcdf return value
    275     INTEGER ::  target_id  !< ID of target which gets attribute (either global or variable_id)
    276 
    277277    INTEGER, INTENT(IN)  ::  file_id       !< file ID
     278    INTEGER              ::  nc_stat       !< netcdf return value
    278279    INTEGER, INTENT(OUT) ::  return_value  !< return value
     280    INTEGER              ::  target_id     !< ID of target which gets attribute (either global or variable_id)
    279281    INTEGER, INTENT(IN)  ::  variable_id   !< variable ID
    280282
     
    336338!> Initialize dimension.
    337339!--------------------------------------------------------------------------------------------------!
    338  SUBROUTINE netcdf4_init_dimension( mode, file_id, dimension_id, variable_id, &
    339                dimension_name, dimension_type, dimension_length, return_value )
     340 SUBROUTINE netcdf4_init_dimension( mode, file_id, dimension_id, variable_id,                      &
     341                                    dimension_name, dimension_type, dimension_length, return_value )
    340342
    341343    CHARACTER(LEN=*), PARAMETER ::  routine_name = 'netcdf4_init_dimension'  !< name of this routine
     
    374376!
    375377!--    Define variable holding dimension values in file
    376        CALL netcdf4_init_variable( mode, file_id, variable_id, dimension_name, dimension_type, &
     378       CALL netcdf4_init_variable( mode, file_id, variable_id, dimension_name, dimension_type,     &
    377379                                   (/ dimension_id /), is_global=.TRUE., return_value=return_value )
    378380
     
    482484
    483485    WRITE( temp_string, * ) file_id
    484     CALL internal_message( 'debug', routine_name // &
     486    CALL internal_message( 'debug', routine_name //                                                &
    485487                           ': finalize file definition (file_id=' // TRIM( temp_string ) // ')' )
    486488!
     
    494496    IF ( nc_stat /= NF90_NOERR )  THEN
    495497       return_value = 1
    496        CALL internal_message( 'error', routine_name // &
     498       CALL internal_message( 'error', routine_name //                                             &
    497499                              ': NetCDF error: ' // NF90_STRERROR( nc_stat ) )
    498500    ENDIF
Note: See TracChangeset for help on using the changeset viewer.