Changeset 4201 for palm/trunk


Ignore:
Timestamp:
Aug 29, 2019 3:47:27 PM (5 years ago)
Author:
suehring
Message:

Limit soil moisture to its saturation value and give a respective warning rather than an error message. Further, adjust checks for number of given soil temperatures for the nested case where the child might have no dynamic input file.

File:
1 edited

Legend:

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

    r4194 r4201  
    2525! -----------------
    2626! $Id$
     27! - Limit soil moisture to its saturation moisture and give a respective
     28!   warning rather than an error.
     29! - Perform checks for soil temperature only when there is no dynamic input
     30!   file for the parent or possible child domains.
     31!
     32! 4194 2019-08-28 08:09:44Z suehring
    2733! Apply more strict limitation of z0 over water surfaces in case it exceeds the
    2834! surface-layer height, in order to avoid instabilities.
     
    182188
    183189    USE netcdf_data_input_mod,                                                 &
    184         ONLY :  building_type_f, init_3d,                                      &
     190        ONLY :  building_type_f,                                               &
     191                init_3d,                                                       &
     192                input_file_dynamic,                                            &
    185193                input_pids_dynamic,                                            &
    186194                input_pids_static,                                             &
    187                 netcdf_data_input_interpolate, netcdf_data_input_init_lsm,     &
    188                 pavement_pars_f, pavement_subsurface_pars_f, pavement_type_f,  &
    189                 root_area_density_lsm_f, soil_pars_f, soil_type_f,             &
    190                 surface_fraction_f, vegetation_pars_f, vegetation_type_f,      &
    191                 water_pars_f, water_type_f
     195                netcdf_data_input_interpolate,                                 &
     196                netcdf_data_input_init_lsm,                                    &
     197                pavement_pars_f,                                               &
     198                pavement_subsurface_pars_f,                                    &
     199                pavement_type_f,                                               &
     200                root_area_density_lsm_f,                                       &
     201                soil_pars_f,                                                   &
     202                soil_type_f,                                                   &
     203                surface_fraction_f,                                            &
     204                vegetation_pars_f,                                             &
     205                vegetation_type_f,                                             &
     206                water_pars_f,                                                  &
     207                water_type_f
    192208
    193209    USE kinds
     
    9921008    INTEGER(iwp) ::  j        !< running index, y-dimension
    9931009    INTEGER(iwp) ::  k        !< running index, z-dimension
     1010   
     1011    LOGICAL      ::  dynamic_soil_input_parent !< flag indicating the presence of a dynamic input file for the parent
    9941012
    9951013!
     
    13921410
    13931411!
    1394 !-- Check whether valid soil temperatures are prescribed
    1395     IF ( .NOT. input_pids_dynamic )  THEN
     1412!-- Check whether valid soil temperatures are prescribed. Only check this if
     1413!-- no dynamic soil is not initialized with dynamic input.
     1414!-- In a nested case, check whether there is a dynamic input file for the
     1415!-- child (input_pids_dynamic = .T.) or one for the parent (inquire without
     1416!-- coupling_char.
     1417    INQUIRE( FILE = TRIM( input_file_dynamic ),                                &
     1418             EXIST = dynamic_soil_input_parent )
     1419
     1420    IF ( .NOT. input_pids_dynamic  .AND.  .NOT. dynamic_soil_input_parent )  THEN
    13961421       IF ( COUNT( soil_temperature /= 9999999.9_wp ) /= nzs )  THEN
    13971422          WRITE( message_string, * )                                           &
     
    14121437!
    14131438!-- Check whether the sum of all root fractions equals one
    1414     IF ( vegetation_type == 0 )  THEN
    1415        IF ( SUM( root_fraction(nzb_soil:nzt_soil) ) /= 1.0_wp )  THEN
    1416           message_string = 'vegetation_type = 0 (user_defined)'//              &
    1417                            'requires setting of root_fraction'//               &
    1418                            '/= 9999999.9 and SUM(root_fraction) = 1'
    1419           CALL message( 'lsm_check_parameters', 'PA0401', 1, 2, 0, 6, 0 )
     1439    IF ( .NOT. vegetation_type_f%from_file )  THEN
     1440       IF ( vegetation_type == 0 )  THEN
     1441          IF ( SUM( root_fraction(nzb_soil:nzt_soil) ) /= 1.0_wp )  THEN
     1442             message_string = 'vegetation_type = 0 (user_defined)'//           &
     1443                              'requires setting of root_fraction'//            &
     1444                              '/= 9999999.9 and SUM(root_fraction) = 1'
     1445             CALL message( 'lsm_check_parameters', 'PA0401', 1, 2, 0, 6, 0 )
     1446          ENDIF
    14201447       ENDIF
    1421     ENDIF     
     1448    ENDIF
    14221449!
    14231450!-- Calculate grid spacings. Temperature and moisture are defined at
     
    43034330!
    43044331!--       After soil moisture and temperature are finally initialized, check
    4305 !--       if soil moisture is higher than its saturation value. Else, this
    4306 !--       will produce floating point errors in the soil model parametrization.
     4332!--       if soil moisture is higher than its saturation value. If this would
     4333!--       be the case, the soil model parametrization will produce floating
     4334!--       point errors. Hence, limit the soil moisture to its saturation value
     4335!--       and give a warning.
    43074336          DO  m = 1, surf_lsm_h%ns
    43084337             IF ( surf_lsm_h%vegetation_surface(m)  .OR.                       &
     
    43104339                DO  k = nzb_soil, nzt_soil
    43114340                   IF ( m_soil_h%var_2d(k,m) > surf_lsm_h%m_sat(k,m) )  THEN
     4341                      m_soil_h%var_2d(k,m) = surf_lsm_h%m_sat(k,m)
    43124342                      WRITE( message_string, * ) 'soil moisture is higher '//  &
    43134343                            'than its saturation value at (k,j,i) ', k,        &
    4314                             surf_lsm_h%i(m), surf_lsm_h%j(m)
    4315                       CALL message( 'lsm_init', 'PA0458', 2, 2, myid, 6, 0 )
     4344                            surf_lsm_h%i(m), surf_lsm_h%j(m), ' and is ' //    &
     4345                            'thus limited to this value to maintain stability.'
     4346                      CALL message( 'lsm_init', 'PA0458', 0, 1, myid, 6, 0 )
    43164347                   ENDIF               
    43174348                ENDDO
     
    43254356                      IF ( m_soil_v(l)%var_2d(k,m) > surf_lsm_v(l)%m_sat(k,m) )&
    43264357                      THEN
     4358                         m_soil_v(l)%var_2d(k,m) = surf_lsm_v(l)%m_sat(k,m)
    43274359                         WRITE( message_string, * )                            &
    4328                             'soil moisture is higher than ' //                 &
    4329                             'its saturation value at (k,j,i) ', k,             &
    4330                             surf_lsm_v(l)%i(m), surf_lsm_v(l)%j(m)
    4331                          CALL message( 'lsm_init', 'PA0458', 2, 2, myid, 6, 0 )                   
     4360                            'soil moisture is higher '//                       &
     4361                            'than its saturation value at (k,j,i) ', k,        &
     4362                            surf_lsm_v(l)%i(m), surf_lsm_v(l)%j(m),            &
     4363                            ' and is ' //                                      &
     4364                            'thus limited to this value to maintain stability.'
     4365                         CALL message( 'lsm_init', 'PA0458', 0, 1, myid, 6, 0 )                   
    43324366                      ENDIF
    43334367                   ENDDO
Note: See TracChangeset for help on using the changeset viewer.