g77에서는 pointer를 사용할 수 없나요?

geoplab의 이미지

안녕하세요.

f77에서는 pointer 변수를 정의하고 C로 된 external function에 적용한 프로그램이 컴파일이 되는데, g77에서도 그것이 가능한지요?

쉽게 설명하자면 메인 프로그램은 포트란으로 짜여져 있고, 배열을 위한 pointer 변수의 메모리량을 C로 된 함수에서 할당하고 없애는 기능 등이 가능한지요?

pointer (a,pa)   <- pointer 변수 정의 

call mem_alloc(a*,n)   <- C로 만든 외부함수
...
call free(a)   <- C로 만든 외부함수

만약 g77이 pointer statement를 지원하지 않으면 그에 대한 해결방법은 없는건지요?

여러 고수님들의 해결책을 기대합니다.
그럼 즐거운 하루가 되길 바라며...

wkpark의 이미지

geoplab wrote:
안녕하세요.

f77에서는 pointer 변수를 정의하고 C로 된 external function에 적용한 프로그램이 컴파일이 되는데, g77에서도 그것이 가능한지요?

쉽게 설명하자면 메인 프로그램은 포트란으로 짜여져 있고, 배열을 위한 pointer 변수의 메모리량을 C로 된 함수에서 할당하고 없애는 기능 등이 가능한지요?

pointer (a,pa)   <- pointer 변수 정의 

call mem_alloc(a*,n)   <- C로 만든 외부함수
...
call free(a)   <- C로 만든 외부함수

만약 g77이 pointer statement를 지원하지 않으면 그에 대한 해결방법은 없는건지요?

여러 고수님들의 해결책을 기대합니다.
그럼 즐거운 하루가 되길 바라며...


f2c로 포트란 파일을 c로 변환해 보세요.

제가 알고 있기로는 g77에서는 모든 argument가 포인터입니다.

따라서 말씀하신 것이 가능하리라 생각됩니다.

간단한 free_()와 mem_alloc_() 함수를 c로 정의해서
테스트 해보시길.

온갖 참된 삶은 만남이다 --Martin Buber

geoplab의 이미지

C로 변환 안하고는 안되나요?
원래의 프로그램 소스(matrix solver)를 구해서 제 프로그램에 합쳐서 쓸려고 하거든요. 기존의 프로그램이 Cray와 IBM SP에서는 정상적으로 f77로 작동하는 건데, 저는 현재 여러 linux cluster에서 사용할려고 해요.

그리고 사실 C에 대해서는 너무 약해서 자신이 없구요.

다른 방법은 없을까요?

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.