2
0
mirror of https://github.com/LCPQ/DEHam synced 2024-07-30 17:14:19 +02:00

Fixed bugs for bool type and precision.

This commit is contained in:
v1j4y 2022-05-16 18:38:53 +02:00
parent 87bacf09db
commit ce1dc54b3d
4 changed files with 11 additions and 7 deletions

View File

@ -3,7 +3,7 @@
implicit none implicit none
integer :: i integer :: i
real*8 :: xmatd real*8,intent(inout) :: xmatd
logical :: yw logical :: yw
! write(6,*)'in elem_diag' ! write(6,*)'in elem_diag'
@ -32,6 +32,7 @@
if(deter(i).ne.3) xmatd = xmatd + E(i) if(deter(i).ne.3) xmatd = xmatd + E(i)
enddo enddo
xmatd = xmatd - E(natom+1) xmatd = xmatd - E(natom+1)
if(yw)write(6,*)'xmatd=',xmatd
!-----stockage de l element diag !-----stockage de l element diag

View File

@ -195,7 +195,7 @@ int main(int argc,char **argv)
/* /*
Save eigenvectors, if == ested Save eigenvectors, if == ested
*/ */
EPSGetConverged(eps,&nconv); ierr = EPSGetConverged(eps,&nconv);CHKERRQ(ierr);
if (getdata.print_wf) { if (getdata.print_wf) {
PetscViewerASCIIOpen(PETSC_COMM_WORLD,filename,&viewer); PetscViewerASCIIOpen(PETSC_COMM_WORLD,filename,&viewer);
PetscViewerSetFormat(viewer,PETSC_VIEWER_ASCII_MATLAB); PetscViewerSetFormat(viewer,PETSC_VIEWER_ASCII_MATLAB);

View File

@ -26,6 +26,7 @@
count1=0 count1=0
count2=1 count2=1
tistart2=tistart tistart2=tistart
xmat=0.0d0
do j=1,nrows do j=1,nrows

View File

@ -32,7 +32,9 @@ void Data_new(FILE* file, Data* dat) {
dat->isz=atol(line); dat->isz=atol(line);
break; break;
case 6: case 6:
dat->FAM1 = to_bool(line); //dat->FAM1 = to_bool(line);
dat->FAM1 = 0;
dat->FAM1 = line && strcmp(line,"true")==0;
break; break;
case 7: case 7:
arrayIdx=0; arrayIdx=0;
@ -115,7 +117,7 @@ void Data_new(FILE* file, Data* dat) {
/** /**
* Convert the next token to a float value * Convert the next token to a float value
*/ */
val = strtof(token, &unconverted); val = strtod(token, &unconverted);
if (!isspace(*unconverted) && *unconverted != 0) if (!isspace(*unconverted) && *unconverted != 0)
{ {
/** /**
@ -139,7 +141,7 @@ void Data_new(FILE* file, Data* dat) {
/** /**
* Convert the next token to a float value * Convert the next token to a float value
*/ */
val = strtof(token, &unconverted); val = strtod(token, &unconverted);
if (!isspace(*unconverted) && *unconverted != 0) if (!isspace(*unconverted) && *unconverted != 0)
{ {
/** /**
@ -163,7 +165,7 @@ void Data_new(FILE* file, Data* dat) {
/** /**
* Convert the next token to a float value * Convert the next token to a float value
*/ */
val = strtof(token, &unconverted); val = strtod(token, &unconverted);
if (!isspace(*unconverted) && *unconverted != 0) if (!isspace(*unconverted) && *unconverted != 0)
{ {
/** /**
@ -187,7 +189,7 @@ void Data_new(FILE* file, Data* dat) {
/** /**
* Convert the next token to a float value * Convert the next token to a float value
*/ */
val = strtof(token, &unconverted); val = strtod(token, &unconverted);
if (!isspace(*unconverted) && *unconverted != 0) if (!isspace(*unconverted) && *unconverted != 0)
{ {
/** /**