how use variable in call system command in fortran? example ,if want create multiple directories
test_1_1 test_1_2 , on till test_3_3
then should code be.
i trying following code can't seem figure out write in #### part.
integer :: i,j ! = 1,3 j = 1,3 ! call system('mkdir folder ####) enddo enddo
character (len=8) :: test_name i=1, 3 j=1, 3 write (test_name, '( "test_", i1, "_", i1 )' ) i, j call system ( "mkdir " // test_name ) end end
the format in example work long numbers single digits. if want larger values use i2.2
(for 2 digits, leading zero, if single digits), or i0
, whatever number of digits needed.
Comments
Post a Comment