Changeset 4475 for palm/trunk/UTIL


Ignore:
Timestamp:
Mar 26, 2020 4:28:19 PM (5 years ago)
Author:
gronemeier
Message:

bugfixes/changes to INIFOR:

  • c: revise output format in routine report (inifor_control)
  • b: check if namelist file was opened (inifor_grid)
  • b: use explicit loop in routine reverse (inifor_util)
Location:
palm/trunk/UTIL/inifor/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/UTIL/inifor/src/inifor_control.f90

    r3997 r4475  
    2626! -----------------
    2727! $Id$
     28! Change output format in routine report to allow for better message formatting
     29!
     30! 3997 2019-05-23 12:35:57Z eckhard
    2831! Added warnings counter
    2932!
     
    126129
    127130    IF ( .NOT. suppress_message )  THEN
    128        PRINT *, "inifor: " // TRIM(message) // "  [ " // TRIM(routine) // " ]"
    129        WRITE(u, *)  TRIM(message) // "  [ " // TRIM(routine) // " ]"
     131       WRITE(*, '(A)') "inifor: " // TRIM(message) // "  [ " // TRIM(routine) // " ]"
     132       WRITE(u, '(A)')  TRIM(message) // "  [ " // TRIM(routine) // " ]"
    130133    ENDIF
    131134
  • palm/trunk/UTIL/inifor/src/inifor_grid.f90

    r4074 r4475  
    2626! -----------------
    2727! $Id$
     28! Bugfix: check if namelist file could be opened without error
     29!
     30! 4074 2019-07-05 13:05:19Z eckhard
    2831! Changed default initialization mode from 'volume' to 'profile'
    2932! Pass hhl_file to cosmo_grid() instead of entire INIFOR configuration
     
    491494!
    492495!-- Read in namelist parameters
    493     OPEN(10, FILE=cfg%namelist_file, STATUS='old')
     496    OPEN(10, FILE=cfg%namelist_file, STATUS='old', IOSTAT=iostat)
     497    IF ( iostat /= 0 )  THEN
     498       message = "Failed to open file '" //             &
     499                 TRIM( cfg%namelist_file ) // "'. "
     500       CALL inifor_abort( 'setup_parameters', message )
     501    ENDIF
     502
    494503    READ(10, NML=inipar, IOSTAT=iostat) ! nx, ny, nz, dx, dy, dz   
    495504    IF ( iostat > 0 )  THEN     
  • palm/trunk/UTIL/inifor/src/inifor_util.f90

    r3866 r4475  
    2626! -----------------
    2727! $Id$
     28! Bugfix: use explicit loop in 'reverse' subroutine instead of implicit loop
     29!
     30! 3866 2019-04-05 14:25:01Z eckhard
    2831! Use PALM's working precision
    2932! Improved coding style
     
    269272 SUBROUTINE reverse(input_arr)
    270273
     274    INTEGER ::  i
     275    INTEGER ::  lbound_3rd_dimension
     276    INTEGER ::  ubound_3rd_dimension
     277
    271278    REAL(wp), INTENT(INOUT) ::  input_arr(:,:,:)
    272279
    273     input_arr = input_arr(:,:,size(input_arr, 3):1:-1)
     280    lbound_3rd_dimension = LBOUND(input_arr, 3)
     281    ubound_3rd_dimension = UBOUND(input_arr, 3)
     282
     283    DO  i = lbound_3rd_dimension, ubound_3rd_dimension
     284       input_arr(:,:,i) = input_arr(:,:,                    &
     285         ubound_3rd_dimension - ( i - lbound_3rd_dimension ))
     286    ENDDO
    274287
    275288 END SUBROUTINE reverse
Note: See TracChangeset for help on using the changeset viewer.