Changeset 3447


Ignore:
Timestamp:
Oct 29, 2018 3:52:54 PM (3 years ago)
Author:
eckhard
Message:

inifor: Renamed source files for compatibilty with PALM build system

Location:
palm/trunk/UTIL/inifor
Files:
1 deleted
3 edited
7 moved

Legend:

Unmodified
Added
Removed
  • palm/trunk/UTIL/inifor/Makefile

    r3395 r3447  
    2525# -----------------
    2626# $Id$
     27# Renamed source files for compatibilty with PALM build system
     28#
     29# 3395 2018-10-22 17:32:49Z eckhard
    2730# Updated build order
    2831#
     
    5053TEST_PATH = $(PROJECT_PATH)/tests
    5154
    52 MODULES = $(SRC_PATH)/defs.mod $(SRC_PATH)/types.mod $(SRC_PATH)/util.mod $(SRC_PATH)/control.mod $(SRC_PATH)/transform.mod $(SRC_PATH)/io.mod $(SRC_PATH)/grid.mod
     55MODULES = $(SRC_PATH)/inifor_defs.mod $(SRC_PATH)/inifor_types.mod \
     56                  $(SRC_PATH)/inifor_util.mod $(SRC_PATH)/inifor_control.mod \
     57                  $(SRC_PATH)/inifor_transform.mod $(SRC_PATH)/inifor_io.mod \
     58                  $(SRC_PATH)/inifor_grid.mod
    5359SOURCES = $(MODULES:%.mod=%.f90) $(SRC_PATH)/$(PROJECT).f90
    5460OBJECTS = $(SOURCES:%.f90=%.o)
  • palm/trunk/UTIL/inifor/Makefile.gnu

    r3395 r3447  
    2525# -----------------
    2626# $Id$
     27# Renamed source files for compatibilty with PALM build system
     28#
     29# 3395 2018-10-22 17:32:49Z eckhard
    2730# Updated build order
    2831#
     
    5154TEST_PATH = $(PROJECT_PATH)/tests
    5255
    53 MODULES = $(SRC_PATH)/defs.mod $(SRC_PATH)/types.mod $(SRC_PATH)/util.mod $(SRC_PATH)/control.mod $(SRC_PATH)/transform.mod $(SRC_PATH)/io.mod $(SRC_PATH)/grid.mod
     56MODULES = $(SRC_PATH)/inifor_defs.mod $(SRC_PATH)/inifor_types.mod \
     57                  $(SRC_PATH)/inifor_util.mod $(SRC_PATH)/inifor_control.mod \
     58                  $(SRC_PATH)/inifor_transform.mod $(SRC_PATH)/inifor_io.mod \
     59                  $(SRC_PATH)/inifor_grid.mod
    5460SOURCES = $(MODULES:%.mod=%.f90) $(SRC_PATH)/$(PROJECT).f90
    5561OBJECTS = $(SOURCES:%.f90=%.o)
  • palm/trunk/UTIL/inifor/Makefile.ifort

    r3395 r3447  
    2525# -----------------
    2626# $Id$
     27# Renamed source files for compatibilty with PALM build system
     28#
     29# 3395 2018-10-22 17:32:49Z eckhard
    2730# Updated build order
    2831#
     
    5154TEST_PATH = $(PROJECT_PATH)/tests
    5255
    53 MODULES = $(SRC_PATH)/defs.mod $(SRC_PATH)/types.mod $(SRC_PATH)/util.mod $(SRC_PATH)/control.mod $(SRC_PATH)/transform.mod $(SRC_PATH)/io.mod $(SRC_PATH)/grid.mod
     56MODULES = $(SRC_PATH)/inifor_defs.mod $(SRC_PATH)/inifor_types.mod \
     57                  $(SRC_PATH)/inifor_util.mod $(SRC_PATH)/inifor_control.mod \
     58                  $(SRC_PATH)/inifor_transform.mod $(SRC_PATH)/inifor_io.mod \
     59                  $(SRC_PATH)/inifor_grid.mod
    5460SOURCES = $(MODULES:%.mod=%.f90) $(SRC_PATH)/$(PROJECT).f90
    5561OBJECTS = $(SOURCES:%.f90=%.o)
  • palm/trunk/UTIL/inifor/src/inifor_control.f90

    r3446 r3447  
    1 !> @file src/control.f90
     1!> @file src/inifor_control.f90
    22!------------------------------------------------------------------------------!
    33! This file is part of the PALM model system.
     
    2626! -----------------
    2727! $Id$
     28! Renamed source files for compatibilty with PALM build system
     29!
     30!
     31! 3395 2018-10-22 17:32:49Z eckhard
    2832! Suppress debugging messages unless --debug option is given
    2933!
  • palm/trunk/UTIL/inifor/src/inifor_defs.f90

    r3446 r3447  
    1 !> @file src/defs.f90
     1!> @file src/inifor_defs.f90
    22!------------------------------------------------------------------------------!
    33! This file is part of the PALM model system.
     
    2626! -----------------
    2727! $Id$
     28! Renamed source files for compatibilty with PALM build system
     29!
     30!
     31! 3395 2018-10-22 17:32:49Z eckhard
    2832! New parameters for computation of geostrophic winds
    2933! Bumped INIFOR version number
  • palm/trunk/UTIL/inifor/src/inifor_grid.f90

    r3446 r3447  
    1 !> @file src/grid.f90
     1!> @file src/inifor_grid.f90
    22!------------------------------------------------------------------------------!
    33! This file is part of the PALM model system.
     
    2626! -----------------
    2727! $Id$
     28! Renamed source files for compatibilty with PALM build system
     29!
     30!
     31! 3395 2018-10-22 17:32:49Z eckhard
    2832! Added computation of geostrophic winds form COSMO pressure fields
    2933! Introduced averaging grids and internal 'output' variables for computation of
  • palm/trunk/UTIL/inifor/src/inifor_io.f90

    r3446 r3447  
    1 !> @file src/io.f90
     1!> @file src/inifor_io.f90
    22!------------------------------------------------------------------------------!
    33! This file is part of the PALM model system.
     
    2626! -----------------
    2727! $Id$
     28! Removed INCLUDE statement for get_netcdf_variable()
     29! Renamed source files for compatibilty with PALM build system
     30!
     31!
     32! 3395 2018-10-22 17:32:49Z eckhard
    2833! Added command-line options for configuring the computation of geostrophic
    2934!     winds (--averagin-mode, --averaging-angle)
     
    9196       INTEGER(hp), ALLOCATABLE, INTENT(INOUT) ::  buffer(:,:,:)
    9297
    93        INCLUDE 'get_netcdf_variable.inc'
     98       INTEGER               ::  ncid
     99       INTEGER, DIMENSION(3) ::  start, count
     100
     101       IF ( nf90_open( TRIM(in_file), NF90_NOWRITE, ncid ) .EQ. NF90_NOERR .AND. &
     102            nf90_inq_varid( ncid, in_var % name, in_var % varid ) .EQ. NF90_NOERR )  THEN
     103
     104          CALL get_input_dimensions(in_var, ncid)
     105
     106          CALL get_netcdf_start_and_count(in_var, start, count)
     107 CALL run_control('time', 'read')
     108
     109          ALLOCATE( buffer( count(1), count(2), count(3) ) )
     110 CALL run_control('time', 'alloc')
     111
     112          CALL check(nf90_get_var( ncid, in_var % varid, buffer,                  &
     113                                   start = start,                                 &
     114                                   count = count ))
     115
     116       ELSE
     117
     118          message = "Failed to read '" // TRIM(in_var % name) // &
     119             "' from file '" // TRIM(in_file) // "'."
     120          CALL abort('get_netcdf_variable', message)
     121
     122       END IF
     123
     124       CALL check(nf90_close(ncid))
     125 CALL run_control('time', 'read')
    94126
    95127    END SUBROUTINE get_netcdf_variable_int
     
    102134       REAL(dp), ALLOCATABLE, INTENT(INOUT) ::  buffer(:,:,:)
    103135
    104        INCLUDE 'get_netcdf_variable.inc'
     136       INTEGER               ::  ncid
     137       INTEGER, DIMENSION(3) ::  start, count
     138
     139       IF ( nf90_open( TRIM(in_file), NF90_NOWRITE, ncid ) .EQ. NF90_NOERR .AND. &
     140            nf90_inq_varid( ncid, in_var % name, in_var % varid ) .EQ. NF90_NOERR )  THEN
     141
     142          CALL get_input_dimensions(in_var, ncid)
     143
     144          CALL get_netcdf_start_and_count(in_var, start, count)
     145 CALL run_control('time', 'read')
     146
     147          ALLOCATE( buffer( count(1), count(2), count(3) ) )
     148 CALL run_control('time', 'alloc')
     149
     150          CALL check(nf90_get_var( ncid, in_var % varid, buffer,                  &
     151                                   start = start,                                 &
     152                                   count = count ))
     153
     154       ELSE
     155
     156          message = "Failed to read '" // TRIM(in_var % name) // &
     157             "' from file '" // TRIM(in_file) // "'."
     158          CALL abort('get_netcdf_variable', message)
     159
     160       END IF
     161
     162       CALL check(nf90_close(ncid))
     163 CALL run_control('time', 'read')
    105164
    106165    END SUBROUTINE get_netcdf_variable_real
     166
     167
     168    SUBROUTINE get_input_dimensions(in_var, ncid)
     169
     170       TYPE(nc_var), INTENT(INOUT)     ::  in_var
     171       INTEGER, INTENT(OUT)            ::  ncid
     172
     173       INTEGER ::  i
     174
     175       CALL check(nf90_get_att( ncid, in_var % varid, "long_name",             &
     176                                in_var % long_name))
     177
     178       CALL check(nf90_get_att( ncid, in_var % varid, "units",                 &
     179                                in_var % units ))
     180
     181       CALL check(nf90_inquire_variable( ncid, in_var % varid,                 &
     182                                         ndims  = in_var % ndim,               &
     183                                         dimids = in_var % dimids ))
     184
     185       DO i = 1, in_var % ndim
     186          CALL check(nf90_inquire_dimension( ncid, in_var % dimids(i),         &
     187                                             name = in_var % dimname(i),       &
     188                                             len  = in_var % dimlen(i) ))
     189       END DO
     190
     191    END SUBROUTINE get_input_dimensions
     192
     193
     194    SUBROUTINE get_netcdf_start_and_count(in_var, start, count)
     195
     196       TYPE(nc_var), INTENT(INOUT)        ::  in_var
     197       INTEGER, DIMENSION(3), INTENT(OUT) ::  start, count
     198
     199       INTEGER ::  ndim
     200
     201       IF ( in_var % ndim .LT. 2  .OR.  in_var % ndim .GT. 4 )  THEN
     202
     203          message = "Failed reading NetCDF variable " //                       &
     204             TRIM(in_var % name) // " with " // TRIM(str(in_var%ndim)) //      &
     205             " dimensions because only two- and and three-dimensional" //      &
     206             " variables are supported."
     207          CALL abort('get_netcdf_start_and_count', message)
     208
     209       END IF
     210
     211       start = (/ 1, 1, 1 /)
     212       IF ( TRIM(in_var % name) .EQ. 'T_SO' )  THEN
     213          ! Skip depth = 0.0 for T_SO and reduce number of depths from 9 to 8
     214          in_var % dimlen(3) = in_var % dimlen(3) - 1
     215
     216          ! Start reading from second level, e.g. depth = 0.005 instead of 0.0
     217          start(3) = 2
     218       END IF
     219
     220       IF (in_var % ndim .EQ. 2)  THEN
     221          in_var % dimlen(3) = 1
     222       ENDIF
     223
     224       ndim = MIN(in_var % ndim, 3)
     225       count = (/ 1, 1, 1 /)
     226       count(1:ndim) = in_var % dimlen(1:ndim)
     227
     228    END SUBROUTINE get_netcdf_start_and_count
    107229
    108230
  • palm/trunk/UTIL/inifor/src/inifor_transform.f90

    r3446 r3447  
    1 !> @file src/transform.f90
     1!> @file src/inifor_transform.f90
    22!------------------------------------------------------------------------------!
    33! This file is part of the PALM model system.
     
    2626! -----------------
    2727! $Id$
     28! Renamed source files for compatibilty with PALM build system
     29!
     30!
     31! 3395 2018-10-22 17:32:49Z eckhard
    2832! Switched addressing of averaging regions from index bounds to list of columns
    2933! Added routines for the computation of geostrophic winds including:
  • palm/trunk/UTIL/inifor/src/inifor_types.f90

    r3446 r3447  
    1 !> @file src/types.f90
     1!> @file src/inifor_types.f90
    22!------------------------------------------------------------------------------!
    33! This file is part of the PALM model system.
     
    2626! -----------------
    2727! $Id$
     28! Renamed source files for compatibilty with PALM build system
     29!
     30!
     31! 3395 2018-10-22 17:32:49Z eckhard
    2832! Added *_is_set LOGICALs to inifor_config type to indicate option invocation
    2933!     from the command-line
  • palm/trunk/UTIL/inifor/src/inifor_util.f90

    r3446 r3447  
    1 !> @file src/util.f90
     1!> @file src/inifor_util.f90
    22!------------------------------------------------------------------------------!
    33! This file is part of the PALM model system.
     
    2626! -----------------
    2727! $Id$
     28! Renamed source files for compatibilty with PALM build system
     29!
     30!
     31! 3395 2018-10-22 17:32:49Z eckhard
    2832! New routines for computing potential temperature and moist air density
    2933! Increased number of digits in real-to-str conversion
Note: See TracChangeset for help on using the changeset viewer.