TABLE OF CONTENTS


ABINIT/init10 [ Functions ]

[ Top ] [ Functions ]

NAME

 init10

FUNCTION

 Initialize the code multibinit: write heading and make the first i/os

INPUTS

  character(len=fnlen) input_path: gives the name of the input file.
 If not given, the files file are then used with a deprecation message.

OUTPUT

 character(len=fnlen) filnam(18)=character strings giving file names

NOTES

 1. Should be executed by one processor only.
 2. File names refer to following files, in order:
     (1) Formatted input file
     (2) Formatted output file
     (3) Input for reference structure and harmonic part (DDB file or XML)
     (4) Input for XML with polynomial coefficients (DDB file)
     (5) Input for HIST Training-Set file (netcdf .nc format)
     (6) Input for HIST Test-Set file (netcdf .nc format)
     (7-18) Input Derivative Database (XML format)

SOURCE

 70 subroutine init10(input_path, filnam,comm)
 71 
 72  use defs_basis
 73  use m_xmpi
 74  use m_errors
 75 
 76  use m_fstrings,     only : int2char4
 77  use m_io_tools,     only : open_file
 78 
 79  implicit none
 80 
 81 !Arguments -------------------------------
 82 !scalars
 83  integer,intent(in) :: comm
 84  character(len=fnlen), intent(in) :: input_path
 85 !arrays
 86  character(len=fnlen),intent(out) :: filnam(18)
 87 
 88 !Local variables--------------------------
 89 !scalars
 90  integer,parameter :: master=0
 91  integer :: me,nproc,ierr
 92  integer :: ii,io, i1, i2
 93 
 94  character(len=fnlen) :: fname
 95 ! *********************************************************************
 96 
 97 !Determine who I am in comm
 98  me = xmpi_comm_rank(comm)
 99  nproc = xmpi_comm_size(comm)
100 
101  filnam(:) = ""
102 
103  if (me==master)then
104     if (len_trim(input_path) == 0) then
105        ! Legacy Files file mode.
106        write(std_out, "(2a)")" DeprecationWarning: ",ch10
107        write(std_out, "(a)") "     The files file has been deprecated in Abinit9 and will be removed in Abinit10."
108        write(std_out, "(a)")"     Use the syntax `multibinit t01.abi` where t01.abi is an input."
109        !Read the file names
110        write(std_out,*)' Give name for      formatted input file : '
111        read(std_in, '(a)',IOSTAT=io) filnam(1)
112        write(std_out,'(a,a)' )'-   ',trim(filnam(1))
113        write(std_out,*)' Give name for     formatted output file : '
114        read(std_in, '(a)',IOSTAT=io) filnam(2)
115        write(std_out,'(a,a)' )'-   ',trim(filnam(2))
116        write(std_out,*)' Give name for input derivative database of reference structure',&
117             &                  ' (DDB or XML file): '
118        read(std_in, '(a)',IOSTAT=io) filnam(3)
119        write(std_out,'(a,a)' )'-   ',trim(filnam(3))
120        write(std_out,*)' Give name for input coefficients from fitted polynomial',&
121             &                  ' (XML file or enter no): '
122        read(std_in, '(a)',IOSTAT=io) filnam(4)
123        write(std_out,'(a,a)' )'-   ',trim(filnam(4))
124        write(std_out,*)' Give name for training-set file',&
125             &                  ' (netcdf file or enter no): '
126        read(std_in, '(a)',IOSTAT=io) filnam(5)
127        write(std_out,'(a,a)' )'-   ',trim(filnam(5)) 
128        write(std_out,*)' Give name for test-set file',&
129             &                  ' (netcdf file or enter no): '
130        read(std_in, '(a)',IOSTAT=io) filnam(6)
131        write(std_out,'(a,a)' )'-   ',trim(filnam(6)) 
132        ii = 7
133        do while (io>=0 .and. ii<19)
134           write(std_out,*)' Give name for input derivative database (DDB or XML file): '
135           read(std_in, '(a)',IOSTAT=io) filnam(ii)
136           write(std_out,'(a,a)' )'-   ',trim(filnam(ii))
137           if(trim(filnam(ii))==" ") exit
138           ii = ii + 1
139        end do
140     else
141        filnam(1)=input_path
142        filnam(2) = trim(input_path)//".abo"
143 
144        fname = basename(input_path)
145        i1 = index(fname, ".")
146        if (i1 > 1) then
147           i2 = index(input_path, ".", back=.True.)
148           filnam(2) = input_path(:i2) // "abo"
149           ! The rest filnam(3:) are set after reading from input file.
150           ! as in postfix_filenames subroutine
151        end if
152     end if
153  end if
154 
155 
156 !Communicate filenames to all processors
157  call xmpi_bcast (filnam, master, comm, ierr)
158 
159 end subroutine init10

ABINIT/m_init10 [ Modules ]

[ Top ] [ Modules ]

NAME

  m_init10

FUNCTION

   It should be "contained" in multibinit but abilint does not accept "contains" in programs.

COPYRIGHT

  Copyright (C) 2008-2024 ABINIT group ()
  This file is distributed under the terms of the
  GNU General Public License, see ~abinit/COPYING
  or http://www.gnu.org/copyleft/gpl.txt .

SOURCE

16 #if defined HAVE_CONFIG_H
17 #include "config.h"
18 #endif
19 
20 #include "abi_common.h"
21 
22 module m_init10
23 
24  use defs_basis
25  use m_errors
26  use m_abicore
27  use m_fstrings,     only : int2char4, rmquotes, sjoin, strcat, basename
28  use m_multibinit_dataset, only: multibinit_dtset_type
29 
30  implicit none
31 
32  private