unit2IUf Function

public function unit2IUf(string) result(met)

Convert a unit string into value (m)

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: string

Return Value real(kind=R8)


Called by

proc~~unit2iuf~~CalledByGraph proc~unit2iuf unit2IUf proc~surf2scal surf2scal proc~surf2scal->proc~unit2iuf proc~unit2iuc unit2IUc proc~unit2iuc->proc~unit2iuf proc~build_surf build_surf proc~build_surf->proc~unit2iuc proc~open_surffile open_surffile proc~open_surffile->proc~surf2scal proc~trans_surf_tab trans_surf_tab proc~trans_surf_tab->proc~unit2iuc proc~write_surf write_surf proc~write_surf->proc~surf2scal proc~write_surf->proc~build_surf proc~read_surf~2 read_surf proc~read_surf~2->proc~open_surffile proc~read_surf~2->proc~trans_surf_tab program~test_surfile test_surfile program~test_surfile->proc~write_surf program~test_surfile->proc~read_surf~2

Source Code

   function unit2IUf(string) result (met)
   !! Convert a unit string into value (m)
   implicit none
   real(kind=R8) :: met
   character(*), intent(in) :: string

      select case(string)
         case('m')
            met = 1.e+00_R8
         case('cm')
            met = 1.e-02_R8
         case('mm')
            met = 1.e-03_R8
         case('µm')
            met = 1.e-06_R8
         case('µ')
            met = 1.e-06_R8
         case('nm')
            met = 1.e-09_R8
         case('pm')
            met = 1.e-12_R8
         case('Pa')
            met = 1.e+00_R8
         case('MP')
            met = 1.e+06_R8
         case('GP')
            met = 1.e+09_R8
         case default
            if ( string(1:1) == '%' ) then
               met = 1.e-02_R8
            else
               met = 1
            endif
      endselect

   return
   endfunction unit2IUf