[cig-commits] [commit] Hiro_latest: Add subroutine to compare characters with ignoring cases (2314a29)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Mon Nov 18 16:21:14 PST 2013


Repository : ssh://geoshell/calypso

On branch  : Hiro_latest
Link       : https://github.com/geodynamics/calypso/compare/93e9f8f974c7a247c8f02e54ec18de063f86c8fb...3c548304673360ddedd7d68c8095b3fb74a2b9ce

>---------------------------------------------------------------

commit 2314a2957489fea1dc144afa264e4560ba4d6ed2
Author: Hiroaki Matsui <h_kemono at mac.com>
Date:   Wed Oct 30 10:31:38 2013 -0700

    Add subroutine to compare characters with ignoring cases


>---------------------------------------------------------------

2314a2957489fea1dc144afa264e4560ba4d6ed2
 .../SERIAL_src/IO/skip_comment_f.f90               | 31 ++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/src/Fortran_libraries/SERIAL_src/IO/skip_comment_f.f90 b/src/Fortran_libraries/SERIAL_src/IO/skip_comment_f.f90
index 6bc147e..1075add 100644
--- a/src/Fortran_libraries/SERIAL_src/IO/skip_comment_f.f90
+++ b/src/Fortran_libraries/SERIAL_src/IO/skip_comment_f.f90
@@ -3,6 +3,7 @@
 !!
 !!@authorH.Matsui and H.Okuda
 !!@date Programmed  H. Matsui in  Feb. 2001 
+!!@date Modified   H. Matsui in  Oct. 2013 
 !
 !> @brief subroutines to find comment lines in data
 !!
@@ -15,6 +16,9 @@
 !!
 !!      subroutine change_2_upper_case(string)
 !!      subroutine change_2_lower_case(string)
+!!      integer function compare_ignore_cases(ref_chara, cmp_chara)
+!!          if ref_chara and cmp_chara are same ignoreing case,
+!!          returns 1, othewwise returns 0
 !!@endverbatim
 !
       module skip_comment_f
@@ -159,4 +163,31 @@
 !
 !-----------------------------------------------------------------------
 !
+      integer function compare_ignore_cases(ref_chara, cmp_chara)
+!
+      character*(*), intent(in) :: ref_chara
+      character(len=kchara), intent(in) :: cmp_chara
+      character(len=kchara)  :: ref_tmp, cmp_tmp
+      integer(kind = kint) :: len
+!
+!
+      len = len_trim(ref_chara)
+      if(len_trim(cmp_chara) .ne. len) then
+        compare_ignore_cases = 0
+        return
+      end if
+!
+      write(ref_tmp,'(a)')  ref_chara
+      write(cmp_tmp,'(a)')  cmp_chara
+      call change_2_lower_case(ref_tmp)
+      call change_2_lower_case(cmp_tmp)
+!
+      compare_ignore_cases = 0
+      if(ref_tmp .eq. cmp_tmp) compare_ignore_cases = 1
+      return
+!
+      end function compare_ignore_cases
+!
+!-----------------------------------------------------------------------
+!
       end module skip_comment_f



More information about the CIG-COMMITS mailing list