Ignore:
Timestamp:
Nov 27, 2019 2:06:25 PM (4 years ago)
Author:
suehring
Message:

Checks and initialization for relative surface fractions revised

File:
1 edited

Legend:

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

    r4298 r4312  
    2020! Current revisions:
    2121! -----------------
    22 !
     22! Checks for surface fractions revised
    2323!
    2424! Former revisions:
     
    36433643                                  2, 2, myid, 6, 0 )
    36443644                ENDIF
    3645              ENDIF
    3646 !
    3647 !--          Check for consistency of surface fraction. If more than one type
    3648 !--          is set, surface fraction need to be given and the sum must not
    3649 !--          be larger than 1.
     3645             ENDIF
     3646!
     3647!--          Check for consistency of given types. At the moment, only one
     3648!--          of vegetation, pavement, or water-type can be set. This is
     3649!--          because no tile approach is yet implemented in the land-surface
     3650!--          model. Later, when this is possible, surface fraction need to be
     3651!--          given and the sum must not  be larger than 1. Please note, in case
     3652!--          more than one type is given at a pixel, an error message will be
     3653!--          given.
    36503654             n_surf = 0
    36513655             IF ( vegetation_type_f%var(j,i) /= vegetation_type_f%fill )       &
     
    36573661
    36583662             IF ( n_surf > 1 )  THEN
    3659                 IF ( .NOT. surface_fraction_f%from_file )  THEN
    3660                    message_string = 'If more than one surface type is ' //     &
    3661                                  'given at a location, surface_fraction ' //   &
    3662                                  'must be provided.'
    3663                    CALL message( 'netcdf_data_input_mod', 'PA0565',            &
    3664                                   2, 2, myid, 6, 0 )
    3665                 ELSEIF ( ANY ( surface_fraction_f%frac(:,j,i) ==               &
    3666                                surface_fraction_f%fill ) )  THEN
    3667                    message_string = 'If more than one surface type is ' //     &
    3668                                  'given at a location, surface_fraction ' //   &
    3669                                  'must be provided.'
    3670                    CALL message( 'netcdf_data_input_mod', 'PA0565',            &
    3671                                   2, 2, myid, 6, 0 )
    3672                 ENDIF
     3663                WRITE( message_string, * )                                     &
     3664                                 'More than one surface type (vegetation, '//  &
     3665                                 'pavement, water) is given at a location. '// &
     3666                                 'Please note, this is not possible at ' //    &
     3667                                 'the moment as no tile approach has been ' // &
     3668                                 'yet implemented. (i,j) = ', i, j
     3669                CALL message( 'netcdf_data_input_mod', 'PA0565',               &
     3670                               2, 2, myid, 6, 0 )
     3671
     3672!                 IF ( .NOT. surface_fraction_f%from_file )  THEN
     3673!                    message_string = 'More than one surface type (vegetation '//&
     3674!                                  'pavement, water) is given at a location. '// &
     3675!                                  'Please note, this is not possible at ' //    &
     3676!                                  'the moment as no tile approach is yet ' //   &
     3677!                                  'implemented.'
     3678!                    message_string = 'If more than one surface type is ' //     &
     3679!                                  'given at a location, surface_fraction ' //   &
     3680!                                  'must be provided.'
     3681!                    CALL message( 'netcdf_data_input_mod', 'PA0565',            &
     3682!                                   2, 2, myid, 6, 0 )
     3683!                 ELSEIF ( ANY ( surface_fraction_f%frac(:,j,i) ==               &
     3684!                                surface_fraction_f%fill ) )  THEN
     3685!                    message_string = 'If more than one surface type is ' //     &
     3686!                                  'given at a location, surface_fraction ' //   &
     3687!                                  'must be provided.'
     3688!                    CALL message( 'netcdf_data_input_mod', 'PA0565',            &
     3689!                                   2, 2, myid, 6, 0 )
     3690!                 ENDIF
    36733691             ENDIF
    36743692!
     
    36783696             IF ( surface_fraction_f%from_file )  THEN
    36793697!
    3680 !--             Sum of relative fractions must not exceed 1.
    3681                 IF ( SUM ( surface_fraction_f%frac(0:2,j,i) ) > 1.0_wp )  THEN
    3682                    message_string = 'surface_fraction must not exceed 1'
    3683                    CALL message( 'netcdf_data_input_mod', 'PA0566',            &
     3698!--             If surface fractions is given, also check that only one type
     3699!--             is given.
     3700                IF ( SUM( MERGE( 1, 0, surface_fraction_f%frac(:,j,i) /= 0.0_wp&
     3701                                .AND.  surface_fraction_f%frac(:,j,i) /=       &
     3702                                       surface_fraction_f%fill  ) ) > 1 )  THEN
     3703                   WRITE( message_string, * )                                  &
     3704                                    'surface_fraction is given for more ' //   &
     3705                                    'than one type. ' //                       &
     3706                                    'Please note, this is not possible at ' // &
     3707                                    'the moment as no tile approach has '//    &
     3708                                    'yet been implemented. (i, j) = ', i, j
     3709                   CALL message( 'netcdf_data_input_mod', 'PA0676',            &
    36843710                                  2, 2, myid, 6, 0 )
     3711                ENDIF
     3712!
     3713!--             Sum of relative fractions must be 1. Note, due to type
     3714!--             type conversions due to reading, the sum of surface fractions
     3715!--             might be not exactly 1. Hence, the sum is check with a
     3716!--             tolerance. Later, in the land-surface model, the relative
     3717!--             fractions are normalized to one.
     3718                IF ( ANY( surface_fraction_f%frac(:,j,i) /=                    &
     3719                          surface_fraction_f%fill ) )  THEN
     3720                   IF ( SUM ( surface_fraction_f%frac(0:2,j,i) ) >             &
     3721                        1.0_wp + 1E-8_wp  .OR.                                 &
     3722                        SUM ( surface_fraction_f%frac(0:2,j,i) ) <             &
     3723                        1.0_wp - 1E-8_wp )  THEN
     3724                      WRITE( message_string, * )                               &
     3725                                    'The sum of all land-surface fractions ' //&
     3726                                    'must equal 1. ', i, j
     3727                      CALL message( 'netcdf_data_input_mod', 'PA0566',         &
     3728                                     2, 2, myid, 6, 0 )
     3729                   ENDIF
    36853730                ENDIF
    36863731!
Note: See TracChangeset for help on using the changeset viewer.