Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Nov 20 2018 14:17

    scemama on web

    (compare)

  • Nov 20 2018 13:47

    scemama on master

    Better error handling when ',' … (compare)

  • Apr 30 2018 17:23

    scemama on v1.7.2

    (compare)

  • Apr 27 2018 13:18

    scemama on master

    More Python2 (compare)

  • Apr 27 2018 12:58

    scemama on v1.7.1

    (compare)

  • Apr 27 2018 12:57

    scemama on master

    Update version 1.7.1 (compare)

  • Apr 27 2018 12:40

    scemama on master

    Changed python to python2 (compare)

  • Sep 18 2017 13:20

    scemama on master

    Fixed regexp Fixed assert (compare)

  • Sep 18 2017 13:11

    scemama on master

    (compare)

  • Sep 18 2017 12:39

    scemama on development

    (compare)

  • Sep 18 2017 08:58

    scemama on master

    Fixed regexp (compare)

  • Jul 11 2017 21:59

    scemama on master

    Working on mangled entity Fix pertinant children in graph Correct graphiz format and 30 more (compare)

  • Jul 11 2017 21:22
    scemama closed #19
  • Jul 11 2017 21:18

    scemama on master

    typo Merge with TApplencourt (compare)

  • May 16 2017 13:48
    scemama closed #20
  • May 16 2017 13:48

    scemama on master

    Merge pull request #1 from scem… Merge pull request #2 from scem… Merge pull request #3 from scem… and 13 more (compare)

  • May 16 2017 13:40
    scemama opened #20
  • May 16 2017 11:00

    scemama on master

    Removed stack trace from assert (compare)

  • Mar 17 2017 21:21
    TApplencourt synchronize #19
  • Mar 17 2017 21:07
    TApplencourt synchronize #19
Anthony Scemama
@scemama
Welcome to the IRPF90 chat!
Thomas Applencourt
@TApplencourt
:poop:
Anthony Scemama
@scemama
c'est malin!
Maximilien Levesque
@maxlevesque
Hi there, how to force a provider to recalculate a value?
It seems to me that TOUCH toto tells to update everything that is related to toto, but not toto itself. How can I force toto to be recalculated?
For instance, I would like to force variable mmax to be calculated at the place where I have my UPDATE here:
program foo
implicit none
print*,mmax
UPDATE mmax
print*,mmax
Maximilien Levesque
@maxlevesque
@scemama
Thomas Applencourt
@TApplencourt

I cannot test right now but i guess a

program foo
implicit none
print*,mmax
mmax = 100
TOUCH mmax
print*,mmax
end foo

should work

Or you can try to replace TOUCH by SOFT_TOUCH.
Maybe you can find more info where https://scemama.gitbooks.io/irpf90/content/IRPF90/Touch.html

I all of this failed, you can create a dummy provider who just print mnax and use it instead.

Anthony Scemama
@scemama
In normal situations, you shouldn't force a provider to recalculate a value. Let the IRPF90 calculate it when it should be calculated !
But, if you really need it, the keyword PROVIDE forces an entity to be provided at some point in the code (it will not be recalculated if it is not required).
Anthony Scemama
@scemama
However, if you change x and mmax depends on x, if you TOUCH x, then mmax will be recomputed if needed.
Think like in a Makefile : if you need to force to recompile a file by hand, it means something is going wrong in your makefile.
Anthony Scemama
@scemama
Last point could be for measuring performance or debugging. In that case, you can use call bld_mmax.
Maximilien Levesque
@maxlevesque
@TApplencourt I tested your proposition and it does not "work as I expected". Anyway, thanks for your answer.
@scemama Thanks. For now, mmax provider is just a read mmax from stdin. I wanted to force foo to read again from stdin but I can now convince myself that's not IRP style, is it ? :)
This is nevertheless tricky since mmax is a function of stdin and IRPF90 cannot infer if this has changed or not ... mmmm I have to think.
Thomas Applencourt
@TApplencourt

@maxlevesque I find a "horrible" trick if you realy need to read mmax from stdin. You can do (sry @scemama ...) a :

mmax_is_built = .FALSE.
call provide_mmax

It will work ; i guess. But i don't know how many horrible side effect this trick will have.

Thomas Applencourt
@TApplencourt

@maxlevesque A more irp-ich version is something like this i guess :
in provider.irp.f90 :

BEGIN_PROVIDER [integer, mmax]
  print*, " initial value"
  read (*,"(I3)") mmax
END_PROVIDER


SUBROUTINE update_mmax
  implicit none
  print*, "update"
  read (*,"(I3)") mmax

  TOUCH mmax

end update_mmax

and in main.irp.f

program icule
    print*, mmax
    call update_mmax()
    print*, mmax

end program icule

It will read from stdin again ; like you asked.

PS : More simply this :

program toto

    print*, mmax
    read (*,"(I3)") mmax
    print*, mmax

end program toto
Anthony Scemama
@scemama
Yes, this one is the proper way to do it. :clap:
Maximilien Levesque
@maxlevesque
thanks :)