- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dears
I used "gofr" for get some properties from output of Molecular dynamic simualtion
this code do caculation in 3D, in my system existed some layers of molecule that located in z direction
I need ddefine this code for peroperties for each layers.
I need insert "if" statement same :
"if(zzz.ge.1.and.zzz.le.3)then "that calculation foratoms that have zcoordinate between 1 to 3
this comanad is correct? do I use "zzz" for zcoordinate of atoms? or other parameter?
which line is appropriate for insert "if" and which line is appropriate for insert "endif"?
Thanks
I used "gofr" for get some properties from output of Molecular dynamic simualtion
this code do caculation in 3D, in my system existed some layers of molecule that located in z direction
I need ddefine this code for peroperties for each layers.
I need insert "if" statement same :
"if(zzz.ge.1.and.zzz.le.3)then "that calculation foratoms that have zcoordinate between 1 to 3
this comanad is correct? do I use "zzz" for zcoordinate of atoms? or other parameter?
which line is appropriate for insert "if" and which line is appropriate for insert "endif"?
Thanks
Link Copied
6 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you phrase your question in terms of some application area, such as molecular dynamics or options pricing or drug assimilation, you will drastically reduce the number of people who are able to help you.
What are the units of 'zzz'? Angstroms? Nanometers? ...? Or are you confusing the array elements and their integer indices, as in 'zzz=xyz(3,i)'. Since zzz is declared real, what prevents it from have non-integral values? Are 1,2 and 3 possible values for zzz?
In terms of Fortran, perhaps this is what you seek:
if(zzz.ge.1d0.and.zzz.le.3d0)then
...
<= zzz <= 3
...
endif
What are the units of 'zzz'? Angstroms? Nanometers? ...? Or are you confusing the array elements and their integer indices, as in 'zzz=xyz(3,i)'. Since zzz is declared real, what prevents it from have non-integral values? Are 1,2 and 3 possible values for zzz?
In terms of Fortran, perhaps this is what you seek:
if(zzz.ge.1d0.and.zzz.le.3d0)then
...
...
endif
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear Mecej4
thanks for reply,
in this code unit of zzz as angstroms. and I have one layer between 1 to 3 angestrom (location need to analyzed).
are you agreement with "zzz" parameter for limtation calculation in z direction? or other parameter az xyz need be define for this purpose?
thanks
thanks for reply,
in this code unit of zzz as angstroms. and I have one layer between 1 to 3 angestrom (location need to analyzed).
are you agreement with "zzz" parameter for limtation calculation in z direction? or other parameter az xyz need be define for this purpose?
thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
> are you agreement with "zzz" parameter for limtation calculation in z direction?
Sorry, that is not a programming question, but one for an atomic physicist -- which I am not!
Sorry, that is not a programming question, but one for an atomic physicist -- which I am not!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ok Thanks,
I found manual that introduce "zzz" is z component of position atoms, then "zzz" s correct.
now , where lines(line number) are suitable for insert "if" and "endif"????
what difference between these two commands?
if(zzz.ge.1.and.zzz.le.3)then and if(zzz.ge.1d0.and.zzz.le.3d0)then
I found manual that introduce "zzz" is z component of position atoms, then "zzz" s correct.
now , where lines(line number) are suitable for insert "if" and "endif"????
what difference between these two commands?
if(zzz.ge.1.and.zzz.le.3)then and if(zzz.ge.1d0.and.zzz.le.3d0)then
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
>what difference between these two commands?
Neither is a command -- these are lines of source code in a compiled language.
The difference is that the first version involves mixed mode (real and integer). It would be erroneous to compare the memory locations directly. The rules of the language provide that the integers 1 and 3 be converted to the same type as zzz before the comparisons are made. In the second version, the items compared are already of the same type.
Try this example
Neither is a command -- these are lines of source code in a compiled language.
The difference is that the first version involves mixed mode (real and integer). It would be erroneous to compare the memory locations directly. The rules of the language provide that the integers 1 and 3 be converted to the same type as zzz before the comparisons are made. In the second version, the items compared are already of the same type.
Try this example
[fxfortran] real*8 z z=4 if(z/3.eq.1.3333333)write(*,*)'z/3 = 1.3333333 is true' if(z/3.eq.4d0/3)write(*,*)'z/3 = 4d0/3 is true' if(z/3.eq.4.0/3)write(*,*)'z/3 = 4.0/3 is true' end [/fxfortran]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
what's your idea about line that insert 'if" statement.??
what's your idea about line that insert 'if" statement.??

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page