Ignore:
Timestamp:
Mar 28, 2019 3:04:04 PM (2 years ago)
Author:
forkel
Message:

removed USE chem_gasphase_mod from chem_modules, apply USE chem_gasphase for nvar, nspec, cs_mech and spc_names instead

File:
1 edited

Legend:

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

    r3766 r3833  
    2525! -----------------
    2626! $Id$
     27! renamed nvar to nmeas, replaced USE chem_modules by USE chem_gasphase_mod and nspec by nvar
     28!
     29! 3766 2019-02-26 16:23:41Z raasch
    2730! unused variables removed
    2831!
     
    7679        ONLY:  q, pt, u, v, w, zu, zw
    7780
    78     USE chem_modules,                                                          &
    79         ONLY:  nspec
     81    USE chem_gasphase_mod,                                                     &
     82        ONLY:  nvar
    8083
    8184    USE chemistry_model_mod,                                                   &
     
    132135       INTEGER(iwp) ::  ns_tot = 0      !< total number of observation coordinates, for atmospheric measurements
    133136       INTEGER(iwp) ::  ntraj           !< number of trajectories of a measurement
    134        INTEGER(iwp) ::  nvar            !< number of measured variables (atmosphere + soil)
     137       INTEGER(iwp) ::  nmeas           !< number of measured variables (atmosphere + soil)
    135138       
    136139       INTEGER(iwp) ::  ns_soil = 0     !< number of observation coordinates on subdomain, for soil measurements
     
    551554!--    for a NULL to get the correct character length in order to compare
    552555!--    them with the list of allowed variables.
    553        vmea(l)%nvar   = 0
     556       vmea(l)%nmeas  = 0
    554557       DO ll = 1, SIZE( measured_variables_file )
    555558          IF ( measured_variables_file(ll)(1:1) /= CHAR(0)  .AND.              &
     
    569572                IF ( measured_variables_file(ll)(1:len_char) ==                &
    570573                     TRIM( list_allowed_variables(lll) ) )  THEN
    571                    vmea(l)%nvar = vmea(l)%nvar + 1
    572                    measured_variables(vmea(l)%nvar) =                          &
     574                   vmea(l)%nmeas = vmea(l)%nmeas + 1
     575                   measured_variables(vmea(l)%nmeas) =                         &
    573576                                       measured_variables_file(ll)(1:len_char)
    574577                ENDIF
     
    578581!
    579582!--    Allocate array for the measured variables names for the respective site.
    580        ALLOCATE( vmea(l)%measured_vars_name(1:vmea(l)%nvar) )
    581 
    582        DO  ll = 1, vmea(l)%nvar
     583       ALLOCATE( vmea(l)%measured_vars_name(1:vmea(l)%nmeas) )
     584
     585       DO  ll = 1, vmea(l)%nmeas
    583586          vmea(l)%measured_vars_name(ll) = TRIM( measured_variables(ll) )
    584587       ENDDO
     
    587590!--    chemistry mechanism.
    588591!        IF ( air_chemistry )  THEN
    589 !           DO  ll = 1, vmea(l)%nvar
     592!           DO  ll = 1, vmea(l)%nmeas
    590593!              chem_include = .FALSE.
    591 !              DO  n = 1, nspec
     594!              DO  n = 1, nvar
    592595!                 IF ( TRIM( vmea(l)%measured_vars_name(ll) ) ==                 &
    593596!                      TRIM( chem_species(n)%name ) )  chem_include = .TRUE.
     
    609612!--    as this would exceed memory requirements, particularly for trajectory
    610613!--    measurements.
    611        IF ( vmea(l)%nvar > 0 )  THEN
     614       IF ( vmea(l)%nmeas > 0 )  THEN
    612615!
    613616!--       For stationary measurements UTM coordinates are just one value and
     
    855858!
    856859!--       Allocate array to save the sampled values.
    857           ALLOCATE( vmea(l)%measured_vars(1:vmea(l)%ns,1:vmea(l)%nvar) )
     860          ALLOCATE( vmea(l)%measured_vars(1:vmea(l)%ns,1:vmea(l)%nmeas) )
    858861         
    859862          IF ( vmea(l)%soil_sampling )                                         &
    860863             ALLOCATE( vmea(l)%measured_vars_soil(1:vmea(l)%ns_soil,           &
    861                                                   1:vmea(l)%nvar) )
     864                                                  1:vmea(l)%nmeas) )
    862865!
    863866!--       Initialize with _FillValues
    864           vmea(l)%measured_vars(1:vmea(l)%ns,1:vmea(l)%nvar) = vmea(l)%fillout
     867          vmea(l)%measured_vars(1:vmea(l)%ns,1:vmea(l)%nmeas) = vmea(l)%fillout
    865868          IF ( vmea(l)%soil_sampling )                                         &
    866              vmea(l)%measured_vars_soil(1:vmea(l)%ns_soil,1:vmea(l)%nvar) =    &
     869             vmea(l)%measured_vars_soil(1:vmea(l)%ns_soil,1:vmea(l)%nmeas) =   &
    867870                                                                vmea(l)%fillout
    868871!
     
    955958                 WRITE ( 27 )  vmea(l)%ns_tot
    956959                 WRITE ( 27 )  'number of measured variables      '
    957                  WRITE ( 27 )  vmea(l)%nvar
     960                 WRITE ( 27 )  vmea(l)%nmeas
    958961                 WRITE ( 27 )  'variables                         '
    959962                 WRITE ( 27 )  vmea(l)%measured_vars_name(:)
     
    10131016!--              Skip binary writing if no observation points are defined on PE
    10141017                 IF ( vmea(l)%ns < 1  .AND.  vmea(l)%ns_soil < 1)  CYCLE                 
    1015                  DO  n = 1, vmea(l)%nvar
     1018                 DO  n = 1, vmea(l)%nmeas
    10161019                    WRITE( 27 )  vmea(l)%measured_vars_name(n)
    10171020                    IF ( vmea(l)%soil_sampling  .AND.                           &
     
    11061109!
    11071110!--     Loop over all variables measured at this site. 
    1108         DO  n = 1, vmea(l)%nvar
     1111        DO  n = 1, vmea(l)%nmeas
    11091112       
    11101113           SELECT CASE ( TRIM( vmea(l)%measured_vars_name(n) ) )
     
    12631266!--                 Run loop over all chemical species, if the measured
    12641267!--                 variable matches the interal name, sample the variable.
    1265                     DO  nn = 1, nspec                   
     1268                    DO  nn = 1, nvar                   
    12661269                       IF ( TRIM( chem_vars(1,ind_chem) ) ==                   &
    12671270                            TRIM( chem_species(nn)%name ) )  THEN                           
Note: See TracChangeset for help on using the changeset viewer.