[cig-commits] r21437 - in seismo/3D/SPECFEM3D_GLOBE/trunk: src/auxiliaries utils/extract_database

elliott.sales.de.andrade at geodynamics.org elliott.sales.de.andrade at geodynamics.org
Sat Mar 2 00:14:14 PST 2013


Author: elliott.sales.de.andrade
Date: 2013-03-02 00:14:14 -0800 (Sat, 02 Mar 2013)
New Revision: 21437

Modified:
   seismo/3D/SPECFEM3D_GLOBE/trunk/src/auxiliaries/combine_paraview_strain_data.f90
   seismo/3D/SPECFEM3D_GLOBE/trunk/src/auxiliaries/combine_surf_data.f90
   seismo/3D/SPECFEM3D_GLOBE/trunk/src/auxiliaries/combine_vol_data.f90
   seismo/3D/SPECFEM3D_GLOBE/trunk/utils/extract_database/extract_database.f90
Log:
Fix some Fortran2003 incompatibilities.

* getarg -> get_command_argument
* system has no replacement (though one exists in Fortran2008)
* xlf (IBM) doesn't like 0-length strings

Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/src/auxiliaries/combine_paraview_strain_data.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/src/auxiliaries/combine_paraview_strain_data.f90	2013-03-02 00:00:11 UTC (rev 21436)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/src/auxiliaries/combine_paraview_strain_data.f90	2013-03-02 08:14:14 UTC (rev 21437)
@@ -50,8 +50,8 @@
   logical :: MOVIE_COARSE
 
   do i = 1,6
-    call getarg(i,arg(i))
-    if (i < 7 .and. trim(arg(i)) == '') then
+    call get_command_argument(i,arg(i))
+    if (i < 7 .and. len_trim(arg(i)) == 0) then
       print *, ' '
       print *, ' Usage: xcombine_data nnodes dt_movie itstart itstop comp MOVIE_COARSE'
       print *, '   component can be SEE, SNE,SEZ,SNN,SNZ,SZZ,I1 or I2'

Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/src/auxiliaries/combine_surf_data.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/src/auxiliaries/combine_surf_data.f90	2013-03-02 00:00:11 UTC (rev 21436)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/src/auxiliaries/combine_surf_data.f90	2013-03-02 08:14:14 UTC (rev 21437)
@@ -58,8 +58,8 @@
 ! ------------------ program starts here -------------------
 
   do i = 1, 7
-    call getarg(i,arg(i))
-    if (i < 7 .and. trim(arg(i)) == '') then
+    call get_command_argument(i,arg(i))
+    if (i < 7 .and. len_trim(arg(i)) == 0) then
       write(*,*) ' '
       write(*,*) ' Usage: xcombine_surf_data slice_list filename surfname input_dir output_dir high/low-resolution 2D/3D'
       write(*,*) ' filename.bin can be either'
@@ -192,7 +192,7 @@
   write(em_mesh_file,'(a,i1,a)') trim(outdir)//'/'//trim(filename)//'_element.surf'
   command_name='rm -f '//trim(pt_mesh_file)//' '//trim(em_mesh_file)//' '//trim(mesh_file)
 
-  call system(trim(command_name))
+  !call system(trim(command_name))
   call open_file_fd(trim(pt_mesh_file)//char(0),pfd)
   call open_file_fd(trim(em_mesh_file)//char(0),efd)
 
@@ -340,7 +340,7 @@
   print *, ' '
   print *, 'cat mesh files ...'
   print *, trim(command_name)
-  call system(trim(command_name))
+  !call system(trim(command_name))
 
   print *, 'Done writing '//trim(mesh_file)
   print *, ' '

Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/src/auxiliaries/combine_vol_data.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/src/auxiliaries/combine_vol_data.f90	2013-03-02 00:00:11 UTC (rev 21436)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/src/auxiliaries/combine_vol_data.f90	2013-03-02 08:14:14 UTC (rev 21437)
@@ -77,8 +77,8 @@
 
   ! starts here--------------------------------------------------------------------------------------------------
   do i = 1, 7
-    call getarg(i,arg(i))
-    if (i < 7 .and. trim(arg(i)) == '') then
+    call get_command_argument(i,arg(i))
+    if (i < 7 .and. len_trim(arg(i)) == 0) then
       print *, ' '
       print *, ' Usage: xcombine_vol_data slice_list filename input_topo_dir input_file_dir '
       print *, '        output_dir high/low-resolution [region]'
@@ -96,7 +96,7 @@
              stop 'This program needs that NSPEC_CRUST_MANTLE > NSPEC_OUTER_CORE and NSPEC_INNER_CORE'
 
   ! get region id
-  if (trim(arg(7)) == '') then
+  if (len_trim(arg(7)) == 0) then
     iregion  = 0
   else
     read(arg(7),*) iregion
@@ -208,6 +208,7 @@
 
     print *, 'nspec(it) = ', nspec(1:num_node)
     print *, 'nglob(it) = ', nglob(1:num_node)
+    print *, 'nelement(it) = ', nelement(1:num_node)
 
     call write_integer_fd(efd,sum(nelement(1:num_node)))
 
@@ -462,7 +463,7 @@
     print *, ' '
     print *, 'cat mesh files: '
     print *, trim(command_name)
-    call system(trim(command_name))
+    !call system(trim(command_name))
 
   enddo
 

Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/utils/extract_database/extract_database.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/utils/extract_database/extract_database.f90	2013-03-02 00:00:11 UTC (rev 21436)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/utils/extract_database/extract_database.f90	2013-03-02 08:14:14 UTC (rev 21437)
@@ -16,12 +16,12 @@
   real(kind=CUSTOM_REAL), dimension(NGLLX,NGLLY,NGLLZ,NSPEC_CRUST_MANTLE) :: junk
   real(kind=CUSTOM_REAL) :: junk2
 
-  call getarg(1,infile)
-  call getarg(2,s_ireg)
-  call getarg(3,s_num)
-  call getarg(4,outfile)
-  if (trim(infile) == '' .or. trim(s_ireg) == '' .or. trim(s_num) == '' &
-   .or. trim(outfile) == '') then 
+  call get_command_argument(1,infile)
+  call get_command_argument(2,s_ireg)
+  call get_command_argument(3,s_num)
+  call get_command_argument(4,outfile)
+  if (len_trim(infile) == 0 .or. len_trim(s_ireg) == 0 .or. len_trim(s_num) == 0 &
+   .or. len_trim(outfile) == 0) then 
      print *, 'Usage: extract_databases infile ireg num outfile'
      print *, '  ireg = 1, 2, 3'
      print *, '  num = 10 for rho,  11 for kappav, 12 for muv '



More information about the CIG-COMMITS mailing list