- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello. In MSC.Marc with the Intel XE 2015 Fortran compiler there is the demonstration example e8x94c.dat on deformation of a plate. Without use of file u8x94c.f on Fortran with the method usplit_mesh, shown below, deformation of a plate is run without a splitting of faces of the hexagon finite elements. After adding file u8x94c.f, deformation of a plate is run with a splitting of faces (written above in code in the method usplit_mesh) of hexagon finite elements.
In file u8x94c.f is declared the method usplit_mesh with ten parameters, stated below. From the theory of programming it is known, that the method usplit_mesh is not run, until it is called with a task of certain values for all ten parameters, for example with the value “1” for the variable “icall”. At running of the demonstration example e8x94c.dat on deformation of a plate with use of file u8x94c.f with method usplit_mesh, somewhere is called the method usplit_mesh with the certain values for all ten parameters, but where is called, it is unknown.
What code should be written in the method usplit_mesh, shown below, to learn, where the method usplit_mesh is called? Thanks.
subroutine usplit_mesh(icall,nodelist,nlist,iedgelist,nedgelist,
$ ifacelist,nfacelist,inc,time,timeinc)
#ifdef _IMPLICITNONE
implicit none
#else
implicit logical (a-z)
#endif
integer nodelist,nlist,iedgelist,nedgelist,ifacelist,nfacelist
integer icall,inc
real*8 time,timeinc
dimension nodelist(*),iedgelist(2,*),ifacelist(4,*)
integer num,i,alt
if (icall.eq.1) then
alt=3
c alternative 1: specify a sequence of nodes
if (alt.eq.1) then
nlist=7
num=0
do i=57,63
num=num+1
nodelist(num)=i
enddo
elseif (alt.eq.2) then
c alternative 2: specify a list of edges in any order
nedgelist=6
iedgelist(1,1)=57
iedgelist(2,1)=58
iedgelist(1,2)=62
iedgelist(2,2)=63
iedgelist(1,3)=59
iedgelist(2,3)=60
iedgelist(1,4)=58
iedgelist(2,4)=59
iedgelist(1,5)=60
iedgelist(2,5)=61
iedgelist(1,6)=61
iedgelist(2,6)=62
elseif (alt.eq.3) then
c 3d: give a list of faces
nfacelist=4
ifacelist(1,1)=819
ifacelist(2,1)=817
ifacelist(3,1)=822
ifacelist(4,1)=824
c
ifacelist(1,2)=817
ifacelist(2,2)=57
ifacelist(3,2)=58
ifacelist(4,2)=822
c
ifacelist(1,3)=829
ifacelist(2,3)=827
ifacelist(3,3)=822
ifacelist(4,3)=824
c
ifacelist(1,4)=822
ifacelist(2,4)=827
ifacelist(3,4)=58
ifacelist(4,4)=59
endif
endif
return
end
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you read that, it was incorrect. Visual Studio Express Edition has never supported anything other than Microsoft languages (and it came into existence long after Microsoft left the Fortran market.) (One could do command-line builds of Fortran, but not debugging, with Visual Studio Express Editions.)
However, Microsoft now offers Visual Studio Community Edition for free, if you qualify, and it does support Intel Fortran. You will need the latest version of Intel Parallel Studio XE 2017 (Update 4) to support Visual Studio 2017 Community Edition.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for answers.
In two code lines, brought above:
16 |
open( file='icall.log', newunit=lun, status='unknown', |
17 |
+ access='append' ) |
my Intel Visual Fortran Compiler XE 15.0.3 for Windows 7 shows the following errors:
C:\temp\e8x94c_var27\u8x94c.f(16): error #5082: Syntax error, found END-OF-STATEMENT when expecting one of: ( * <IDENTIFIER> <CHAR_CON_KIND_PARAM> <CHAR_NAM_KIND_PARAM> <CHARACTER_CONSTANT> ...
open( file='icall.log', newunit=lun, status='unknown',
--------------------------------------------------------------------^
C:\temp\e8x94c_var27\u8x94c.f(17): error #5276: Unbalanced parentheses
+ access='append' )
------------------------------------^
C:\temp\e8x94c_var27\u8x94c.f(17): error #5082: Syntax error, found '+' when expecting one of: <LABEL> <END-OF-STATEMENT> ; BLOCK PROGRAM BLOCKDATA MODULE INTEGER REAL COMPLEX ...
+ access='append' )
-------------^
I changed these two code lines in different variants, but errors do not disappear. Such impression, that we have different compilers of Intel, and if your compiler does not find an error, then my compiler finds errors.
Write, please, as to me to write these two code lines for my Intel Visual Fortran Compiler XE 15.0.3 for Windows 7, that there were no errors. Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The code should work in ANY version, attach your source file an we can see what is wrong.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Most probably, Valery has introduced blanks and tabs by copying the code and pasting in Notepad. If he does not follow the advice to learn the basic syntax rules of Fortran and the rules for fixed form Fortran (see #21), such hurdles will persist.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for answers.
Mr. Andrew_4619, I copied your advanced and already debugged (in what editor?) code, which you kindly provided above, inserted into Word, and then from Word, by 1st variant, inserted into Notepad, deleted row numbers, saved as the u8x94c.f file, added to Marc, at a solution of the example e8x94c.dat, Marc connected the Intel Visual Fortran Compiler XE 15.0.3 and in the *.log file Marc displayed those errors, which I showed in the previous post. By the 2nd variant, I inserted your code from Word not into Notepad, and into Visual Studio 2017 (File, New, File, Text File, Open) and further received the same errors, as VS 2017 does not give the chance to debug a code on Fortran.
As I understood Mr. Mecej4, for editing the advanced code of Mr. Andrew_4619, it is necessary to use not Notepad, and some other editor.
What editor and debugger of code on Fortran I should use instead of Notepad for editing the code of Mr. Andrew_4619, that after adding in Marc, I did not receive the error messages? Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
go back to #21/Notepad words just fine. WORD is a disaster stay away!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for answers.
Mr. Andrew_4619, in #19 in your 1st program, I clicked the <> icon, inserted into Notepad, passing Word, saved as u8x94c.f, added to Marc, and Marc with the Intel Visual Fortran Compiler XE 15.0.3 solved the example e8x94c.dat without errors.
But when from #19, in Notepad, to your 1st program, I added from #19 your following 2nd program:
program main
implicit none
integer :: nlist, nedgelist, nfacelist
integer :: nodelist(7), iedgelist(2,6), ifacelist(4,6)
integer :: icall, inc
real(8) :: time, timeinc
do ICALL = 1, 3
call usplit_mesh(icall,nodelist,nlist,iedgelist,nedgelist,ifacelist,nfacelist,inc,time,timeinc)
enddo
end program main
that the following errors appeared:
ifort /fpp /c /DWIN32_intel -D_IMPLICITNONE /nologo /integer_size:64 -DI64 -DMKL -DOPENMP -DOMP_COMPAT -D_MSCMARC -DWIN64 /I"C:\MSC.Software\Marc\2016.0.0\marc2016\common" /I"C:\MSC.Software\Marc\2016.0.0\marc2016\bcsgpusolver\common" /I"C:\MSC.Software\Marc\2016.0.0\marc2016\mumpssolver\include" /I"C:\MSC.Software\Marc\2016.0.0\marc2016\intelmpi\win64\include" /O2 /Qip /Qvec- /Qsafe-cray-ptr /switch:fe_old_modvar /W0 /Qopenmp /Qopenmp-threadprivate:compat -DCASI -DPARDISO -DMUMPS -DBCSGPU -DCUDA /MD -DDDM /object:"C:\Users\Valerij\u8x94c.obj" "C:\temp\e8x94c_var29\u8x94c.f"
C:\temp\e8x94c_var29\u8x94c.f(69): error #5082: Syntax error, found END-OF-STATEMENT when expecting one of: ( * ) :: , . % + - [ : . ** / // .LT. < .LE. <= .EQ. == ...
call usplit_mesh(icall,nodelist,nlist,iedgelist,nedgelist,ifacel
------------------------------------------------------------------------^
C:\temp\e8x94c_var29\u8x94c.f(69): error #6404: This name does not have a type, and must have an explicit type. [IFACEL]
call usplit_mesh(icall,nodelist,nlist,iedgelist,nedgelist,ifacel
------------------------------------------------------------------^
compilation aborted for C:\temp\e8x94c_var29\u8x94c.f (code 1)
compile failed for C:\Users\Valerij\u8x94c.f
Marc Exit number 3
If to comment out a line “implicit none”, then the 2nd error disappears, but the 1st error remains.
Write, please, how to me to add your 2nd program, that at a solution of an example e8x94c.dat, Marc with the Intel Visual Fortran Compiler XE 15.0.3 did not give an error message? Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
works for me, you did have Encoding ANSI set at the bottom of notepad?
Attach the file to a post.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Valery, Andrew's main program is for testing the subroutine usplit_mesh() outside Marc. Typically, you do so at the command line or in Visual Studio.
FEA packages such as Marc are set up to call a compiler such as Ifort to compile and link a DLL, which the package can then call. You cannot build a DLL out of a Fortran main program. Even if you fix the syntax errors in the source and compile the main program using Marc+IFort, the linking phase will fail, no DLL will be produced, and you will have wasted your time and efforts.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
mecej4 wrote:
Valery, Andrew's main program is for testing the subroutine usplit_mesh() outside Marc. Typically, you do so at the command line or in Visual Studio.
FEA packages such as Marc are set up to call a compiler such as Ifort to compile and link a DLL, which the package can then call. You cannot build a DLL out of a Fortran main program. Even if you fix the syntax errors in the source and compile the main program using Marc+IFort, the linking phase will fail, no DLL will be produced, and you will have wasted your time and efforts.
From the output shown the sub-program is being compiled by MARC and failing....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mr. Andrew and Mr. Mecej, thanks for answers.
Yes, I did have Encoding ANSI set at the bottom of Notepad.
Mr. Andrew, in #19 in your 1st program, I clicked the <> icon, inserted into Notepad, passing Word, saved as u8x94c.f, added to Marc, and Marc with the Intel Visual Fortran Compiler XE 15.0.3 solved the example e8x94c.dat without errors. To two files e8x94c.dat and u8x94c.f, Marc creates the 6 more files: *.mud, *_job1.dat, *_job1.log, *_job1.out, *_job1.sts, *_job1.t16. Attach file *_job1.log or any other?
But when from #19, in Notepad, to your 1st program, I added from #19 your 2nd program, there were errors. Marc creates only one short file *_job1.log, which I wrote in the previous post in a short form.
I attach this file *_job1.log.
Write, please, how to me to add your 2nd program, that at a solution of an example e8x94c.dat, Marc with the Intel Visual Fortran Compiler XE 15.0.3 did not give an error message? Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Attach u8x94c.f,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mr. Andrew, I attach the u8x94c.f file, which gives the errors, given in the model39_job1.log file, which I attached in the previous post.
If in this u8x94c.f file to delete your 2nd program “program main” from #19, Marc with the Intel Visual Fortran Compiler XE 15.0.3 solved the example e8x94c.dat without errors and with the files, specified in the previous post.
Help to correct errors, please.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That is clear now. See #19 item 4] and #29
Delete lines 62 to 71 (program Main .... end program main. This is NOT part of U8x94c.f
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for answers.
Mr. Andrew, and why your 2nd program (program main .... end program main) from #19 is necessary and how to use it? Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
using the two Fortran files you can make a program in Visual Studio not using Marc at all. You can run this using the debugger and step through the program as it runs and examine values of variables etc. for me this achieves 2 things:
1] You can test that the Fortran is legal and compiles OK
2] you can do some simple checks that the logic in your user routine makes sense and works as you expect it to, Once you put it it Marc there is an extra level of complexity added and in my experience of such things an FEA analysis may run for a long time before and error in a user routine might get exposed so it saves time.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for answers.
After a solution in Marc with the Intel Visual Fortran Compiler XE 15.0.3 of this example e8x94c.dat with file u8x94c.f, which is loaded above (without “program main”), with the declared subroutine usplit_mesh:
subroutine usplit_mesh(icall,nodelist,nlist,iedgelist,nedgelist,
$ ifacelist,nfacelist,inc,time,timeinc)
with use of the block of code, which was kindly added Mr. Andrew and Mr. Mecej:
lun = 0
open( file='icall.log', newunit=lun, status='unknown',
+ access='append' )
if (lun /= 0) then
write(lun,'(1x,I6,2x,A,2x,i12)') lun,'ICALL = ',icall
close(lun)
lret = setenvqq("FOR_DIAGNOSTIC_LOG_FILE=icall.log")
CALL TRACEBACKQQ("My application message string",
+ user_exit_code=-1)
end if
in the folder C, Users, Valerij, in the file icall.log, the next 22 lines are written:
-129 ICALL = 1
-130 ICALL = 3
-131 ICALL = 2
-132 ICALL = 3
-133 ICALL = 2
-134 ICALL = 3
-135 ICALL = 2
-136 ICALL = 3
-137 ICALL = 2
-138 ICALL = 3
-139 ICALL = 2
-140 ICALL = 3
-141 ICALL = 2
-142 ICALL = 3
-143 ICALL = 2
-144 ICALL = 3
-145 ICALL = 2
-146 ICALL = 3
-147 ICALL = 2
-148 ICALL = 3
-149 ICALL = 2
-150 ICALL = 3
In this example e8x94c.dat it is set, that the plate is deformed for 10 increments. The subroutine usplit_mesh, declared in file u8x94c.f, is not run out until it is called. Therefore, on each “inc”, subroutine usplit_mesh is called 22 times with values for icall, equal 1, 3, 2, 3, 2, … And only at icall=1, are performed the operations, leading to the deformation of the plate for 1 increment.
After a solution of this example e8x94c.dat, Marc displays the following records:
Command > *import marc_read "..\..\temp\e8x94c_var31\e8x94c.dat"
INFO: File ..\..\temp\e8x94c_var31\e8x94c.dat has been imported.
It has been assumed that the data is defined
in the same length unit as the current model (millimeter).
Command > *edit_job job1
Enter edit job :
Command > *edit_job job1
Enter edit job : *update_job
Enter edit job : *job_usersub_file ..\..\temp\e8x94c_var31\u8x94c.f
Command > *submit_job 1 *monitor_job
INFO: Analysis dimension is derived from element class hex8.
INFO: Assuming 3-D analysis!
INFO: Found 0 errors and 0 warnings.
C:\MSC.Software\Marc\2016.0.0\mentat2016\bin\submit1.bat marc default 1 1 - - model41_job1 ..\..\temp\e8x94c_var31\u8x94c.f - - - - 0 n n - - 0 1 1 0 - -
Job job1 submitted!
How to define, where in Marc is called the subroutine usplit_mesh with specific values 1, 3, 2, 3, 2, … for icall? Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
valery z. wrote:
How to define, where in Marc is called the subroutine usplit_mesh with specific values 1, 3, 2, 3, 2, … for icall? Thanks.
Absolutely no idea, I am not expert in use of Marc, I have used it maybe 20 years ago. Those questions are better in a Marc user forum not a Fortran user forum.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Valery Z wrote:
How to define, where in Marc is called the subroutine usplit_mesh with specific values 1, 3, 2, 3, 2, … for icall?
As stated in #11 and the preceding post by Andrew_4619, this is not a forum in which that question is likely to be answered. Furthermore, since Marc is proprietary software, the proprietor may regard the answer as privileged information.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for answers.
Many versions of Fortran are known. What Fortran version is applied in Marc with the Intel Visual Fortran Compiler XE 15.0.3, for example in file u8x94c.f, which is loaded above, and by what international standard this version of Fortran is protected? Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If your source file has USE statements, you are using a Fortran 90/95 feature. If you do not use modules, and your source code is in fixed form, Fortran 77 is probably sufficient.
Fortran 77 documentation is considerably shorter than Fortran 95 documentation.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for answers.
Mr. Andrew, explain, please, in #19 in what systems you received, and how it is necessary to understand the following data, obtained by you? Thanks.
…
04 |
libifcoremdd.dll 5C295B1B Unknown Unknown Unknown |
|
05 |
functest.exe 008C12AA _USPLIT_MESH 22 Source2.for |
06 |
functest.exe 008C1081 _MAIN__ 8 Source1.f90 |
|
07 |
functest.exe 008C18AF Unknown Unknown Unknown |
08 |
functest.exe 008C4209 Unknown Unknown Unknown |
09 |
functest.exe 008C434D Unknown Unknown Unknown |
10 |
KERNEL32.DLL 76F062C4 Unknown Unknown Unknown |
11 |
ntdll.dll 77A50FD9 Unknown Unknown Unknown |
12 |
ntdll.dll 77A50FA4 Unknown Unknown Unknown |
…
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page