These are chat archives for scemama/irpf90

Oct 2015
Thomas Applencourt
Oct 05 2015 11:49

@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
Oct 05 2015 12:03

@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

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
Oct 05 2015 14:05
Yes, this one is the proper way to do it. :clap: