- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear all,
I am probably doing something that is not possible.
I have created this variable in a general module:
TYPE tresultVar REAL :: pmean ! posterior mean for variable i REAL :: PM(4) REAL :: pstd ! posterior std deviation REAL :: PR(4) REAL :: NSET(4) ! ENDTYPE
After that I call a subroutine as:
CALL APMSUB(nVar,resapmVAR,res1RESULTSVAR,res2RESULTSVAR)
and the subroutione look like:
SUBROUTINE APMSUB(nVar,resultGV,result1V,result2V) USE VARS_DIAGNOSTIC USE mod_alngam IMPLICIT NONE INTEGER :: nVar TYPE(tresultVar) :: resultGV(nVar) TYPE(tresultVar) :: result1V(nVar) TYPE(tresultVar) :: result2V(nVar)
The var type in in the module VARS_DIAGNOSTIC
Where I write:
WRITE(*,*) size(resultGV(iVar)%PM)
I get, as expected: 4
However, if a write:
WRITE(*,*) resultGV(iVar)%PM
I get an error.
What am I doing wrong?
I am trying to do something that is not possible?
Thanks for any helps
Diedro
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Diedro, this is not s a complete code. All examples I tried to make from it, compiled. You get an error? What kind of error? A compilation error, a runtime error, the computer froze? You have to give more information.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear Juergen R. Dear all,
you are right. I get the following error:
forrtl: severe (174): SIGSEGV, segmentation fault occurred Image PC Routine Line Source a.out 0000000000460BBD Unknown Unknown Unknown libpthread-2.23.s 00007F69D3F49390 Unknown Unknown Unknown
Really thanks for any kind of help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That is a little more information, but not yet enough. So the program compiles and then exhibits a runtime error. The fact that the pthread library appears there raises my suspicion that you are linking some external tool/library into your program which uses more than one thread, and then you do a write operation. But possibly one needs a full reproducer here.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear Juergen R., dear all,
I have no external tool/library. However, I will try to make a simple test case by the end of tomorrow.
Thanks for the suggestions,
Diedro
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
diedro wrote:.. I attach the test case hoping that it can help in understanding this post, ..
@diedro,
I'll suggest you provide specific details on the code you are using and steps you are taking to compile and link and execute to get prompt and relevant guidance. Here's an example using a Windows console of what one can do:
C:\Temp>type VARS_DIAGNOSTIC.f90 MODULE VARS_DIAGNOSTIC ! ! TYPE tresultVar REAL :: PM(4) ENDTYPE ! ! ENDMODULE C:\Temp>ifort /c /standard-semantics /warn:all /stand VARS_DIAGNOSTIC.f90 Intel(R) Visual Fortran Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 19.0.1.144 Build 20181018 Copyright (C) 1985-2018 Intel Corporation. All rights reserved. C:\Temp>type MOD_TEST_SUB.f90 MODULE MOD_TEST_SUB CONTAINS SUBROUTINE TEST_SUB(nn,VARIN) USE VARS_DIAGNOSTIC IMPLICIT NONE INTEGER :: nn TYPE(tresultVar) :: VARIN(nn) VARIN(1)%PM(1) = 1. WRITE(*,*) VARIN(1)%PM ENDSUBROUTINE ENDMODULE C:\Temp>ifort /c /standard-semantics /warn:all /stand MOD_TEST_SUB.f90 Intel(R) Visual Fortran Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 19.0.1.144 Build 20181018 Copyright (C) 1985-2018 Intel Corporation. All rights reserved. C:\Temp>type TEST.f90 PROGRAM TEST USE VARS_DIAGNOSTIC USE MOD_TEST_SUB IMPLICIT NONE INTEGER :: nVar TYPE(tresultVar) , ALLOCATABLE:: VAR(:) nVar = 5 ALLOCATE(VAR(nVar)) CALL TEST_SUB(nVar,VAR) ENDPROGRAM C:\Temp>ifort /c /standard-semantics /warn:all /stand TEST.f90 Intel(R) Visual Fortran Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 19.0.1.144 Build 20181018 Copyright (C) 1985-2018 Intel Corporation. All rights reserved. C:\Temp>link TEST.obj MOD_TEST_SUB.obj VARS_DIAGNOSTIC.obj /subsystem:console -out:test.exe Microsoft (R) Incremental Linker Version 14.16.27026.1 Copyright (C) Microsoft Corporation. All rights reserved. C:\Temp>test.exe 1.000000 1.1095753E+27 2.6785321E+20 1.9345917E-19 C:\Temp>
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page